795a642fafb86e70876881f9b5a18407ead7e10e
[framework/api/application.git] / include / app_private.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_PRIVATE_H__
19 #define __TIZEN_APPFW_APP_PRIVATE_H__
20
21 #include <appcore-common.h>
22
23 // GNU gettext macro is already defined at appcore-common.h
24 #ifdef _ 
25 #undef _
26 #endif
27
28 #include <app.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #define TIZEN_PATH_MAX 1024
35
36 #define PATH_FMT_APP_ROOT "/opt/usr/apps"
37 #define PATH_FMT_RES_DIR PATH_FMT_APP_ROOT "/%s/res"
38 #define PATH_FMT_LOCALE_DIR PATH_FMT_RES_DIR "/locale"
39 #define PATH_FMT_DATA_DIR PATH_FMT_APP_ROOT "/%s/data"
40
41 #define PATH_FMT_RO_APP_ROOT "/usr/apps"
42 #define PATH_FMT_RO_RES_DIR PATH_FMT_RO_APP_ROOT "/%s/res"
43 #define PATH_FMT_RO_LOCALE_DIR PATH_FMT_RO_RES_DIR "/locale"
44
45 typedef void (*app_finalizer_cb) (void *data);
46
47 int app_error(app_error_e error, const char* function, const char *description);
48
49 app_device_orientation_e app_convert_appcore_rm(enum appcore_rm rm);
50
51 int app_get_package_app_name(const char *package, char **name);
52
53 int app_finalizer_add(app_finalizer_cb callback, void *data);
54
55 int app_finalizer_remove(app_finalizer_cb callback);
56
57 void app_finalizer_execute(void);
58
59 #ifdef __cplusplus
60 }
61 #endif
62
63 #endif /* __TIZEN_APPFW_APP_PRIVATE_H__ */