2 * Copyright (C) 2010-2011 Robert Ancell.
3 * Author: Robert Ancell <robert.ancell@canonical.com>
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
15 #include <glib-object.h>
17 #include <security/pam_appl.h>
19 typedef struct Session Session;
21 #include "display-server.h"
23 #include "x-authority.h"
28 #define SESSION_TYPE (session_get_type())
29 #define SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SESSION_TYPE, Session))
30 #define SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SESSION_TYPE, SessionClass))
31 #define SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SESSION_TYPE, SessionClass))
33 typedef struct SessionPrivate SessionPrivate;
37 GObject parent_instance;
43 GObjectClass parent_class;
45 gboolean (*start)(Session *session);
46 void (*run)(Session *session);
47 void (*stop)(Session *session);
49 void (*got_messages)(Session *session);
50 void (*authentication_complete)(Session *session);
51 void (*stopped)(Session *session);
60 GType session_get_type (void);
62 Session *session_new (void);
64 void session_set_session_type (Session *session, const gchar *session_type);
66 const gchar *session_get_session_type (Session *session);
68 void session_set_pam_service (Session *session, const gchar *pam_service);
70 void session_set_username (Session *session, const gchar *username);
72 void session_set_do_authenticate (Session *session, gboolean do_authenticate);
74 void session_set_is_interactive (Session *session, gboolean is_interactive);
76 void session_set_is_guest (Session *session, gboolean is_guest);
78 gboolean session_get_is_guest (Session *session);
80 void session_set_log_file (Session *session, const gchar *filename);
82 void session_set_display_server (Session *session, DisplayServer *display_server);
84 DisplayServer *session_get_display_server (Session *session);
86 void session_set_tty (Session *session, const gchar *tty);
88 void session_set_xdisplay (Session *session, const gchar *xdisplay);
90 void session_set_x_authority (Session *session, XAuthority *authority, gboolean use_system_location);
92 void session_set_remote_host_name (Session *session, const gchar *remote_host_name);
94 void session_set_env (Session *session, const gchar *name, const gchar *value);
96 const gchar *session_get_env (Session *session, const gchar *name);
98 void session_unset_env (Session *session, const gchar *name);
100 void session_set_argv (Session *session, gchar **argv);
103 User *session_get_user (Session *session);
105 gboolean session_start (Session *session);
107 gboolean session_get_is_started (Session *session);
109 const gchar *session_get_username (Session *session);
111 const gchar *session_get_console_kit_cookie (Session *session);
113 void session_respond (Session *session, struct pam_response *response);
115 void session_respond_error (Session *session, int error);
117 int session_get_messages_length (Session *session);
119 const struct pam_message *session_get_messages (Session *session);
121 gboolean session_get_is_authenticated (Session *session);
123 int session_get_authentication_result (Session *session);
125 const gchar *session_get_authentication_result_string (Session *session);
127 void session_run (Session *session);
129 void session_lock (Session *session);
131 void session_unlock (Session *session);
133 void session_stop (Session *session);
135 gboolean session_get_is_stopping (Session *session);
139 #endif /* SESSION_H_ */