Commit d5a8a9bd authored by David Zeuthen's avatar David Zeuthen

turn PolkitActionDescription into an user defined struct

Now to port the XML parser and land it in polkitbackend so backends
can easily implement EnumerateActions().
parent c63cccdf
......@@ -5,9 +5,32 @@
<!-- User defined struct for Subjects -->
<annotation name="org.gtk.EggDBus.DeclareStruct" value="Subject">
<annotation name="org.gtk.EggDBus.Struct.Signature" value="(sa{sv})"/>
<!-- element 0: string: the subject type; known values: "unix-user", "unix-group", "unix-process" -->
<!-- element 1: map<string,any>: key/value pairs depending on the subject type -->
<!-- TODO: document values in hash table for each subject type-->
</annotation>
<!-- The error domain used for reporting erros -->
<!-- User defined struct for ActionDescription -->
<annotation name="org.gtk.EggDBus.DeclareStruct" value="ActionDescription">
<annotation name="org.gtk.EggDBus.Struct.Signature" value="(ssssssa{ss})"/>
<!-- element 0: string: action-id -->
<!-- element 1: string: description -->
<!-- element 2: string: message -->
<!-- element 3: string: vendor name -->
<!-- element 4: string: vendor url -->
<!-- element 5: string: icon name -->
<!-- element 6: map<string,string>: annotations -->
<!-- TODO: also include defaults -->
</annotation>
<!-- The error domain used for reporting errors -->
<annotation name="org.gtk.EggDBus.DeclareErrorDomain" value="Error">
<annotation name="org.gtk.EggDBus.ErrorDomain.Member" value="org.freedesktop.PolicyKit1.Error.Failed">
<annotation name="org.gtk.EggDBus.DocString" value="The operation failed"/>
......@@ -17,7 +40,7 @@
</annotation>
</annotation>
<!-- An enumeration for -->
<!-- An enumeration for results of CheckClaim() (TODO: implement this method) -->
<annotation name="org.gtk.EggDBus.DeclareEnum" value="AuthorizationResult">
<annotation name="org.gtk.EggDBus.Enum.Member" value="NotAuthorized">
<annotation name="org.gtk.EggDBus.DocString" value="The subject is not authorized for the specified action"/>
......@@ -42,5 +65,10 @@
<arg name="users" direction="out" type="a(sa{sv})"/>
</method>
<method name="EnumerateActions">
<arg name="locale" direction="in" type="s"/>
<arg name="action_descriptions" direction="out" type="a(ssssssa{ss})"/>
</method>
</interface>
</node>
This diff is collapsed.
......@@ -19,55 +19,40 @@
* Author: David Zeuthen <davidz@redhat.com>
*/
#if !defined (_POLKIT_COMPILATION) && !defined(_POLKIT_INSIDE_POLKIT_H)
#error "Only <polkit/polkit.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef __POLKIT_ACTION_DESCRIPTION_H__
#define __POLKIT_ACTION_DESCRIPTION_H__
#ifndef __POLKIT_ACTION_DESCRIPTION_H
#define __POLKIT_ACTION_DESCRIPTION_H
#include <sys/types.h>
#include <unistd.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <polkit/polkitbindings.h>
G_BEGIN_DECLS
#define POLKIT_TYPE_ACTION_DESCRIPTION (polkit_action_description_get_type ())
#define POLKIT_TYPE_ACTION_DESCRIPTION (polkit_action_description_get_type())
#define POLKIT_ACTION_DESCRIPTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), POLKIT_TYPE_ACTION_DESCRIPTION, PolkitActionDescription))
#define POLKIT_ACTION_DESCRIPTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), POLKIT_TYPE_ACTION_DESCRIPTION, PolkitActionDescriptionClass))
#define POLKIT_IS_ACTION_DESCRIPTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), POLKIT_TYPE_ACTION_DESCRIPTION))
#define POLKIT_IS_ACTION_DESCRIPTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), POLKIT_TYPE_ACTION_DESCRIPTION))
#define POLKIT_ACTION_DESCRIPTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), POLKIT_TYPE_ACTION_DESCRIPTION, PolkitActionDescriptionClass))
typedef struct _PolkitActionDescription PolkitActionDescription;
typedef struct _PolkitActionDescriptionClass PolkitActionDescriptionClass;
typedef struct _PolkitActionDescriptionPrivate PolkitActionDescriptionPrivate;
#define POLKIT_ACTION_DESCRIPTION_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE((o), POLKIT_TYPE_ACTION_DESCRIPTION, PolkitActionDescriptionIface))
struct _PolkitActionDescription
{
GObject parent_instance;
PolkitActionDescriptionPrivate *priv;
};
#if 0
typedef struct _PolkitActionDescription PolkitActionDescription; /* Dummy typedef */
#endif
typedef struct _PolkitActionDescriptionIface PolkitActionDescriptionIface;
struct _PolkitActionDescriptionClass
struct _PolkitActionDescriptionIface
{
GObjectClass parent_class;
GTypeInterface g_iface;
};
GType polkit_action_description_get_type (void) G_GNUC_CONST;
GList * polkit_action_description_new_from_file (GFile *file,
GCancellable *cancellable,
GError **error);
GList * polkit_action_description_new_from_directory (GFile *directory,
GCancellable *cancellable,
GError **error);
const gchar * polkit_action_description_get_action_id (PolkitActionDescription *action_description);
GIcon * polkit_action_description_get_icon (PolkitActionDescription *action_description);
const gchar * polkit_action_description_get_description (PolkitActionDescription *action_description);
const gchar * polkit_action_description_get_message (PolkitActionDescription *action_description);
const gchar * polkit_action_description_get_vendor_name (PolkitActionDescription *action_description);
const gchar * polkit_action_description_get_vendor_url (PolkitActionDescription *action_description);
GHashTable * polkit_action_description_get_annotations (PolkitActionDescription *action_description);
GType polkit_action_description_get_type (void) G_GNUC_CONST;
const gchar *polkit_action_description_get_action_id (PolkitActionDescription *action_description);
const gchar *polkit_action_description_get_description (PolkitActionDescription *action_description);
const gchar *polkit_action_description_get_message (PolkitActionDescription *action_description);
const gchar *polkit_action_description_get_vendor_name (PolkitActionDescription *action_description);
const gchar *polkit_action_description_get_vendor_url (PolkitActionDescription *action_description);
GIcon *polkit_action_description_get_icon (PolkitActionDescription *action_description);
GHashTable *polkit_action_description_get_annotations (PolkitActionDescription *action_description);
G_END_DECLS
#endif /* __POLKIT_ACTION_DESCRIPTION_H__ */
#endif /* __POLKIT_ACTION_DESCRIPTION_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment