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"
26 #include "../connobject/ConnectionObject.h"
33 struct frmContactEditor;
35 class wxActTimer : public wxTimer
38 int intActivityProgress = 0;
39 wxStaticBitmap *bmpActivity;
40 wxBitmap *SleepBitmapPtr;
43 wxActTimer():wxTimer()
47 void SetBitmap(wxStaticBitmap *ActMgr);
49 void StartAnimation();
51 void SetSleepBitmap(wxBitmap *SleepBitmap);
52 void SetupPointer(void *frmMainPtrIn);
56 class wxActProcessTimer : public wxTimer
60 int intActivityProgress = 0;
61 wxStaticBitmap *bmpActivity;
64 wxActProcessTimer():wxTimer()
68 void SetupPointers(void *ActMgr);
72 class wxActListProcTimer : public wxTimer
76 std::map<int,int> *ActListPtr = nullptr;
77 std::map<int,long> *ActListUIPtr = nullptr;
78 std::map<int,wxString> *ActListDetailPtr = nullptr;
79 wxListCtrl *lstActivityPtr = nullptr;
80 wxStaticText *lblDetailsPtr = nullptr;
81 bool *TasksActivePtr = nullptr;
82 wxGauge *GauProgressPtr = nullptr;
83 void *ActMgrPtr = nullptr;
84 int intActivityTotal = 0;
85 int intActivityCompleted = 0;
86 wxActTimer *ActTimerPtr = nullptr;
87 wxActProcessTimer *ActProcessTimerPtr = nullptr;
88 std::map<int,wxDateTime> *ActListFinDTPtr = nullptr;
89 std::map<int,ConnectionObject*> *ActListConnObjectsPtr = nullptr;
90 bool ClearupProcessed = FALSE;
92 wxActListProcTimer():wxTimer()
96 void SetupPointers(std::map<int,int> *ActList, std::map<int,long> *ActListUI,
97 std::map<int,wxString> *ActListDetail, bool *TasksActive,
98 wxListCtrl *lstActivity, wxStaticText *lblDetails, wxGauge *GauProgress,
99 void *ActMgr, wxActTimer *ActTimer, wxActProcessTimer *ActProcessTimer,
100 std::map<int,wxDateTime> *ActListFinDT, std::map<int,ConnectionObject*> *ActListConnObjects);
101 void EnableClearup();
105 class wxETagProcessTimer : public wxTimer
108 int intActivityProgress = 0;
109 std::map<wxString,ETagDB> ETagDBList;
110 //std::map<int,ETagDB2> ETagDBListv3;
111 std::mutex ReloadLock;
113 wxETagProcessTimer():wxTimer()
118 ETagDB* GetPointer(wxString Filename);
119 void ReloadAccounts();
120 //void SetupPointers(frmActivityMgr *ActMgr);
124 class wxContactFileMonitorTimer : public wxTimer
127 bool FileStatus = FALSE;
129 frmContactEditor *frmCEPtr;
130 wxDateTime FileDateTime;
132 wxContactFileMonitorTimer():wxTimer()
136 void SetFilename(wxString FilenameInc);
137 void SetupPointers(frmContactEditor *frmCEPtrInc);
138 void UpdateTimestamp();
141 class wxContactWindowMonitor : public wxTimer
144 std::map<wxString, void*> *ContactWindowListPtr;
146 wxContactWindowMonitor():wxTimer()
150 void SetupPointers(std::map<wxString, void*> *ContactWindowListPtrInc);
153 class wxAccountSyncTimer : public wxTimer
157 wxString AccNameFull;
163 wxAccountSyncTimer():wxTimer()
167 void SetupData(wxString AccNameInc, wxString AccNameFull);
168 void SetupPointers(void *frmMainPtrInc,
169 void *frmACtMgrPtr, ETagDB *ETagDBPtrInc);
173 void SleepFor(unsigned long longSleepNanoSecs);