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