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>
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.
13 #ifndef COMMON_USER_LIST_H_
14 #define COMMON_USER_LIST_H_
16 #include <glib-object.h>
17 #include <sys/types.h>
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))
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))
35 #define USER_LIST_SIGNAL_USER_ADDED "user-added"
36 #define USER_LIST_SIGNAL_USER_CHANGED "user-changed"
37 #define USER_LIST_SIGNAL_USER_REMOVED "user-removed"
39 #define USER_SIGNAL_CHANGED "changed"
43 GObject parent_instance;
48 GObjectClass parent_class;
50 void (*changed)(CommonUser *user);
55 GObject parent_instance;
60 GObjectClass parent_class;
62 void (*user_added)(CommonUserList *user_list, CommonUser *user);
63 void (*user_changed)(CommonUserList *user_list, CommonUser *user);
64 void (*user_removed)(CommonUserList *user_list, CommonUser *user);
65 } CommonUserListClass;
67 GType common_user_list_get_type (void);
69 GType common_user_get_type (void);
71 CommonUserList *common_user_list_get_instance (void);
73 void common_user_list_cleanup (void);
75 gint common_user_list_get_length (CommonUserList *user_list);
77 CommonUser *common_user_list_get_user_by_name (CommonUserList *user_list, const gchar *username);
79 GList *common_user_list_get_users (CommonUserList *user_list);
81 const gchar *common_user_get_name (CommonUser *user);
83 const gchar *common_user_get_real_name (CommonUser *user);
85 const gchar *common_user_get_display_name (CommonUser *user);
87 const gchar *common_user_get_home_directory (CommonUser *user);
89 const gchar *common_user_get_shell (CommonUser *user);
91 const gchar *common_user_get_image (CommonUser *user);
93 const gchar *common_user_get_background (CommonUser *user);
95 const gchar *common_user_get_language (CommonUser *user);
97 void common_user_set_language (CommonUser *user, const gchar *language);
99 const gchar *common_user_get_layout (CommonUser *user);
101 const gchar * const *common_user_get_layouts (CommonUser *user);
103 const gchar *common_user_get_session (CommonUser *user);
105 void common_user_set_session (CommonUser *user, const gchar *session);
107 gboolean common_user_get_logged_in (CommonUser *user);
109 gboolean common_user_get_has_messages (CommonUser *user);
111 uid_t common_user_get_uid (CommonUser *user);
113 gid_t common_user_get_gid (CommonUser *user);
117 #endif /* COMMON_USER_LIST_H_ */