Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Right click menu support added for the contact list and search results.
[xestiaab/.git] / source / frmMain.h
1 #ifndef __frmMain__
2 #define __frmMain__
4 /**
5 @file
6 Subclass of frmMainADT, which is generated by wxFormBuilder.
7 */
9 #include "AppXestiaAddrBk.h"
10 #include "common/preferences.h"
11 #include <map>
12 #include <utility>
13 #include <wx/timer.h>
14 #include <wx/filesys.h>
15 #include <wx/combo.h>
16 #include <wx/treectrl.h>
17 #include <wx/treebase.h>
18 #include <wx/imaglist.h>
19 #include <wx/mstream.h>
20 #include <wx/tooltip.h>
22 #include "common/timers.h"
23 #include "common/events.h"
24 #include "common/etag.h"
25 #include "bitmaps.h"
26 #include "common/sslcertstructs.h"
27 #include "widgets/XABContactMenu.h"
28 #include "widgets/XABAccountView.h"
30 //// end generated include
32 DECLARE_EVENT_TYPE(CE_UPDATECONTACTLIST, wxID_ANY)
33 DECLARE_EVENT_TYPE(CE_UPDATEACCOUNTLIST, wxID_ANY)
34 DECLARE_EVENT_TYPE(SE_UPDATECONTACTNOTIF, wxID_ANY)
35 DECLARE_EVENT_TYPE(CE_OPENCONTACT, wxID_ANY)
36 DECLARE_EVENT_TYPE(CE_OPENCONTACTLIST, wxID_ANY)
37 DECLARE_EVENT_TYPE(CE_NEWCONTACT, wxID_ANY)
38 DECLARE_EVENT_TYPE(CE_EDITCONTACT, wxID_ANY)
39 DECLARE_EVENT_TYPE(CE_DELETECONTACT, wxID_ANY)
40 DECLARE_EVENT_TYPE(CE_REVEALCONTACT, wxID_ANY)
41 DECLARE_EVENT_TYPE(CE_REMOVESEARCH, wxID_ANY)
42 DECLARE_EVENT_TYPE(CE_REMOVECONTACT, wxID_ANY)
43 DECLARE_EVENT_TYPE(SYNC_EMPTYSERVER, wxID_ANY)
44 DECLARE_EVENT_TYPE(ACTMGR_START, wxID_ANY);
45 DECLARE_EVENT_TYPE(ACTMGR_SHUFFLE, wxID_ANY);
46 DECLARE_EVENT_TYPE(ACTMGR_STOP, wxID_ANY);
47 DECLARE_EVENT_TYPE(WINDOW_ADD, wxID_ANY);
48 DECLARE_EVENT_TYPE(WINDOW_EDIT, wxID_ANY);
49 //DECLARE_EVENT_TYPE(WINDOW_DELETE, wxID_ANY);
50 DECLARE_EVENT_TYPE(WINDOW_CLOSE, wxID_ANY);
51 DECLARE_EVENT_TYPE(CONNSTAT_UPDATE, wxID_ANY);
52 DECLARE_EVENT_TYPE(INVALIDSSLCERT, wxID_ANY);
53 DECLARE_EVENT_TYPE(GETSELECTEDLIST, wxID_ANY);
54 DECLARE_EVENT_TYPE(SYNCACCOUNT, wxID_ANY);
55 DECLARE_EVENT_TYPE(IMPORT_RESULTSSHOW, wxID_ANY);
56 DECLARE_EVENT_TYPE(RELOADCONTACTLIST, wxID_ANY);
57 DECLARE_EVENT_TYPE(REFRESHADDRESSBOOK, wxID_ANY);
59 struct UCNotif{
60         wxString ContactAccount;
61         wxString ContactFilename;
62         wxString ContactName;
63         wxString ContactNameField;
64         wxString ContactNickname;
65         vCardName ContactNameArray;
66 };
68 struct SWCloseNotif{
69         void *SCHWinPtr;
70 };
72 struct QRNotif{
73         int *QResponse;
74         bool *PausePtr;
75 };
77 struct XABViewMode{
79         int SortMode;
80         bool AscendingMode;
82 };
84 struct WindowData{
86         int DataType;
87         void *WindowPointer;
88         int WindowID;
90 };
92 /** Implementing frmMainADT */
93 class frmMain : public frmMainADT
94 {
95         private:
96                 XABPrefAccounts prefaccounts;
97                 wxArrayString ContactsFileIndex;
98                 std::map<wxString, bool> WindowList;
99                 std::map<int, wxTimer> AccountRefreshList;
100                 std::map<int, wxString> AccountAccDirList;
101                 std::map<int, SSLCertCollection> AccountSSLData;
102                 std::map<int, int> AccountSSLResult;
103                 std::multimap<int, int> AccountGroupList;
104                 std::multimap<int, wxString> AccountGroupFilename;
105                 std::multimap<wxTreeItemId, int> AccountGroupTreeId;
106                 std::map<wxString, wxAccountSyncTimer*> AccountSyncTimers;
107                 void *ActMgrPtr;
108                 wxString ActiveAccount;
109                 wxString ActiveAccountType;
110                 wxString ActiveFilename;
111                 wxETagProcessTimer ETagProcTimer;
112                 std::map<wxString,wxString> MemoryFileList;
113                 std::map<void*,wxString> ContactWindowList;
114                 std::map<void*,wxString> ContactEditorWindowList;
115                 std::map<void*,wxString> SearchWindowList;
116                 std::map<int,wxMenuItem*> WindowListPointersMenu;
117                 std::map<int,void*> WindowListPointers;
118                 std::map<int,int> WindowListType;
119                 //std::map<int,int> WindowListType;
120                 wxMenuItem *mnuContactWindows;
121                 wxMenuItem *mnuContactEditorWindows;
122                 wxMenuItem *mnuSearchWindows;
123                 wxToolTip *SSLToolTip;
124                 bool RevealWait = FALSE;
125                 wxString SessionID;
126                 wxString OldSessionID;
127                 wxIcon IconEmp;
128                 //wxIcon Emp;
129                 //wxComboCtrl* AccControl = new wxGenericComboCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize);
130                 //wxComboCtrl* AccControl = new wxComboCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxCB_READONLY|wxEXPAND|wxCC_STD_BUTTON);
131                 //wxStaticBitmap* AccIcon = new wxStaticBitmap(this, wxID_ANY, IconEmp, wxDefaultPosition, wxSize(16,16), wxALL|wxEXPAND, wxStaticBitmapNameStr);
132                 XABAccountView* treAccounts = new XABAccountView();
133                 wxImageList *AccImgList =  new wxImageList(16,16,true);
134                 wxImageList *ActMgrImgList = new wxImageList(16,16,true);
135                 //wxIcon wxIAccInet;
136                 int AccountID;
137                 int AccountNetID;
138                 int AccountGrpID;
139                 int AccountNoneID;
140                 bool ReloadAccounts = FALSE;
141                 bool AscendingMode = FALSE;
142                 int SortMode = 1;
143                 wxStaticBitmap *imgConnStatus = NULL;
144                 wxStaticBitmap *imgSSLStatus = NULL;
145                 wxStaticBitmap *imgActivityStatus = NULL;
146                 wxBitmap *imgActIcon1 = NULL;
147                 wxBitmap *imgActIcon2 = NULL;
148                 wxBitmap *imgActIcon3 = NULL;
149                 wxBitmap *imgActIcon4 = NULL;
150                 wxBitmap *imgActIconSleep = NULL;
151                 wxBitmap *imgSSL = NULL;
152                 wxBitmap *imgNoSSL = NULL;
153                 wxBitmap *imgSSLWarning = NULL;
154                 wxBitmap *imgOnline = NULL;
155                 wxBitmap *imgOffline = NULL;
156                 int ActivityIconStatus = 0;
157                 int SearchUID = 0;
158                 int ContactUID = 0;
159                 int ContactEditorUID = 0;
160                 int WindowMenuItemID = 0;
161                 XABContactMenu *ContactMenu = new XABContactMenu(XABCONTACTMENU_MAIN); 
162         protected:
163                 // Handlers for frmMainADT events.
164                 void QuitApp( wxCloseEvent& event );
165                 void QuitApp( wxCommandEvent& event );
166                 void QuitApp();
167                 void ShowAboutWindow( wxCommandEvent& event );
168                 void OpenPreferences( wxCommandEvent& event );
169                 void OpenNewABDialog( wxCommandEvent& event );
170                 void LoadPreferences( wxActivateEvent& event );
171                 void LoadPreferences();
172                 void ShowContactInfo( wxListEvent& event );
173                 void OpenContactInfoList( wxListEvent& event );
174                 void OpenContactInfoList( wxCommandEvent& event );
175                 void OpenContactInfo( wxCommandEvent& event );
176                 void ShowContactEditorNew( wxCommandEvent& event );             
177                 void ShowContactEditorEdit( wxCommandEvent& event );
178                 void RefreshAddressBook( wxCommandEvent& event );
179                 void ShowActivityWindow( wxCommandEvent& event );
180                 void LoadContactList( wxTreeEvent& event );             
181                 wxTreeItemId FindItemNamed(wxTreeCtrl &tree, 
182                               const std::wstring &name);
183                 void ConflictResolution( wxCommandEvent& event );
184                 void UpdateContactList( wxCommandEvent& event );
185                 void UpdateAccountList( wxCommandEvent& event );
186                 void UpdateSearchContactLists( wxCommandEvent& event );
187                 void OpenFindContactsWindow(wxCommandEvent& event);
188                 void RevealContact( wxCommandEvent& event );
189                 void RemoveContactsWindowPointer(wxCommandEvent& event);
190                 void RemoveContactEditorWindowPointer(wxCommandEvent& event);
191                 void UpdateWindowList(wxCommandEvent& event);
192                 void RemoveContactSearchWindows(wxCommandEvent& event);
193                 void DeleteContact(wxCommandEvent& event);
194                 void EmptyServerDialog(wxCommandEvent& event);
195                 void DeleteContactSync(wxString &Account, wxString &Filename);
196                 void SortFNLN( wxCommandEvent& event );
197                 void SortLNFN( wxCommandEvent& event );
198                 void SortNickname( wxCommandEvent& event );
199                 void SortDisplayAs( wxCommandEvent& event );
200                 void SortAscending( wxCommandEvent& event );
201                 void SortDescending( wxCommandEvent& event );
202                 void ToggleStatusBar( wxCommandEvent& event );
203                 void UpdateSBIconPlacement( wxSizeEvent& event );
204                 void WindowAdd( wxCommandEvent& event );
205                 void WindowEdit( wxCommandEvent& event );
206                 void WindowDelete( wxCommandEvent& event );
207                 void ShowContactWindow( wxCommandEvent& event );
208                 void ShowContactEditorWindow( wxCommandEvent& event );
209                 void ShowSearchWindow( wxCommandEvent& event );
210                 void ToggleConnectionStatus( wxCommandEvent& event );
211                 void ShowSSLCertificates( wxCommandEvent& event );
212                 void ShowSSLInfo( wxCommandEvent& event );
213                 void HideSSLInfo( wxCommandEvent& event );
214                 void UpdateConnectionStatus( wxCommandEvent& event );
215                 void SetupSSLStatus( int AccountID );
216                 void InvalidSSLCertificate( wxCommandEvent& event );
217                 void CheckUpdates( wxCommandEvent& event );
218                 void OpenImportDialog( wxCommandEvent& event );
219                 void OpenExportDialog( wxCommandEvent& event );
220                 void GetSelectedList( wxCommandEvent& event );
221                 void SyncAccount( wxCommandEvent& event );
222                 void ShowHelp( wxCommandEvent& event );
223                 void ShowContactMenu( wxMouseEvent& event );
224                 void ProcessMenuItemClick( wxCommandEvent &event );
225         public:
226                 /** Constructor */
227                 frmMain( wxWindow* parent );
228                 int ShowConflictDialog(vCard *LocalObj, vCard *ServerObj);
229                 void SetupPointers(void *ActMgr);
230                 void SetupForm();
231                 void ActivityIconStart( wxCommandEvent& event );
232                 void ActivityIconShuffle( wxCommandEvent& event );
233                 void ActivityIconStop( wxCommandEvent& event );
234                 void PauseAllTimers();
235                 void ResumeAllTimers();
236                 void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SSLCertCollection SSLCertInc);
237                 void GetListControl(wxListCtrl *lstContactsPtr, wxArrayString *ContactsFileIndexPtr);
238                 void ShowImportResults( wxCommandEvent& event );
239                 void ReloadContactList( wxCommandEvent& event );
240                 XABViewMode GetViewMode();
241                 DECLARE_EVENT_TABLE()
243         //// end generated class members
244         
245 };
247 #endif // __frmMain__
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy