Update package version to 0.8.5
[platform/core/uifw/libscl-core.git] / src / sclcoreui.cpp
1 /*
2  * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 #include <dlog.h>
19
20 #include "sclcoreui.h"
21
22 #include "sclcoreui-efl.h"
23
24 using namespace scl;
25
26 CSCLCoreUI::CSCLCoreUI()
27 {
28     m_backend_identifier = "undefined";
29     m_impl = NULL;
30 }
31
32 CSCLCoreUI::~CSCLCoreUI()
33 {
34 }
35
36 std::string CSCLCoreUI::get_backend_identifier()
37 {
38     return m_backend_identifier;
39 }
40
41 sclboolean CSCLCoreUI::init()
42 {
43     sclboolean ret = FALSE;
44     if (m_impl == NULL) {
45         /* There could be other backend implementations.. */
46         m_impl = new CSCLCoreUIEFL;
47         if (m_impl) {
48             ret = m_impl->init();
49         }
50     }
51     return ret;
52 }
53
54 void CSCLCoreUI::fini()
55 {
56     if (m_impl) {
57         m_impl->fini();
58         delete m_impl;
59         m_impl = NULL;
60     }
61 }
62
63 sclboolean CSCLCoreUI::create_main_window()
64 {
65     sclboolean ret = FALSE;
66     if (m_impl) {
67         ret = m_impl->create_main_window();
68     }
69     return ret;
70 }
71
72 void CSCLCoreUI::run(const sclchar *display)
73 {
74     if (m_impl) {
75         m_impl->run(display);
76     }
77 }
78
79 void CSCLCoreUI::set_keyboard_size_hints(SclSize portrait, SclSize landscape)
80 {
81     if (m_impl) {
82         m_impl->set_keyboard_size_hints(portrait, landscape);
83     }
84 }
85
86 sclwindow CSCLCoreUI::get_main_window()
87 {
88     sclwindow ret = SCLWINDOW_INVALID;
89     if (m_impl) {
90         ret = m_impl->get_main_window();
91     }
92     return ret;
93 }
94
95 void CSCLCoreUI::set_screen_rotation_degree(int degree)
96 {
97     if (m_impl) {
98         m_impl->set_screen_rotation_degree(degree);
99     }
100 }
101
102 int CSCLCoreUI::get_screen_rotation_degree()
103 {
104     int ret = 0;
105     if (m_impl) {
106         ret = m_impl->get_screen_rotation_degree();
107     }
108     return ret;
109 }
110
111 sclwindow CSCLCoreUI::create_option_window(SCLOptionWindowType type)
112 {
113     sclwindow ret = SCLWINDOW_INVALID;
114     if (m_impl) {
115         ret = m_impl->create_option_window(type);
116     }
117     return ret;
118 }
119
120 bool CSCLCoreUI::show_option_window(SCLOptionWindowType type)
121 {
122     bool ret = false;
123     if (m_impl) {
124         ret = m_impl->show_option_window(type);
125     }
126     return ret;
127 }
128
129 void CSCLCoreUI::destroy_option_window(sclwindow window)
130 {
131     if (m_impl) {
132         m_impl->destroy_option_window(window);
133     }
134 }
135
136 void CSCLCoreUI::process_keyboard_ui_state_change(KEYBOARD_UI_STATE state)
137 {
138     if (m_impl) {
139         m_impl->process_keyboard_ui_state_change(state);
140     }
141 }
142
143 void CSCLCoreUI::set_floating_mode(sclboolean floating_mode)
144 {
145     if (m_impl) {
146         m_impl->set_floating_mode(floating_mode);
147     }
148 }
149
150 void CSCLCoreUI::set_floating_drag_enabled(sclboolean enabled)
151 {
152     if (m_impl) {
153         m_impl->set_floating_drag_enabled(enabled);
154     }
155 }
156
157 void CSCLCoreUI::update_keyboard_geometry(SclSize portrait, SclSize landscape)
158 {
159     if (m_impl) {
160         m_impl->update_keyboard_geometry(portrait, landscape);
161     }
162 }
163
164 void CSCLCoreUI::get_keyboard_size(SclSize *portrait, SclSize *landscape)
165 {
166     if (m_impl) {
167         m_impl->get_keyboard_size(portrait, landscape);
168     }
169 }