forked from Blup1980/microsip_42
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainDlg.h
245 lines (217 loc) · 7.5 KB
/
mainDlg.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
/*
* Copyright (C) 2011-2020 MicroSIP (http://www.microsip.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#pragma once
#include "stdafx.h"
#include <afxwin.h>
#include "define.h"
#include "addons.h"
#include <pjsua-lib/pjsua.h>
#include <pjsua-lib/pjsua_internal.h>
#ifndef _WIN64
#ifdef NDEBUG
#pragma comment(lib, "libpjproject-i386-Win32-vc14-Release-Static.lib")
#else
#pragma comment(lib, "libpjproject-i386-Win32-vc14-Debug-Static.lib")
#endif
#else
#ifdef NDEBUG
#pragma comment(lib, "libpjproject-x86_64-x64-vc14-Release-Static.lib")
#else
#pragma comment(lib, "libpjproject-x86_64-x64-vc14-Debug-Static.lib")
#endif
#endif
#include "MMNotificationClient.h"
#include "BaseDialog.h"
#include "RinginDlg.h"
#include "AccountDlg.h"
#include "SettingsDlg.h"
#include "ShortcutsDlg.h"
#include "MessagesDlg.h"
#include "Dialer.h"
#include "Contacts.h"
#include "Calls.h"
#include "Preview.h"
#include "Transfer.h"
#include "StatusBar.h"
// CmainDlg dialog
class CmainDlg : public CBaseDialog
{
// Construction
public:
CmainDlg(CWnd* pParent = NULL); // standard constructor
~CmainDlg();
// Dialog Data
enum { IDD = IDD_MAIN };
bool m_startMinimized;
CButton m_ButtonMenu;
SettingsDlg* settingsDlg;
bool shortcutsEnabled;
bool shortcutsBottom;
ShortcutsDlg* shortcutsDlg;
MessagesDlg* messagesDlg;
Transfer* transferDlg;
AccountDlg* accountDlg;
Dialer* pageDialer;
Contacts* pageContacts;
bool usersDirectoryLoaded;
Calls* pageCalls;
BOOL notStopRinging;
CArray <RinginDlg*> ringinDlgs;
CString dialNumberDelayed;
pjsua_call_id autoAnswerCallId;
pjsua_acc_config acc_cfg;
pjsua_transport_id transport_udp_local;
pjsua_transport_id transport_udp;
pjsua_transport_id transport_tcp;
pjsua_transport_id transport_tls;
player_eof_data *player_eof_data;
int iconStatusbar;
int widthAdd;
int heightAdd;
bool missed;
CString callIdIncomingIgnore;
CList<int,int> toneCalls;
CList<int,int> attendedCalls;
CList<CString> audioCodecList;
CList<int> confernceCalls;
void InitUI();
void ShowTrayIcon();
void OnCreated();
void PJCreate();
void PJDestroy();
void PJAccountAdd();
void PJAccountAddRaw();
void PJAccountAddLocal();
void PJAccountDelete(bool deep = false);
void PJAccountDeleteLocal();
void PJAccountConfig(pjsua_acc_config *acc_cfg, Account *account);
bool CommandLine(CString params);
void TabFocusSet() override;
void UpdateWindowText(CString = CString(), int icon = IDI_DEFAULT, bool afterRegister = false);
void PublishStatus(bool online = true, bool init=false);
void BaloonPopup(CString title, CString message, DWORD flags = NIIF_WARNING);
bool GotoTabLParam(LPARAM lParam);
bool GotoTab(int i, CTabCtrl* tab = NULL) override;
void DialNumberFromCommandLine(CString number);
void DialNumber(CString params);
bool MakeCall(CString number, bool hasVideo = false, bool fromCommandLine = false);
bool MessagesOpen(CString number, CString name=_T(""), CString *commands = NULL, bool forCall = false);
void AutoAnswer(pjsua_call_id call_id);
pjsua_call_id CurrentCallId();
void ShortcutAction(Shortcut *shortcut);
void PlayerPlay(CString filename, bool noLoop = false, bool inCall = false);
BOOL CopyStringToClipboard( IN const CString & str );
void OnTimerProgress();
void OnTimerCall ();
void UsersDirectoryLoad();
void OnTimerContactBlink();
afx_msg LRESULT onUsersDirectoryLoaded(WPARAM wParam,LPARAM lParam);
void SetupJumpList();
void RemoveJumpList();
void MainPopupMenu(bool isMenuButton = false);
void SetPaneText2(CString str = _T(""));
void AccountSettingsPendingSave();
void OnAccountChanged();
void UpdateSoundDevicesIds();
void PlayerStop();
#ifdef _GLOBAL_VIDEO
Preview* previewWin;
int VideoCaptureDeviceId(CString name=_T(""));
#endif
bool CommandCallAnswer();
bool CommandCallReject();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
HICON m_hIcon;
HICON iconSmall;
HICON iconInactive;
HICON iconMissed;
NOTIFYICONDATA tnd;
StatusBar m_bar;
CMMNotificationClient *mmNotificationClient;
unsigned char m_tabPrev;
DWORD m_lastInputTime;
int m_idleCounter;
pjrpid_activity m_PresenceStatus;
bool newMessages;
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
virtual BOOL OnInitDialog();
virtual void PostNcDestroy();
virtual BOOL PreTranslateMessage(MSG* pMsg);
// Generated message map functions
afx_msg LRESULT OnUpdateWindowText(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onTrayNotify(WPARAM, LPARAM);
afx_msg LRESULT onCreateRingingDlg(WPARAM, LPARAM);
afx_msg LRESULT onRefreshLevels(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onRegState2(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onCallState(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onMWIInfo(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onCallMediaState(WPARAM, LPARAM);
afx_msg LRESULT onCallTransferStatus(WPARAM, LPARAM);
afx_msg LRESULT onPager(WPARAM, LPARAM);
afx_msg LRESULT onPagerStatus(WPARAM, LPARAM);
afx_msg LRESULT onBuddyState(WPARAM, LPARAM);
afx_msg LRESULT onCopyData(WPARAM, LPARAM);
afx_msg LRESULT CreationComplete(WPARAM, LPARAM);
DECLARE_MESSAGE_MAP()
public:
afx_msg LRESULT onPowerBroadcast(WPARAM, LPARAM);
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg BOOL OnQueryEndSession();
afx_msg void OnBnClickedOk();
afx_msg void OnBnClickedMenu();
afx_msg void OnClose();
afx_msg void OnContextMenu(CWnd *pWnd, CPoint point );
afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData);
afx_msg void OnSessionChange(UINT nSessionState, UINT nId);
afx_msg void OnMove(int x, int y);
afx_msg void OnSize(UINT type, int w, int h);
afx_msg LRESULT onShellHookMessage(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onCallAnswer(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onCallHangup(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onTabIconUpdate(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onSetPaneText(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onPlayerPlay(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT onPlayerStop(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT OnAccount(WPARAM wParam,LPARAM lParam);
afx_msg void OnMenuAccountAdd();
afx_msg void OnMenuAccountChange(UINT nID);
afx_msg void OnMenuAccountEdit(UINT nID);
afx_msg void OnMenuAccountLocalEdit();
afx_msg void OnMenuCustomRange(UINT nID);
afx_msg void OnMenuSettings();
afx_msg void OnMenuShortcuts();
afx_msg void OnMenuAlwaysOnTop();
afx_msg void OnMenuLog();
afx_msg void OnMenuExit();
afx_msg void OnTimer (UINT_PTR TimerVal);
afx_msg void OnTcnSelchangeTab(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnTcnSelchangingTab(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnMenuWebsite();
afx_msg void OnMenuHelp();
afx_msg void OnMenuAddl();
afx_msg void CheckUpdates();
afx_msg LRESULT OnUpdateCheckerLoaded(WPARAM wParam, LPARAM lParam);
#ifdef _GLOBAL_VIDEO
afx_msg void createPreviewWin();
#endif
};
extern CmainDlg *mainDlg;