2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <boost/signals2/signal.hpp>
23 #include "AbstractUIComponent.h"
24 #include "AbstractService.h"
25 #include "ServiceFactory.h"
26 #include "service_macros.h"
28 namespace tizen_browser{
31 class BROWSER_EXPORT ZoomUI
32 : public tizen_browser::interfaces::AbstractUIComponent
33 , public tizen_browser::core::AbstractService
39 //AbstractUIComponent interface methods
40 void init(Evas_Object* parent);
41 Evas_Object* getContent();
44 std::string getName();
46 void show(Evas_Object* parent);
49 boost::signals2::signal<void ()> closeZoomUI;
50 boost::signals2::signal<void (int)> setZoom;
51 boost::signals2::signal<void (const int&, const int&)> scrollView;
53 void createLayout(Evas_Object* parent);
54 void createZoomSlider();
55 void createNavigationButtons();
56 void setImageFile(Evas_Object* obj, int direction, bool focused);
58 static void _zoom_slider_changed(void * data, Evas_Object * obj, void * event_info);
59 static void _left_button_clicked(void * data, Evas_Object * obj, void * event_info);
60 static void _right_button_clicked(void * data, Evas_Object * obj, void * event_info);
61 static void _up_button_clicked(void * data, Evas_Object * obj, void * event_info);
62 static void _down_button_clicked(void * data, Evas_Object * obj, void * event_info);
63 static void _close_button_clicked(void * data, Evas_Object * obj, void * event_info);
64 static void _cb_focus_in_left_button(void * data, Evas *, Evas_Object *obj, void *);
65 static void _cb_focus_out_left_button(void * data, Evas *, Evas_Object *obj, void *);
66 static void _cb_focus_in_right_button(void * data, Evas *, Evas_Object *obj, void *);
67 static void _cb_focus_out_right_button(void * data, Evas *, Evas_Object *obj, void *);
68 static void _cb_focus_in_up_button(void * data, Evas *, Evas_Object *obj, void *);
69 static void _cb_focus_out_up_button(void * data, Evas *, Evas_Object *obj, void *);
70 static void _cb_focus_in_down_button(void * data, Evas *, Evas_Object *obj, void *);
71 static void _cb_focus_out_down_button(void * data, Evas *, Evas_Object *obj, void *);
73 std::string m_edjFilePath;
74 Evas_Object* m_layout;
75 Evas_Object* m_zoom_slider;
76 Evas_Object* m_nav_layout;
77 Evas_Object* m_parent;
79 int m_current_translation_x;
80 int m_current_translation_y;
91 ZOOM_DEFAULT = ZOOM_100,