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);
53 wxString ContactAccount;
54 wxString ContactFilename;
56 wxString ContactNameField;
57 wxString ContactNickname;
58 vCardName ContactNameArray;
85 /** Implementing frmMainADT */
86 class frmMain : public frmMainADT
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;
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;
119 wxString OldSessionID;
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);
133 bool ReloadAccounts = FALSE;
134 bool AscendingMode = FALSE;
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;
152 int ContactEditorUID = 0;
153 int WindowMenuItemID = 0;
155 // Handlers for frmMainADT events.
156 void QuitApp( wxCommandEvent& event );
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 );
215 frmMain( wxWindow* parent );
216 int ShowConflictDialog(vCard *LocalObj, vCard *ServerObj);
217 void SetupPointers(void *ActMgr);
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
233 #endif // __frmMain__