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 "../common/timers.h"
37 #include "../common/etag.h"
38 #include "../common/dirs.h"
39 #include "../common/preferences.h"
40 #include "../common/sslcertstructs.h"
41 #include "../connobject/ConnectionObject.h"
42 #include "../carddav2/carddav2.h"
44 #if defined(__WIN32__)
45 #include "../common/win32ssl.h"
48 //// end generated include
50 DECLARE_EVENT_TYPE(ACTMGR_RESUMEPROC, wxID_ANY)
51 DECLARE_EVENT_TYPE(ACTMGR_TOGGLECONN, wxID_ANY)
52 DECLARE_EVENT_TYPE(ACTMGR_STARTTIMER, wxID_ANY)
53 DECLARE_EVENT_TYPE(ACTMGR_STOPTIMER, wxID_ANY)
54 DECLARE_EVENT_TYPE(ACTMGR_STARTPROCESSTIMER, wxID_ANY)
55 DECLARE_EVENT_TYPE(ACTMGR_STOPPROCESSTIMER, wxID_ANY)
56 DECLARE_EVENT_TYPE(ACTMGR_UPDATESTATUSLABEL, wxID_ANY)
57 DECLARE_EVENT_TYPE(ACTMGR_STARTANIMATIONTIMER, wxID_ANY)
59 struct vCardDownloadDataFileClass{
60 unsigned int DataType = 0;
64 struct ActivityMgrLabelUpdate{
70 #if defined(__APPLE__)
71 struct SSLInvalidTrustNotifObj{
72 SecTrustRef SecurityTrustObject;
79 struct ActivityMgrAccountSettings{
89 /** Implementing frmActivityMgrADT */
90 class frmActivityMgr : public frmActivityMgrADT
93 wxActTimer AnimationTimer;
94 wxActProcessTimer ActProcessTimer;
95 wxActListProcTimer ActListProcTimer;
97 int ActivityTaskID = 0;
98 int ActivityProgressBarTotal = 0;
99 int ActivityProgressBarDone = 0;
100 bool BlankBool = FALSE;
101 std::map<int,int> ActivityList;
102 std::map<int,int> ActivityListType;
103 std::map<int,long> ActivityListIndex;
104 std::map<int,wxString> ActivityListData;
105 std::map<int,wxString> ActivityListURL;
106 std::map<int,bool> ActivityListEditMode;
107 std::map<int,wxString> ActivityListTaskDetail;
108 std::map<int,wxString> ActivityListAccount;
109 std::map<int,wxString> ActivityListFilename;
110 std::map<int,wxString> ActivityListFullFilename;
111 std::map<int,ConnectionObject*> ActivityListConnObject;
112 std::map<int,ActivityMgrAccountSettings> ActivityListAccSettings;
113 std::map<int,wxString> ActivityListETag;
114 std::map<int,wxString> ActivityListETagOriginal;
115 std::map<int,wxDateTime> ActivityListFinDate;
116 std::map<int,wxArrayString> ActivityListLog;
117 bool WindowOpen = FALSE;
118 bool TasksActive = FALSE;
119 bool ApplicationSleepMode = FALSE;
120 bool ProcessTasksData = FALSE;
121 //int ConflictResult = 0;
122 wxETagProcessTimer *ETagTmrPtr;
124 #if defined(__APPLE__)
125 int DisplayTrustPanel(SecTrustRef SecurityTrustObject, wxString AccountNameFriendly);
127 //frmMain *frmMainPtr;
129 // Handlers for frmActivityMgrADT events.
130 void CloseWindow( wxCommandEvent& event );
131 void CloseWindow( wxCloseEvent& event );
132 void StopTask( wxCommandEvent& event );
133 void StopAllTasks( wxCommandEvent& event );
134 void RetryTask( wxCommandEvent& event );
135 void StartTimer( wxCommandEvent& event );
136 void StopTimer( wxCommandEvent& event );
137 void StartProcessTimer( wxCommandEvent& event );
138 void StopProcessTimer( wxCommandEvent& event );
139 void StartAnimationTimer(wxCommandEvent& event);
140 void FlushAllTasks();
142 void ProcessTasksThread();
143 void ToggleConnectionStatus( wxCommandEvent& event );
144 void SleepMode( wxCommandEvent &event );
145 void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
146 void WriteServerCertificate(wxString AccountName, SSLCertCollectionString SSLCertInc);
147 void UpdateStatusLabel( wxCommandEvent& event );
150 frmActivityMgr( wxWindow* parent );
151 int AddTask(int TaskType, wxString TaskDetail, wxString TaskAccount,
152 wxString TaskURL, wxString TaskFilename, wxString TaskFullFilename,
156 void SetupPointers(wxETagProcessTimer *ETagTmrPtrInc, void *frmMainPtrInc);
157 void ResumeProcessing(wxCommandEvent &event);
158 void PauseAllTimers();
159 void ResumeAllTimers();
160 int GetTaskStatus(int intTaskID);
161 DECLARE_EVENT_TABLE()
163 //// end generated class members
167 #endif // __frmActivityMgr__