Debian Codegraph @

Xpjproject/pjsip-apps/src/vidgui/vidgui.h

raw symbols SCIP
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
21 #include <QApplication>
22 #include <QCheckBox>
23 #include <QFont>
24 #include <QLabel>
25 #include <QLineEdit>
26 #include <QMainWindow>
27 #include <QObject>
28 #include <QPushButton>
29 #include <QStatusBar>
30 #include <QTextEdit>
31 #include <QVBoxLayout>
32 #include <QWidget>
33
34 #include <pjsua.h>
35
36 class VidWin;
37
38 class MainWin : public QWidget
39 {
40 Q_OBJECT
41
42 public:
43 MainWin(QWidget *parent = 0);
44 virtual ~MainWin();
45
46 static MainWin *instance();
47
48 bool initStack();
49 void showError(const char *title, pj_status_t status);
50 void showStatus(const char *msg);
51
52 void on_reg_state(pjsua_acc_id acc_id);
53 void on_call_state(pjsua_call_id call_id, pjsip_event *e);
54 void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, pjsip_rx_data *rdata);
55 void on_call_media_state(pjsua_call_id call_id);
56
57 signals:
58 void signalNewCall(int, bool);
59 void signalCallReleased();
60 void signalInitVideoWindow();
61 void signalShowStatus(const QString&);
62
63 public slots:
64 void preview();
65 void call();
66 void hangup();
67 void quit();
68 void onVidEnabledChanged(int state);
69
70 void onNewCall(int cid, bool incoming);
71 void onCallReleased();
72 void initVideoWindow();
73 void doShowStatus(const QString& msg);
74
75 private:
76 static MainWin *theInstance_;
77 pjsua_acc_id accountId_;
78 pjsua_call_id currentCall_;
79 bool preview_on;
80
81 private:
82 QPushButton *callButton_,
83 *hangupButton_,
84 *quitButton_,
85 *previewButton_;
86 QCheckBox *vidEnabled_;
87 QLineEdit *url_;
88 VidWin *video_;
89 VidWin *video_prev_;
90 //QStatusBar *statusBar_;
91 QLabel *statusBar_;
92 QLabel *localUri_;
93
94 QVBoxLayout *vbox_left;
95
96 void initLayout();
97 };
98
99
100
101 #endif /* VIDGUI_H_ */