Adapt auto capitalize feature
[framework/uifw/libscl-ui.git] / scl / include / scluiimpl.h
1 /*
2  * Copyright 2012-2013 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.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://floralicense.org/license/
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_UIIMPL_H__
19 #define __SCL_UIIMPL_H__
20
21 #include "scltypes.h"
22 #include "sclstructs.h"
23 #include "scleventcallback.h"
24
25 //SCL_BEGIN_DECLS
26
27 namespace scl
28 {
29 /**
30  * @brief The base class to work as a soft-based keyboard
31  *
32  * This class implements all functions for working as a soft-based keyboard
33  * In side of ISE developer, they can modify it by their requirements.
34  */
35 class CSCLUIImpl
36 {
37 private:
38     static CSCLUIImpl* m_instance; /* For singleton */
39     CSCLUIImpl();
40
41 public:
42     ~CSCLUIImpl();
43     static CSCLUIImpl* get_instance();
44
45     sclboolean init(sclwindow parent, SCLParserType parser_type, const char *entry_filepath);
46
47     void show();
48     void hide();
49
50     void set_ui_event_callback(ISCLUIEventCallback *callback, const sclchar *input_mode);
51
52     sclboolean set_rotation(SCLRotation degree);
53     SCLRotation get_rotation();
54
55     SCLDisplayMode get_display_mode();
56
57     sclboolean set_input_mode(const sclchar *input_mode);
58     const sclchar* get_input_mode();
59
60     void set_update_pending(sclboolean pend);
61
62     sclint set_private_key(const sclchar* custom_id, sclchar* label, sclchar* imagelabel[SCL_BUTTON_STATE_MAX], sclchar* imagebg[SCL_BUTTON_STATE_MAX], sclulong key_event, sclchar *key_value, sclboolean redraw);
63     void unset_private_key(const sclchar* custom_id);
64
65     void enable_button(const sclchar* custom_id, sclboolean enabled);
66
67     sclboolean set_cur_themename(const sclchar *themename);
68
69     sclboolean set_cur_sublayout(const sclchar *sub_layout_name);
70     const sclchar* get_cur_sublayout();
71
72     void set_shift_state(SCLShiftState state);
73     SCLShiftState get_shift_state();
74
75     void notify_app_focus_changed();
76     void reset_popup_timeout();
77     void close_all_popups();
78
79     SclRectangle get_main_window_rect();
80     SclSize get_input_mode_size(const sclchar *input_mode, SCLDisplayMode display_mode);
81     void get_screen_resolution(sclint *width, sclint *height);
82
83     scl16 get_scale_x(scl16 x);
84     scl16 get_scale_y(scl16 y);
85     sclfloat get_scale_rate();
86
87     sclint get_multi_touch_context_num();
88     sclboolean get_multi_touch_event(sclint seqorder, SclUIEventDesc *desc);
89
90     void set_debug_mode(SCLDebugMode mode);
91     SCLDebugMode get_debug_mode();
92
93     sclboolean set_longkey_duration(scllong msc);
94     sclboolean set_longkey_cancel_dist(sclshort dist);
95     sclboolean set_repeatkey_duration(scllong msc);
96     sclboolean set_autopoup_key_duration(scllong msc);
97     sclboolean set_button_delay_duration(scllong msc);
98
99     void enable_magnifier(sclboolean enabled);
100     void enable_sound(sclboolean enabled);
101     void enable_vibration(sclboolean enabled);
102     void enable_tts(sclboolean enabled);
103     void enable_shift_multi_touch(sclboolean enabled);
104
105     void enable_touch_offset(sclboolean enabled);
106     void disable_input_events(sclboolean disabled);
107
108     void set_custom_magnifier_label(scltouchdevice touch_id, sclint index, const sclchar* label);
109
110     void set_string_substitution(const sclchar *original, const sclchar *substitute);
111     void unset_string_substitution(const sclchar *original);
112     sclint get_caps_mode();
113     void set_caps_mode(sclint caps_mode);
114 private:
115     sclboolean m_initialized;
116     sclint m_caps_mode;
117 };
118
119 }
120
121 //SCL_END_DECLS
122
123 #endif //__SCL_UIIMPL_H__