Back to index

lightdm  1.3.2
session.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010-2011 Robert Ancell.
00003  * Author: Robert Ancell <robert.ancell@canonical.com>
00004  * 
00005  * This program is free software: you can redistribute it and/or modify it under
00006  * the terms of the GNU General Public License as published by the Free Software
00007  * Foundation, either version 3 of the License, or (at your option) any later
00008  * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
00009  * license.
00010  */
00011 
00012 #ifndef _SESSION_H_
00013 #define _SESSION_H_
00014 
00015 #include <glib-object.h>
00016 
00017 #include <security/pam_appl.h>
00018 
00019 #include "accounts.h"
00020 #include "xauthority.h"
00021 
00022 G_BEGIN_DECLS
00023 
00024 #define SESSION_TYPE           (session_get_type())
00025 #define SESSION(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), SESSION_TYPE, Session))
00026 #define SESSION_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), SESSION_TYPE, SessionClass))
00027 #define SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SESSION_TYPE, SessionClass))
00028 
00029 typedef struct SessionPrivate SessionPrivate;
00030 
00031 typedef struct
00032 {
00033     GObject         parent_instance;
00034     SessionPrivate *priv;
00035 } Session;
00036 
00037 typedef struct
00038 {
00039     GObjectClass parent_class;
00040 
00041     void (*got_messages)(Session *session);
00042     void (*authentication_complete)(Session *session);
00043     void (*stopped)(Session *session);
00044 } SessionClass;
00045 
00046 #define XDG_SESSION_CLASS_USER        "user"
00047 #define XDG_SESSION_CLASS_GREETER     "greeter"
00048 #define XDG_SESSION_CLASS_LOCK_SCREEN "lock-screen"
00049 
00050 GType session_get_type (void);
00051 
00052 void session_set_log_file (Session *session, const gchar *filename);
00053 
00054 void session_set_class (Session *session, const gchar *class);
00055 
00056 void session_set_tty (Session *session, const gchar *tty);
00057 
00058 void session_set_xdisplay (Session *session, const gchar *xdisplay);
00059 
00060 void session_set_xauthority (Session *session, XAuthority *authority, gboolean use_system_location);
00061 
00062 void session_set_remote_host_name (Session *session, const gchar *remote_host_name);
00063 
00064 void session_set_env (Session *session, const gchar *name, const gchar *value);
00065 
00066 // FIXME: Remove
00067 User *session_get_user (Session *session);
00068 
00069 gboolean session_start (Session *session, const gchar *service, const gchar *username, gboolean do_authenticate, gboolean is_interactive);
00070 
00071 const gchar *session_get_username (Session *session);
00072 
00073 const gchar *session_get_console_kit_cookie (Session *session);
00074 
00075 void session_respond (Session *session, struct pam_response *response);
00076 
00077 void session_respond_error (Session *session, int error);
00078 
00079 int session_get_messages_length (Session *session);
00080 
00081 const struct pam_message *session_get_messages (Session *session);
00082 
00083 gboolean session_get_is_authenticated (Session *session);
00084 
00085 int session_get_authentication_result (Session *session);
00086 
00087 const gchar *session_get_authentication_result_string (Session *session);
00088 
00089 void session_run (Session *session, gchar **argv);
00090 
00091 void session_lock (Session *session);
00092 
00093 void session_unlock (Session *session);
00094 
00095 void session_stop (Session *session);
00096 
00097 gboolean session_get_is_stopped (Session *session);
00098 
00099 G_END_DECLS
00100 
00101 #endif /* _SESSION_H_ */