2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_DateTimeBar.h
20 * @brief This is the header file for the _DateTimeBar class.
22 * This header file contains the declarations of the %_DateTimeBar class.
24 #ifndef _FUI_CTRL_INTERNAL_DATETIME_BAR_H_
25 #define _FUI_CTRL_INTERNAL_DATETIME_BAR_H_
27 #include <FBaseString.h>
28 #include <FBaseDateTime.h>
29 #include "FUi_Window.h"
30 #include "FUi_UiTouchEvent.h"
31 #include "FUi_IAccessibilityListener.h"
32 #include "FUi_AccessibilityContainer.h"
33 #include "FUi_AccessibilityElement.h"
34 #include "FUiCtrl_IActionEventListener.h"
35 #include "FUiCtrl_ActionEvent.h"
36 #include "FUiCtrl_DateTimeDefine.h"
37 #include "FUiCtrl_DateTimeChangeEvent.h"
38 #include "FUiCtrl_IDateTimeChangeEventListener.h"
39 #include "FUi_ITouchFlickGestureEventListener.h"
41 namespace Tizen { namespace Ui
43 class _AccessibilityElement;
46 namespace Tizen { namespace Ui { namespace Controls
48 class _DateTimeBarPresenter;
52 , public _IAccessibilityListener
53 , virtual public Tizen::Ui::_ITouchFlickGestureEventListener
54 , virtual public Tizen::Base::Runtime::IEventListener
55 , virtual public _IUiEventListener
56 , virtual public _IUiEventPreviewer
59 virtual ~_DateTimeBar(void);
60 static _DateTimeBar* CreateDateTimeBarN(_Control&);
63 result SetPositionAndAlignment(const Tizen::Graphics::FloatPoint& point, _DateTimeBarAlignment alignment);
65 result SetInitialValue(int minValue, int maxValue, int displayValue, _DateTimeId boxId);
66 result RemoveAllItems(void);
68 _DateTimeId GetSelectedBoxId(void) const;
70 int GetItemCount(void) const;
72 _DateTimeBarAlignment GetAlignment(void) const;
74 result AddActionEventListener(const _IActionEventListener& listener);
75 result RemoveActionEventListener(const _IActionEventListener& listener);
77 result AddDateTimeChangeEventListener(const _IDateTimeChangeEventListener& listener);
78 result RemoveDateTimeChangeEventListener(const _IDateTimeChangeEventListener& listener);
80 result CalculateArrowBounds(const Tizen::Graphics::FloatRectangle& bounds);
82 result FireActionEvent(int actionId);
83 result FireDateTimeChangeEvent(_DateTimeChangeStatus status);
85 virtual bool IsActivatedOnOpen(void) const;
86 virtual void OnDraw(void);
87 virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
88 virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
89 virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
90 virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
91 virtual void OnTouchMoveHandled(const Tizen::Ui::_Control& control);
92 virtual result OnAttachedToMainTree(void);
93 virtual result OnDetachingFromMainTree(void);
94 virtual bool OnFlickGestureDetected(_TouchFlickGestureDetector& gesture);
95 virtual bool OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture);
96 void AddAccessibilityElement(const Tizen::Graphics::FloatRectangle& itemBounds, const Tizen::Base::String& itemText);
97 void RemoveAllAccessibilityElement(void);
98 Tizen::Ui::AccessibilityTraits GetAccessibilityTraitValue();
99 Tizen::Base::String GetMonthValue(int month) const;
100 void SetFont(Tizen::Graphics::Font& pFont);
101 void SetParentWindowBounds(Tizen::Graphics::FloatRectangle& parentWindowBounds);
102 Tizen::Graphics::FloatRectangle GetParentWindowBounds() const;
104 // accessibility listener
105 virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element);
106 virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element);
107 virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element);
108 virtual bool OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element);
109 virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element);
110 virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element);
111 virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element);
112 virtual bool OnAccessibilityValueIncreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
113 virtual bool OnAccessibilityValueDecreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
118 _DateTimeBar(const _DateTimeBar&);
119 _DateTimeBar& operator =(const _DateTimeBar&);
121 void SetAlignment(_DateTimeBarAlignment alignment);
122 void SetSelectedBoxId(_DateTimeId boxId);
123 void InitializeAccessibilityElement(void);
125 _DateTimeBarPresenter* __pDateTimeBarPresenter;
126 _ActionEvent* __pActionEvent;
128 _DateTimeId __selectedBoxId;
129 _DateTimeBarAlignment __alignment;
130 _DateTimeChangeEvent* __pDateTimeChangeEvent;
131 _TouchFlickGestureDetector* __pGestureFlick;
132 Tizen::Base::Collection::LinkedListT<_AccessibilityElement*> __accessibilityElements;
133 Tizen::Graphics::FloatRectangle __parentWindowBounds;
137 }}} // Tizen::Ui::Controls
139 #endif //_FUI_CTRL_INTERNAL_DATETIME_BAR_H_