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.
27 #include "AppXestiaAddrBk.h"
28 #include "carddav/carddav.h"
32 #include "common/timers.h"
33 #include "common/etag.h"
35 //// end generated include
37 DECLARE_EVENT_TYPE(ACTMGR_RESUMEPROC, wxID_ANY)
38 DECLARE_EVENT_TYPE(ACTMGR_TOGGLECONN, wxID_ANY)
39 DECLARE_EVENT_TYPE(ACTMGR_STARTTIMER, wxID_ANY)
40 DECLARE_EVENT_TYPE(ACTMGR_STOPTIMER, wxID_ANY)
41 DECLARE_EVENT_TYPE(ACTMGR_STARTPROCESSTIMER, wxID_ANY)
42 DECLARE_EVENT_TYPE(ACTMGR_STOPPROCESSTIMER, wxID_ANY)
43 DECLARE_EVENT_TYPE(ACTMGR_UPDATESTATUSLABEL, wxID_ANY)
45 struct vCardDownloadDataFileClass{
46 unsigned int DataType = 0;
50 struct ActivityMgrLabelUpdate{
56 /** Implementing frmActivityMgrADT */
57 class frmActivityMgr : public frmActivityMgrADT
60 wxActTimer AnimationTimer;
61 wxActProcessTimer ActProcessTimer;
62 wxActListProcTimer ActListProcTimer;
64 int ActivityTaskID = 0;
65 int ActivityProgressBarTotal = 0;
66 int ActivityProgressBarDone = 0;
67 bool BlankBool = FALSE;
68 std::map<int,int> ActivityList;
69 std::map<int,int> ActivityListType;
70 std::map<int,long> ActivityListIndex;
71 std::map<int,wxString> ActivityListData;
72 std::map<int,wxString> ActivityListTaskDetail;
73 std::map<int,wxString> ActivityListAccount;
74 std::map<int,wxString> ActivityListFilename;
75 std::map<int,wxString> ActivityListFullFilename;
76 std::map<int,CardDAV> ActivityListConn;
77 std::map<int,wxString> ActivityListETag;
78 std::map<int,wxString> ActivityListETagOriginal;
79 std::map<int,wxDateTime> ActivityListFinDate;
80 std::map<int,wxArrayString> ActivityListLog;
81 bool WindowOpen = FALSE;
82 bool TasksActive = FALSE;
83 bool SleepMode = FALSE;
84 bool ProcessTasksData = FALSE;
85 //int ConflictResult = 0;
86 wxETagProcessTimer *ETagTmrPtr;
88 //frmMain *frmMainPtr;
90 // Handlers for frmActivityMgrADT events.
91 void CloseWindow( wxCommandEvent& event );
92 void CloseWindow( wxCloseEvent& event );
93 void StopTask( wxCommandEvent& event );
94 void StopAllTasks( wxCommandEvent& event );
95 void RetryTask( wxCommandEvent& event );
96 void StartTimer( wxCommandEvent& event );
97 void StopTimer( wxCommandEvent& event );
98 void StartProcessTimer( wxCommandEvent& event );
99 void StopProcessTimer( wxCommandEvent& event );
100 void FlushAllTasks();
102 void ProcessTasksThread();
103 void ToggleConnectionStatus( wxCommandEvent& event );
104 void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
105 void UpdateStatusLabel( wxCommandEvent& event );
108 frmActivityMgr( wxWindow* parent );
109 int AddTask(int TaskType, wxString TaskDetail, wxString TaskAccount,
110 wxString TaskURL, wxString TaskFilename, wxString TaskFullFilename,
114 void SetupPointers(wxETagProcessTimer *ETagTmrPtrInc, void *frmMainPtrInc);
115 void ResumeProcessing(wxCommandEvent &event);
116 void PauseAllTimers();
117 void ResumeAllTimers();
118 int GetTaskStatus(int intTaskID);
119 DECLARE_EVENT_TABLE()
121 //// end generated class members
125 #endif // __frmActivityMgr__