Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIHotkeysBehaviour.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 GUI_HOTKEYS_BEHAVIOUR__H_
11#define GUI_HOTKEYS_BEHAVIOUR__H_
12
13#include "GUIBehaviourDecorator.h"
15#include "GUICommand.h"
16#include "eC_TList_doubleLinked.h"
17
18
20
60{
61public:
66 CGUIHotkeysBehaviour(eC_Bool bMarkAlwaysAsHandled = false);
67
72
78
79 virtual ~CGUIHotkeysBehaviour() {}
80
81 virtual CGUIBehaviourDecorator* Clone() const;
82
103 GUIKeyIdentifier_t eKeyIdentifier,
104 eC_UInt uiModifiers,
105 eC_Bool bCheckForModifiers,
106 ObjectHandle_t eMappedObjID,
107 eC_Bool bAbstractObj,
108 CGUICommandPtr pkCommand = NULL,
109 eC_Bool bActivated = true);
110
120 eC_UInt uiModifiers,
121 eC_Bool bCheckForModifiers);
122
129 void SetMarkAlwaysAsHandled(eC_Bool bMarkAlwaysAsHandled);
130
139 GUIKeyIdentifier_t eKeyContent,
140 eC_UInt uiModifiers,
141 eC_Bool bActivated);
142
151 eC_Bool GetHotKey(
152 GUIKeyIdentifier_t& reKeyIdentifier,
153 eC_UInt& ruiModifiers,
154 ObjectHandle_t eMappedObjID) const;
155
156#ifdef GUILIANI_STREAM_GUI
158#endif
159#ifdef GUILIANI_WRITE_GUI
160 void WriteToStream(const eC_Bool bWriteClassID = false);
161#endif
162
163protected:
167 {
170
173
176
181
189
196
201
212 GUIKeyIdentifier_t eKeyContent = GK_NONE,
213 eC_UInt uiModifiers = 0,
214 eC_Bool bCheckForModifiers = false,
215 ObjectHandle_t eMappedObjID = NO_HANDLE,
216 eC_Bool bAbstractObj = false,
217 CGUICommandPtr pkCommand = NULL,
218 eC_Bool bActivated = true) :
219 m_eKeyID(eKeyContent),
220 m_uiModifiers(uiModifiers),
221 m_bCheckForModifiers(bCheckForModifiers),
222 m_eMappedObjID(eMappedObjID),
223 m_bAbstractObj(bAbstractObj),
224 m_pkCommand(pkCommand),
225 m_bActivated(bActivated)
226 {
227 }
228 };
229
232
239 virtual eC_Bool DoKeyDown(
240 const GUIKeyIdentifier_t& eKeyIdentifier,
241 const eC_UInt& uiModifiers);
242
249 virtual eC_Bool DoKeyUp(
250 const GUIKeyIdentifier_t& eKeyIdentifier,
251 const eC_UInt& uiModifiers);
252
253private:
255 enum CallSlot
256 {
257 CS_KEYDOWN,
258 CS_KEYUP
259 };
260
265 void CopyAttributes(const CGUIHotkeysBehaviour& kSource);
266
268 eC_Bool HandleHotKeyContent(
269 GUIKeyIdentifier_t eKeyIdentifier,
270 eC_UInt uiModifiers,
271 CallSlot eSlot);
272
274 eC_Bool m_bMarkAlwaysAsHandled;
275};
276
277#endif
GUIKeyIdentifier_t
Platform independent key identifiers.
Definition: GUIEventTypeResource.h:207
Helper Macros in Guiliani
ObjectHandle_t
List of object resource ids.
Definition: GUIObjectHandleResource.h:55
GUIBehaviourDecorator base class.
Definition: GUIBehaviourDecorator.h:78
Maps key codes to object IDs and 'clicks' on objects.
Definition: GUIHotkeysBehaviour.h:60
CGUIHotkeysBehaviour(eC_Bool bMarkAlwaysAsHandled=false)
void SetActivated(GUIKeyIdentifier_t eKeyContent, eC_UInt uiModifiers, eC_Bool bActivated)
virtual eC_Bool DoKeyUp(const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
virtual CGUIBehaviourDecorator * Clone() const
eC_Bool GetHotKey(GUIKeyIdentifier_t &reKeyIdentifier, eC_UInt &ruiModifiers, ObjectHandle_t eMappedObjID) const
eC_TListDoubleLinked< HotKeyMap_t > m_kHotKeyMapList
The hot key mappings are saved in this list.
Definition: GUIHotkeysBehaviour.h:231
CGUIHotkeysBehaviour(const CGUIHotkeysBehaviour &kSource)
CGUIHotkeysBehaviour & operator=(const CGUIHotkeysBehaviour &kSource)
void AddHotKeyMap(GUIKeyIdentifier_t eKeyIdentifier, eC_UInt uiModifiers, eC_Bool bCheckForModifiers, ObjectHandle_t eMappedObjID, eC_Bool bAbstractObj, CGUICommandPtr pkCommand=NULL, eC_Bool bActivated=true)
virtual eC_Bool DoKeyDown(const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
void WriteToStream(const eC_Bool bWriteClassID=false)
void SetMarkAlwaysAsHandled(eC_Bool bMarkAlwaysAsHandled)
void SetModifiers(GUIKeyIdentifier_t eKey, eC_UInt uiModifiers, eC_Bool bCheckForModifiers)
Represents a double linked list template with header and tail node.
Definition: eC_TList_doubleLinked.h:67
Definition of one hot key mapping with all necessary parameters.
Definition: GUIHotkeysBehaviour.h:167
eC_UInt m_uiModifiers
Definition: GUIHotkeysBehaviour.h:172
eC_Bool m_bActivated
Definition: GUIHotkeysBehaviour.h:200
eC_Bool m_bAbstractObj
Definition: GUIHotkeysBehaviour.h:188
ObjectHandle_t m_eMappedObjID
Definition: GUIHotkeysBehaviour.h:180
GUIKeyIdentifier_t m_eKeyID
Definition: GUIHotkeysBehaviour.h:169
eC_Bool m_bCheckForModifiers
Definition: GUIHotkeysBehaviour.h:175
HotKeyMap_t(GUIKeyIdentifier_t eKeyContent=GK_NONE, eC_UInt uiModifiers=0, eC_Bool bCheckForModifiers=false, ObjectHandle_t eMappedObjID=NO_HANDLE, eC_Bool bAbstractObj=false, CGUICommandPtr pkCommand=NULL, eC_Bool bActivated=true)
Definition: GUIHotkeysBehaviour.h:211
CGUICommandPtr m_pkCommand
Definition: GUIHotkeysBehaviour.h:195