1 // timers.h - Timers subroutines header.
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/>
24 #include "../actmgr/frmActivityMgr.h"
25 #include "../contacteditor/frmContactEditor.h"
32 struct frmContactEditor;
34 class wxActTimer : public wxTimer
37 int intActivityProgress = 0;
38 wxStaticBitmap *bmpActivity;
39 wxBitmap *SleepBitmapPtr;
42 wxActTimer():wxTimer()
46 void SetBitmap(wxStaticBitmap *ActMgr);
48 void StartAnimation();
50 void SetSleepBitmap(wxBitmap *SleepBitmap);
51 void SetupPointer(void *frmMainPtrIn);
55 class wxActProcessTimer : public wxTimer
59 int intActivityProgress = 0;
60 wxStaticBitmap *bmpActivity;
63 wxActProcessTimer():wxTimer()
67 void SetupPointers(void *ActMgr);
71 class wxActListProcTimer : public wxTimer
75 std::map<int,int> *ActListPtr;
76 std::map<int,long> *ActListUIPtr;
77 std::map<int,wxString> *ActListDetailPtr;
78 std::map<int,CardDAV*> *ActListConnPtr;
79 wxListCtrl *lstActivityPtr;
80 wxStaticText *lblDetailsPtr;
82 wxGauge *GauProgressPtr;
84 int intActivityTotal = 0;
85 int intActivityCompleted = 0;
86 wxActTimer *ActTimerPtr;
87 wxActProcessTimer *ActProcessTimerPtr;
88 std::map<int,wxDateTime> *ActListFinDTPtr;
89 bool ClearupProcessed = FALSE;
91 wxActListProcTimer():wxTimer()
95 void SetupPointers(std::map<int,int> *ActList, std::map<int,long> *ActListUI,
96 std::map<int,wxString> *ActListDetail, bool *TasksActive,
97 wxListCtrl *lstActivity, wxStaticText *lblDetails, wxGauge *GauProgress,
98 void *ActMgr, wxActTimer *ActTimer, wxActProcessTimer *ActProcessTimer,
99 std::map<int,wxDateTime> *ActListFinDT, std::map<int, CardDAV*> *ActListConn);
100 void EnableClearup();
104 class wxETagProcessTimer : public wxTimer
107 int intActivityProgress = 0;
108 std::map<wxString,ETagDB> ETagDBList;
109 //std::map<int,ETagDB2> ETagDBListv3;
110 std::mutex ReloadLock;
112 wxETagProcessTimer():wxTimer()
117 ETagDB* GetPointer(wxString Filename);
118 void ReloadAccounts();
119 //void SetupPointers(frmActivityMgr *ActMgr);
123 class wxContactFileMonitorTimer : public wxTimer
126 bool FileStatus = FALSE;
128 frmContactEditor *frmCEPtr;
129 wxDateTime FileDateTime;
131 wxContactFileMonitorTimer():wxTimer()
135 void SetFilename(wxString FilenameInc);
136 void SetupPointers(frmContactEditor *frmCEPtrInc);
137 void UpdateTimestamp();
140 class wxContactWindowMonitor : public wxTimer
143 std::map<wxString, void*> *ContactWindowListPtr;
145 wxContactWindowMonitor():wxTimer()
149 void SetupPointers(std::map<wxString, void*> *ContactWindowListPtrInc);
152 class wxAccountSyncTimer : public wxTimer
156 wxString AccNameFull;
162 wxAccountSyncTimer():wxTimer()
166 void SetupData(wxString AccNameInc, wxString AccNameFull);
167 void SetupPointers(void *frmMainPtrInc,
168 void *frmACtMgrPtr, ETagDB *ETagDBPtrInc);
172 void SleepFor(unsigned long longSleepNanoSecs);