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"
15 #if BUILDFLAG(IS_TIZEN)
16 #include <efl_extension.h>
25 explicit InputPicker(EWebView* view);
28 InputPicker(const InputPicker&) = delete;
29 InputPicker& operator=(const InputPicker&) = delete;
31 void ShowColorPicker(int r, int g, int b, int a);
32 void ShowDatePicker(ui::TextInputType input_type, double input_date);
37 static Layout* CreateAndShowColorPickerLayout(InputPicker* parent,
41 static Layout* CreateAndShowDateLayout(InputPicker* parent,
42 struct tm* currentTime,
43 ui::TextInputType type);
44 static Layout* CreateAndShowDateTimeLayout(InputPicker* parent,
45 struct tm* currentTime,
46 ui::TextInputType type);
47 static Layout* CreateAndShowTimeLayout(InputPicker* parent,
48 struct tm* currentTime);
53 explicit Layout(InputPicker* parent);
55 Layout(const Layout&) = delete;
56 Layout& operator=(const Layout&) = delete;
58 bool AddBaseLayout(const char* title, const char* layout_group);
60 bool AddColorSelector(int r, int g, int b);
61 void AddColorPickerCallbacks();
62 void DeleteColorPickerCallbacks();
63 void AddDatePickerCallbacks();
64 void DeleteDatePickerCallbacks();
66 bool SetDatetimePicker(Evas_Object* picker, const char* style);
68 static void ColorPickerSelectFinishedCallback(void* data,
71 static void ColorPickerItemSelectedCallback(void* data,
74 static void DatePickerSelectFinishedCallback(void* data,
77 static void DatePickerItemChangedCallback(void* data,
81 static void ColorPickerBackKeyCallback(void* data,
84 static void DatePickerBackKeyCallback(void* data,
90 Evas_Object* conformant_ = nullptr;
91 Evas_Object* popup_ = nullptr;
92 Evas_Object* layout_ = nullptr;
93 Evas_Object* set_button_ = nullptr;
94 Evas_Object* cancel_button_ = nullptr;
95 Evas_Object* color_picker_ = nullptr;
96 Evas_Object* color_rect_ = nullptr;
97 Evas_Object* date_picker_ = nullptr;
98 Evas_Object* time_picker_ = nullptr;
99 #if BUILDFLAG(IS_TIZEN) && !BUILDFLAG(IS_TIZEN_TV)
100 Eext_Circle_Surface* circle_surface_ = nullptr;
102 ui::TextInputType input_type_ = ui::TEXT_INPUT_TYPE_NONE;
103 bool is_color_picker_ = false;
109 void RemoveColorPicker();
110 void RemoveDatePicker(bool cancel);
113 std::unique_ptr<Layout> picker_layout_;
116 } // namespace content
118 #endif // EWK_EFL_INTEGRATION_BROWSER_INPUT_PICKER_INPUT_PICKER_H_