Guiliani  Version 2.5 revision 7293 (documentation build 13)
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
44 {
45 }
46
51 eC_Bool operator == (const CTimerCallback& T) const { if (m_uiDuration == T.m_uiDuration && m_pAnimatable == T.m_pAnimatable) return true; return false; }
52
57 eC_Bool operator != (const CTimerCallback& T) const { return !operator==(T); }
58
63 eC_Bool operator > (const CTimerCallback& T) const { if (m_uiRestTime > T.m_uiRestTime && m_pAnimatable == T.m_pAnimatable) return true; return false; }
64};
65
67
104{
105 friend class CGUIComponentManager;
106
107public:
110 static void CreateInstance();
111
114 static void DeleteInstance();
115
116 /* This function may not call GUICommandHandler functions or a deadlock will occur */
121 virtual eC_UInt GetTime();
122
126 void Process();
127
135 void AddAnimationCallback(eC_UInt uiTime, CGUIAnimatable *pAnimatable);
136
141
146 eC_Bool IsAnimating(const CGUIAnimatable *pAnimatable) const;
147
151 eC_UInt GetIdleTime();
152
153private:
156 CGUITimer();
157
160 virtual ~CGUITimer();
161
164 CGUITimer(const CGUITimer& kSource);
165
168 CGUITimer& operator=(const CGUITimer& kSource);
169
170private:
172 eC_TListDoubleLinked<CTimerCallback> m_AnimationCallbackList;
173};
174#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:104
eC_UInt GetIdleTime()
static void DeleteInstance()
void Process()
void AddAnimationCallback(eC_UInt uiTime, CGUIAnimatable *pAnimatable)
virtual eC_UInt GetTime()
static void CreateInstance()
void RemoveAnimationCallback(CGUIAnimatable *pAnimatable)
eC_Bool IsAnimating(const CGUIAnimatable *pAnimatable) const
Structure to hold timer information.
Definition: GUITimer.h:23
eC_UInt m_uiOldTime
Definition: GUITimer.h:38
eC_Bool operator>(const CTimerCallback &T) const
Definition: GUITimer.h:63
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:51
CGUIAnimatable * m_pAnimatable
The animatable whose DoAnimate method has to be called.
Definition: GUITimer.h:34
CTimerCallback()
Definition: GUITimer.h:42
eC_Bool operator!=(const CTimerCallback &T) const
Definition: GUITimer.h:57
eC_UInt m_uiDuration
Definition: GUITimer.h:31