1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
3
* Copyright 2012 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 2 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.
19
* Written by: Stef Walter <stefw@gnome.org>
22
#ifndef __UM_REALM_MANAGER_H__
23
#define __UM_REALM_MANAGER_H__
25
#include "um-realm-generated.h"
30
UM_REALM_ERROR_BAD_LOGIN,
31
UM_REALM_ERROR_BAD_PASSWORD,
32
UM_REALM_ERROR_GENERIC,
35
#define UM_REALM_ERROR (um_realm_error_get_quark ())
37
GQuark um_realm_error_get_quark (void) G_GNUC_CONST;
39
#define UM_TYPE_REALM_MANAGER (um_realm_manager_get_type ())
40
#define UM_REALM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UM_TYPE_REALM_MANAGER, UmRealmManager))
41
#define UM_IS_REALM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UM_TYPE_REALM_MANAGER))
43
typedef struct _UmRealmManager UmRealmManager;
45
GType um_realm_manager_get_type (void) G_GNUC_CONST;
47
void um_realm_manager_new (GCancellable *cancellable,
48
GAsyncReadyCallback callback,
51
UmRealmManager * um_realm_manager_new_finish (GAsyncResult *result,
54
void um_realm_manager_discover (UmRealmManager *self,
56
GCancellable *cancellable,
57
GAsyncReadyCallback callback,
60
GList * um_realm_manager_discover_finish (UmRealmManager *self,
64
GList * um_realm_manager_get_realms (UmRealmManager *self);
66
void um_realm_login (UmRealmObject *realm,
68
const gchar *password,
69
GCancellable *cancellable,
70
GAsyncReadyCallback callback,
73
gboolean um_realm_login_finish (GAsyncResult *result,
77
gboolean um_realm_join_as_user (UmRealmObject *realm,
79
const gchar *password,
81
GCancellable *cancellable,
82
GAsyncReadyCallback callback,
84
G_GNUC_WARN_UNUSED_RESULT;
86
gboolean um_realm_join_as_admin (UmRealmObject *realm,
88
const gchar *password,
90
GCancellable *cancellable,
91
GAsyncReadyCallback callback,
93
G_GNUC_WARN_UNUSED_RESULT;
95
gboolean um_realm_join_finish (UmRealmObject *realm,
99
gboolean um_realm_is_configured (UmRealmObject *realm);
101
gchar * um_realm_calculate_login (UmRealmCommon *realm,
102
const gchar *username);
106
#endif /* __UM_REALM_H__ */