gdm-display.h 6.8 KB
Newer Older
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 19 20 21 22 23 24 25
 *
 */


#ifndef __GDM_DISPLAY_H
#define __GDM_DISPLAY_H

#include <glib-object.h>
26
#include <gio/gio.h>
27 28 29

G_BEGIN_DECLS

30 31
#define GDM_TYPE_DISPLAY (gdm_display_get_type ())
G_DECLARE_DERIVABLE_TYPE (GdmDisplay, gdm_display, GDM, DISPLAY, GObject)
32 33

typedef enum {
34
        GDM_DISPLAY_UNMANAGED = 0,
35
        GDM_DISPLAY_PREPARED,
36
        GDM_DISPLAY_MANAGED,
37
        GDM_DISPLAY_WAITING_TO_FINISH,
38 39
        GDM_DISPLAY_FINISHED,
        GDM_DISPLAY_FAILED,
40 41
} GdmDisplayStatus;

42
struct _GdmDisplayClass
43
{
44 45 46
        GObjectClass   parent_class;

        /* methods */
47 48
        gboolean (*prepare) (GdmDisplay *display);
        void     (*manage)  (GdmDisplay *self);
49
};
50 51 52

typedef enum
{
53
         GDM_DISPLAY_ERROR_GENERAL,
54 55
         GDM_DISPLAY_ERROR_GETTING_USER_INFO,
         GDM_DISPLAY_ERROR_GETTING_SESSION_INFO,
56 57 58 59
} GdmDisplayError;

#define GDM_DISPLAY_ERROR gdm_display_error_quark ()

60
GQuark              gdm_display_error_quark                    (void);
61 62 63

int                 gdm_display_get_status                     (GdmDisplay *display);
time_t              gdm_display_get_creation_time              (GdmDisplay *display);
64
char *              gdm_display_open_session_sync              (GdmDisplay    *display,
65 66
                                                                GPid           pid_of_caller,
                                                                uid_t          uid_of_caller,
67 68
                                                                GCancellable  *cancellable,
                                                                GError       **error);
69 70 71 72 73 74 75

char *              gdm_display_open_reauthentication_channel_sync        (GdmDisplay    *display,
                                                                           const char    *username,
                                                                           GPid           pid_of_caller,
                                                                           uid_t          uid_of_caller,
                                                                           GCancellable  *cancellable,
                                                                           GError       **error);
76
const char *        gdm_display_get_session_id                 (GdmDisplay *display);
77
gboolean            gdm_display_create_authority               (GdmDisplay *display);
78
gboolean            gdm_display_prepare                        (GdmDisplay *display);
79
gboolean            gdm_display_manage                         (GdmDisplay *display);
80
gboolean            gdm_display_finish                         (GdmDisplay *display);
81 82
gboolean            gdm_display_unmanage                       (GdmDisplay *display);

83
GDBusObjectSkeleton *gdm_display_get_object_skeleton           (GdmDisplay *display);
84 85 86

/* exported to bus */
gboolean            gdm_display_get_id                         (GdmDisplay *display,
87 88
                                                                char      **id,
                                                                GError    **error);
89
gboolean            gdm_display_get_remote_hostname            (GdmDisplay *display,
90 91
                                                                char      **hostname,
                                                                GError    **error);
92
gboolean            gdm_display_get_x11_display_number         (GdmDisplay *display,
93 94
                                                                int        *number,
                                                                GError    **error);
95
gboolean            gdm_display_get_x11_display_name           (GdmDisplay *display,
96 97
                                                                char      **x11_display,
                                                                GError    **error);
98 99 100
gboolean            gdm_display_get_seat_id                    (GdmDisplay *display,
                                                                char      **seat_id,
                                                                GError    **error);
101
gboolean            gdm_display_is_local                       (GdmDisplay *display,
102 103
                                                                gboolean   *local,
                                                                GError    **error);
104 105 106
gboolean            gdm_display_is_initial                     (GdmDisplay  *display,
                                                                gboolean    *initial,
                                                                GError     **error);
107

108 109 110 111
gboolean            gdm_display_get_x11_cookie                 (GdmDisplay  *display,
                                                                const char **x11_cookie,
                                                                gsize       *x11_cookie_size,
                                                                GError     **error);
112
gboolean            gdm_display_get_x11_authority_file         (GdmDisplay *display,
113 114
                                                                char      **filename,
                                                                GError    **error);
115
gboolean            gdm_display_add_user_authorization         (GdmDisplay *display,
116 117 118
                                                                const char *username,
                                                                char      **filename,
                                                                GError    **error);
119
gboolean            gdm_display_remove_user_authorization      (GdmDisplay *display,
120 121
                                                                const char *username,
                                                                GError    **error);
122 123
void                gdm_display_start_greeter_session          (GdmDisplay  *display);
void                gdm_display_stop_greeter_session           (GdmDisplay  *display);
124

125 126
gboolean            gdm_display_connect                        (GdmDisplay *self);

127 128 129
G_END_DECLS

#endif /* __GDM_DISPLAY_H */