Guiliani  Version 2.5 revision 6773 (build 33)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 {
21 public:
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 
45  eC_UInt GetNumberOfAdditionalPhases() const;
46 
47 #if defined(GUILIANI_STREAM_GUI)
48 
52  virtual void ReadFromStream();
53 #endif
54 
55 #if defined(GUILIANI_WRITE_GUI)
56 
61  virtual void WriteToStream(const eC_Bool bWriteClassID = false);
62 #endif
63 
64 protected:
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 
87 private:
88  void EnterRepeatPhase(const eC_UInt& uiInterval);
89 
90 private:
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