2 * Copyright (C) 2013,2014 Jens Georg <mail@jensge.org>
4 * Author: Jens Georg <mail@jensge.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef __GUPNP_ACL_H__
23 #define __GUPNP_ACL_H__
26 #include <glib-object.h>
27 #include <libsoup/soup-session.h>
32 gupnp_acl_get_type (void) G_GNUC_CONST;
34 #define GUPNP_TYPE_ACL (gupnp_acl_get_type())
36 #define GUPNP_ACL(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
41 #define GUPNP_IS_ACL(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
45 #define GUPNP_ACL_GET_INTERFACE(obj) \
46 (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
47 GUPNP_TYPE_ACL, GUPnPAclInterface))
52 * Handle to an object implementing the #GUPnPAclInterface interface.
54 typedef struct _GUPnPAcl GUPnPAcl;
58 * @parent: The parent interface.
59 * @is_allowed: Check whether access to the resource is granted.
60 * @is_allowed_async: Asynchronously check whether the access is granted.
61 * @is_allowed_finish: Conclude the @is_allowed_async operation.
62 * @can_sync: Whether the ACL can do sync queries.
64 * Implement a simple access control list for GUPnP.
68 typedef struct _GUPnPAclInterface GUPnPAclInterface;
70 /* Forward declarations to avoid recursive includes */
71 typedef struct _GUPnPDevice GUPnPDevice;
72 typedef struct _GUPnPService GUPnPService;
74 struct _GUPnPAclInterface {
75 GTypeInterface parent;
77 gboolean (*is_allowed) (GUPnPAcl *self,
79 GUPnPService *service,
84 void (*is_allowed_async) (GUPnPAcl *self,
86 GUPnPService *service,
90 GCancellable *cancellable,
91 GAsyncReadyCallback callback,
94 gboolean (*is_allowed_finish) (GUPnPAcl *self,
98 gboolean (*can_sync) (GUPnPAcl *self);
103 void (* _gupnp_reserved1) (void);
104 void (* _gupnp_reserved2) (void);
105 void (* _gupnp_reserved3) (void);
106 void (* _gupnp_reserved4) (void);
110 gupnp_acl_is_allowed (GUPnPAcl *self,
112 GUPnPService *service,
118 gupnp_acl_is_allowed_async (GUPnPAcl *self,
120 GUPnPService *service,
124 GCancellable *cancellable,
125 GAsyncReadyCallback callback,
129 gupnp_acl_is_allowed_finish (GUPnPAcl *self,
134 gupnp_acl_can_sync (GUPnPAcl *self);