Initialize Tizen 2.3
[apps/home/b2-clocksetting.git] / include / setting-language.h
1 /*
2  * Copyright (c) 2000 - 2013 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  * 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
39 #define ITEM_COUNT                              2
40
41 #if defined(FEATURE_SETTING_SDK) || defined(FEATURE_SETTING_EMUL)
42 #define LANGUAGE_ITEM_COUNT     49      
43 #else
44 #define LANGUAGE_ITEM_COUNT     84
45 #endif
46
47 struct _lang_menu_item {
48         char *name;
49         char *sub_name;
50         char *id;
51         char *lang;
52 };
53
54 appdata * tmp_ad;
55 static Eina_List * s_langlist;
56 static void (*lang_update_cb)(void*);
57
58
59 char * _gl_lang_title_get(void *data, Evas_Object *obj, const char *part);
60 Evas_Object * _gl_lang_ridio_get(void *data, Evas_Object *obj, const char *part);
61 Evas_Object * _create_lang_list(void* data);
62 void _lang_sel_changed_cb(void *data, Evas_Object *obj, void *event_info);
63 void _gl_lang_sel_cb(void * data, Evas_Object * obj, void * event_info);
64 void _clear_lang_cb(void *data , Evas *e, Evas_Object *obj, void *event_info);
65 void _initialize_language(void * data);
66 void _set_launguage_update_cb(void (*cb)(void*));
67
68 void _langlist_load();
69 Eina_List* _get_language_list();
70 void _langlist_destroy();
71 static void _parseLangListXML(char* docname);
72 static void _tree_walk_langlist(xmlNodePtr cur);
73
74
75
76 #endif /* SETTING_LANGUAGE_H_ */