e43c116b540b871e8d5921faa15a8232ccd4cbb5
[platform/framework/web/crosswalk-tizen.git] /
1 // Copyright 2016 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.
4
5 #ifndef EWK_EFL_INTEGRATION_BROWSER_SELECT_PICKER_FORM_NAVIGABLE_PICKER_H_
6 #define EWK_EFL_INTEGRATION_BROWSER_SELECT_PICKER_FORM_NAVIGABLE_PICKER_H_
7
8 #include "browser/select_picker/select_picker_base.h"
9
10 class FormNavigablePicker : public SelectPickerBase {
11  public:
12   ~FormNavigablePicker() override;
13   void UpdateFormNavigation(int form_element_count,
14                             int current_node_index) override;
15   void UpdatePickerData(int selected_index,
16                         const std::vector<content::MenuItem>& items,
17                         bool is_multiple_selection) override;
18
19  protected:
20   explicit FormNavigablePicker(EWebView* web_view,
21                                int selected_index,
22                                bool is_multi_select);
23   void RegisterCallbacks(const char* edj, bool overlay);
24   void RegisterCallbacks();
25   Evas_Object* AddBackground();
26   void AddDoneButton();
27   void ShowButtons();
28   void RequestFormNavigationInformation();
29   void FormNavigate(bool direction);
30
31  private:
32   void UpdateNavigationButtons();
33   static void KeyUpCallback(void* data,
34                             Evas* e,
35                             Evas_Object* obj,
36                             void* event_info);
37 #if defined(OS_TIZEN)
38   static void HWBackKeyCallback(void* data, Evas_Object* obj, void* event_info);
39 #endif
40   static void ListClosedCallback(void* data,
41                                  Evas_Object* obj,
42                                  const char* emission,
43                                  const char* source);
44   static void NavigateToPrevCallback(void* data,
45                                      Evas_Object* obj,
46                                      const char* emission,
47                                      const char* source);
48   static void NavigateToNextCallback(void* data,
49                                      Evas_Object* obj,
50                                      const char* emission,
51                                      const char* source);
52   static Eina_Bool EcoreEventFilterCallback(void* data,
53                                             void* loop_data,
54                                             int type,
55                                             void* event);
56
57   Ecore_Event_Filter* ecore_events_filter_;
58   struct FormNavigatorInfo {
59     int count;
60     int index;
61     bool is_prev;
62     bool is_next;
63   } form_navigator_info_;
64 };
65
66 #endif  // EWK_EFL_INTEGRATION_BROWSER_SELECT_PICKER_FORM_NAVIGABLE_PICKER_H_