-
Notifications
You must be signed in to change notification settings - Fork 2
/
qt4phonedlg.h
125 lines (104 loc) · 2.76 KB
/
qt4phonedlg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#ifndef QTPHONEDLG_H
#define QTPHONEDLG_H
#include <QSystemTrayIcon>
#include <QCloseEvent>
#include <QLabel>
#include <QMenu>
#include <QComboBox>
#include <QThread>
#include <QtGui/QMainWindow>
#include <QSystemSemaphore>
#include <QSharedMemory>
#include "ui_qt4phone.h"
#include "myphoneendpoint.h"
#include "global.h"
class CheckOneApp: public QThread
{
Q_OBJECT
QSystemSemaphore *sem;
QSharedMemory *shmem;
bool fWork;
void run();
public:
CheckOneApp();
~CheckOneApp();
bool isRun();
signals:
void signalShow();
};
class QtPhoneDlg : public QMainWindow
{
Q_OBJECT
enum states
{
STATE_READY,
STATE_WORK,
STATE_CALL
};
states m_state;
QMenu *trayIconMenu;
QSystemTrayIcon *trayIcon;
QComboBox *iconComboBox;
CMyPhoneEndPoint *m_endpoint;
void closeEvent(QCloseEvent *ev);
public:
QtPhoneDlg(QWidget *parent = 0, Qt::WFlags flags = 0);
~QtPhoneDlg();
PString m_token;
QLabel *m_pLblStat;
PTimer indTimer;
PDECLARE_NOTIFIER(PTimer, QtPhoneDlg, OnUpdateIndicators);
PTimer ringSoundTimer;
PDECLARE_NOTIFIER(PTimer, QtPhoneDlg, OnRingSoundAgain);
void OnUpdateIndicators();
void OnRingSoundAgain();
PString ringSoundFile;
QString FindContactName(const H323Connection & connection);
bool hidePnP;
bool autoAddInAddr;
bool autohideVideoPan;
bool showVideoPan;
bool hideStat; // can show stat
PConfig adrbook; // PhoneBook file
void ShowStats() const;
int Close();
#if PTRACING // If Compiled with PTlib Tracing support (like in OpenH323)
bool Tracing;
bool OpenTraceFile(PConfig & config);
int TraceLevel; // set -1 for no trace, or set trace detalization level (0-3).
PTextFile * myTraceFile;
#endif
private:
Ui::QtPhoneClass ui;
void SendUserInput(const QString &strusermsg);
public slots:
void slot_SendMsg();
void slot_OnCall();
void slot_OnRefuse();
void slot_OnSettings();
void slot_MuteMicrophoneCmd(bool);
void slot_MuteSpeakerCmd(bool);
void slot_ChangeSoundCmd(int);
void slot_ChangeMicCmd(int);
void slot_RecvStats(const QString &txt);
void slot_OutputStatus(const QString &text);
void slot_OnConnectionEstablished(const QString &remotename);
void slot_OnConnectionCleared(const QString &remotename);
void slot_OnAnswerCall(const QString &remotename);
void slot_ShowVideoPanels(bool show = true);
void slot_SetLevelVolume(unsigned int val);
void slot_SetLevelMic(unsigned int val);
void slot_CreateConnection();
void slot_OutputUserMsg(const QString &text);
void slot_IconActivated(QSystemTrayIcon::ActivationReason reason);
void slot_SetIcon(int index);
void slot_Close();
void about();
void openContacts();
void showSlot();
signals:
void signal_SetLevelVolume(unsigned int val);
void signal_SetLevelMic(unsigned int val);
void signal_SetIcon(int index);
};
#endif // QTPHONEDLG_H