~unity8-desktop-session-team/indicator-session/indicator-session-using-upstart

« back to all changes in this revision

Viewing changes to src/actions.h

  • Committer: Charles Kerr
  • Date: 2012-08-22 06:31:53 UTC
  • Revision ID: charles.kerr@canonical.com-20120822063153-ezwmbzyfr0waf99i
Tags: 12.10.1
12.10.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2013 Canonical Ltd.
3
 
 *
4
 
 * Authors:
5
 
 *   Charles Kerr <charles.kerr@canonical.com>
6
 
 *
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.
10
 
 *
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.
15
 
 *
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/>.
18
 
 */
19
 
 
20
 
#ifndef __INDICATOR_SESSION_ACTIONS_H__
21
 
#define __INDICATOR_SESSION_ACTIONS_H__
22
 
 
23
 
#include <glib.h>
24
 
#include <glib-object.h>
25
 
 
26
 
G_BEGIN_DECLS
27
 
 
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))
34
 
 
35
 
typedef struct _IndicatorSessionActions      IndicatorSessionActions;
36
 
typedef struct _IndicatorSessionActionsClass IndicatorSessionActionsClass;
37
 
 
38
 
/* property keys */
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"
47
 
 
48
 
/**
49
 
 * A base class for invoking and getting state information on system actions.
50
 
 * Use backend.h's get_backend() to get an instance.
51
 
 */
52
 
struct _IndicatorSessionActions
53
 
{
54
 
  /*< private >*/
55
 
  GObject parent;
56
 
};
57
 
 
58
 
struct _IndicatorSessionActionsClass
59
 
{
60
 
  GObjectClass parent_class;
61
 
 
62
 
  /* pure virtual functions */
63
 
 
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);
72
 
 
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);
82
 
 
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);
88
 
};
89
 
 
90
 
/***
91
 
****
92
 
***/
93
 
 
94
 
GType indicator_session_actions_get_type (void);
95
 
 
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);
104
 
 
105
 
 
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);
114
 
 
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);
121
 
 
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);
126
 
 
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);
132
 
 
133
 
G_END_DECLS
134
 
 
135
 
#endif /* __INDICATOR_SESSION_ACTIONS_H__ */