Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added copyright and licence header to C++ files and headers for the common directory.
[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 "../frmActivityMgr.h"
25 #include "../contacteditor/frmContactEditor.h"
26 #include "etag.h"
28 #ifndef TIMERS_H
29 #define TIMERS_H
31 struct ETagDB;
32 struct frmContactEditor;
34 class wxActTimer : public wxTimer
35 {
36 private:
37     int intActivityProgress = 0;
38     wxStaticBitmap *bmpActivity;
39     wxBitmap *SleepBitmapPtr;
40     void *frmMainPtr;
41 public:
42     wxActTimer():wxTimer()
43     {
44     }
45     void Notify();
46     void SetBitmap(wxStaticBitmap *ActMgr);
47     void ResetBitmap();
48     void StartAnimation();
49     void StopAnimation();
50     void SetSleepBitmap(wxBitmap *SleepBitmap);
51     void SetupPointer(void *frmMainPtrIn);
52     
53 };
55 class wxActProcessTimer : public wxTimer
56 {
57     
58 private:
59     int intActivityProgress = 0;
60     wxStaticBitmap *bmpActivity;
61     void *ActMgrPtr;
62 public:
63     wxActProcessTimer():wxTimer()
64     {
65     }
66     void Notify();
67     void SetupPointers(void *ActMgr);
68     
69 };
71 class wxActListProcTimer : public wxTimer
72 {
73     
74 private:
75     std::map<int,int> *ActListPtr;
76     std::map<int,long> *ActListUIPtr;
77     std::map<int,wxString> *ActListDetailPtr;
78     wxListCtrl *lstActivityPtr;
79     wxStaticText *lblDetailsPtr;
80     bool *TasksActivePtr;
81     wxGauge *GauProgressPtr;
82     void *ActMgrPtr;
83     int intActivityTotal = 0;
84     int intActivityCompleted = 0;
85     wxActTimer *ActTimerPtr;
86     wxActProcessTimer *ActProcessTimerPtr;
87     std::map<int,wxDateTime> *ActListFinDTPtr;
88     bool ClearupProcessed = FALSE;
89 public:
90     wxActListProcTimer():wxTimer()
91     {
92     }
93     void Notify();
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);
99     void EnableClearup();
100     
101 };
103 class wxETagProcessTimer : public wxTimer
105 private:
106     int intActivityProgress = 0;
107     std::map<wxString,ETagDB> ETagDBList;
108     //std::map<int,ETagDB2> ETagDBListv3;
109     std::mutex ReloadLock;
110 public:
111     wxETagProcessTimer():wxTimer()
112     {
113         ReloadAccounts();
114     }
115     void Notify();
116     ETagDB* GetPointer(wxString Filename);
117     void ReloadAccounts();
118     //void SetupPointers(frmActivityMgr *ActMgr);
119     
120 };
122 class wxContactFileMonitorTimer : public wxTimer
124 private:
125     bool FileStatus = FALSE;
126     wxString Filename;
127     frmContactEditor *frmCEPtr;
128     wxDateTime FileDateTime;
129 public:
130     wxContactFileMonitorTimer():wxTimer()
131     {
132     }
133     void Notify();
134     void SetFilename(wxString FilenameInc);
135     void SetupPointers(frmContactEditor *frmCEPtrInc);
136     void UpdateTimestamp();
137 };
139 class wxContactWindowMonitor : public wxTimer
141 private:
142     std::map<wxString, void*> *ContactWindowListPtr;
143 public:
144     wxContactWindowMonitor():wxTimer()
145     {
146     }
147     void Notify();
148     void SetupPointers(std::map<wxString, void*> *ContactWindowListPtrInc);
149 };
151 class wxAccountSyncTimer : public wxTimer
153 private:
154     wxString AccName;
155     wxString AccNameFull;
156     void *frmMainPtr;
157     void *frmActMgrPtr;
158     ETagDB *ETagDBPtr;
159     int intTaskID;
160 public:
161     wxAccountSyncTimer():wxTimer()
162     {
163     }
164     void Notify();
165     void SetupData(wxString AccNameInc, wxString AccNameFull);
166     void SetupPointers(void *frmMainPtrInc, 
167                        void *frmACtMgrPtr, ETagDB *ETagDBPtrInc);
168     
169 };
171 void SleepFor(unsigned long longSleepNanoSecs);
173 #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