Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIAutoRepeatBehaviour.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 GUIAUTOREPEATBEHAVIOUR__H_
11#define GUIAUTOREPEATBEHAVIOUR__H_
12
13#include "GUIAnimatable.h"
14#include "GUIBehaviourDecorator.h"
15
20{
21public:
24
31 const eC_Bool& bUseLongClick,
32 const eC_UInt& uiInitialDelay,
33 const eC_UInt& uiInterval);
34
40 void AddAdditionalPhase(const eC_UInt& uiStartTime, const eC_UInt& uiInterval);
41
46
47#if defined(GUILIANI_STREAM_GUI)
52 virtual void ReadFromStream();
53#endif
54
55#if defined(GUILIANI_WRITE_GUI)
61 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
62#endif
63
64protected:
65 virtual void DoAnimate(const eC_Value& vTimes = eC_FromInt(1));
66
67 virtual eC_Bool DoButtonDown(
68 const eC_Value& vAbsX,
69 const eC_Value& vAbsY);
70
71 virtual eC_Bool DoButtonUp(
72 const eC_Value& vAbsX,
73 const eC_Value& vAbsY);
74
75 virtual eC_Bool DoClick(
76 const eC_Value& vAbsX,
77 const eC_Value& vAbsY);
78
79 virtual eC_Bool DoLongClick(
80 const eC_Value& vAbsX,
81 const eC_Value& vAbsY);
82
83 virtual eC_Bool DoDragEnd(
84 const eC_Value& vAbsX,
85 const eC_Value& vAbsY);
86
87private:
88 void EnterRepeatPhase(const eC_UInt& uiInterval);
89
90private:
91 enum AutoRepeatState_t
92 {
93 ARS_IDLE,
94 ARS_DELAY,
95 ARS_REPEAT
96 };
97
98 eC_Bool m_bUseLongClick;
99 eC_UInt m_uiInitialDelay;
100 eC_UInt m_uiInterval;
101
102 AutoRepeatState_t m_eState;
103
104 eC_UInt m_uiNumAdditionalPhases;
105 eC_UInt m_uiCurrentPhase;
106 eC_UInt m_uiLastPhaseStart;
107
108 eC_TArray<eC_UInt> m_aStartTimes;
109 eC_TArray<eC_UInt> m_aIntervals;
110
111 eC_Bool m_bIgnoreNextClick;
112};
113
114#endif
Base interface for animation callbacks.
Definition: GUIAnimatable.h:51
Behaviour for repeating clicks on object Additional phases can be defined where the start-time of the...
Definition: GUIAutoRepeatBehaviour.h:20
eC_UInt GetNumberOfAdditionalPhases() const
void AddAdditionalPhase(const eC_UInt &uiStartTime, const eC_UInt &uiInterval)
virtual eC_Bool DoDragEnd(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual eC_Bool DoClick(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual eC_Bool DoButtonUp(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual void ReadFromStream()
CGUIAutoRepeatBehaviour(const eC_Bool &bUseLongClick, const eC_UInt &uiInitialDelay, const eC_UInt &uiInterval)
CGUIAutoRepeatBehaviour()
Default constructor.
virtual eC_Bool DoButtonDown(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual void DoAnimate(const eC_Value &vTimes=eC_FromInt(1))
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
virtual eC_Bool DoLongClick(const eC_Value &vAbsX, const eC_Value &vAbsY)
GUIBehaviourDecorator base class.
Definition: GUIBehaviourDecorator.h:78