6 Subclass of frmMainADT, which is generated by wxFormBuilder.
9 #include "AppXestiaAddrBk.h"
10 #include "common/preferences.h"
14 #include <wx/filesys.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"
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);
54 wxString ContactAccount;
55 wxString ContactFilename;
57 wxString ContactNameField;
58 wxString ContactNickname;
59 vCardName ContactNameArray;
86 /** Implementing frmMainADT */
87 class frmMain : public frmMainADT
90 XABPrefAccounts prefaccounts;
91 wxArrayString ContactsFileIndex;
92 std::map<wxString, bool> WindowList;
93 std::map<int, wxTimer> AccountRefreshList;
94 std::map<int, wxString> AccountAccDirList;
95 std::map<int, SSLCertCollection> AccountSSLData;
96 std::map<int, int> AccountSSLResult;
97 std::multimap<int, int> AccountGroupList;
98 std::multimap<int, wxString> AccountGroupFilename;
99 std::multimap<wxTreeItemId, int> AccountGroupTreeId;
100 std::map<wxString, wxAccountSyncTimer*> AccountSyncTimers;
102 wxString ActiveAccount;
103 wxString ActiveAccountType;
104 wxString ActiveFilename;
105 wxETagProcessTimer ETagProcTimer;
106 std::map<wxString,wxString> MemoryFileList;
107 std::map<void*,wxString> ContactWindowList;
108 std::map<void*,wxString> ContactEditorWindowList;
109 std::map<void*,wxString> SearchWindowList;
110 std::map<int,wxMenuItem*> WindowListPointersMenu;
111 std::map<int,void*> WindowListPointers;
112 std::map<int,int> WindowListType;
113 //std::map<int,int> WindowListType;
114 wxMenuItem *mnuContactWindows;
115 wxMenuItem *mnuContactEditorWindows;
116 wxMenuItem *mnuSearchWindows;
117 wxToolTip *SSLToolTip;
118 bool RevealWait = FALSE;
120 wxString OldSessionID;
123 //wxComboCtrl* AccControl = new wxGenericComboCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize);
124 //wxComboCtrl* AccControl = new wxComboCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxCB_READONLY|wxEXPAND|wxCC_STD_BUTTON);
125 //wxStaticBitmap* AccIcon = new wxStaticBitmap(this, wxID_ANY, IconEmp, wxDefaultPosition, wxSize(16,16), wxALL|wxEXPAND, wxStaticBitmapNameStr);
126 XABAccountView* treAccounts = new XABAccountView();
127 wxImageList *AccImgList = new wxImageList(16,16,true);
128 wxImageList *ActMgrImgList = new wxImageList(16,16,true);
134 bool ReloadAccounts = FALSE;
135 bool AscendingMode = FALSE;
137 wxStaticBitmap *imgConnStatus = NULL;
138 wxStaticBitmap *imgSSLStatus = NULL;
139 wxStaticBitmap *imgActivityStatus = NULL;
140 wxBitmap *imgActIcon1 = NULL;
141 wxBitmap *imgActIcon2 = NULL;
142 wxBitmap *imgActIcon3 = NULL;
143 wxBitmap *imgActIcon4 = NULL;
144 wxBitmap *imgActIconSleep = NULL;
145 wxBitmap *imgSSL = NULL;
146 wxBitmap *imgNoSSL = NULL;
147 wxBitmap *imgSSLWarning = NULL;
148 wxBitmap *imgOnline = NULL;
149 wxBitmap *imgOffline = NULL;
150 int ActivityIconStatus = 0;
153 int ContactEditorUID = 0;
154 int WindowMenuItemID = 0;
156 // Handlers for frmMainADT events.
157 void QuitApp( wxCommandEvent& event );
159 void ShowAboutWindow( wxCommandEvent& event );
160 void OpenPreferences( wxCommandEvent& event );
161 void OpenNewABDialog( wxCommandEvent& event );
162 void LoadPreferences( wxActivateEvent& event );
163 void LoadPreferences();
164 void LoadContactList( wxTreeEvent& event );
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 wxTreeItemId FindItemNamed(wxTreeCtrl &tree,
173 const std::wstring &name);
174 void ConflictResolution( wxCommandEvent& event );
175 void UpdateContactList( wxCommandEvent& event );
176 void UpdateAccountList( wxCommandEvent& event );
177 void UpdateSearchContactLists( wxCommandEvent& event );
178 void OpenFindContactsWindow(wxCommandEvent& event);
179 void RevealContact( wxCommandEvent& event );
180 void RemoveContactsWindowPointer(wxCommandEvent& event);
181 void RemoveContactEditorWindowPointer(wxCommandEvent& event);
182 void UpdateWindowList(wxCommandEvent& event);
183 void RemoveContactSearchWindows(wxCommandEvent& event);
184 void DeleteContact(wxCommandEvent& event);
185 void EmptyServerDialog(wxCommandEvent& event);
186 void DeleteContactSync(wxString &Account, wxString &Filename);
187 void SortFNLN( wxCommandEvent& event );
188 void SortLNFN( wxCommandEvent& event );
189 void SortNickname( wxCommandEvent& event );
190 void SortDisplayAs( wxCommandEvent& event );
191 void SortAscending( wxCommandEvent& event );
192 void SortDescending( wxCommandEvent& event );
193 void ToggleStatusBar( wxCommandEvent& event );
194 void UpdateSBIconPlacement( wxSizeEvent& event );
195 void WindowAdd( wxCommandEvent& event );
196 void WindowEdit( wxCommandEvent& event );
197 void WindowDelete( wxCommandEvent& event );
198 void ShowContactWindow( wxCommandEvent& event );
199 void ShowContactEditorWindow( wxCommandEvent& event );
200 void ShowSearchWindow( wxCommandEvent& event );
201 void ToggleConnectionStatus( wxCommandEvent& event );
202 void ShowSSLCertificates( wxCommandEvent& event );
203 void ShowSSLInfo( wxCommandEvent& event );
204 void HideSSLInfo( wxCommandEvent& event );
205 void UpdateConnectionStatus( wxCommandEvent& event );
206 void SetupSSLStatus( int AccountID );
207 void InvalidSSLCertificate( wxCommandEvent& event );
208 void CheckUpdates( wxCommandEvent& event );
209 void OpenImportDialog( wxCommandEvent& event );
210 void OpenExportDialog( wxCommandEvent& event );
211 void GetSelectedList( wxCommandEvent& event );
212 void SyncAccount( wxCommandEvent& event );
213 void ShowHelp( wxCommandEvent& event );
216 frmMain( wxWindow* parent );
217 int ShowConflictDialog(vCard *LocalObj, vCard *ServerObj);
218 void SetupPointers(void *ActMgr);
220 void ActivityIconStart( wxCommandEvent& event );
221 void ActivityIconShuffle( wxCommandEvent& event );
222 void ActivityIconStop( wxCommandEvent& event );
223 void PauseAllTimers();
224 void ResumeAllTimers();
225 void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SSLCertCollection SSLCertInc);
226 void GetListControl(wxListCtrl *lstContactsPtr, wxArrayString *ContactsFileIndexPtr);
227 void ShowImportResults( wxCommandEvent& event );
228 XABViewMode GetViewMode();
229 DECLARE_EVENT_TABLE()
231 //// end generated class members
235 #endif // __frmMain__