4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
24 #ifndef __AGENT_APPCORE_H__
25 #define __AGENT_APPCORE_H__
31 #include <app_control_internal.h>
38 struct agentcore_ops {
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. */
49 enum appcore_agent_event {
50 APPCORE_AGENT_EVENT_UNKNOWN,
52 APPCORE_AGENT_EVENT_LOW_MEMORY,
54 APPCORE_AGENT_EVENT_LOW_BATTERY,
56 APPCORE_AGENT_EVENT_LANG_CHANGE,
57 /**< Language setting is changed */
58 APPCORE_AGENT_EVENT_REGION_CHANGE,
59 /**< Region setting is changed */
62 int appcore_agent_main(int argc, char **argv, struct agentcore_ops *ops);
64 int appcore_agent_terminate();
66 int appcore_agent_terminate_without_restart();
68 int appcore_agent_set_event_callback(enum appcore_agent_event event,
69 int (*cb) (void *, void *), void *data);
75 #endif /* __AGENT_APPCORE_H__ */