Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIPageContainer.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 GUIPAGECONTAINER_H
11#define GUIPAGECONTAINER_H
12
13#include "GUICompositeObject.h"
14#include "GUIEasing.h"
15#include "GUIImageResource.h"
16#include "GUINinePatch.h"
17
18#include "GUICommonEnums.h"
19
20// @guiliani_doxygen toplevel_control Page-Container
32// @endguiliani_doxygen
33
57{
58public:
68 CGUICompositeObject* const pkParent,
69 const eC_Value& vX, const eC_Value& vY,
70 const eC_Value& vWidth, const eC_Value& vHeight,
71 const ObjectHandle_t &eID = NO_HANDLE);
72
75
80
86
87 virtual ~CGUIPageContainer();
88
89 virtual eC_Bool AddObject(CGUIObject* pkObject);
90
91 virtual void RemoveObject(CGUIObject* pkObject);
92
96 virtual void ScrollTo(eC_UInt uiNodeIndex);
97
101 virtual void ScrollToAnimated(eC_UInt uiNodeIndex);
102
106 virtual eC_UInt GetCurrentIndex();
107
108 // Methods derived from CGUIObject
109 virtual eC_Bool DoDraw();
110 virtual eC_Bool DoPostDraw();
111
112 virtual void DoAnimate(const eC_Value& vTimes = eC_FromInt(1));
113 virtual eC_Bool DoClick(const eC_Value& vAbsX, const eC_Value& vAbsY);
114 virtual eC_Bool DoButtonDown(const eC_Value& vAbsX, const eC_Value& vAbsY);
115 virtual eC_Bool DoDrag(const eC_Value& vDeltaX, const eC_Value& vDeltaY, const eC_Value& vAbsX, const eC_Value& vAbsY);
116 virtual eC_Bool DoDragEnd(const eC_Value& vAbsX, const eC_Value& vAbsY);
117 virtual eC_Bool SetValue(const CGUIValue& rkValue);
118
119 virtual void SetWidth(const eC_Value& vX);
120 virtual void SetHeight(const eC_Value& vY);
121
122#if defined(GUILIANI_STREAM_GUI)
127 virtual void ReadFromStream();
128#endif
129
130#if defined(GUILIANI_WRITE_GUI)
136 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
137#endif
138
143 {
144 return m_kNinePatch;
145 }
146
150
154
155public:
156 /* Setter/Getter */
157
162
167
172 void SetDragActive(const eC_Bool& bDragActive);
173
177 eC_Bool GetDragActive() const;
178
182 void SetDragDistance(const eC_Value& vDragDistance);
183
187 eC_Value GetDragDistance() const;
188
192 void SetSwipeDistance(const eC_Value& vSwipeDistance);
193
197 eC_Value GetSwipeDistance() const;
198
203 void SetOverShoot(const eC_Value& vOvershoot);
204
208 eC_Value GetOverShoot() const;
209
213 void SetBGImage(const ImageResource_t& eBGImage);
214
219
224
229
235 const ImageResource_t& eImageInactive,
236 const ImageResource_t& eImageActive);
237
243 ImageResource_t& eImageInactive,
244 ImageResource_t& eImageActive) const;
245
250 void SetIndicatorSize(const eC_Value& vWidth, const eC_Value& vHeight);
251
256 void GetIndicatorSize(eC_Value& vWidth, eC_Value& vHeight) const;
257
261 void SetIndicatorsActive(const eC_Bool& bIndicatorsActive);
262
266 eC_Bool GetIndicatorsActive() const;
267
274 const CGUIEasing::EasingType_t& eEasing,
275 const eC_Value& vEasingTime);
276
283 eC_Value& vEasingTime) const;
284
292 const CGUIEasing::EasingType_t& eEasing,
293 const eC_Value& vEasingTime);
294
301 eC_Value& vEasingTime) const;
302
303private:
304 void Init();
305
306 void DeInit();
307
308 void ArrangeChildren();
309
310 void UpdateChildPositions(const eC_Value& vPosition);
311
312 void AdjustPosition(const eC_Value& vPositionDelta, const eC_Value& vPositionAbs);
313
314 eC_Value GetValidPosition(const eC_Value& vPosition, const eC_Value& vDistanceForDirection);
315
316private:
317 CGUICommonEnums::Orientation_t m_eDirection;
318 eC_Bool m_bDragActive;
319 eC_Value m_vMinimumDragDistance;
320 eC_Value m_vSwipeDistance;
321 eC_Value m_vOverShoot;
322
323 ImageResource_t m_eBGImage;
324 CGUINinePatch m_kNinePatch;
325
326 CGUICommonEnums::Alignment_t m_eIndicatorAlignment;
327 ImageResource_t m_ePageIndicatorInactive;
328 ImageResource_t m_ePageIndicatorActive;
329 eC_Value m_vIndicatorWidth;
330 eC_Value m_vIndicatorHeight;
331 eC_Bool m_bIndicatorsActive;
332
333 eC_UInt m_uiDragTimeStamp;
334 eC_UInt m_uiDragStarted;
335 CGUIPoint m_kDragStart;
336
337 CGUIEasing::EasingType_t m_eCurrentEasingType;
338 eC_Value m_vCurrentEasingDuration;
339 CGUIEasing::EasingType_t m_eEasingTypeNormal;
340 eC_Value m_vEasingDurationNormal;
341 CGUIEasing::EasingType_t m_eEasingTypeBounce;
342 eC_Value m_vEasingDurationBounce;
343
344 CGUIObject* m_pkCurrentElement;
345 eC_UInt m_uiCurrentIndex;
346
347 eC_Value m_vMaxPosition;
348 eC_Value m_vCurrentPosition;
349 eC_Value m_vTargetPosition;
350
351 eC_TArray<CGUIRect> m_kIndicatorRects;
352};
353
354#endif
Helper Macros in Guiliani
ImageResource_t
Enumeration of image resource ids.
Definition: GUIImageResource.h:126
ObjectHandle_t
List of object resource ids.
Definition: GUIObjectHandleResource.h:55
Alignment_t
Position of control.
Definition: GUICommonEnums.h:64
Orientation_t
orientation of controls
Definition: GUICommonEnums.h:57
This is the Guiliani base class for all composite objects.
Definition: GUICompositeObject.h:70
EasingType_t
The differnet easing types.
Definition: GUIEasing.h:50
Helper class to for storing Nine-Patch images.
Definition: GUINinePatch.h:41
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:81
This container can be used to create multiple pages of controls which can be swiped page-wise.
Definition: GUIPageContainer.h:57
virtual void SetHeight(const eC_Value &vY)
virtual void ReadFromStream()
CGUICommonEnums::Alignment_t GetIndicatorAlignment() const
CGUIPageContainer & operator=(const CGUIPageContainer &kSource)
virtual void StopScrollingAnimation()
void SetNormalEasing(const CGUIEasing::EasingType_t &eEasing, const eC_Value &vEasingTime)
void SetIndicatorImages(const ImageResource_t &eImageInactive, const ImageResource_t &eImageActive)
virtual void DoAnimate(const eC_Value &vTimes=eC_FromInt(1))
CGUINinePatch & GetNinePatch()
Definition: GUIPageContainer.h:142
void SetOverShoot(const eC_Value &vOvershoot)
virtual eC_Bool SetValue(const CGUIValue &rkValue)
void SetIndicatorAlignment(const CGUICommonEnums::Alignment_t &eAlignment)
virtual void RemoveObject(CGUIObject *pkObject)
eC_Value GetOverShoot() const
virtual void ScrollToAnimated(eC_UInt uiNodeIndex)
CGUICommonEnums::Orientation_t GetDirection() const
void GetNormalEasing(CGUIEasing::EasingType_t &eEasing, eC_Value &vEasingTime) const
virtual eC_Bool DoDrag(const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual eC_UInt GetCurrentIndex()
virtual void SetWidth(const eC_Value &vX)
eC_Value GetDragDistance() const
void SetIndicatorsActive(const eC_Bool &bIndicatorsActive)
virtual eC_Bool DoButtonDown(const eC_Value &vAbsX, const eC_Value &vAbsY)
ImageResource_t GetBGImage() const
eC_Bool GetDragActive() const
eC_Bool GetIndicatorsActive() const
void SetSwipeDistance(const eC_Value &vSwipeDistance)
virtual eC_Bool DoDragEnd(const eC_Value &vAbsX, const eC_Value &vAbsY)
void GetBounceEasing(CGUIEasing::EasingType_t &eEasing, eC_Value &vEasingTime) const
void SetDirection(const CGUICommonEnums::Orientation_t &eDirection)
virtual eC_Bool DoPostDraw()
CGUIPageContainer()
Default constructor.
void GetIndicatorSize(eC_Value &vWidth, eC_Value &vHeight) const
void SetDragDistance(const eC_Value &vDragDistance)
void SetIndicatorSize(const eC_Value &vWidth, const eC_Value &vHeight)
virtual void ScrollTo(eC_UInt uiNodeIndex)
virtual eC_Bool DoClick(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual void StartScrollingAnimation()
void SetDragActive(const eC_Bool &bDragActive)
void GetIndicatorImages(ImageResource_t &eImageInactive, ImageResource_t &eImageActive) const
void SetBounceEasing(const CGUIEasing::EasingType_t &eEasing, const eC_Value &vEasingTime)
CGUIPageContainer(const CGUIPageContainer &kToBeCopied)
void SetBGImage(const ImageResource_t &eBGImage)
eC_Value GetSwipeDistance() const
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
virtual eC_Bool DoDraw()
virtual eC_Bool AddObject(CGUIObject *pkObject)
CGUIPageContainer(CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
CGUIPoint class to hold two values (x, y) like a vector.
Definition: GUIPoint.h:18
CGUIValue stores a single value in one specific type.
Definition: GUIValue.h:25