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 "../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 wxListCtrl *lstActivityPtr;
79 wxStaticText *lblDetailsPtr;
81 wxGauge *GauProgressPtr;
83 int intActivityTotal = 0;
84 int intActivityCompleted = 0;
85 wxActTimer *ActTimerPtr;
86 wxActProcessTimer *ActProcessTimerPtr;
87 std::map<int,wxDateTime> *ActListFinDTPtr;
88 bool ClearupProcessed = FALSE;
90 wxActListProcTimer():wxTimer()
94 void SetupPointers(std::map<int,int> *ActList, std::map<int,long> *ActListUI,
95 std::map<int,wxString> *ActListDetail, bool *TasksActive,
96 wxListCtrl *lstActivity, wxStaticText *lblDetails, wxGauge *GauProgress,
97 void *ActMgr, wxActTimer *ActTimer, wxActProcessTimer *ActProcessTimer,
98 std::map<int,wxDateTime> *ActListFinDT);
103 class wxETagProcessTimer : public wxTimer
106 int intActivityProgress = 0;
107 std::map<wxString,ETagDB> ETagDBList;
108 //std::map<int,ETagDB2> ETagDBListv3;
109 std::mutex ReloadLock;
111 wxETagProcessTimer():wxTimer()
116 ETagDB* GetPointer(wxString Filename);
117 void ReloadAccounts();
118 //void SetupPointers(frmActivityMgr *ActMgr);
122 class wxContactFileMonitorTimer : public wxTimer
125 bool FileStatus = FALSE;
127 frmContactEditor *frmCEPtr;
128 wxDateTime FileDateTime;
130 wxContactFileMonitorTimer():wxTimer()
134 void SetFilename(wxString FilenameInc);
135 void SetupPointers(frmContactEditor *frmCEPtrInc);
136 void UpdateTimestamp();
139 class wxContactWindowMonitor : public wxTimer
142 std::map<wxString, void*> *ContactWindowListPtr;
144 wxContactWindowMonitor():wxTimer()
148 void SetupPointers(std::map<wxString, void*> *ContactWindowListPtrInc);
151 class wxAccountSyncTimer : public wxTimer
155 wxString AccNameFull;
161 wxAccountSyncTimer():wxTimer()
165 void SetupData(wxString AccNameInc, wxString AccNameFull);
166 void SetupPointers(void *frmMainPtrInc,
167 void *frmACtMgrPtr, ETagDB *ETagDBPtrInc);
171 void SleepFor(unsigned long longSleepNanoSecs);