2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 FWebCtrl_InputPickerPopup.h
20 * @brief The file contains the definition of _InputPickerPopup class.
23 #ifndef _FWEB_CTRL_INTERNAL_INPUT_POPUP_H_
24 #define _FWEB_CTRL_INTERNAL_INPUT_POPUP_H_
26 #include <unique_ptr.h>
29 #include <FBaseString.h>
30 #include <FGrpColor.h>
32 #include <FUiIActionEventListener.h>
33 #include <FUiIPropagatedKeyEventListener.h>
34 #include <FUi_ControlManager.h>
35 #include "FWebCtrl_WebPopup.h"
37 namespace Tizen { namespace Ui
39 class IActionEventListener;
42 namespace Tizen { namespace Ui { namespace Controls
47 }}} // Tizen::Ui::Controls
49 namespace Tizen { namespace Web { namespace Controls
52 enum _InputPickerButtonId
54 ID_BUTTON_INPUT_DATE_SELECTION,
55 ID_BUTTON_INPUT_COLOR_SELECTION
65 class _InputPickerPopup
67 , public Tizen::Ui::IPropagatedKeyEventListener
74 _InputPickerPopup(void);
79 virtual ~_InputPickerPopup(void);
81 result Construct(const Tizen::Base::String& strDate, Ewk_Input_Type inputType, Tizen::Web::Controls::_WebImpl* pImpl);
83 result Construct(const Tizen::Graphics::Color& color, Tizen::Web::Controls::_WebImpl* pImpl);
85 void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
87 result ChangeLayout(Tizen::Ui::_ControlOrientation orientation);
89 Tizen::Base::String GetDate(void) const;
90 Tizen::Graphics::Color GetColor(void) const;
92 virtual bool OnKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
93 virtual bool OnKeyReleased (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
94 virtual bool OnPreviewKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
95 virtual bool OnPreviewKeyReleased (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
96 virtual bool TranslateKeyEventInfo (Tizen::Ui::Control &source, Tizen::Ui::KeyEventInfo &keyEventInfo);
99 _InputPickerPopup(const _InputPickerPopup& rhs);
101 _InputPickerPopup& operator =(const _InputPickerPopup& rhs);
103 result CreatePopup(void);
105 void CalculateColorPickerPopupSize(Tizen::Ui::_ControlOrientation orientation);
107 result UpdateDate(void);
108 void UpdateColor(void);
110 result Parse(const Tizen::Base::String& strDateTime, Tizen::Base::DateTime& dateTime);
112 void GetDateTimeForWeek(int year, int totalDays, Tizen::Base::DateTime& dateTime);
116 Tizen::Ui::Controls::EditDate* __pEditDate;
117 Tizen::Ui::Controls::EditTime* __pEditTime;
118 Tizen::Ui::Controls::Button* __pSelectionBtn;
119 Tizen::Ui::Controls::ColorPicker* __pColorPicker;
120 Tizen::Ui::Controls::Panel* __pButtonPanel;
126 Ewk_Input_Type __inputType;
127 Tizen::Base::String __dateStr;
128 Tizen::Graphics::Color __Color;
130 _InputPickerMode __inputPickerMode;
131 }; // _InputPickerPopup
133 }}} // Tizen::Web::Controls
134 #endif // _FWEB_CTRL_INTERNAL_INPUT_POPUP_H_