61456992afc03b56f84312c681310e4251d52931
[platform/core/uifw/libscl-core.git] / src / sclcoreimpl.h
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 #ifndef __SCL_CORE_IMPL_H__
19 #define __SCL_CORE_IMPL_H__
20
21 #include "sclcore.h"
22 #include "sclcoreui.h"
23 #include "sclcorecallback.h"
24 #include "sclconnection.h"
25
26 //SCL_BEGIN_DECLS
27
28 namespace scl
29 {
30
31 class CSCLCoreImpl
32 {
33 private:
34     CSCLCoreImpl();
35
36     sclchar* m_display;
37
38 public:
39     ~CSCLCoreImpl();
40     static CSCLCoreImpl* get_instance();
41
42     void init(const sclchar *display);
43     void fini();
44
45     void on_run(const sclchar *uuid, const sclchar *display);
46     void run();
47
48     void set_core_event_callback(ISCLCoreEventCallback *callback);
49     ISCLCoreEventCallback* get_core_event_callback();
50
51     CSCLCoreUI* get_core_ui();
52     CSCLConnection* get_connection();
53     sclchar* get_uuid();
54
55     void config_reload();
56     sclboolean config_read_int(const sclchar *name, sclint &value);
57     sclboolean config_read_string(const sclchar *name, std::string &value);
58     sclboolean config_write_int(const sclchar *name, sclint value);
59     sclboolean config_write_string(const sclchar *name, const std::string value);
60     sclboolean config_erase(const sclchar *name);
61     sclboolean config_flush(void);
62
63     void send_imengine_event(sclint ic, const sclchar *ic_uuid, const sclint command, const sclu32 value);
64     void reset_keyboard_ise();
65     void flush_keyboard_ise();
66     void send_key_event(sclint ic, const sclchar *ic_uuid, sclu32 keycode, sclu16 keymask);
67     void forward_key_event(sclint ic, const sclchar *ic_uuid, sclu32 keycode, sclu16 keymask);
68     void commit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str);
69     void select_candidate(int index);
70     void show_preedit_string(sclint ic, const sclchar *ic_uuid);
71     void show_aux_string(void);
72     void show_candidate_string(void);
73     void show_associate_string(void);
74     void hide_preedit_string(sclint ic, const sclchar *ic_uuid);
75     void hide_aux_string(void);
76     void hide_candidate_string(void);
77     void hide_associate_string(void);
78     void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str);
79     void update_preedit_string(sclint ic, const sclchar *ic_uuid, const sclchar *str, const scim::AttributeList &attrs);
80     //void update_aux_string (const sclchar *str, const AttributeList &attrs) const;
81     void update_aux_string(const sclchar *str);
82     //void update_candidate_string (const LookupTable &table) const;
83     //void update_associate_string (const LookupTable &table) const;
84     void update_input_context(sclu32 type, sclu32 value);
85     void update_geometry(sclint x, sclint y, sclint width, sclint height);
86     void get_surrounding_text(const sclchar* ic_uuid, sclint maxlen_before, sclint maxlen_after) const;
87     void delete_surrounding_text(sclint offset, sclint len) const;
88     void set_candidate_position(sclint left, sclint top);
89     void enable_soft_candidate(sclboolean enable);
90     void candidate_hide(void);
91     //void get_candidate_window_geometry (const String           &uuid) const;
92     void set_keyboard_ise_by_uuid(const sclchar *uuid);
93     void get_keyboard_ise(const sclchar *uuid);
94     //void get_keyboard_ise_list    (const String                &uuid) const;
95
96     sclwindow get_main_window();
97     int get_screen_rotation_degree();
98     void set_keyboard_size_hints(SclSize portrait, SclSize landscape);
99
100     sclwindow create_option_window();
101     void destroy_option_window(sclwindow window);
102
103     void set_selection(sclint start, sclint end);
104     void send_private_command(const sclchar *command);
105     sclint get_surrounding_text(sclint maxlen_before, sclint maxlen_after, sclchar **text, int &cursor);
106     void get_selection_text(sclchar **text);
107
108     void request_ise_hide();
109 private:
110     ISCLCoreEventCallback *m_event_callback;
111
112     CSCLConnection m_connection;
113     CSCLCoreUI m_core_ui;
114     sclchar *m_uuid;
115 };
116
117 }
118
119 //SCL_END_DECLS
120
121 #endif //__SCL_CORE_IMPL_H__