Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added initial OS X support for frmActivityMgr.h
[xestiaab/.git] / source / actmgr / frmActivityMgr.h
1 // frmActivityMgr.h - Activity Manager header file.
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
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.
10 //
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.
15 //
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__
22 /**
23 @file
24 Subclass of frmActivityMgrADT, which is generated by wxFormBuilder.
25 */
27 #include <map>
28 #include <wx/timer.h>
29 #if defined(__APPLE__)
30 #import <Foundation/Foundation.h>
31 #import <SecurityInterface/SFCertificateTrustPanel.h>
32 #include "../frmMain.h"
33 #endif
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;
54         wxString FileData;
55 };
57 struct ActivityMgrLabelUpdate{
58         long ItemIndex;
59         wxString ItemLabel;
60         wxString ItemDes;
61 };
63 #if defined(__APPLE__)
64 struct SSLInvalidTrustNotifObj{
65         SecTrustRef SecurityTrustObject;
66         int *ResultValue;
67         bool *PausePtr;
68         wxString AccountName;
69 };
70 #endif
72 /** Implementing frmActivityMgrADT */
73 class frmActivityMgr : public frmActivityMgrADT
74 {
75         private:
76                 wxActTimer AnimationTimer;
77                 wxActProcessTimer ActProcessTimer;
78                 wxActListProcTimer ActListProcTimer;
79                 wxBitmap SleepBitmap;
80                 int ActivityTaskID = 0;
81                 int ActivityProgressBarTotal = 0;
82                 int ActivityProgressBarDone = 0;
83                 bool BlankBool = FALSE;
84                 std::map<int,int> ActivityList;
85                 std::map<int,int> ActivityListType;
86                 std::map<int,long> ActivityListIndex;
87                 std::map<int,wxString> ActivityListData;
88                 std::map<int,wxString> ActivityListTaskDetail;
89                 std::map<int,wxString> ActivityListAccount;
90                 std::map<int,wxString> ActivityListFilename;
91                 std::map<int,wxString> ActivityListFullFilename;
92                 std::map<int,CardDAV*> ActivityListConn;
93                 std::map<int,wxString> ActivityListETag;
94                 std::map<int,wxString> ActivityListETagOriginal;
95                 std::map<int,wxDateTime> ActivityListFinDate;
96                 std::map<int,wxArrayString> ActivityListLog;
97                 bool WindowOpen = FALSE;
98                 bool TasksActive = FALSE;
99                 bool SleepMode = FALSE;
100                 bool ProcessTasksData = FALSE;
101                 //int ConflictResult = 0;
102                 wxETagProcessTimer *ETagTmrPtr;
103                 void *frmMainPtr;
104 #if defined(__APPLE__)
105                 int DisplayTrustPanel(SecTrustRef SecurityTrustObject, wxString AccountNameFriendly);
106 #endif
107                 //frmMain *frmMainPtr;
108         protected:
109                 // Handlers for frmActivityMgrADT events.
110                 void CloseWindow( wxCommandEvent& event );
111                 void CloseWindow( wxCloseEvent& event );
112                 void StopTask( wxCommandEvent& event );
113                 void StopAllTasks( wxCommandEvent& event );
114                 void RetryTask( wxCommandEvent& event );
115                 void StartTimer( wxCommandEvent& event );
116                 void StopTimer( wxCommandEvent& event );
117                 void StartProcessTimer( wxCommandEvent& event );
118                 void StopProcessTimer( wxCommandEvent& event );
119                 void FlushAllTasks();
120                 void RemoveTask();
121                 void ProcessTasksThread();
122                 void ToggleConnectionStatus( wxCommandEvent& event );
123                 void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
124                 void UpdateStatusLabel( wxCommandEvent& event );
125         public:
126                 /** Constructor */
127                 frmActivityMgr( wxWindow* parent );
128                 int AddTask(int TaskType, wxString TaskDetail, wxString TaskAccount, 
129                         wxString TaskURL, wxString TaskFilename, wxString TaskFullFilename,
130                         wxString TaskData);
131                 void ProcessTasks();
132                 void OpenWindow();
133                 void SetupPointers(wxETagProcessTimer *ETagTmrPtrInc, void *frmMainPtrInc);
134                 void ResumeProcessing(wxCommandEvent &event);
135                 void PauseAllTimers();
136                 void ResumeAllTimers();
137                 int GetTaskStatus(int intTaskID);
138                 DECLARE_EVENT_TABLE()
140         //// end generated class members
141         
142 };
144 #endif // __frmActivityMgr__
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy