1 // Copyright 2014 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef EWK_EFL_INTEGRATION_BROWSER_INPUT_PICKER_INPUT_PICKER_H_
6 #define EWK_EFL_INTEGRATION_BROWSER_INPUT_PICKER_INPUT_PICKER_H_
12 #include "ewk/efl_integration/eweb_view.h"
13 #include "ui/base/ime/text_input_type.h"
16 #include <efl_extension.h>
25 explicit InputPicker(EWebView* view);
28 void ShowColorPicker(int r, int g, int b, int a);
29 void ShowDatePicker(ui::TextInputType input_type, double input_date);
34 static Layout* CreateAndShowColorPickerLayout(
35 InputPicker* parent, int r, int g, int b);
36 static Layout* CreateAndShowDateLayout(
37 InputPicker* parent, struct tm* currentTime, ui::TextInputType type);
38 static Layout* CreateAndShowDateTimeLayout(
39 InputPicker* parent, struct tm* currentTime, ui::TextInputType type);
40 static Layout* CreateAndShowTimeLayout(
41 InputPicker* parent, struct tm* currentTime);
46 explicit Layout(InputPicker* parent);
48 bool AddBaseLayout(const char* title, const char* layout_group);
50 bool AddColorSelector(int r, int g, int b);
51 void AddColorPickerCallbacks();
52 void DeleteColorPickerCallbacks();
53 void AddDatePickerCallbacks();
54 void DeleteDatePickerCallbacks();
56 bool SetDatetimePicker(Evas_Object* picker, const char* style);
58 static void ColorPickerSelectFinishedCallback(
59 void* data, Evas_Object* obj, void* event_info);
60 static void ColorPickerItemSelectedCallback(
61 void* data, Evas_Object* obj, void* event_info);
62 static void DatePickerSelectFinishedCallback(
63 void* data, Evas_Object* obj, void* event_info);
64 static void DatePickerItemChangedCallback(
65 void* data, Evas_Object* obj, void* event_info);
66 static void ColorPickerBackKeyCallback(
67 void* data, Evas_Object* obj, void* event_info);
68 static void DatePickerBackKeyCallback(
69 void* data, Evas_Object* obj, void* event_info);
73 Evas_Object* conformant_;
76 Evas_Object* set_button_;
77 Evas_Object* cancel_button_;
78 Evas_Object* color_picker_;
79 Evas_Object* color_rect_;
80 Evas_Object* date_picker_;
81 Evas_Object* time_picker_;
82 #if defined(OS_TIZEN) && !defined(OS_TIZEN_TV_PRODUCT)
83 Eext_Circle_Surface* circle_surface_;
85 ui::TextInputType input_type_;
86 bool is_color_picker_;
92 void RemoveColorPicker();
93 void RemoveDatePicker(bool cancel);
96 std::unique_ptr<Layout> picker_layout_;
99 } // namespace content
101 #endif // EWK_EFL_INTEGRATION_BROWSER_INPUT_PICKER_INPUT_PICKER_H_