Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Capitalise Bitmaps and Tools directories
[xestiaab/.git] / source / common / timers.h
1 // timers.h - Timers subroutines header.
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 #include <map>
20 #include <mutex>
21 #include <atomic>
22 #include <wx/timer.h>
23 #include <wx/wx.h>
24 #include <wx/mstream.h>
25 #include <wx/file.h>
26 #include <wx/ffile.h>
27 #include <wx/filename.h>
28 #include <wx/tokenzr.h>
30 #include "../actmgr/frmActivityMgr.h"
31 #include "../contacteditor/frmContactEditor.h"
32 #include "../connobject/ConnectionObject.h"
33 #include "../frmContact.h"
34 #include "../frmMain.h"
35 #include "../Bitmaps.h"
36 #include "../enums.h"
37 #include "../common/preferences.h"
38 #include "../common/etag.h"
39 #include "../common/dirs.h"
40 #include "etag.h"
42 #ifndef TIMERS_H
43 #define TIMERS_H
45 struct ETagDB;
46 struct frmContactEditor;
48 class wxActTimer : public wxTimer
49 {
50 private:
51     int intActivityProgress = 0;
52     wxStaticBitmap *bmpActivity;
53     wxBitmap *SleepBitmapPtr;
54     void *frmMainPtr;
55 public:
56     wxActTimer():wxTimer()
57     {
58     }
59     void Notify();
60     void SetBitmap(wxStaticBitmap *ActMgr);
61     void ResetBitmap();
62     void StartAnimation();
63     void StopAnimation();
64     void SetSleepBitmap(wxBitmap *SleepBitmap);
65     void SetupPointer(void *frmMainPtrIn);
66     
67 };
69 class wxActProcessTimer : public wxTimer
70 {
71     
72 private:
73     int intActivityProgress = 0;
74     wxStaticBitmap *bmpActivity;
75     void *ActMgrPtr;
76 public:
77     wxActProcessTimer():wxTimer()
78     {
79     }
80     void Notify();
81     void SetupPointers(void *ActMgr);
82     
83 };
85 class wxActListProcTimer : public wxTimer
86 {
87     
88 private:
89     std::map<int,int> *ActListPtr = nullptr;
90     std::map<int,long> *ActListUIPtr = nullptr;
91     std::map<int,wxString> *ActListDetailPtr = nullptr;
92     wxListCtrl *lstActivityPtr = nullptr;
93     wxStaticText *lblDetailsPtr = nullptr;
94     bool *TasksActivePtr = nullptr;
95     wxGauge *GauProgressPtr = nullptr;
96     void *ActMgrPtr = nullptr;
97     int intActivityTotal = 0;
98     int intActivityCompleted = 0;
99     wxActTimer *ActTimerPtr = nullptr;
100     wxActProcessTimer *ActProcessTimerPtr = nullptr;
101     std::map<int,wxDateTime> *ActListFinDTPtr = nullptr;
102     std::map<int,ConnectionObject*> *ActListConnObjectsPtr = nullptr;
103     bool ClearupProcessed = FALSE;
104 public:
105     wxActListProcTimer():wxTimer()
106     {
107     }
108     void Notify();
109     void SetupPointers(std::map<int,int> *ActList, std::map<int,long> *ActListUI,
110                        std::map<int,wxString> *ActListDetail, bool *TasksActive,
111                        wxListCtrl *lstActivity, wxStaticText *lblDetails, wxGauge *GauProgress,
112                        void *ActMgr, wxActTimer *ActTimer, wxActProcessTimer *ActProcessTimer,
113                        std::map<int,wxDateTime> *ActListFinDT, std::map<int,ConnectionObject*> *ActListConnObjects);
114     void EnableClearup();
115     
116 };
118 class wxETagProcessTimer : public wxTimer
120 private:
121     int intActivityProgress = 0;
122     std::map<wxString,ETagDB> ETagDBList;
124     std::mutex ReloadLock;
125 public:
126     wxETagProcessTimer():wxTimer()
127     {
128         ReloadAccounts();
129     }
130     void Notify();
131     ETagDB* GetPointer(wxString Filename);
132     void ReloadAccounts();
133     
134 };
136 class wxContactFileMonitorTimer : public wxTimer
138 private:
139     bool FileStatus = FALSE;
140     wxString Filename;
141     frmContactEditor *frmCEPtr;
142     wxDateTime FileDateTime;
143 public:
144     wxContactFileMonitorTimer():wxTimer()
145     {
146     }
147     void Notify();
148     void SetFilename(wxString FilenameInc);
149     void SetupPointers(frmContactEditor *frmCEPtrInc);
150     void UpdateTimestamp();
151 };
153 class wxContactWindowMonitor : public wxTimer
155 private:
156     std::map<wxString, void*> *ContactWindowListPtr;
157 public:
158     wxContactWindowMonitor():wxTimer()
159     {
160     }
161     void Notify();
162     void SetupPointers(std::map<wxString, void*> *ContactWindowListPtrInc);
163 };
165 class wxAccountSyncTimer : public wxTimer
167 private:
168     wxString AccName;
169     wxString AccNameFull;
170     void *frmMainPtr;
171     void *frmActMgrPtr;
172     ETagDB *ETagDBPtr;
173     int intTaskID;
174 public:
175     wxAccountSyncTimer():wxTimer()
176     {
177     }
178     void Notify();
179     void SetupData(wxString AccNameInc, wxString AccNameFull);
180     void SetupPointers(void *frmMainPtrInc, 
181                        void *frmACtMgrPtr, ETagDB *ETagDBPtrInc);
182     
183 };
185 void SleepFor(unsigned long longSleepNanoSecs);
187 #endif
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