-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContacts.h
More file actions
111 lines (99 loc) · 3.81 KB
/
Contacts.h
File metadata and controls
111 lines (99 loc) · 3.81 KB
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
/*
* Copyright (C) 2011-2024 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 "AddDlg.h"
#include "BaseDialog.h"
#include "CListCtrl_SortItemsEx.h"
class Contacts : public CBaseDialog
{
public:
Contacts(CWnd *pParent = NULL); // standard constructor
~Contacts();
enum
{
IDD = IDD_CONTACTS
};
void TabFocusSet() override {};
bool GotoTab(int i, CTabCtrl *tab) { return false; };
void ProcessCommand(CString str) override {};
CListCtrl_SortItemsEx m_SortItemsExListCtrl;
AddDlg *addDlg;
CList<Contact *> contacts;
bool ContactPrepare(Contact *contact);
void ContactCreate(CListCtrl *list, Contact *pContact, bool subscribe = true);
void ListAppend(CListCtrl *list, Contact *contact, bool subscribe = true);
bool ContactUpdate(CListCtrl *list, int i, Contact *contact, Contact *newContact, CStringList *fields);
void ContactsAdd(CArray<ContactWithFields *> *contacts, bool directory = false);
bool ContactAdd(Contact contact, BOOL save = FALSE, BOOL load = FALSE, CStringList *fields = NULL, CString oldNumber = _T(""), bool manual = false);
void ContactDelete(int i);
void ContactDeleteRaw(Contact *contact);
void ContactsSave();
void ContactsLoad();
bool isFiltered(Contact *pContact = NULL);
void filterReset();
void SetCanditates();
int DeleteCanditates();
void UpdateCallButton();
Contact *FindContact(CString number, bool subscribed = false);
CString GetNameByNumber(CString number);
void PresenceSubsribeOne(Contact *pContact);
void PresenceUnsubsribeOne(Contact *pContact);
void PresenceSubscribe();
void PresenceReset(Contact *pContact = NULL);
void PresenceReceived(CString *buddyNumber, int image, bool ringing, CString *info, bool fromUsersDirectory = false);
void OnTimerContactsBlink();
void OnCreated();
bool Import(CString filename, CArray<ContactWithFields *> &contacts, bool directory = false);
private:
void ContactDecode(CString str, Contact &contact);
void MessageDlgOpen(BOOL isCall = FALSE, BOOL hasVideo = FALSE, BYTE index = 0);
void DefaultItemAction(int i);
protected:
virtual BOOL OnInitDialog();
virtual void PostNcDestroy();
virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support
virtual BOOL PreTranslateMessage(MSG *pMsg);
DECLARE_MESSAGE_MAP()
public:
// Adicionar no message map declarations:
afx_msg HBRUSH OnCtlColor(CDC *pDC, CWnd *pWnd, UINT nCtlColor);
afx_msg BOOL OnEraseBkgnd(CDC *pDC);
afx_msg void OnTimer(UINT_PTR TimerVal);
afx_msg void OnBnClickedOk();
afx_msg void OnBnClickedCancel();
afx_msg void OnFilterValueChange();
afx_msg void OnMenuCallPickup();
afx_msg void OnMenuCall();
afx_msg void OnMenuCallPhone();
afx_msg void OnMenuCallMobile();
afx_msg void OnMenuChat();
afx_msg void OnMenuAdd();
afx_msg void OnMenuEdit();
afx_msg void OnMenuCopy();
afx_msg void OnMenuDelete();
afx_msg void OnMenuImport();
afx_msg void OnMenuExport();
afx_msg LRESULT OnContextMenu(WPARAM wParam, LPARAM lParam);
afx_msg void OnNMDblclkContacts(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnEndtrack(NMHDR *pNMHDR, LRESULT *pResult);
#ifdef _GLOBAL_VIDEO
afx_msg void OnMenuCallVideo();
#endif
};