2
* Copyright 2009 Canonical Ltd.
5
* Cody Russell <crussell@canonical.com>
6
* Charles Kerr <charles.kerr@canonical.com>
8
* This program is free software: you can redistribute it and/or modify it
9
* under the terms of the GNU General Public License version 3, as published
10
* by the Free Software Foundation.
12
* This program is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranties of
14
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15
* PURPOSE. See the GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License along
18
* with this program. If not, see <http://www.gnu.org/licenses/>.
21
#ifndef __USERS_SERVICE_DBUS_H__
22
#define __USERS_SERVICE_DBUS_H__
25
#include <glib-object.h>
27
#include "dbus-user.h" /* for AccountsUser */
31
#define USERS_SERVICE_DBUS_TYPE (users_service_dbus_get_type ())
32
#define USERS_SERVICE_DBUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), USERS_SERVICE_DBUS_TYPE, UsersServiceDbus))
33
#define IS_USERS_SERVICE_DBUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), USERS_SERVICE_DBUS_TYPE))
35
typedef struct _UsersServiceDbus UsersServiceDbus;
36
typedef struct _UsersServiceDbusClass UsersServiceDbusClass;
37
typedef struct _UsersServiceDbusPrivate UsersServiceDbusPrivate;
40
* A facade class which interacts with multiple DBus services to
41
* track info which is useful to the interactor's user menu:
43
* 1. A list of users to add to the user menu.
45
* Each user is an AccountsUser object, which is a GDBusProxy
46
* to an org.freedesktop.Accounts.User object.
48
* We initially build this list by calling org.freedesktop.Accounts'
49
* GetCachedUsers method. We also monitor o.f.Accounts' UserAdded
50
* and UserDeleted and update the list accordingly.
52
* 2. Track which users currently have X sessions.
53
* This is used for the menuitems' USER_ITEM_PROP_LOGGED_IN property.
55
* We initially build this list by calling org.freedesktop.ConsoleKit.Seat's
56
* GetDevices method. We also monitor the seat for SessionAdded and
57
* SessionRemoved and update the list accordingly.
59
* 3. Provide an API for user switching and guest sessions.
60
* These are typically pass-through functions to GDBusProxies.
63
struct _UsersServiceDbus
67
UsersServiceDbusPrivate * priv;
70
struct _UsersServiceDbusClass
72
GObjectClass parent_class;
75
void (* user_list_changed) (UsersServiceDbus*, gpointer);
76
void (* user_logged_in_changed) (UsersServiceDbus*, AccountsUser*, gpointer);
77
void (* guest_logged_in_changed) (UsersServiceDbus*, gpointer);
80
GType users_service_dbus_get_type (void) G_GNUC_CONST;
82
GList * users_service_dbus_get_user_list (UsersServiceDbus * self);
84
gboolean users_service_dbus_is_guest_logged_in (UsersServiceDbus * self);
85
gboolean users_service_dbus_is_user_logged_in (UsersServiceDbus * self,
88
void users_service_dbus_show_greeter (UsersServiceDbus * self);
89
gboolean users_service_dbus_guest_session_enabled (UsersServiceDbus * self);
90
gboolean users_service_dbus_can_activate_session (UsersServiceDbus * self);
91
void users_service_dbus_activate_guest_session (UsersServiceDbus * self);
92
void users_service_dbus_activate_user_session (UsersServiceDbus * self,