Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUITimer.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef GUITIMER__H_
11#define GUITIMER__H_
12
13#include "eC_TList_doubleLinked.h"
14#include "GUIComponentManager.h"
15
17#define GETTIMER CGUIComponentManager::GetInstance().GetTimer()
18
19class CGUIAnimatable;
20
23{
25
27 eC_UInt m_uiRestTime;
28
31 eC_UInt m_uiDuration;
32
35
38 eC_UInt m_uiOldTime;
39
43 m_uiRestTime(0),
44 m_uiDuration(0),
45 m_pkAnimatable(NULL),
47 {
48 }
49
54 eC_Bool operator == (const CTimerCallback& T) const { if (m_uiDuration == T.m_uiDuration && m_pkAnimatable == T.m_pkAnimatable) return true; return false; }
55
60 eC_Bool operator != (const CTimerCallback& T) const { return !operator==(T); }
61
66 eC_Bool operator > (const CTimerCallback& T) const { if (m_uiRestTime > T.m_uiRestTime && m_pkAnimatable == T.m_pkAnimatable) return true; return false; }
67};
68
70
107{
108 friend class CGUIComponentManager;
109
110public:
113 static void CreateInstance();
114
117 static void DeleteInstance();
118
119 /* This function may not call GUICommandHandler functions or a deadlock will occur */
124 virtual eC_UInt GetTime();
125
129 void Process();
130
138 void AddAnimationCallback(eC_UInt uiTime, CGUIAnimatable* pkAnimatable);
139
144
149 eC_Bool IsAnimating(const CGUIAnimatable* pkAnimatable) const;
150
154 eC_UInt GetIdleTime();
155
159 void SetStepMode(const eC_Bool& bStepMode);
160
164 eC_Bool GetStepMode() const;
165
169 void SetStepDuration(const eC_UInt& uiStepDuration);
170
174 eC_UInt GetStepDuration() const;
175
178 void NextTick();
179
180private:
183 CGUITimer();
184
187 virtual ~CGUITimer();
188
191 CGUITimer(const CGUITimer& kSource);
192
195 CGUITimer& operator=(const CGUITimer& kSource);
196
197private:
199 eC_TListDoubleLinked<CTimerCallback> m_kAnimationCallbackList;
200
201 eC_Bool m_bStepMode;
202
203 eC_UInt m_uiStepTime;
204 eC_UInt m_uiStepDuration;
205};
206#endif
Base interface for animation callbacks.
Definition: GUIAnimatable.h:51
central component-manager
Definition: GUIComponentManager.h:62
Timer used for timer callbacks to instances of CGUIAnimatable.
Definition: GUITimer.h:107
eC_UInt GetIdleTime()
void AddAnimationCallback(eC_UInt uiTime, CGUIAnimatable *pkAnimatable)
static void DeleteInstance()
eC_Bool GetStepMode() const
eC_UInt GetStepDuration() const
void SetStepDuration(const eC_UInt &uiStepDuration)
void Process()
void RemoveAnimationCallback(CGUIAnimatable *pkAnimatable)
void NextTick()
eC_Bool IsAnimating(const CGUIAnimatable *pkAnimatable) const
virtual eC_UInt GetTime()
static void CreateInstance()
void SetStepMode(const eC_Bool &bStepMode)
Structure to hold timer information.
Definition: GUITimer.h:23
eC_UInt m_uiOldTime
Definition: GUITimer.h:38
CGUIAnimatable * m_pkAnimatable
The animatable whose DoAnimate method has to be called.
Definition: GUITimer.h:34
eC_Bool operator>(const CTimerCallback &T) const
Definition: GUITimer.h:66
eC_UInt m_uiRestTime
The temporary time used to calculate the time left after each call of CGUITimer::Process() in millise...
Definition: GUITimer.h:27
eC_Bool operator==(const CTimerCallback &T) const
Definition: GUITimer.h:54
CTimerCallback()
Definition: GUITimer.h:42
eC_Bool operator!=(const CTimerCallback &T) const
Definition: GUITimer.h:60
eC_UInt m_uiDuration
Definition: GUITimer.h:31