Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added #include <rpc.h> to Win32 section.
[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( wxCommandEvent& event );
159                 void QuitApp();
160                 void ShowAboutWindow( wxCommandEvent& event );
161                 void OpenPreferences( wxCommandEvent& event );
162                 void OpenNewABDialog( wxCommandEvent& event );
163                 void LoadPreferences( wxActivateEvent& event );
164                 void LoadPreferences();
165                 void ShowContactInfo( wxListEvent& event );
166                 void OpenContactInfo( wxListEvent& event );
167                 void OpenContactInfo( wxCommandEvent& event );
168                 void ShowContactEditorNew( wxCommandEvent& event );             
169                 void ShowContactEditorEdit( wxCommandEvent& event );
170                 void RefreshAddressBook( wxCommandEvent& event );
171                 void ShowActivityWindow( wxCommandEvent& event );
172                 void LoadContactList( wxTreeEvent& event );             
173                 wxTreeItemId FindItemNamed(wxTreeCtrl &tree, 
174                               const std::wstring &name);
175                 void ConflictResolution( wxCommandEvent& event );
176                 void UpdateContactList( wxCommandEvent& event );
177                 void UpdateAccountList( wxCommandEvent& event );
178                 void UpdateSearchContactLists( wxCommandEvent& event );
179                 void OpenFindContactsWindow(wxCommandEvent& event);
180                 void RevealContact( wxCommandEvent& event );
181                 void RemoveContactsWindowPointer(wxCommandEvent& event);
182                 void RemoveContactEditorWindowPointer(wxCommandEvent& event);
183                 void UpdateWindowList(wxCommandEvent& event);
184                 void RemoveContactSearchWindows(wxCommandEvent& event);
185                 void DeleteContact(wxCommandEvent& event);
186                 void EmptyServerDialog(wxCommandEvent& event);
187                 void DeleteContactSync(wxString &Account, wxString &Filename);
188                 void SortFNLN( wxCommandEvent& event );
189                 void SortLNFN( wxCommandEvent& event );
190                 void SortNickname( wxCommandEvent& event );
191                 void SortDisplayAs( wxCommandEvent& event );
192                 void SortAscending( wxCommandEvent& event );
193                 void SortDescending( wxCommandEvent& event );
194                 void ToggleStatusBar( wxCommandEvent& event );
195                 void UpdateSBIconPlacement( wxSizeEvent& event );
196                 void WindowAdd( wxCommandEvent& event );
197                 void WindowEdit( wxCommandEvent& event );
198                 void WindowDelete( wxCommandEvent& event );
199                 void ShowContactWindow( wxCommandEvent& event );
200                 void ShowContactEditorWindow( wxCommandEvent& event );
201                 void ShowSearchWindow( wxCommandEvent& event );
202                 void ToggleConnectionStatus( wxCommandEvent& event );
203                 void ShowSSLCertificates( wxCommandEvent& event );
204                 void ShowSSLInfo( wxCommandEvent& event );
205                 void HideSSLInfo( wxCommandEvent& event );
206                 void UpdateConnectionStatus( wxCommandEvent& event );
207                 void SetupSSLStatus( int AccountID );
208                 void InvalidSSLCertificate( wxCommandEvent& event );
209                 void CheckUpdates( wxCommandEvent& event );
210                 void OpenImportDialog( wxCommandEvent& event );
211                 void OpenExportDialog( wxCommandEvent& event );
212                 void GetSelectedList( wxCommandEvent& event );
213                 void SyncAccount( wxCommandEvent& event );
214                 void ShowHelp( wxCommandEvent& event );
215         public:
216                 /** Constructor */
217                 frmMain( wxWindow* parent );
218                 int ShowConflictDialog(vCard *LocalObj, vCard *ServerObj);
219                 void SetupPointers(void *ActMgr);
220                 void SetupForm();
221                 void ActivityIconStart( wxCommandEvent& event );
222                 void ActivityIconShuffle( wxCommandEvent& event );
223                 void ActivityIconStop( wxCommandEvent& event );
224                 void PauseAllTimers();
225                 void ResumeAllTimers();
226                 void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SSLCertCollection SSLCertInc);
227                 void GetListControl(wxListCtrl *lstContactsPtr, wxArrayString *ContactsFileIndexPtr);
228                 void ShowImportResults( wxCommandEvent& event );
229                 void ReloadContactList( wxCommandEvent& event );
230                 XABViewMode GetViewMode();
231                 DECLARE_EVENT_TABLE()
233         //// end generated class members
234         
235 };
237 #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