]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - src/user-manager.h
Change language/layout/session when user selected in GTK+ greeter
[sojka/lightdm.git] / src / user-manager.h
1 /*
2  * Copyright (C) 2010 Robert Ancell.
3  * Author: Robert Ancell <robert.ancell@canonical.com>
4  * 
5  * This program is free software: you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License as published by the Free Software
7  * Foundation, either version 3 of the License, or (at your option) any later
8  * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
9  * license.
10  */
11
12 #ifndef _USER_MANAGER_H_
13 #define _USER_MANAGER_H_
14
15 #include <glib-object.h>
16
17 G_BEGIN_DECLS
18
19 #define USER_MANAGER_TYPE (user_manager_get_type())
20 #define USER_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), USER_MANAGER_TYPE, UserManager));
21
22 typedef struct UserManagerPrivate UserManagerPrivate;
23
24 typedef struct
25 {
26     GObject         parent_instance;
27     UserManagerPrivate *priv;
28 } UserManager;
29
30 typedef struct
31 {
32     GObjectClass parent_class;
33 } UserManagerClass;
34
35 typedef struct
36 {
37     const gchar *name;
38     const gchar *real_name;
39     const gchar *image;
40     const gchar *home_dir;
41     gboolean logged_in;
42 } UserInfo;
43
44 GType user_manager_get_type (void);
45
46 UserManager *user_manager_new (GKeyFile *config_file);
47
48 gint user_manager_get_num_users (UserManager *manager);
49
50 const UserInfo *user_manager_get_user (UserManager *manager, const gchar *username);
51
52 gboolean user_manager_get_users (UserManager *manager, GPtrArray **users, GError *error);
53
54 gboolean user_manager_get_user_defaults (UserManager *manager, gchar *username, gchar **language, gchar **layout, gchar **session, GError *error);
55
56 G_END_DECLS
57
58 #endif /* _USER_MANAGER_H_ */