// frmActivityMgr.h - Activity Manager header file. // // (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 __frmActivityMgr__ #define __frmActivityMgr__ /** @file Subclass of frmActivityMgrADT, which is generated by wxFormBuilder. */ #include #include #if defined(__APPLE__) #import #import #include "../frmMain.h" #endif #include "../AppXestiaAddrBk.h" #include "../common/timers.h" #include "../common/etag.h" #include "../common/dirs.h" #include "../common/preferences.h" #include "../common/sslcertstructs.h" #include "../connobject/ConnectionObject.h" #include "../carddav2/carddav2.h" #if defined(__WIN32__) #include "../common/win32ssl.h" #endif //// end generated include DECLARE_EVENT_TYPE(ACTMGR_RESUMEPROC, wxID_ANY) DECLARE_EVENT_TYPE(ACTMGR_TOGGLECONN, wxID_ANY) DECLARE_EVENT_TYPE(ACTMGR_STARTTIMER, wxID_ANY) DECLARE_EVENT_TYPE(ACTMGR_STOPTIMER, wxID_ANY) DECLARE_EVENT_TYPE(ACTMGR_STARTPROCESSTIMER, wxID_ANY) DECLARE_EVENT_TYPE(ACTMGR_STOPPROCESSTIMER, wxID_ANY) DECLARE_EVENT_TYPE(ACTMGR_UPDATESTATUSLABEL, wxID_ANY) DECLARE_EVENT_TYPE(ACTMGR_STARTANIMATIONTIMER, wxID_ANY) struct vCardDownloadDataFileClass{ unsigned int DataType = 0; wxString FileData; }; struct ActivityMgrLabelUpdate{ long ItemIndex; wxString ItemLabel; wxString ItemDes; }; #if defined(__APPLE__) struct SSLInvalidTrustNotifObj{ SecTrustRef SecurityTrustObject; int *ResultValue; bool *PausePtr; wxString AccountName; }; #endif struct ActivityMgrAccountSettings{ wxString Address; int Port; wxString Username; wxString Password; bool SSL; wxString Prefix; wxString Dir; }; /** Implementing frmActivityMgrADT */ class frmActivityMgr : public frmActivityMgrADT { private: wxActTimer AnimationTimer; wxActProcessTimer ActProcessTimer; wxActListProcTimer ActListProcTimer; wxBitmap SleepBitmap; int ActivityTaskID = 0; int ActivityProgressBarTotal = 0; int ActivityProgressBarDone = 0; bool BlankBool = FALSE; std::map ActivityList; std::map ActivityListType; std::map ActivityListIndex; std::map ActivityListData; std::map ActivityListURL; std::map ActivityListEditMode; std::map ActivityListTaskDetail; std::map ActivityListAccount; std::map ActivityListFilename; std::map ActivityListFullFilename; std::map ActivityListConnObject; std::map ActivityListAccSettings; std::map ActivityListETag; std::map ActivityListETagOriginal; std::map ActivityListFinDate; std::map ActivityListLog; bool WindowOpen = FALSE; bool TasksActive = FALSE; bool ApplicationSleepMode = FALSE; bool ProcessTasksData = FALSE; //int ConflictResult = 0; wxETagProcessTimer *ETagTmrPtr; void *frmMainPtr; #if defined(__APPLE__) int DisplayTrustPanel(SecTrustRef SecurityTrustObject, wxString AccountNameFriendly); #endif //frmMain *frmMainPtr; protected: // Handlers for frmActivityMgrADT events. void CloseWindow( wxCommandEvent& event ); void CloseWindow( wxCloseEvent& event ); void StopTask( wxCommandEvent& event ); void StopAllTasks( wxCommandEvent& event ); void RetryTask( wxCommandEvent& event ); void StartTimer( wxCommandEvent& event ); void StopTimer( wxCommandEvent& event ); void StartProcessTimer( wxCommandEvent& event ); void StopProcessTimer( wxCommandEvent& event ); void StartAnimationTimer(wxCommandEvent& event); void FlushAllTasks(); void RemoveTask(); void ProcessTasksThread(); void ToggleConnectionStatus( wxCommandEvent& event ); void SleepMode( wxCommandEvent &event ); void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc); void WriteServerCertificate(wxString AccountName, SSLCertCollectionString SSLCertInc); void UpdateStatusLabel( wxCommandEvent& event ); public: /** Constructor */ frmActivityMgr( wxWindow* parent ); int AddTask(int TaskType, wxString TaskDetail, wxString TaskAccount, wxString TaskURL, wxString TaskFilename, wxString TaskFullFilename, wxString TaskData); void ProcessTasks(); void OpenWindow(); void SetupPointers(wxETagProcessTimer *ETagTmrPtrInc, void *frmMainPtrInc); void ResumeProcessing(wxCommandEvent &event); void PauseAllTimers(); void ResumeAllTimers(); int GetTaskStatus(int intTaskID); DECLARE_EVENT_TABLE() //// end generated class members }; #endif // __frmActivityMgr__