Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Merge branch 'master' of ssh://gelforn.xestia.co.uk/scmrepos/xestiaab
[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 #if defined(__WIN32__)
43 #include "../common/win32ssl.h"
44 #endif
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;
58         wxString FileData;
59 };
61 struct ActivityMgrLabelUpdate{
62         long ItemIndex;
63         wxString ItemLabel;
64         wxString ItemDes;
65 };
67 #if defined(__APPLE__)
68 struct SSLInvalidTrustNotifObj{
69         SecTrustRef SecurityTrustObject;
70         int *ResultValue;
71         bool *PausePtr;
72         wxString AccountName;
73 };
74 #endif
76 struct ActivityMgrAccountSettings{
77         wxString Address;
78         int Port;
79         wxString Username;
80         wxString Password;
81         bool SSL;
82         wxString Prefix;
83         wxString Dir;
84 };
86 /** Implementing frmActivityMgrADT */
87 class frmActivityMgr : public frmActivityMgrADT
88 {
89         private:
90                 wxActTimer AnimationTimer;
91                 wxActProcessTimer ActProcessTimer;
92                 wxActListProcTimer ActListProcTimer;
93                 wxBitmap SleepBitmap;
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;
120                 void *frmMainPtr;
121 #if defined(__APPLE__)
122                 int DisplayTrustPanel(SecTrustRef SecurityTrustObject, wxString AccountNameFriendly);
123 #endif
124                 //frmMain *frmMainPtr;
125         protected:
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();
137                 void RemoveTask();
138                 void ProcessTasksThread();
139                 void ToggleConnectionStatus( wxCommandEvent& event );
140                 void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
141                 void UpdateStatusLabel( wxCommandEvent& event );
142         public:
143                 /** Constructor */
144                 frmActivityMgr( wxWindow* parent );
145                 int AddTask(int TaskType, wxString TaskDetail, wxString TaskAccount, 
146                         wxString TaskURL, wxString TaskFilename, wxString TaskFullFilename,
147                         wxString TaskData);
148                 void ProcessTasks();
149                 void OpenWindow();
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
158         
159 };
161 #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