384.2.1
by Charles Kerr
port indicator-session to GMenu/cmake. Code coverage increased from 0% to 95.4%. |
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 __GUEST_H__
|
|
21 |
#define __GUEST_H__
|
|
22 |
||
23 |
#include <glib.h> |
|
24 |
#include <glib-object.h> |
|
25 |
||
26 |
G_BEGIN_DECLS
|
|
27 |
||
28 |
#define INDICATOR_TYPE_SESSION_GUEST (indicator_session_guest_get_type())
|
|
29 |
#define INDICATOR_SESSION_GUEST(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), INDICATOR_TYPE_SESSION_GUEST, IndicatorSessionGuest))
|
|
30 |
#define INDICATOR_SESSION_GUEST_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), INDICATOR_TYPE_SESSION_GUEST, IndicatorSessionGuestClass))
|
|
31 |
#define INDICATOR_SESSION_GUEST_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), INDICATOR_TYPE_SESSION_GUEST, IndicatorSessionGuestClass))
|
|
32 |
#define INDICATOR_IS_SESSION_GUEST(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), INDICATOR_TYPE_SESSION_GUEST))
|
|
33 |
||
34 |
typedef struct _IndicatorSessionGuest IndicatorSessionGuest; |
|
35 |
typedef struct _IndicatorSessionGuestClass IndicatorSessionGuestClass; |
|
36 |
||
37 |
GType indicator_session_guest_get_type (void); |
|
38 |
||
39 |
/**
|
|
40 |
* A base class for getting state information about the system's guest user.
|
|
41 |
* Use backend.h's get_backend() to get an instance.
|
|
42 |
*/
|
|
43 |
struct _IndicatorSessionGuest |
|
44 |
{
|
|
45 |
/*< private >*/
|
|
46 |
GObject parent; |
|
47 |
};
|
|
48 |
||
49 |
/* properties */
|
|
50 |
#define INDICATOR_SESSION_GUEST_PROPERTY_ALLOWED "guest-is-allowed"
|
|
51 |
#define INDICATOR_SESSION_GUEST_PROPERTY_LOGGED_IN "guest-is-logged-in"
|
|
52 |
#define INDICATOR_SESSION_GUEST_PROPERTY_ACTIVE "guest-is-active-session"
|
|
53 |
||
54 |
struct _IndicatorSessionGuestClass |
|
55 |
{
|
|
56 |
GObjectClass parent_class; |
|
57 |
||
58 |
/* virtual functions */
|
|
59 |
gboolean (* is_allowed) (IndicatorSessionGuest * self); |
|
60 |
gboolean (* is_logged_in) (IndicatorSessionGuest * self); |
|
61 |
gboolean (* is_active) (IndicatorSessionGuest * self); |
|
62 |
void (* switch_to_guest) (IndicatorSessionGuest * self); |
|
63 |
};
|
|
64 |
||
65 |
gboolean indicator_session_guest_is_allowed (IndicatorSessionGuest * self); |
|
66 |
gboolean indicator_session_guest_is_logged_in (IndicatorSessionGuest * self); |
|
67 |
gboolean indicator_session_guest_is_active (IndicatorSessionGuest * self); |
|
68 |
||
69 |
void indicator_session_guest_switch_to_guest (IndicatorSessionGuest * self); |
|
70 |
||
71 |
/**
|
|
72 |
* Emit 'notify' signals for the corresponding properties.
|
|
73 |
* These functions should only be called by IndicatorSessionGuest implementations.
|
|
74 |
*/
|
|
75 |
void indicator_session_guest_notify_allowed (IndicatorSessionGuest * self); |
|
76 |
void indicator_session_guest_notify_logged_in (IndicatorSessionGuest * self); |
|
77 |
void indicator_session_guest_notify_active (IndicatorSessionGuest * self); |
|
78 |
||
79 |
||
80 |
G_END_DECLS
|
|
81 |
||
82 |
#endif
|