// frmMain.h - Main window header form. // // (c) 2012-2015 Xestia Software Development. // // This file is part of Xestia Address Book. // // Xestia Address Book is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by the // Free Software Foundation, version 3 of the license. // // Xestia Address Book is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with Xestia Address Book. If not, see #ifndef __frmMain__ #define __frmMain__ /** @file Subclass of frmMainADT, which is generated by wxFormBuilder. */ #include "AppXestiaAddrBk.h" #include "common/preferences.h" #include #include #include #include #include #include #include #include #include #include #if defined(__APPLE__) #import #import #elif defined(__WIN32__) #include "common/win32ssl.h" #endif #include "common/timers.h" #include "common/events.h" #include "common/etag.h" #include "common/structs.h" #include "bitmaps.h" #include "common/sslcertstructs.h" #include "widgets/XABContactMenu.h" #include "widgets/XABAccountView.h" //// end generated include DECLARE_EVENT_TYPE(CE_UPDATECONTACTLIST, wxID_ANY) DECLARE_EVENT_TYPE(CE_UPDATEACCOUNTLIST, wxID_ANY) DECLARE_EVENT_TYPE(SE_UPDATECONTACTNOTIF, wxID_ANY) DECLARE_EVENT_TYPE(CE_OPENCONTACT, wxID_ANY) DECLARE_EVENT_TYPE(CE_OPENCONTACTLIST, wxID_ANY) DECLARE_EVENT_TYPE(CE_NEWCONTACT, wxID_ANY) DECLARE_EVENT_TYPE(CE_EDITCONTACT, wxID_ANY) DECLARE_EVENT_TYPE(CE_DELETECONTACT, wxID_ANY) DECLARE_EVENT_TYPE(CE_REVEALCONTACT, wxID_ANY) DECLARE_EVENT_TYPE(CE_REMOVESEARCH, wxID_ANY) DECLARE_EVENT_TYPE(CE_REMOVECONTACT, wxID_ANY) DECLARE_EVENT_TYPE(SYNC_EMPTYSERVER, wxID_ANY) DECLARE_EVENT_TYPE(ACTMGR_START, wxID_ANY); DECLARE_EVENT_TYPE(ACTMGR_SHUFFLE, wxID_ANY); DECLARE_EVENT_TYPE(ACTMGR_STOP, wxID_ANY); DECLARE_EVENT_TYPE(WINDOW_ADD, wxID_ANY); DECLARE_EVENT_TYPE(WINDOW_EDIT, wxID_ANY); //DECLARE_EVENT_TYPE(WINDOW_DELETE, wxID_ANY); DECLARE_EVENT_TYPE(WINDOW_CLOSE, wxID_ANY); DECLARE_EVENT_TYPE(CONNSTAT_UPDATE, wxID_ANY); DECLARE_EVENT_TYPE(INVALIDSSLCERT, wxID_ANY); DECLARE_EVENT_TYPE(INVALIDSSLCERTSTRING, wxID_ANY); DECLARE_EVENT_TYPE(GETSELECTEDLIST, wxID_ANY); DECLARE_EVENT_TYPE(SYNCACCOUNT, wxID_ANY); DECLARE_EVENT_TYPE(IMPORT_RESULTSSHOW, wxID_ANY); DECLARE_EVENT_TYPE(RELOADCONTACTLIST, wxID_ANY); DECLARE_EVENT_TYPE(REFRESHADDRESSBOOK, wxID_ANY); #if defined(__APPLE__) DECLARE_EVENT_TYPE(INVALIDSSLTRUST, wxID_ANY); #endif struct UCNotif{ wxString ContactAccount; wxString ContactFilename; wxString ContactName; wxString ContactNameField; wxString ContactNickname; vCardName ContactNameArray; }; struct SWCloseNotif{ void *SCHWinPtr; }; struct XABViewMode{ int SortMode; bool AscendingMode; }; struct WindowData{ int DataType; void *WindowPointer; int WindowID; }; /** Implementing frmMainADT */ class frmMain : public frmMainADT { private: XABPrefAccounts prefaccounts; wxArrayString ContactsFileIndex; std::map WindowList; std::map AccountRefreshList; std::map AccountAccDirList; #if defined(__APPLE__) std::map AccountTrustData; #elif defined(__WIN32__) std::map AccountCertificateData; #else std::map AccountSSLData; #endif std::map AccountSSLResult; std::multimap AccountGroupList; std::multimap AccountGroupFilename; std::multimap AccountGroupTreeId; std::map AccountSyncTimers; void *ActMgrPtr; wxString ActiveAccount; wxString ActiveAccountType; wxString ActiveFilename; wxETagProcessTimer ETagProcTimer; std::map MemoryFileList; std::map ContactWindowList; std::map ContactEditorWindowList; std::map SearchWindowList; std::map WindowListPointersMenu; std::map WindowListPointers; std::map WindowListType; wxMenuItem *mnuContactWindows; wxMenuItem *mnuContactEditorWindows; wxMenuItem *mnuSearchWindows; wxToolTip *SSLToolTip; bool RevealWait = FALSE; wxString SessionID; wxString OldSessionID; wxColour ContactBackgroundColour; wxIcon IconEmp; XABAccountView* treAccounts = new XABAccountView(); wxImageList *AccImgList = new wxImageList(16,16,true); wxImageList *ActMgrImgList = new wxImageList(16,16,true); int AccountID; int AccountNetID; int AccountGrpID; int AccountUnsupportedID; int AccountNoneID; bool ReloadAccounts = FALSE; bool AscendingMode = FALSE; int SortMode = 1; wxStaticBitmap *imgConnStatus = NULL; wxStaticBitmap *imgSSLStatus = NULL; wxStaticBitmap *imgActivityStatus = NULL; wxBitmap *imgActIcon1 = NULL; wxBitmap *imgActIcon2 = NULL; wxBitmap *imgActIcon3 = NULL; wxBitmap *imgActIcon4 = NULL; wxBitmap *imgActIconSleep = NULL; wxBitmap *imgSSL = NULL; wxBitmap *imgNoSSL = NULL; wxBitmap *imgSSLWarning = NULL; wxBitmap *imgOnline = NULL; wxBitmap *imgOffline = NULL; wxBitmap *imgAddAddressBook = NULL; wxBitmap *imgPreferences = NULL; wxBitmap *imgSearchContacts = NULL; wxBitmap *imgAddContact = NULL; wxBitmap *imgEditContact = NULL; wxBitmap *imgDeleteContact = NULL; int ActivityIconStatus = 0; int SearchUID = 0; int ContactUID = 0; int ContactEditorUID = 0; int WindowMenuItemID = 0; XABContactMenu *ContactMenu = new XABContactMenu(XABCONTACTMENU_MAIN); void ResetContactInfo(); #if defined(__APPLE__) void DisplayCertificate(SecTrustRef SecurityTrustObject); void DisplayTrustPanel( wxCommandEvent& event ); #endif protected: // Handlers for frmMainADT events. void QuitApp( wxCloseEvent& event ); void QuitApp( wxCommandEvent& event ); void QuitApp(); void ShowAboutWindow( wxCommandEvent& event ); void OpenPreferences( wxCommandEvent& event ); void OpenNewABDialog( wxCommandEvent& event ); void LoadPreferences( wxActivateEvent& event ); void LoadPreferences(); void ShowContactInfo( wxListEvent& event ); void OpenContactInfoList( wxListEvent& event ); void OpenContactInfoList( wxCommandEvent& event ); void OpenContactInfo( wxCommandEvent& event ); void ShowContactEditorNew( wxCommandEvent& event ); void ShowContactEditorEdit( wxCommandEvent& event ); void RefreshAddressBook( wxCommandEvent& event ); void ShowActivityWindow( wxCommandEvent& event ); void LoadContactList( wxTreeEvent& event ); wxTreeItemId FindItemNamed(wxTreeCtrl &tree, const std::wstring &name); void ConflictResolution( wxCommandEvent& event ); void UpdateContactList( wxCommandEvent& event ); void UpdateAccountList( wxCommandEvent& event ); void UpdateSearchContactLists( wxCommandEvent& event ); void OpenFindContactsWindow(wxCommandEvent& event); void RevealContact( wxCommandEvent& event ); void RemoveContactsWindowPointer(wxCommandEvent& event); void RemoveContactEditorWindowPointer(wxCommandEvent& event); void RemoveContactSearchWindows(wxCommandEvent& event); void DeleteContact(wxCommandEvent& event); void EmptyServerDialog(wxCommandEvent& event); void DeleteContactSync(wxString &Account, wxString &Filename); void SortFNLN( wxCommandEvent& event ); void SortLNFN( wxCommandEvent& event ); void SortNickname( wxCommandEvent& event ); void SortDisplayAs( wxCommandEvent& event ); void SortAscending( wxCommandEvent& event ); void SortDescending( wxCommandEvent& event ); void ToggleStatusBar( wxCommandEvent& event ); void UpdateSBIconPlacement( wxSizeEvent& event ); void WindowAdd( wxCommandEvent& event ); void WindowEdit( wxCommandEvent& event ); void WindowDelete( wxCommandEvent& event ); void ShowContactWindow( wxCommandEvent& event ); void ShowContactEditorWindow( wxCommandEvent& event ); void ShowSearchWindow( wxCommandEvent& event ); void ToggleConnectionStatus( wxCommandEvent& event ); void ShowSSLCertificates( wxCommandEvent& event ); void ShowSSLInfo( wxCommandEvent& event ); void HideSSLInfo( wxCommandEvent& event ); void UpdateConnectionStatus( wxCommandEvent& event ); void SetupSSLStatus( int AccountID ); void InvalidSSLCertificate( wxCommandEvent& event ); void InvalidSSLCertificateString( wxCommandEvent& event ); void CheckUpdates( wxCommandEvent& event ); void OpenImportDialog( wxCommandEvent& event ); void OpenExportDialog( wxCommandEvent& event ); void GetSelectedList( wxCommandEvent& event ); void SyncAccount( wxCommandEvent& event ); void ShowHelp( wxCommandEvent& event ); void ShowContactMenu( wxMouseEvent& event ); void ProcessMenuItemClick( wxCommandEvent &event ); public: /** Constructor */ frmMain( wxWindow* parent ); int ShowConflictDialog(vCard *LocalObj, vCard *ServerObj); void SetupPointers(void *ActMgr); void SetupForm(); void ActivityIconStart( wxCommandEvent& event ); void ActivityIconShuffle( wxCommandEvent& event ); void ActivityIconStop( wxCommandEvent& event ); void PauseAllTimers(); void ResumeAllTimers(); void GetListControl(wxListCtrl *lstContactsPtr, wxArrayString *ContactsFileIndexPtr); void ShowImportResults( wxCommandEvent& event ); void ReloadContactList( wxCommandEvent& event ); XABViewMode GetViewMode(); #if defined(__APPLE__) void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SecTrustRef SecurityTrustObject); #elif defined(__WIN32__) void UpdateSSLAccountStatus(int AccountID, int SSLStatus, PCCERT_CONTEXT CertificateContext); #else void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SSLCertCollectionString SSLCertInc); #endif bool CloseAllWindows(); DECLARE_EVENT_TABLE() //// end generated class members }; #endif // __frmMain__