2
* Copyright 2013 Canonical Ltd.
5
* Charles Kerr <charles.kerr@canonical.com>
7
* This program is free software: you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License version 3, as published
9
* by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranties of
13
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
* PURPOSE. See the GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef __INDICATOR_SESSION_ACTIONS_H__
21
#define __INDICATOR_SESSION_ACTIONS_H__
24
#include <glib-object.h>
28
/* standard GObject macros */
29
#define INDICATOR_TYPE_SESSION_ACTIONS (indicator_session_actions_get_type())
30
#define INDICATOR_SESSION_ACTIONS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), INDICATOR_TYPE_SESSION_ACTIONS, IndicatorSessionActions))
31
#define INDICATOR_SESSION_ACTIONS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), INDICATOR_TYPE_SESSION_ACTIONS, IndicatorSessionActionsClass))
32
#define INDICATOR_SESSION_ACTIONS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), INDICATOR_TYPE_SESSION_ACTIONS, IndicatorSessionActionsClass))
33
#define INDICATOR_IS_SESSION_ACTIONS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), INDICATOR_TYPE_SESSION_ACTIONS))
35
typedef struct _IndicatorSessionActions IndicatorSessionActions;
36
typedef struct _IndicatorSessionActionsClass IndicatorSessionActionsClass;
39
#define INDICATOR_SESSION_ACTIONS_PROP_CAN_LOCK "can-lock"
40
#define INDICATOR_SESSION_ACTIONS_PROP_CAN_LOGOUT "can-logout"
41
#define INDICATOR_SESSION_ACTIONS_PROP_CAN_REBOOT "can-reboot"
42
#define INDICATOR_SESSION_ACTIONS_PROP_CAN_SWITCH "can-switch"
43
#define INDICATOR_SESSION_ACTIONS_PROP_CAN_SUSPEND "can-suspend"
44
#define INDICATOR_SESSION_ACTIONS_PROP_CAN_HIBERNATE "can-hibernate"
45
#define INDICATOR_SESSION_ACTIONS_PROP_CAN_PROMPT "can-show-end-session-dialog"
46
#define INDICATOR_SESSION_ACTIONS_PROP_HAS_ONLINE_ACCOUNT_ERROR "has-online-account-error"
49
* A base class for invoking and getting state information on system actions.
50
* Use backend.h's get_backend() to get an instance.
52
struct _IndicatorSessionActions
58
struct _IndicatorSessionActionsClass
60
GObjectClass parent_class;
62
/* pure virtual functions */
64
gboolean (*can_lock) (IndicatorSessionActions * self);
65
gboolean (*can_logout) (IndicatorSessionActions * self);
66
gboolean (*can_reboot) (IndicatorSessionActions * self);
67
gboolean (*can_switch) (IndicatorSessionActions * self);
68
gboolean (*can_suspend) (IndicatorSessionActions * self);
69
gboolean (*can_hibernate) (IndicatorSessionActions * self);
70
gboolean (*can_prompt) (IndicatorSessionActions * self);
71
gboolean (*has_online_account_error) (IndicatorSessionActions * self);
73
void (*suspend) (IndicatorSessionActions * self);
74
void (*hibernate) (IndicatorSessionActions * self);
75
void (*logout) (IndicatorSessionActions * self);
76
void (*reboot) (IndicatorSessionActions * self);
77
void (*power_off) (IndicatorSessionActions * self);
78
void (*help) (IndicatorSessionActions * self);
79
void (*about) (IndicatorSessionActions * self);
80
void (*settings) (IndicatorSessionActions * self);
81
void (*online_accounts) (IndicatorSessionActions * self);
83
void (*switch_to_greeter) (IndicatorSessionActions * self);
84
void (*switch_to_screensaver) (IndicatorSessionActions * self);
85
void (*switch_to_guest) (IndicatorSessionActions * self);
86
void (*switch_to_username) (IndicatorSessionActions * self,
87
const gchar * username);
94
GType indicator_session_actions_get_type (void);
96
gboolean indicator_session_actions_can_lock (IndicatorSessionActions * self);
97
gboolean indicator_session_actions_can_logout (IndicatorSessionActions * self);
98
gboolean indicator_session_actions_can_reboot (IndicatorSessionActions * self);
99
gboolean indicator_session_actions_can_switch (IndicatorSessionActions * self);
100
gboolean indicator_session_actions_can_suspend (IndicatorSessionActions * self);
101
gboolean indicator_session_actions_can_hibernate (IndicatorSessionActions * self);
102
gboolean indicator_session_actions_can_prompt (IndicatorSessionActions * self);
103
gboolean indicator_session_actions_has_online_account_error (IndicatorSessionActions * self);
106
void indicator_session_actions_notify_can_lock (IndicatorSessionActions * self);
107
void indicator_session_actions_notify_can_logout (IndicatorSessionActions * self);
108
void indicator_session_actions_notify_can_reboot (IndicatorSessionActions * self);
109
void indicator_session_actions_notify_can_switch (IndicatorSessionActions * self);
110
void indicator_session_actions_notify_can_suspend (IndicatorSessionActions * self);
111
void indicator_session_actions_notify_can_hibernate (IndicatorSessionActions * self);
112
void indicator_session_actions_notify_can_prompt (IndicatorSessionActions * self);
113
void indicator_session_actions_notify_has_online_account_error (IndicatorSessionActions * self);
115
void indicator_session_actions_lock (IndicatorSessionActions * self);
116
void indicator_session_actions_suspend (IndicatorSessionActions * self);
117
void indicator_session_actions_hibernate (IndicatorSessionActions * self);
118
void indicator_session_actions_logout (IndicatorSessionActions * self);
119
void indicator_session_actions_reboot (IndicatorSessionActions * self);
120
void indicator_session_actions_power_off (IndicatorSessionActions * self);
122
void indicator_session_actions_help (IndicatorSessionActions * self);
123
void indicator_session_actions_about (IndicatorSessionActions * self);
124
void indicator_session_actions_settings (IndicatorSessionActions * self);
125
void indicator_session_actions_online_accounts (IndicatorSessionActions * self);
127
void indicator_session_actions_switch_to_screensaver (IndicatorSessionActions * self);
128
void indicator_session_actions_switch_to_greeter (IndicatorSessionActions * self);
129
void indicator_session_actions_switch_to_guest (IndicatorSessionActions * self);
130
void indicator_session_actions_switch_to_username (IndicatorSessionActions * self,
131
const gchar * username);
135
#endif /* __INDICATOR_SESSION_ACTIONS_H__ */