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