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.
29 #if defined(__APPLE__)
30 #import <Foundation/Foundation.h>
31 #import <SecurityInterface/SFCertificateTrustPanel.h>
32 #include "../frmMain.h"
35 #include "../AppXestiaAddrBk.h"
36 #include "../carddav/carddav.h"
37 #include "../common/timers.h"
38 #include "../common/etag.h"
39 #include "../common/dirs.h"
40 #include "../common/preferences.h"
42 //// end generated include
44 DECLARE_EVENT_TYPE(ACTMGR_RESUMEPROC, wxID_ANY)
45 DECLARE_EVENT_TYPE(ACTMGR_TOGGLECONN, wxID_ANY)
46 DECLARE_EVENT_TYPE(ACTMGR_STARTTIMER, wxID_ANY)
47 DECLARE_EVENT_TYPE(ACTMGR_STOPTIMER, wxID_ANY)
48 DECLARE_EVENT_TYPE(ACTMGR_STARTPROCESSTIMER, wxID_ANY)
49 DECLARE_EVENT_TYPE(ACTMGR_STOPPROCESSTIMER, wxID_ANY)
50 DECLARE_EVENT_TYPE(ACTMGR_UPDATESTATUSLABEL, wxID_ANY)
52 struct vCardDownloadDataFileClass{
53 unsigned int DataType = 0;
57 struct ActivityMgrLabelUpdate{
63 #if defined(__APPLE__)
64 struct SSLInvalidTrustNotifObj{
65 SecTrustRef SecurityTrustObject;
72 /** Implementing frmActivityMgrADT */
73 class frmActivityMgr : public frmActivityMgrADT
76 wxActTimer AnimationTimer;
77 wxActProcessTimer ActProcessTimer;
78 wxActListProcTimer ActListProcTimer;
80 int ActivityTaskID = 0;
81 int ActivityProgressBarTotal = 0;
82 int ActivityProgressBarDone = 0;
83 bool BlankBool = FALSE;
84 std::map<int,int> ActivityList;
85 std::map<int,int> ActivityListType;
86 std::map<int,long> ActivityListIndex;
87 std::map<int,wxString> ActivityListData;
88 std::map<int,wxString> ActivityListTaskDetail;
89 std::map<int,wxString> ActivityListAccount;
90 std::map<int,wxString> ActivityListFilename;
91 std::map<int,wxString> ActivityListFullFilename;
92 std::map<int,CardDAV*> ActivityListConn;
93 std::map<int,wxString> ActivityListETag;
94 std::map<int,wxString> ActivityListETagOriginal;
95 std::map<int,wxDateTime> ActivityListFinDate;
96 std::map<int,wxArrayString> ActivityListLog;
97 bool WindowOpen = FALSE;
98 bool TasksActive = FALSE;
99 bool SleepMode = FALSE;
100 bool ProcessTasksData = FALSE;
101 //int ConflictResult = 0;
102 wxETagProcessTimer *ETagTmrPtr;
104 #if defined(__APPLE__)
105 int DisplayTrustPanel(SecTrustRef SecurityTrustObject, wxString AccountNameFriendly);
107 //frmMain *frmMainPtr;
109 // Handlers for frmActivityMgrADT events.
110 void CloseWindow( wxCommandEvent& event );
111 void CloseWindow( wxCloseEvent& event );
112 void StopTask( wxCommandEvent& event );
113 void StopAllTasks( wxCommandEvent& event );
114 void RetryTask( wxCommandEvent& event );
115 void StartTimer( wxCommandEvent& event );
116 void StopTimer( wxCommandEvent& event );
117 void StartProcessTimer( wxCommandEvent& event );
118 void StopProcessTimer( wxCommandEvent& event );
119 void FlushAllTasks();
121 void ProcessTasksThread();
122 void ToggleConnectionStatus( wxCommandEvent& event );
123 void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
124 void UpdateStatusLabel( wxCommandEvent& event );
127 frmActivityMgr( wxWindow* parent );
128 int AddTask(int TaskType, wxString TaskDetail, wxString TaskAccount,
129 wxString TaskURL, wxString TaskFilename, wxString TaskFullFilename,
133 void SetupPointers(wxETagProcessTimer *ETagTmrPtrInc, void *frmMainPtrInc);
134 void ResumeProcessing(wxCommandEvent &event);
135 void PauseAllTimers();
136 void ResumeAllTimers();
137 int GetTaskStatus(int intTaskID);
138 DECLARE_EVENT_TABLE()
140 //// end generated class members
144 #endif // __frmActivityMgr__