]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - common/user-list.h
820e0b256149079fc998dc29c6c9ea756c02feb1
[sojka/lightdm.git] / common / user-list.h
1 /*
2  * Copyright (C) 2010 Robert Ancell.
3  * Copyright (C) 2014 Canonical, Ltd.
4  * Authors: Robert Ancell <robert.ancell@canonical.com>
5  *          Michael Terry <michael.terry@canonical.com>
6  *
7  * This library is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Lesser General Public License as published by the Free
9  * Software Foundation; either version 2 or version 3 of the License.
10  * See http://www.gnu.org/copyleft/lgpl.html the full text of the license.
11  */
12
13 #ifndef COMMON_USER_LIST_H_
14 #define COMMON_USER_LIST_H_
15
16 #include <glib-object.h>
17 #include <sys/types.h>
18
19 G_BEGIN_DECLS
20
21 #define COMMON_TYPE_USER_LIST            (common_user_list_get_type())
22 #define COMMON_USER_LIST(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), COMMON_TYPE_USER_LIST, CommonUserList));
23 #define COMMON_USER_LIST_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), COMMON_TYPE_USER_LIST, CommonUserListClass))
24 #define COMMON_IS_USER_LIST(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COMMON_TYPE_USER_LIST))
25 #define COMMON_IS_USER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COMMON_TYPE_USER_LIST))
26 #define COMMON_USER_LIST_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), COMMON_TYPE_USER_LIST, CommonUserListClass))
27
28 #define COMMON_TYPE_USER            (common_user_get_type())
29 #define COMMON_USER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), COMMON_TYPE_USER, CommonUser));
30 #define COMMON_USER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), COMMON_TYPE_USER, CommonUserClass))
31 #define COMMON_IS_USER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COMMON_TYPE_USER))
32 #define COMMON_IS_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), COMMON_TYPE_USER))
33 #define COMMON_USER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), COMMON_TYPE_USER, CommonUserClass))
34
35 typedef struct
36 {
37     GObject parent_instance;
38 } CommonUser;
39
40 typedef struct
41 {
42     GObjectClass parent_class;
43
44     void (*changed)(CommonUser *user);
45 } CommonUserClass;
46
47 typedef struct
48 {
49     GObject parent_instance;
50 } CommonUserList;
51
52 typedef struct
53 {
54     GObjectClass parent_class;
55
56     void (*user_added)(CommonUserList *user_list, CommonUser *user);
57     void (*user_changed)(CommonUserList *user_list, CommonUser *user);
58     void (*user_removed)(CommonUserList *user_list, CommonUser *user);
59 } CommonUserListClass;
60
61 GType common_user_list_get_type (void);
62
63 GType common_user_get_type (void);
64
65 CommonUserList *common_user_list_get_instance (void);
66
67 gint common_user_list_get_length (CommonUserList *user_list);
68
69 CommonUser *common_user_list_get_user_by_name (CommonUserList *user_list, const gchar *username);
70
71 GList *common_user_list_get_users (CommonUserList *user_list);
72
73 const gchar *common_user_get_name (CommonUser *user);
74
75 const gchar *common_user_get_real_name (CommonUser *user);
76
77 const gchar *common_user_get_display_name (CommonUser *user);
78
79 const gchar *common_user_get_home_directory (CommonUser *user);
80
81 const gchar *common_user_get_shell (CommonUser *user);
82
83 const gchar *common_user_get_image (CommonUser *user);
84
85 const gchar *common_user_get_background (CommonUser *user);
86
87 const gchar *common_user_get_language (CommonUser *user);
88
89 void common_user_set_language (CommonUser *user, const gchar *language);
90
91 const gchar *common_user_get_layout (CommonUser *user);
92
93 const gchar * const *common_user_get_layouts (CommonUser *user);
94
95 const gchar *common_user_get_session (CommonUser *user);
96
97 void common_user_set_session (CommonUser *user, const gchar *session);
98
99 gboolean common_user_get_logged_in (CommonUser *user);
100
101 gboolean common_user_get_has_messages (CommonUser *user);
102
103 uid_t common_user_get_uid (CommonUser *user);
104
105 gid_t common_user_get_gid (CommonUser *user);
106
107 G_END_DECLS
108
109 #endif /* COMMON_USER_LIST_H_ */