Fix prevent issue and remove compile warning messages
[platform/core/appfw/appcore-agent.git] / include / appcore-agent.h
1 /*
2  *  app-core
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22
23
24 #ifndef __AGENT_APPCORE_H__
25 #define __AGENT_APPCORE_H__
26
27
28 #include <libintl.h>
29 #include <bundle.h>
30
31 #include <app_control_internal.h>
32
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 struct agentcore_ops {
39         void *data;
40             /**< Callback data */
41         int (*create) (void *); /**< This callback function is called at the start of the application. */
42         int (*terminate) (void *); /**< This callback function is called once after the main loop of application exits. */
43         int (*app_control) (app_control_h, void *); /**< This callback function is called when other application send the launch request to the application. */
44
45         void *reserved[6];
46                    /**< Reserved */
47 };
48
49 enum appcore_agent_event {
50         APPCORE_AGENT_EVENT_UNKNOWN,
51                         /**< Unknown event */
52         APPCORE_AGENT_EVENT_LOW_MEMORY,
53                         /**< Low memory */
54         APPCORE_AGENT_EVENT_LOW_BATTERY,
55                         /**< Low battery */
56         APPCORE_AGENT_EVENT_LANG_CHANGE,
57                         /**< Language setting is changed */
58         APPCORE_AGENT_EVENT_REGION_CHANGE,
59                         /**< Region setting is changed */
60 };
61
62 int appcore_agent_main(int argc, char **argv, struct agentcore_ops *ops);
63
64 int appcore_agent_terminate();
65
66 int appcore_agent_terminate_without_restart();
67
68 int appcore_agent_set_event_callback(enum appcore_agent_event event,
69                                           int (*cb) (void *, void *), void *data);
70
71 #ifdef __cplusplus
72 }
73 #endif
74
75 #endif                          /* __AGENT_APPCORE_H__ */