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 struct ActivityMgrAccountSettings{
82 /** Implementing frmActivityMgrADT */
83 class frmActivityMgr : public frmActivityMgrADT
86 wxActTimer AnimationTimer;
87 wxActProcessTimer ActProcessTimer;
88 wxActListProcTimer ActListProcTimer;
90 int ActivityTaskID = 0;
91 int ActivityProgressBarTotal = 0;
92 int ActivityProgressBarDone = 0;
93 bool BlankBool = FALSE;
94 std::map<int,int> ActivityList;
95 std::map<int,int> ActivityListType;
96 std::map<int,long> ActivityListIndex;
97 std::map<int,wxString> ActivityListData;
98 std::map<int,wxString> ActivityListURL;
99 std::map<int,bool> ActivityListEditMode;
100 std::map<int,wxString> ActivityListTaskDetail;
101 std::map<int,wxString> ActivityListAccount;
102 std::map<int,wxString> ActivityListFilename;
103 std::map<int,wxString> ActivityListFullFilename;
104 std::map<int,CardDAV*> ActivityListConn;
105 std::map<int,ActivityMgrAccountSettings> ActivityListAccSettings;
106 std::map<int,wxString> ActivityListETag;
107 std::map<int,wxString> ActivityListETagOriginal;
108 std::map<int,wxDateTime> ActivityListFinDate;
109 std::map<int,wxArrayString> ActivityListLog;
110 bool WindowOpen = FALSE;
111 bool TasksActive = FALSE;
112 bool SleepMode = FALSE;
113 bool ProcessTasksData = FALSE;
114 //int ConflictResult = 0;
115 wxETagProcessTimer *ETagTmrPtr;
117 #if defined(__APPLE__)
118 int DisplayTrustPanel(SecTrustRef SecurityTrustObject, wxString AccountNameFriendly);
120 //frmMain *frmMainPtr;
122 // Handlers for frmActivityMgrADT events.
123 void CloseWindow( wxCommandEvent& event );
124 void CloseWindow( wxCloseEvent& event );
125 void StopTask( wxCommandEvent& event );
126 void StopAllTasks( wxCommandEvent& event );
127 void RetryTask( wxCommandEvent& event );
128 void StartTimer( wxCommandEvent& event );
129 void StopTimer( wxCommandEvent& event );
130 void StartProcessTimer( wxCommandEvent& event );
131 void StopProcessTimer( wxCommandEvent& event );
132 void FlushAllTasks();
134 void ProcessTasksThread();
135 void ToggleConnectionStatus( wxCommandEvent& event );
136 void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
137 void UpdateStatusLabel( wxCommandEvent& event );
140 frmActivityMgr( wxWindow* parent );
141 int AddTask(int TaskType, wxString TaskDetail, wxString TaskAccount,
142 wxString TaskURL, wxString TaskFilename, wxString TaskFullFilename,
146 void SetupPointers(wxETagProcessTimer *ETagTmrPtrInc, void *frmMainPtrInc);
147 void ResumeProcessing(wxCommandEvent &event);
148 void PauseAllTimers();
149 void ResumeAllTimers();
150 int GetTaskStatus(int intTaskID);
151 DECLARE_EVENT_TABLE()
153 //// end generated class members
157 #endif // __frmActivityMgr__