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"
41 #include "../common/sslcertstructs.h"
43 #if defined(__WIN32__)
44 #include "../common/win32ssl.h"
47 //// end generated include
49 DECLARE_EVENT_TYPE(ACTMGR_RESUMEPROC, wxID_ANY)
50 DECLARE_EVENT_TYPE(ACTMGR_TOGGLECONN, wxID_ANY)
51 DECLARE_EVENT_TYPE(ACTMGR_STARTTIMER, wxID_ANY)
52 DECLARE_EVENT_TYPE(ACTMGR_STOPTIMER, wxID_ANY)
53 DECLARE_EVENT_TYPE(ACTMGR_STARTPROCESSTIMER, wxID_ANY)
54 DECLARE_EVENT_TYPE(ACTMGR_STOPPROCESSTIMER, wxID_ANY)
55 DECLARE_EVENT_TYPE(ACTMGR_UPDATESTATUSLABEL, wxID_ANY)
56 DECLARE_EVENT_TYPE(ACTMGR_STARTANIMATIONTIMER, wxID_ANY)
58 struct vCardDownloadDataFileClass{
59 unsigned int DataType = 0;
63 struct ActivityMgrLabelUpdate{
69 #if defined(__APPLE__)
70 struct SSLInvalidTrustNotifObj{
71 SecTrustRef SecurityTrustObject;
78 struct ActivityMgrAccountSettings{
88 /** Implementing frmActivityMgrADT */
89 class frmActivityMgr : public frmActivityMgrADT
92 wxActTimer AnimationTimer;
93 wxActProcessTimer ActProcessTimer;
94 wxActListProcTimer ActListProcTimer;
96 int ActivityTaskID = 0;
97 int ActivityProgressBarTotal = 0;
98 int ActivityProgressBarDone = 0;
99 bool BlankBool = FALSE;
100 std::map<int,int> ActivityList;
101 std::map<int,int> ActivityListType;
102 std::map<int,long> ActivityListIndex;
103 std::map<int,wxString> ActivityListData;
104 std::map<int,wxString> ActivityListURL;
105 std::map<int,bool> ActivityListEditMode;
106 std::map<int,wxString> ActivityListTaskDetail;
107 std::map<int,wxString> ActivityListAccount;
108 std::map<int,wxString> ActivityListFilename;
109 std::map<int,wxString> ActivityListFullFilename;
110 std::map<int,CardDAV*> ActivityListConn;
111 std::map<int,ActivityMgrAccountSettings> ActivityListAccSettings;
112 std::map<int,wxString> ActivityListETag;
113 std::map<int,wxString> ActivityListETagOriginal;
114 std::map<int,wxDateTime> ActivityListFinDate;
115 std::map<int,wxArrayString> ActivityListLog;
116 bool WindowOpen = FALSE;
117 bool TasksActive = FALSE;
118 bool ApplicationSleepMode = FALSE;
119 bool ProcessTasksData = FALSE;
120 //int ConflictResult = 0;
121 wxETagProcessTimer *ETagTmrPtr;
123 #if defined(__APPLE__)
124 int DisplayTrustPanel(SecTrustRef SecurityTrustObject, wxString AccountNameFriendly);
126 //frmMain *frmMainPtr;
128 // Handlers for frmActivityMgrADT events.
129 void CloseWindow( wxCommandEvent& event );
130 void CloseWindow( wxCloseEvent& event );
131 void StopTask( wxCommandEvent& event );
132 void StopAllTasks( wxCommandEvent& event );
133 void RetryTask( wxCommandEvent& event );
134 void StartTimer( wxCommandEvent& event );
135 void StopTimer( wxCommandEvent& event );
136 void StartProcessTimer( wxCommandEvent& event );
137 void StopProcessTimer( wxCommandEvent& event );
138 void StartAnimationTimer(wxCommandEvent& event);
139 void FlushAllTasks();
141 void ProcessTasksThread();
142 void ToggleConnectionStatus( wxCommandEvent& event );
143 void SleepMode( wxCommandEvent &event );
144 void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
145 void UpdateStatusLabel( wxCommandEvent& event );
148 frmActivityMgr( wxWindow* parent );
149 int AddTask(int TaskType, wxString TaskDetail, wxString TaskAccount,
150 wxString TaskURL, wxString TaskFilename, wxString TaskFullFilename,
154 void SetupPointers(wxETagProcessTimer *ETagTmrPtrInc, void *frmMainPtrInc);
155 void ResumeProcessing(wxCommandEvent &event);
156 void PauseAllTimers();
157 void ResumeAllTimers();
158 int GetTaskStatus(int intTaskID);
159 DECLARE_EVENT_TABLE()
161 //// end generated class members
165 #endif // __frmActivityMgr__