tizen 2.3.1 release
[apps/home/b2-clocksetting.git] / include / setting-language.h
1 /*
2  *  Copyright (c) 2014 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  * setting-language.h
19  *
20  *  Created on: Oct 9, 2013
21  *      Author: min-hoyun
22  */
23
24 #ifndef SETTING_LANGUAGE_H_
25 #define SETTING_LANGUAGE_H_
26
27 #include <Elementary.h>
28 #include <libintl.h>
29 #include <string.h>
30 #include <libxml/xmlmemory.h>
31 #include <libxml/parser.h>
32 #include <libxml/tree.h>
33
34 #include "util.h"
35
36 #define LANGLIST_FILE_PATH_IN_RW                "/opt/usr/data/setting/langlist.xml"
37 #define LANGLIST_FILE_PATH_IN_RO                "/usr/apps/org.tizen.clocksetting/data/langlist.xml"
38 /*#define LANGLIST_FILE_PATH            "/usr/apps/org.tizen.clocksetting/data/langlist_all.xml" */
39
40 #define ITEM_COUNT                              2
41
42 #if defined(FEATURE_SETTING_SDK) || defined(FEATURE_SETTING_EMUL)
43 #define LANGUAGE_ITEM_COUNT     49
44 #else
45 #define LANGUAGE_ITEM_COUNT     84
46 #endif
47
48 struct _lang_menu_item {
49         char *name;
50         char *sub_name;
51         char *id;
52         char *lang;
53 };
54
55 appdata *tmp_ad;
56 static Eina_List *s_langlist;
57 static void (*lang_update_cb)(void *);
58
59
60 char *_gl_lang_title_get(void *data, Evas_Object *obj, const char *part);
61 Evas_Object *_gl_lang_ridio_get(void *data, Evas_Object *obj, const char *part);
62 Evas_Object *_create_lang_list(void *data);
63 void _lang_sel_changed_cb(void *data, Evas_Object *obj, void *event_info);
64 void _gl_lang_sel_cb(void *data, Evas_Object *obj, void *event_info);
65 void _clear_lang_cb(void *data , Evas *e, Evas_Object *obj, void *event_info);
66 void _initialize_language(void *data);
67 void _set_launguage_update_cb(void (*cb)(void *));
68
69 void _langlist_load();
70 Eina_List *_get_language_list();
71 void _langlist_destroy();
72 static void _parseLangListXML(char *docname);
73 static void _tree_walk_langlist(xmlNodePtr cur);
74
75
76
77 #endif /* SETTING_LANGUAGE_H_ */