vidgui.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Copyright (C) 2011-2011 Teluu Inc. (http://www.teluu.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef VIDGUI_H_
  19. #define VIDGUI_H_
  20. #include <QApplication>
  21. #include <QCheckBox>
  22. #include <QFont>
  23. #include <QLabel>
  24. #include <QLineEdit>
  25. #include <QMainWindow>
  26. #include <QObject>
  27. #include <QPushButton>
  28. #include <QStatusBar>
  29. #include <QTextEdit>
  30. #include <QVBoxLayout>
  31. #include <QWidget>
  32. #include <pjsua.h>
  33. class VidWin;
  34. class MainWin : public QWidget
  35. {
  36. Q_OBJECT
  37. public:
  38. MainWin(QWidget *parent = 0);
  39. virtual ~MainWin();
  40. static MainWin *instance();
  41. bool initStack();
  42. void showError(const char *title, pj_status_t status);
  43. void showStatus(const char *msg);
  44. void on_reg_state(pjsua_acc_id acc_id);
  45. void on_call_state(pjsua_call_id call_id, pjsip_event *e);
  46. void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, pjsip_rx_data *rdata);
  47. void on_call_media_state(pjsua_call_id call_id);
  48. signals:
  49. void signalNewCall(int, bool);
  50. void signalCallReleased();
  51. void signalInitVideoWindow();
  52. void signalShowStatus(const QString&);
  53. public slots:
  54. void preview();
  55. void call();
  56. void hangup();
  57. void quit();
  58. void onVidEnabledChanged(int state);
  59. void onNewCall(int cid, bool incoming);
  60. void onCallReleased();
  61. void initVideoWindow();
  62. void doShowStatus(const QString& msg);
  63. private:
  64. static MainWin *theInstance_;
  65. pjsua_acc_id accountId_;
  66. pjsua_call_id currentCall_;
  67. bool preview_on;
  68. private:
  69. QPushButton *callButton_,
  70. *hangupButton_,
  71. *quitButton_,
  72. *previewButton_;
  73. QCheckBox *vidEnabled_;
  74. QLineEdit *url_;
  75. VidWin *video_;
  76. VidWin *video_prev_;
  77. //QStatusBar *statusBar_;
  78. QLabel *statusBar_;
  79. QLabel *localUri_;
  80. QVBoxLayout *vbox_left;
  81. void initLayout();
  82. };
  83. #endif /* VIDGUI_H_ */