forked from Blup1980/microsip_42
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMessagesDlg.h
136 lines (123 loc) · 4.82 KB
/
MessagesDlg.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
/*
* 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 "resource.h"
#include "global.h"
#include "ClosableTabCtrl.h"
#include "BaseDialog.h"
#include <pjsua-lib/pjsua.h>
#include <pjsua-lib/pjsua_internal.h>
enum {
MSIP_TAB_ICON_CALL_OUT,
MSIP_TAB_ICON_CALL_IN,
MSIP_TAB_ICON_CALL_MISS,
MSIP_TAB_ICON_ACTIVE,
MSIP_TAB_ICON_ACTIVE_SECURE,
MSIP_TAB_ICON_CONFERENCE,
MSIP_TAB_ICON_CONFERENCE_SECURE,
MSIP_TAB_ICON_MESSAGE_IN,
MSIP_TAB_ICON_ON_HOLD,
MSIP_TAB_ICON_ON_REMOTE_HOLD,
MSIP_TAB_ICON_ON_REMOTE_HOLD_CONFERENCE
};
class MessagesDlg :
public CBaseDialog
{
CFont fontList;
CFont fontMessage;
PARAFORMAT2 para;
CClosableTabCtrl tabComponent;
CImageList imageList;
public:
MessagesDlg(CWnd* pParent = NULL); // standard constructor
~MessagesDlg();
enum { IDD = IDD_MESSAGES };
void TabFocusSet() override {};
bool GotoTab(int i, CTabCtrl* tab) { return false; };
MessagesContact* AddTab(CString number, CString name = CString(), BOOL activate = FALSE, pjsua_call_info *call_info = NULL, call_user_data *user_data = NULL, BOOL notShowWindow = FALSE, BOOL ifExists = FALSE);
void OnChangeTab(pjsua_call_info *p_call_info = NULL, call_user_data *user_data = NULL);
void OnEndCall(pjsua_call_info *call_info);
bool CallCheck();
pjsua_call_id CurrentCallId();
void Call(BOOL hasVideo = FALSE, CString commands=_T(""));
pjsua_call_id CallMake(CString number, bool hasVideo = false, pj_status_t *pStatus = NULL, call_user_data *user_data = NULL);
void CallStart(bool hasVideo = false, call_user_data *user_data = NULL);
void AddMessage(MessagesContact* messagesContact, CString message, int type = MSIP_MESSAGE_TYPE_SYSTEM, BOOL blockForeground = FALSE);
MessagesContact* GetMessageContact(int i = -1);
MessagesContact* GetMessageContactInCall();
int GetCallDuration(pjsua_call_id *call_id = NULL);
BOOL SendInstantMessage(MessagesContact *messagesContact, CString message, CString number = _T(""));
void UpdateHoldButton(pjsua_call_info *call_info);
void UpdateRecButton(call_user_data *user_data = NULL);
void UpdateTabIcon(MessagesContact *messagesContact, int tabIndex=-1, pjsua_call_info *call_info=NULL, call_user_data *user_data = NULL);
void CallAction(int action, CString number);
void Merge(pjsua_call_id call_id);
void Separate(pjsua_call_id call_id);
CClosableTabCtrl* tab;
MessagesContact* lastCall;
HICON m_hIconDropDown;
HICON m_hIconHold;
HICON m_hIconResume;
private:
void UpdateCallButton(BOOL active = FALSE, pjsua_call_info *call_info = NULL, call_user_data *user_data = NULL);
BOOL CloseTab(int i, BOOL safe = FALSE);
CMenu menuTransfer;
CMenu menuConference;
CMenu menuAttendedTransfer;
CMenu menuMerge;
protected:
afx_msg void OnDestroy();
virtual BOOL OnInitDialog();
virtual void PostNcDestroy();
virtual void DoDataExchange(CDataExchange* pDX);
DECLARE_MESSAGE_MAP()
public:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnClose();
afx_msg void OnMove(int x, int y);
afx_msg void OnSize(UINT type, int w, int h);
afx_msg void OnCancel();
afx_msg void OnBnClickedOk();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg LRESULT OnContextMenu(WPARAM wParam,LPARAM lParam);
afx_msg void OnEnMsgfilterMessage(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnTcnSelchangeTab(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnTcnSelchangingTab(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg LRESULT OnCloseTab(WPARAM wParam,LPARAM lParam);
afx_msg void OnBnClickedCallEnd();
afx_msg void OnBnClickedVideoCall();
afx_msg void OnBnClickedActions(bool isConference = false);
afx_msg void OnBnClickedTransfer();
afx_msg void OnBnClickedConference();
afx_msg void OnBnClickedHold();
afx_msg void OnBnClickedEnd();
afx_msg void OnCloseAllTabs();
afx_msg void OnGoToLastTab();
afx_msg void OnBnClickedCloseAll();
afx_msg void OnBnClickedLastCall();
afx_msg void OnCopy();
afx_msg void OnSelectAll();
afx_msg void OnTransfer();
afx_msg void OnAttendedTransfer(UINT nID);
afx_msg void OnConference();
afx_msg void OnMerge(UINT nID);
afx_msg void OnMergeAll();
afx_msg void OnSeparate();
afx_msg void OnSeparateAll();
afx_msg void OnDisconnect();
};