Tizen 2.1 base
[platform/core/uifw/libscl-ui.git] / scl / include / scluibuilder.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 #include <map>
19 #include <string>
20 #include "sclgwes.h"
21 #include "sclutils.h"
22
23 #ifndef __SCL_UIBUILDER_H__
24 #define __SCL_UIBUILDER_H__
25
26 //SCL_BEGIN_DECLS
27
28 namespace scl
29 {
30
31 /**
32  * @brief The base class to work as a soft-based keyboard
33  *
34  * This class implements all functions for working as a soft-based keyboard
35  * In side of ISE developer, they can modify it by their requirements.
36  */
37 class CSCLUIBuilder
38 {
39     friend class CSCLFontProxy;
40
41 private:
42     static CSCLUIBuilder* m_instance; /* For singleton */
43     CSCLUIBuilder();
44 public:
45     ~CSCLUIBuilder();
46
47     static CSCLUIBuilder* get_instance();
48
49     void init(sclwindow parent);
50     sclboolean show_layout(const sclwindow window, const scl16 x = 0, const scl16 y = 0, const scl16 width = 0, const scl16 height = 0);
51     sclboolean draw_button(const sclwindow window, scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const sclboolean force_draw_bg = FALSE);
52     sclboolean show_magnifier(const sclwindow window, scldrawctx draw_ctx);
53     sclboolean show_autopopup(const sclwindow parent, scldrawctx draw_ctx, const scl16 key_index);
54
55 private:
56     sclboolean draw_button_all(const sclwindow window, const scldrawctx draw_ctx, const scl16 x, const scl16 y, const scl16 width, const scl16 height);
57     sclboolean draw_button_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state);
58     sclboolean draw_window_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const SclSize size,
59         const scldouble line_width, const SclColor line_color, const SclColor fill_color);
60     sclboolean draw_button_bg_by_img(const sclwindow window, const scldrawctx draw_ctx,const scl16 key_index,
61         const SCLButtonState state, const sclboolean shift);
62     sclboolean draw_button_bg_by_layoutimg(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index,
63         const SCLButtonState state, const sclboolean shift);
64     sclboolean draw_button_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index,
65                                  const SCLButtonState state, const sclboolean shift);
66
67     sclboolean draw_magnifier_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 label_index, const sclchar* label);
68
69 protected:
70
71     /* Backend Primitive */
72     CSCLGwes *m_gwes;
73     CSCLUtils *m_utils;
74 };
75
76 }
77
78 //SCL_END_DECLS
79
80 #endif //__SCL_UIBUILDER_H__