1 /* gdm-session-auditor.h - Object for auditing session login/logout
2  *
3  * Copyright (C) 2004, 2008 Sun Microsystems, Inc.
4  * Copyright (C) 2005, 2008 Red Hat, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  *
21  * Written by: Brian A. Cameron <Brian.Cameron@sun.com>
22  *             Gary Winiger <Gary.Winiger@sun.com>
23  *             Ray Strode <rstrode@redhat.com>
24  *             Steve Grubb <sgrubb@redhat.com>
25  */
26 #ifndef GDM_SESSION_AUDITOR_H
27 #define GDM_SESSION_AUDITOR_H
28 
29 #include <glib.h>
30 #include <glib-object.h>
31 
32 G_BEGIN_DECLS
33 #define GDM_TYPE_SESSION_AUDITOR (gdm_session_auditor_get_type ())
34 #define GDM_SESSION_AUDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDM_TYPE_SESSION_AUDITOR, GdmSessionAuditor))
35 #define GDM_SESSION_AUDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDM_TYPE_SESSION_AUDITOR, GdmSessionAuditorClass))
36 #define GDM_IS_SESSION_AUDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDM_TYPE_SESSION_AUDITOR))
37 #define GDM_IS_SESSION_AUDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDM_TYPE_SESSION_AUDITOR))
38 #define GDM_SESSION_AUDITOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GDM_TYPE_SESSION_AUDITOR, GdmSessionAuditorClass))
39 #define GDM_SESSION_AUDITOR_ERROR (gdm_session_auditor_error_quark ())
40 typedef struct _GdmSessionAuditor GdmSessionAuditor;
41 typedef struct _GdmSessionAuditorClass GdmSessionAuditorClass;
42 typedef struct _GdmSessionAuditorPrivate GdmSessionAuditorPrivate;
43 
44 struct _GdmSessionAuditor
45 {
46         GObject                   parent;
47 
48         /*< private > */
49         GdmSessionAuditorPrivate *priv;
50 };
51 
52 struct _GdmSessionAuditorClass
53 {
54         GObjectClass        parent_class;
55 
56         void               (* report_password_changed)        (GdmSessionAuditor *auditor);
57         void               (* report_password_change_failure) (GdmSessionAuditor *auditor);
58         void               (* report_user_accredited)         (GdmSessionAuditor *auditor);
59         void               (* report_login)                   (GdmSessionAuditor *auditor);
60         void               (* report_login_failure)           (GdmSessionAuditor *auditor,
61                                                                int                error_code,
62                                                                const char        *error_message);
63         void               (* report_logout)                  (GdmSessionAuditor *auditor);
64 };
65 
66 GType                     gdm_session_auditor_get_type           (void);
67 GdmSessionAuditor        *gdm_session_auditor_new                (const char *hostname,
68                                                                   const char *display_device);
69 void                      gdm_session_auditor_set_username (GdmSessionAuditor *auditor,
70                                                             const char        *username);
71 void                      gdm_session_auditor_report_password_changed (GdmSessionAuditor *auditor);
72 void                      gdm_session_auditor_report_password_change_failure (GdmSessionAuditor *auditor);
73 void                      gdm_session_auditor_report_user_accredited (GdmSessionAuditor *auditor);
74 void                      gdm_session_auditor_report_login (GdmSessionAuditor *auditor);
75 void                      gdm_session_auditor_report_login_failure (GdmSessionAuditor *auditor,
76                                                                     int                error_code,
77                                                                     const char        *error_message);
78 void                      gdm_session_auditor_report_logout (GdmSessionAuditor *auditor);
79 
80 G_END_DECLS
81 #endif /* GDM_SESSION_AUDITOR_H */
82