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_EditTime.h
20 * @brief This is the header file for the _EditTime class.
22 * This header file contains the declarations of the %_EditTime class.
25 #ifndef _FUI_CTRL_INTERNAL_EDITTIME_H_
26 #define _FUI_CTRL_INTERNAL_EDITTIME_H_
28 #include "FUi_Control.h"
29 #include "FUi_UiTouchEvent.h"
30 #include "FUiCtrl_IDateTimeChangeEventListener.h"
31 #include "FUiCtrl_DateTimeChangeEvent.h"
32 #include "FUiCtrl_IActionEventListener.h"
33 #include "FUi_IAccessibilityListener.h"
34 #include "FUiCtrl_DateTimeBar.h"
36 namespace Tizen { namespace Ui
38 class _AccessibilityElement;
41 namespace Tizen { namespace Ui { namespace Controls
43 class _EditTimePresenter;
45 class _OSP_EXPORT_ _EditTime
47 , public _IDateTimeChangeEventListener
48 , public _IActionEventListener
49 , public _IAccessibilityListener
50 , virtual public Tizen::Base::Runtime::IEventListener
51 , virtual public _IUiEventListener
52 , virtual public _IUiEventPreviewer
54 DECLARE_CLASS_BEGIN(_EditTime, _Control);
55 DECLARE_PROPERTY("time", GetPropertyTime, SetPropertyTime);
56 DECLARE_PROPERTY("hour", GetPropertyHour, SetPropertyHour);
57 DECLARE_PROPERTY("minute", GetPropertyMinute, SetPropertyMinute);
58 DECLARE_PROPERTY("timePickerEnabled", GetPropertyTimePickerEnabled, SetPropertyTimePickerEnabled);
61 result SetPropertyTime(const Tizen::Ui::Variant& time);
62 Tizen::Ui::Variant GetPropertyTime(void) const;
64 result SetPropertyHour(const Tizen::Ui::Variant& hour);
65 Tizen::Ui::Variant GetPropertyHour(void) const;
67 result SetPropertyMinute(const Tizen::Ui::Variant& minute);
68 Tizen::Ui::Variant GetPropertyMinute(void) const;
70 result SetPropertyTimePickerEnabled(const Tizen::Ui::Variant& enable);
71 Tizen::Ui::Variant GetPropertyTimePickerEnabled(void) const;
74 virtual ~_EditTime(void);
75 static _EditTime* CreateEditTimeN(const Tizen::Base::String& title);
77 result AddTimeChangeEventListener(const _IDateTimeChangeEventListener& listener);
78 result RemoveTimeChangeEventListener(const _IDateTimeChangeEventListener& listener);
80 void SetTime(const Tizen::Base::DateTime& time);
81 Tizen::Base::DateTime GetTime(void) const;
83 result SetHour(int hour);
84 int GetHour(void) const;
86 result SetMinute(int minute);
87 int GetMinute(void) const;
89 void SetCurrentTime(void);
91 void SetTimePickerEnabled(bool enable);
92 bool IsTimePickerEnabled(void) const;
94 void Set24HourNotationEnabled(bool enable);
95 bool Is24HourNotationEnabled(void) const;
97 result FireTimeChangeEvent(_DateTimeChangeStatus status);
99 _DateTimeBar* GetDateTimeBar(void) const;
101 virtual void OnDraw(void);
102 virtual result OnAttachedToMainTree(void);
103 virtual void OnBoundsChanged(void);
104 virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
105 virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
106 virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
107 virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
108 virtual void OnTouchMoveHandled(const Tizen::Ui::_Control& control);
110 virtual void OnDateTimeChanged(const Tizen::Ui::_Control& source, int year, int month, int day, int hour, int minute);
111 virtual void OnDateTimeChangeCanceled(const Tizen::Ui::_Control& source);
112 virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
113 virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
114 void OnFontChanged(Tizen::Graphics::Font* pFont);
115 void OnFontInfoRequested(unsigned long& style, int& size);
116 Tizen::Graphics::Rectangle GetParentWindowBounds(void) const;
117 void UpdateAccessibilityElement(void);
119 // accessibility listener
120 virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
121 virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
122 virtual bool OnAccessibilityReadElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
123 virtual bool OnAccessibilityFocusIn(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
124 virtual bool OnAccessibilityFocusOut(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
125 virtual bool OnAccessibilityActionPerformed(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
126 virtual bool OnAccessibilityValueIncreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
127 virtual bool OnAccessibilityValueDecreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
131 _EditTime(const _EditTime&);
132 _EditTime& operator =(const _EditTime&);
134 result CreateDateTimeBar(void);
135 result CalculateDateTimeBarPosition(void);
138 _EditTimePresenter* __pEditTimePresenter;
139 _DateTimeChangeEvent* __pTimeChangeEvent;
140 _DateTimeBar* __pDateTimeBar;
141 Tizen::Graphics::Rectangle __absoluteBounds;
142 Tizen::Base::String __title;
143 Tizen::Ui::_AccessibilityElement* __pAccessibilityTitleElement;
144 Tizen::Ui::_AccessibilityElement* __pAccessibilityHourElement;
145 Tizen::Ui::_AccessibilityElement* __pAccessibilityMinuteElement;
146 Tizen::Ui::_AccessibilityElement* __pAccessibilityAmPmElement;
149 }}} // Tizen::Ui::Controls
151 #endif // _FUI_CTRL_INTERNAL_EDITTIME_H_