polkitlocalauthority.h 8.36 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * Copyright (C) 2008 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: David Zeuthen <davidz@redhat.com>
 */

22 23
#if !defined (_POLKIT_LOCAL_COMPILATION) && !defined(_POLKIT_LOCAL_INSIDE_POLKIT_LOCAL_H)
#error "Only <polkitlocal/polkitlocal.h> can be included directly, this file may disappear or change contents."
24 25
#endif

26 27
#ifndef __POLKIT_LOCAL_AUTHORITY_H
#define __POLKIT_LOCAL_AUTHORITY_H
28 29 30

#include <glib-object.h>
#include <gio/gio.h>
31
#include <polkitlocal/polkitlocaltypes.h>
32

33 34
G_BEGIN_DECLS

35 36 37 38 39 40
#define POLKIT_TYPE_LOCAL_AUTHORITY          (polkit_local_authority_get_type())
#define POLKIT_LOCAL_AUTHORITY(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), POLKIT_TYPE_LOCAL_AUTHORITY, PolkitLocalAuthority))
#define POLKIT_LOCAL_AUTHORITY_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST((k), POLKIT_TYPE_LOCAL_AUTHORITY, PolkitLocalAuthorityClass))
#define POLKIT_LOCAL_AUTHORITY_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), POLKIT_TYPE_LOCAL_AUTHORITY, PolkitLocalAuthorityClass))
#define POLKIT_IS_LOCAL_AUTHORITY(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), POLKIT_TYPE_LOCAL_AUTHORITY))
#define POLKIT_IS_LOCAL_AUTHORITY_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), POLKIT_TYPE_LOCAL_AUTHORITY))
41 42

#if 0
43
typedef struct _PolkitLocalAuthority PolkitLocalAuthority;
44
#endif
45
typedef struct _PolkitLocalAuthorityClass PolkitLocalAuthorityClass;
46

47
GType         polkit_local_authority_get_type         (void) G_GNUC_CONST;
48

49
PolkitLocalAuthority *polkit_local_authority_get (void);
50 51 52

/* ---------------------------------------------------------------------------------------------------- */

53
GList  *polkit_local_authority_enumerate_users_sync (PolkitLocalAuthority *local_authority,
54 55 56
                                                                          GCancellable    *cancellable,
                                                                          GError         **error);

57
GList  *polkit_local_authority_enumerate_groups_sync (PolkitLocalAuthority *local_authority,
58 59 60
                                                        GCancellable           *cancellable,
                                                        GError               **error);

61
GList  *polkit_local_authority_enumerate_authorizations_sync (PolkitLocalAuthority  *local_authority,
62 63 64 65
                                                                PolkitIdentity          *identity,
                                                                GCancellable            *cancellable,
                                                                GError                 **error);

66
gboolean  polkit_local_authority_add_authorization_sync (PolkitLocalAuthority     *local_authority,
67
                                                           PolkitIdentity      *identity,
68
                                                           PolkitLocalAuthorization *authorization,
69 70 71
                                                           GCancellable        *cancellable,
                                                           GError             **error);

72
gboolean  polkit_local_authority_remove_authorization_sync (PolkitLocalAuthority     *local_authority,
73
                                                              PolkitIdentity      *identity,
74
                                                              PolkitLocalAuthorization *authorization,
75 76 77 78 79 80
                                                              GCancellable        *cancellable,
                                                              GError             **error);

/* ---------------------------------------------------------------------------------------------------- */


81
void                       polkit_local_authority_enumerate_users (PolkitLocalAuthority     *local_authority,
82 83 84 85
                                                             GCancellable        *cancellable,
                                                             GAsyncReadyCallback  callback,
                                                             gpointer             user_data);

86
GList *                    polkit_local_authority_enumerate_users_finish (PolkitLocalAuthority *local_authority,
87 88 89
                                                                    GAsyncResult    *res,
                                                                    GError         **error);

90
void                       polkit_local_authority_enumerate_groups (PolkitLocalAuthority     *local_authority,
91 92 93 94
                                                              GCancellable        *cancellable,
                                                              GAsyncReadyCallback  callback,
                                                              gpointer             user_data);

95
GList *                    polkit_local_authority_enumerate_groups_finish (PolkitLocalAuthority *local_authority,
96 97 98
                                                                     GAsyncResult    *res,
                                                                     GError         **error);

99
void                       polkit_local_authority_enumerate_authorizations (PolkitLocalAuthority     *local_authority,
100 101 102 103 104
                                                                      PolkitIdentity      *identity,
                                                                      GCancellable        *cancellable,
                                                                      GAsyncReadyCallback  callback,
                                                                      gpointer             user_data);

105
GList *                    polkit_local_authority_enumerate_authorizations_finish (PolkitLocalAuthority *local_authority,
106 107 108
                                                                             GAsyncResult    *res,
                                                                             GError         **error);

109
void                       polkit_local_authority_add_authorization (PolkitLocalAuthority     *local_authority,
110
                                                               PolkitIdentity      *identity,
111
                                                               PolkitLocalAuthorization *authorization,
112 113 114 115
                                                               GCancellable        *cancellable,
                                                               GAsyncReadyCallback  callback,
                                                               gpointer             user_data);

116
gboolean                   polkit_local_authority_add_authorization_finish (PolkitLocalAuthority *local_authority,
117 118 119
                                                                      GAsyncResult    *res,
                                                                      GError         **error);

120
void                       polkit_local_authority_remove_authorization (PolkitLocalAuthority     *local_authority,
121
                                                                  PolkitIdentity      *identity,
122
                                                                  PolkitLocalAuthorization *authorization,
123 124 125 126
                                                                  GCancellable        *cancellable,
                                                                  GAsyncReadyCallback  callback,
                                                                  gpointer             user_data);

127
gboolean                   polkit_local_authority_remove_authorization_finish (PolkitLocalAuthority *local_authority,
128 129 130 131 132 133 134
                                                                         GAsyncResult    *res,
                                                                         GError         **error);

/* ---------------------------------------------------------------------------------------------------- */

G_END_DECLS

135
#endif /* __POLKIT_LOCAL_AUTHORITY_H */