tizen 2.4 release
[apps/home/settings.git] / setting-font / include / setting-font.h
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #ifndef __SETTING_FONT_H__
22 #define __SETTING_FONT_H__
23
24 #include <stdio.h>
25 #include <Elementary.h>
26
27 #include <glib-object.h>
28
29 #include <setting-common-draw-widget.h>
30 #include <setting-common-view.h>
31 #include <system_settings.h>
32
33 typedef struct _SettingFontUG SettingFontUG;
34
35 typedef enum {
36     FONT_SIZE_AND_FONT_SEL_UG,
37     FONT_SEL_VIEW_APPCONTROL,
38     FONT_SIZE_VIEW_APPCONTROL,
39 } FontUGViewMode;
40
41 typedef enum {
42     SELECTED_FONT_CHANGE_NONE,
43     SELECTED_FONT_CHANGE_IN_PROCESS,
44     SELECTED_FONT_CHANGE_DONE
45 } FontChangStatus;
46
47 typedef enum {
48     FONT_EXPAND_STATE_NONE,
49     FONT_EXPAND_STATE_FONT_TYPE,
50     FONT_EXPAND_STATE_FONT_SIZE,
51 } FontExpandState;
52
53
54 /**
55  * Setting Font UG context
56  * all UG function has void* as an agument. this is casted back to SettingFontUG
57  * and the functions access app context.
58  */
59 struct _SettingFontUG {
60         ui_gadget_h ug;
61
62         /* add more variables here (move your appdata to here) */
63         Evas *evas;
64         Evas_Object *win_main_layout;
65         Evas_Object *win_get;
66
67         Evas_Object *ly_main;
68
69         Evas_Object *genlist;
70         Evas_Object *navibar;
71         Elm_Object_Item *navi_it_font;
72         Elm_Object_Item *navi_it_font_size;
73
74         Evas_Object *btn_done;
75         Evas_Object *btn_cancel;
76
77         Elm_Theme *theme;
78
79         /* font setting */
80         Evas_Object *main_popup;
81         Evas_Object *size_popup;
82
83         Elm_Genlist_Item_Class itc_2text_3_parent;
84         Elm_Genlist_Item_Class itc_1icon_1text_sub;
85         Elm_Genlist_Item_Class itc_1text_1icon_2;
86         Elm_Genlist_Item_Class itc_1text_1icon_2_font_size;
87         Elm_Genlist_Item_Class itc_2text_2;
88         Elm_Genlist_Item_Class itc_group_item;
89         Elm_Genlist_Item_Class itc_bg_1icon;
90         Elm_Genlist_Item_Class itc_seperator;
91         Elm_Genlist_Item_Class itc_1icon;
92
93         Setting_GenGroupItem_Data *subitem;
94         Setting_GenGroupItem_Data *font_type;
95         Setting_GenGroupItem_Data *font_size;
96         Setting_GenGroupItem_Data *font_example;
97
98         /* font type */
99         int prev_font;
100         char *font_name;
101
102         char *font_size_str;
103         char *font_type_str;
104         int init_font_size;
105         int init_font_type;
106         bool size_change_flag;
107         bool type_change_flag;
108
109         int ret_font_size;
110
111         FontUGViewMode viewmode;
112
113         /* Font Size & Sel */
114         Evas_Object *size_rdg;
115         setting_view *view_to_load;
116
117         Elm_Object_Item *cur_focus_item;
118         Eina_List *font_type_list;
119
120         Ecore_Timer *timer;
121         Ecore_Timer *font_size_idler;
122         Ecore_Timer *font_type_timer;
123
124         FontChangStatus font_change_status;
125         FontExpandState font_expand_state;
126
127         int rotate_angle;
128 };
129
130 extern setting_view setting_view_font_main;
131 extern setting_view setting_view_font_font_size;
132
133
134 #endif                          /* __SETTING_FONT_H__ */