1 // frmActivityMgr.h - Activity Manager header file.
3 // (c) 2012-2015 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #ifndef __frmActivityMgr__
20 #define __frmActivityMgr__
24 Subclass of frmActivityMgrADT, which is generated by wxFormBuilder.
30 #include "../AppXestiaAddrBk.h"
31 #include "../carddav/carddav.h"
32 #include "../common/timers.h"
33 #include "../common/etag.h"
34 #include "../common/dirs.h"
35 #include "../common/preferences.h"
37 //// end generated include
39 DECLARE_EVENT_TYPE(ACTMGR_RESUMEPROC, wxID_ANY)
40 DECLARE_EVENT_TYPE(ACTMGR_TOGGLECONN, wxID_ANY)
41 DECLARE_EVENT_TYPE(ACTMGR_STARTTIMER, wxID_ANY)
42 DECLARE_EVENT_TYPE(ACTMGR_STOPTIMER, wxID_ANY)
43 DECLARE_EVENT_TYPE(ACTMGR_STARTPROCESSTIMER, wxID_ANY)
44 DECLARE_EVENT_TYPE(ACTMGR_STOPPROCESSTIMER, wxID_ANY)
45 DECLARE_EVENT_TYPE(ACTMGR_UPDATESTATUSLABEL, wxID_ANY)
47 struct vCardDownloadDataFileClass{
48 unsigned int DataType = 0;
52 struct ActivityMgrLabelUpdate{
58 struct ActivityMgrAccountSettings{
68 /** Implementing frmActivityMgrADT */
69 class frmActivityMgr : public frmActivityMgrADT
72 wxActTimer AnimationTimer;
73 wxActProcessTimer ActProcessTimer;
74 wxActListProcTimer ActListProcTimer;
76 int ActivityTaskID = 0;
77 int ActivityProgressBarTotal = 0;
78 int ActivityProgressBarDone = 0;
79 bool BlankBool = FALSE;
80 std::map<int,int> ActivityList;
81 std::map<int,int> ActivityListType;
82 std::map<int,long> ActivityListIndex;
83 std::map<int,wxString> ActivityListData;
84 std::map<int,wxString> ActivityListTaskDetail;
85 std::map<int,wxString> ActivityListAccount;
86 std::map<int,wxString> ActivityListFilename;
87 std::map<int,wxString> ActivityListFullFilename;
88 std::map<int,CardDAV*> ActivityListConn;
89 std::map<int,ActivityMgrAccountSettings> ActivityListAccSettings;
90 std::map<int,wxString> ActivityListETag;
91 std::map<int,wxString> ActivityListETagOriginal;
92 std::map<int,wxDateTime> ActivityListFinDate;
93 std::map<int,wxArrayString> ActivityListLog;
94 bool WindowOpen = FALSE;
95 bool TasksActive = FALSE;
96 bool SleepMode = FALSE;
97 bool ProcessTasksData = FALSE;
98 //int ConflictResult = 0;
99 wxETagProcessTimer *ETagTmrPtr;
101 //frmMain *frmMainPtr;
103 // Handlers for frmActivityMgrADT events.
104 void CloseWindow( wxCommandEvent& event );
105 void CloseWindow( wxCloseEvent& event );
106 void StopTask( wxCommandEvent& event );
107 void StopAllTasks( wxCommandEvent& event );
108 void RetryTask( wxCommandEvent& event );
109 void StartTimer( wxCommandEvent& event );
110 void StopTimer( wxCommandEvent& event );
111 void StartProcessTimer( wxCommandEvent& event );
112 void StopProcessTimer( wxCommandEvent& event );
113 void FlushAllTasks();
115 void ProcessTasksThread();
116 void ToggleConnectionStatus( wxCommandEvent& event );
117 void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
118 void UpdateStatusLabel( wxCommandEvent& event );
121 frmActivityMgr( wxWindow* parent );
122 int AddTask(int TaskType, wxString TaskDetail, wxString TaskAccount,
123 wxString TaskURL, wxString TaskFilename, wxString TaskFullFilename,
127 void SetupPointers(wxETagProcessTimer *ETagTmrPtrInc, void *frmMainPtrInc);
128 void ResumeProcessing(wxCommandEvent &event);
129 void PauseAllTimers();
130 void ResumeAllTimers();
131 int GetTaskStatus(int intTaskID);
132 DECLARE_EVENT_TABLE()
134 //// end generated class members
138 #endif // __frmActivityMgr__