tizen 2.3 release
[framework/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 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #include <app.h>
26 #include <appcore-common.h>
27
28 #define TIZEN_PATH_MAX 1024
29
30 #define PATH_FMT_APP_ROOT "/opt/usr/apps"
31 #define PATH_FMT_RES_DIR PATH_FMT_APP_ROOT "/%s/res"
32 #define PATH_FMT_LOCALE_DIR PATH_FMT_RES_DIR "/locale"
33 #define PATH_FMT_DATA_DIR PATH_FMT_APP_ROOT "/%s/data"
34
35 #define PATH_FMT_RO_APP_ROOT "/usr/apps"
36 #define PATH_FMT_RO_RES_DIR PATH_FMT_RO_APP_ROOT "/%s/res"
37 #define PATH_FMT_RO_LOCALE_DIR PATH_FMT_RO_RES_DIR "/locale"
38
39 struct app_event_handler {
40         app_event_type_e type;
41         app_event_cb cb;
42         void *data;
43 };
44
45 struct app_event_info {
46         app_event_type_e type;
47         void *value;
48 };
49
50 app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm);
51
52 typedef void (*app_finalizer_cb) (void *data);
53
54 int app_error(app_error_e error, const char* function, const char *description);
55
56 app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm);
57
58 int app_get_package_app_name(const char *package, char **name);
59
60 int app_finalizer_add(app_finalizer_cb callback, void *data);
61
62 int app_finalizer_remove(app_finalizer_cb callback);
63
64 void app_finalizer_execute(void);
65
66 int app_get_package(char **package);
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif /* __TIZEN_APPFW_APP_INTERNAL_H__ */