Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Removed references of CardDAV and delete ConnectionObject when finished
[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 <wx/timer.h>
21 #include <wx/wx.h>
22 #include <mutex>
23 #include <atomic>
24 #include "../actmgr/frmActivityMgr.h"
25 #include "../contacteditor/frmContactEditor.h"
26 #include "../connobject/ConnectionObject.h"
27 #include "etag.h"
29 #ifndef TIMERS_H
30 #define TIMERS_H
32 struct ETagDB;
33 struct frmContactEditor;
35 class wxActTimer : public wxTimer
36 {
37 private:
38     int intActivityProgress = 0;
39     wxStaticBitmap *bmpActivity;
40     wxBitmap *SleepBitmapPtr;
41     void *frmMainPtr;
42 public:
43     wxActTimer():wxTimer()
44     {
45     }
46     void Notify();
47     void SetBitmap(wxStaticBitmap *ActMgr);
48     void ResetBitmap();
49     void StartAnimation();
50     void StopAnimation();
51     void SetSleepBitmap(wxBitmap *SleepBitmap);
52     void SetupPointer(void *frmMainPtrIn);
53     
54 };
56 class wxActProcessTimer : public wxTimer
57 {
58     
59 private:
60     int intActivityProgress = 0;
61     wxStaticBitmap *bmpActivity;
62     void *ActMgrPtr;
63 public:
64     wxActProcessTimer():wxTimer()
65     {
66     }
67     void Notify();
68     void SetupPointers(void *ActMgr);
69     
70 };
72 class wxActListProcTimer : public wxTimer
73 {
74     
75 private:
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;
91 public:
92     wxActListProcTimer():wxTimer()
93     {
94     }
95     void Notify();
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();
102     
103 };
105 class wxETagProcessTimer : public wxTimer
107 private:
108     int intActivityProgress = 0;
109     std::map<wxString,ETagDB> ETagDBList;
110     //std::map<int,ETagDB2> ETagDBListv3;
111     std::mutex ReloadLock;
112 public:
113     wxETagProcessTimer():wxTimer()
114     {
115         ReloadAccounts();
116     }
117     void Notify();
118     ETagDB* GetPointer(wxString Filename);
119     void ReloadAccounts();
120     //void SetupPointers(frmActivityMgr *ActMgr);
121     
122 };
124 class wxContactFileMonitorTimer : public wxTimer
126 private:
127     bool FileStatus = FALSE;
128     wxString Filename;
129     frmContactEditor *frmCEPtr;
130     wxDateTime FileDateTime;
131 public:
132     wxContactFileMonitorTimer():wxTimer()
133     {
134     }
135     void Notify();
136     void SetFilename(wxString FilenameInc);
137     void SetupPointers(frmContactEditor *frmCEPtrInc);
138     void UpdateTimestamp();
139 };
141 class wxContactWindowMonitor : public wxTimer
143 private:
144     std::map<wxString, void*> *ContactWindowListPtr;
145 public:
146     wxContactWindowMonitor():wxTimer()
147     {
148     }
149     void Notify();
150     void SetupPointers(std::map<wxString, void*> *ContactWindowListPtrInc);
151 };
153 class wxAccountSyncTimer : public wxTimer
155 private:
156     wxString AccName;
157     wxString AccNameFull;
158     void *frmMainPtr;
159     void *frmActMgrPtr;
160     ETagDB *ETagDBPtr;
161     int intTaskID;
162 public:
163     wxAccountSyncTimer():wxTimer()
164     {
165     }
166     void Notify();
167     void SetupData(wxString AccNameInc, wxString AccNameFull);
168     void SetupPointers(void *frmMainPtrInc, 
169                        void *frmACtMgrPtr, ETagDB *ETagDBPtrInc);
170     
171 };
173 void SleepFor(unsigned long longSleepNanoSecs);
175 #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