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