Debian Codegraph @

src/polkit/polkitauthority.h

raw
1 /*
2 * Copyright (C) 2008 Red Hat, Inc.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General
15 * Public License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17 * Boston, MA 02111-1307, USA.
18 *
19 * Author: David Zeuthen <[email protected]>
20 */
21
22 #if !defined (_POLKIT_COMPILATION) && !defined(_POLKIT_INSIDE_POLKIT_H)
23 #error "Only <polkit/polkit.h> can be included directly, this file may disappear or change contents."
24 #endif
25
26 #ifndef __POLKIT_AUTHORITY_H
27 #define __POLKIT_AUTHORITY_H
28
29 #include <glib-object.h>
30 #include <gio/gio.h>
31 #include <polkit/polkittypes.h>
32 #include <polkit/polkitauthorityfeatures.h>
33
34 G_BEGIN_DECLS
35
36 #define POLKIT_TYPE_AUTHORITY (polkit_authority_get_type())
37 #define POLKIT_AUTHORITY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), POLKIT_TYPE_AUTHORITY, PolkitAuthority))
38 #define POLKIT_AUTHORITY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), POLKIT_TYPE_AUTHORITY, PolkitAuthorityClass))
39 #define POLKIT_AUTHORITY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), POLKIT_TYPE_AUTHORITY, PolkitAuthorityClass))
40 #define POLKIT_IS_AUTHORITY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), POLKIT_TYPE_AUTHORITY))
41 #define POLKIT_IS_AUTHORITY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), POLKIT_TYPE_AUTHORITY))
42
43 #if 0
44 typedef struct _PolkitAuthority PolkitAuthority;
45 #endif
46 typedef struct _PolkitAuthorityClass PolkitAuthorityClass;
47
48 GType polkit_authority_get_type (void) G_GNUC_CONST;
49
50 PolkitAuthority *polkit_authority_get (void) G_GNUC_DEPRECATED_FOR (polkit_authority_get_sync);
51
52 void polkit_authority_get_async (GCancellable *cancellable,
53 GAsyncReadyCallback callback,
54 gpointer user_data);
55 PolkitAuthority *polkit_authority_get_finish (GAsyncResult *res,
56 GError **error);
57 PolkitAuthority *polkit_authority_get_sync (GCancellable *cancellable,
58 GError **error);
59
60 gchar *polkit_authority_get_owner (PolkitAuthority *authority);
61 const gchar *polkit_authority_get_backend_name (PolkitAuthority *authority);
62 const gchar *polkit_authority_get_backend_version (PolkitAuthority *authority);
63 PolkitAuthorityFeatures polkit_authority_get_backend_features (PolkitAuthority *authority);
64
65 /* ---------------------------------------------------------------------------------------------------- */
66
67 GList *polkit_authority_enumerate_actions_sync (PolkitAuthority *authority,
68 GCancellable *cancellable,
69 GError **error);
70
71 PolkitAuthorizationResult *polkit_authority_check_authorization_sync (PolkitAuthority *authority,
72 PolkitSubject *subject,
73 const gchar *action_id,
74 PolkitDetails *details,
75 PolkitCheckAuthorizationFlags flags,
76 GCancellable *cancellable,
77 GError **error);
78
79 gboolean polkit_authority_register_authentication_agent_sync (PolkitAuthority *authority,
80 PolkitSubject *subject,
81 const gchar *locale,
82 const gchar *object_path,
83 GCancellable *cancellable,
84 GError **error);
85
86 gboolean polkit_authority_register_authentication_agent_with_options_sync (PolkitAuthority *authority,
87 PolkitSubject *subject,
88 const gchar *locale,
89 const gchar *object_path,
90 GVariant *options,
91 GCancellable *cancellable,
92 GError **error);
93
94 gboolean polkit_authority_unregister_authentication_agent_sync (PolkitAuthority *authority,
95 PolkitSubject *subject,
96 const gchar *object_path,
97 GCancellable *cancellable,
98 GError **error);
99
100 gboolean polkit_authority_authentication_agent_response_sync (PolkitAuthority *authority,
101 const gchar *cookie,
102 PolkitIdentity *identity,
103 GCancellable *cancellable,
104 GError **error);
105
106 gboolean polkit_authority_authentication_agent_response_with_subject_sync (PolkitAuthority *authority,
107 const gchar *cookie,
108 PolkitIdentity *identity,
109 PolkitSubject *subject,
110 GCancellable *cancellable,
111 GError **error);
112
113 GList *polkit_authority_enumerate_temporary_authorizations_sync (PolkitAuthority *authority,
114 PolkitSubject *subject,
115 GCancellable *cancellable,
116 GError **error);
117
118 gboolean polkit_authority_revoke_temporary_authorizations_sync (PolkitAuthority *authority,
119 PolkitSubject *subject,
120 GCancellable *cancellable,
121 GError **error);
122
123 gboolean polkit_authority_revoke_temporary_authorization_by_id_sync (PolkitAuthority *authority,
124 const gchar *id,
125 GCancellable *cancellable,
126 GError **error);
127
128 /* ---------------------------------------------------------------------------------------------------- */
129
130 void polkit_authority_enumerate_actions (PolkitAuthority *authority,
131 GCancellable *cancellable,
132 GAsyncReadyCallback callback,
133 gpointer user_data);
134
135 GList * polkit_authority_enumerate_actions_finish (PolkitAuthority *authority,
136 GAsyncResult *res,
137 GError **error);
138
139 void polkit_authority_check_authorization (PolkitAuthority *authority,
140 PolkitSubject *subject,
141 const gchar *action_id,
142 PolkitDetails *details,
143 PolkitCheckAuthorizationFlags flags,
144 GCancellable *cancellable,
145 GAsyncReadyCallback callback,
146 gpointer user_data);
147
148 PolkitAuthorizationResult *polkit_authority_check_authorization_finish (PolkitAuthority *authority,
149 GAsyncResult *res,
150 GError **error);
151
152 void polkit_authority_register_authentication_agent (PolkitAuthority *authority,
153 PolkitSubject *subject,
154 const gchar *locale,
155 const gchar *object_path,
156 GCancellable *cancellable,
157 GAsyncReadyCallback callback,
158 gpointer user_data);
159
160
161 gboolean polkit_authority_register_authentication_agent_finish (PolkitAuthority *authority,
162 GAsyncResult *res,
163 GError **error);
164
165 gboolean polkit_authority_register_authentication_agent_with_options_finish (PolkitAuthority *authority,
166 GAsyncResult *res,
167 GError **error);
168
169 void polkit_authority_register_authentication_agent_with_options (PolkitAuthority *authority,
170 PolkitSubject *subject,
171 const gchar *locale,
172 const gchar *object_path,
173 GVariant *options,
174 GCancellable *cancellable,
175 GAsyncReadyCallback callback,
176 gpointer user_data);
177
178 void polkit_authority_unregister_authentication_agent (PolkitAuthority *authority,
179 PolkitSubject *subject,
180 const gchar *object_path,
181 GCancellable *cancellable,
182 GAsyncReadyCallback callback,
183 gpointer user_data);
184
185 gboolean polkit_authority_unregister_authentication_agent_finish (PolkitAuthority *authority,
186 GAsyncResult *res,
187 GError **error);
188
189 void polkit_authority_authentication_agent_response (PolkitAuthority *authority,
190 const gchar *cookie,
191 PolkitIdentity *identity,
192 GCancellable *cancellable,
193 GAsyncReadyCallback callback,
194 gpointer user_data);
195
196 void polkit_authority_authentication_agent_response_with_subject (PolkitAuthority *authority,
197 const gchar *cookie,
198 PolkitIdentity *identity,
199 PolkitSubject *subject,
200 GCancellable *cancellable,
201 GAsyncReadyCallback callback,
202 gpointer user_data);
203
204 gboolean polkit_authority_authentication_agent_response_finish (PolkitAuthority *authority,
205 GAsyncResult *res,
206 GError **error);
207
208 void polkit_authority_enumerate_temporary_authorizations (PolkitAuthority *authority,
209 PolkitSubject *subject,
210 GCancellable *cancellable,
211 GAsyncReadyCallback callback,
212 gpointer user_data);
213
214 GList *polkit_authority_enumerate_temporary_authorizations_finish (PolkitAuthority *authority,
215 GAsyncResult *res,
216 GError **error);
217
218 void polkit_authority_revoke_temporary_authorizations (PolkitAuthority *authority,
219 PolkitSubject *subject,
220 GCancellable *cancellable,
221 GAsyncReadyCallback callback,
222 gpointer user_data);
223
224 gboolean polkit_authority_revoke_temporary_authorizations_finish (PolkitAuthority *authority,
225 GAsyncResult *res,
226 GError **error);
227
228 void polkit_authority_revoke_temporary_authorization_by_id (PolkitAuthority *authority,
229 const gchar *id,
230 GCancellable *cancellable,
231 GAsyncReadyCallback callback,
232 gpointer user_data);
233
234 gboolean polkit_authority_revoke_temporary_authorization_by_id_finish (PolkitAuthority *authority,
235 GAsyncResult *res,
236 GError **error);
237
238 /* ---------------------------------------------------------------------------------------------------- */
239
240 G_END_DECLS
241
242 #endif /* __POLKIT_AUTHORITY_H */