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