merge tizen 2.4
[platform/core/api/application.git] / include / app_internal.h
1 /*
2  * Copyright (c) 2011 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 #ifndef __TIZEN_APPFW_APP_INTERNAL_H__
19 #define __TIZEN_APPFW_APP_INTERNAL_H__
20
21 #include <appcore-common.h>
22 #include <tzplatform_config.h>
23
24 // GNU gettext macro is already defined at appcore-common.h
25 #ifdef _
26 #undef _
27 #endif
28
29 #include <app.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #define TIZEN_PATH_MAX 1024
36
37 #define PATH_FMT_APP_ROOT tzplatform_getenv(TZ_USER_APP)
38 #define PATH_FMT_RES_DIR "/res"
39 #define PATH_FMT_LOCALE_DIR "/locale"
40 #define PATH_FMT_DATA_DIR "/data"
41
42 #define PATH_FMT_RO_APP_ROOT tzplatform_getenv(TZ_SYS_RO_APP)
43 #define PATH_FMT_RO_RES_DIR "/res"
44 #define PATH_FMT_RO_LOCALE_DIR "/local"
45
46 struct app_event_handler {
47         app_event_type_e type;
48         app_event_cb cb;
49         void *data;
50 };
51
52 struct app_event_info {
53         app_event_type_e type;
54         void *value;
55 };
56
57 app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm);
58
59 typedef void (*app_finalizer_cb) (void *data);
60
61 int app_error(app_error_e error, const char* function, const char *description);
62
63 app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm);
64
65 int app_get_package_app_name(const char *package, char **name);
66
67 int app_finalizer_add(app_finalizer_cb callback, void *data);
68
69 int app_finalizer_remove(app_finalizer_cb callback);
70
71 void app_finalizer_execute(void);
72
73 #ifdef __cplusplus
74 }
75 #endif
76
77 #endif /* __TIZEN_APPFW_APP_INTERNAL_H__ */