4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 #ifndef __DEVICED_POWER_OFF_H__
20 #define __DEVICED_POWER_OFF_H__
22 #include <sys/types.h>
24 #define POWER_POWEROFF "poweroff"
25 #define POWER_REBOOT "reboot"
26 #define POWER_OFF_POPUP "pwroff-popup"
27 #define POWER_EXIT "exit"
29 #define POWER_FLAG_POWEROFF "/run/"POWER_POWEROFF
30 #define POWER_FLAG_REBOOT "/run/"POWER_REBOOT
31 #define POWER_FLAG_EXIT "/run/deviced-shutdown-exit"
34 // 1: Power Off Popup is launched (not supported since Tizen5.5)
39 POWEROFF_TYPE_INVALID = 0,
40 POWEROFF_TYPE_NONE = POWEROFF_TYPE_INVALID, // compat only
41 POWEROFF_TYPE_POWEROFF = 2,
42 POWEROFF_TYPE_DIRECT = POWEROFF_TYPE_POWEROFF, // compat only
44 POWEROFF_TYPE_RESTART = POWEROFF_TYPE_REBOOT, // compat only
49 enum poweroff_type type;
53 struct poweroff_handle {
60 void power_off_init(void);
62 int poweroff_trigger_poweroff(void *data);
63 int poweroff_check_revived(void);
64 void poweroff_request_shutdown(void);
65 int poweroff_add_wait(pid_t pid);
66 void poweroff_remove_wait(pid_t pid);
68 #endif /* __DEVICED_POWER_OFF_H__ */