1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
3
* Copyright (C) 2009-2010 Red Hat, Inc.
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 3 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
#ifndef __UM_USER_MANAGER__
22
#define __UM_USER_MANAGER__
24
#include <glib-object.h>
26
#include <dbus/dbus-glib.h>
32
#define UM_TYPE_USER_MANAGER (um_user_manager_get_type ())
33
#define UM_USER_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UM_TYPE_USER_MANAGER, UmUserManager))
34
#define UM_USER_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), UM_TYPE_USER_MANAGER, UmUserManagerClass))
35
#define UM_IS_USER_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UM_TYPE_USER_MANAGER))
36
#define UM_IS_USER_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), UM_TYPE_USER_MANAGER))
37
#define UM_USER_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), UM_TYPE_USER_MANAGER, UmUserManagerClass))
46
GHashTable *user_by_object_path;
47
GHashTable *user_by_name;
54
GObjectClass parent_class;
56
void (* users_loaded) (UmUserManager *user_managaer);
57
void (* user_added) (UmUserManager *user_manager,
59
void (* user_removed) (UmUserManager *user_manager,
61
void (* user_changed) (UmUserManager *user_manager,
67
UM_USER_MANAGER_ERROR_FAILED,
68
UM_USER_MANAGER_ERROR_USER_EXISTS,
69
UM_USER_MANAGER_ERROR_USER_DOES_NOT_EXIST,
70
UM_USER_MANAGER_ERROR_PERMISSION_DENIED
73
#define UM_USER_MANAGER_ERROR um_user_manager_error_quark ()
75
GQuark um_user_manager_error_quark (void);
77
GType um_user_manager_get_type (void);
79
UmUserManager * um_user_manager_ref_default (void);
81
gboolean um_user_manager_no_service (UmUserManager *manager);
83
GSList * um_user_manager_list_users (UmUserManager *manager);
84
UmUser * um_user_manager_get_user (UmUserManager *manager,
85
const char *user_name);
86
UmUser * um_user_manager_get_user_by_id (UmUserManager *manager,
89
void um_user_manager_create_user (UmUserManager *manager,
90
const char *user_name,
91
const char *real_name,
93
GAsyncReadyCallback done,
95
GDestroyNotify destroy);
96
gboolean um_user_manager_create_user_finish (UmUserManager *manager,
100
void um_user_manager_delete_user (UmUserManager *manager,
102
gboolean remove_files,
103
GAsyncReadyCallback done,
105
GDestroyNotify destroy);
106
gboolean um_user_manager_delete_user_finish (UmUserManager *manager,
107
GAsyncResult *result,
112
#endif /* __UM_USER_MANAGER__ */