2009-02-04 13:45:38 -05:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-10-07 16:59:03 -04:00
|
|
|
#ifndef __GDM_USER_MANAGER_H__
|
|
|
|
#define __GDM_USER_MANAGER_H__
|
2009-02-04 13:45:38 -05:00
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
|
|
|
#include "gdm-user.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GDM_TYPE_USER_MANAGER (gdm_user_manager_get_type ())
|
|
|
|
#define GDM_USER_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_USER_MANAGER, GdmUserManager))
|
|
|
|
#define GDM_USER_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_USER_MANAGER, GdmUserManagerClass))
|
|
|
|
#define GDM_IS_USER_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_USER_MANAGER))
|
|
|
|
#define GDM_IS_USER_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_USER_MANAGER))
|
|
|
|
#define GDM_USER_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_USER_MANAGER, GdmUserManagerClass))
|
|
|
|
|
|
|
|
typedef struct GdmUserManagerPrivate GdmUserManagerPrivate;
|
2010-10-07 16:59:03 -04:00
|
|
|
typedef struct GdmUserManager GdmUserManager;
|
|
|
|
typedef struct GdmUserManagerClass GdmUserManagerClass;
|
|
|
|
typedef enum GdmUserManagerError GdmUserManagerError;
|
2009-02-04 13:45:38 -05:00
|
|
|
|
2010-10-07 16:59:03 -04:00
|
|
|
struct GdmUserManager
|
2009-02-04 13:45:38 -05:00
|
|
|
{
|
|
|
|
GObject parent;
|
|
|
|
GdmUserManagerPrivate *priv;
|
2010-10-07 16:59:03 -04:00
|
|
|
};
|
2009-02-04 13:45:38 -05:00
|
|
|
|
2010-10-07 16:59:03 -04:00
|
|
|
struct GdmUserManagerClass
|
2009-02-04 13:45:38 -05:00
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
void (* user_added) (GdmUserManager *user_manager,
|
|
|
|
GdmUser *user);
|
|
|
|
void (* user_removed) (GdmUserManager *user_manager,
|
|
|
|
GdmUser *user);
|
|
|
|
void (* user_is_logged_in_changed) (GdmUserManager *user_manager,
|
|
|
|
GdmUser *user);
|
2010-10-07 16:59:03 -04:00
|
|
|
void (* user_changed) (GdmUserManager *user_manager,
|
|
|
|
GdmUser *user);
|
|
|
|
};
|
2009-02-04 13:45:38 -05:00
|
|
|
|
2010-10-07 16:59:03 -04:00
|
|
|
enum GdmUserManagerError
|
2009-02-04 13:45:38 -05:00
|
|
|
{
|
|
|
|
GDM_USER_MANAGER_ERROR_GENERAL,
|
|
|
|
GDM_USER_MANAGER_ERROR_KEY_NOT_FOUND
|
2010-10-07 16:59:03 -04:00
|
|
|
};
|
2009-02-04 13:45:38 -05:00
|
|
|
|
|
|
|
#define GDM_USER_MANAGER_ERROR gdm_user_manager_error_quark ()
|
|
|
|
|
|
|
|
GQuark gdm_user_manager_error_quark (void);
|
|
|
|
GType gdm_user_manager_get_type (void);
|
|
|
|
|
|
|
|
GdmUserManager * gdm_user_manager_ref_default (void);
|
|
|
|
|
2010-10-07 16:59:03 -04:00
|
|
|
void gdm_user_manager_queue_load (GdmUserManager *manager);
|
2009-02-04 13:45:38 -05:00
|
|
|
GSList * gdm_user_manager_list_users (GdmUserManager *manager);
|
|
|
|
GdmUser * gdm_user_manager_get_user (GdmUserManager *manager,
|
2010-09-14 20:56:34 -04:00
|
|
|
const char *username);
|
2009-02-04 13:45:38 -05:00
|
|
|
GdmUser * gdm_user_manager_get_user_by_uid (GdmUserManager *manager,
|
2009-11-10 12:12:27 -05:00
|
|
|
gulong uid);
|
2009-02-04 13:45:38 -05:00
|
|
|
|
|
|
|
gboolean gdm_user_manager_activate_user_session (GdmUserManager *manager,
|
|
|
|
GdmUser *user);
|
|
|
|
|
2010-10-07 16:59:03 -04:00
|
|
|
gboolean gdm_user_manager_can_switch (GdmUserManager *manager);
|
|
|
|
|
2009-02-04 13:45:38 -05:00
|
|
|
gboolean gdm_user_manager_goto_login_session (GdmUserManager *manager);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GDM_USER_MANAGER_H */
|