Actions

Actions — Models what a caller is attempting to do.

Synopsis




                    PolKitAction;
PolKitAction*       polkit_action_new                   (void);
PolKitAction*       polkit_action_ref                   (PolKitAction *action);
void                polkit_action_unref                 (PolKitAction *action);
polkit_bool_t       polkit_action_set_action_id         (PolKitAction *action,
                                                         const char *action_id);
polkit_bool_t       polkit_action_get_action_id         (PolKitAction *action,
                                                         char **out_action_id);
void                polkit_action_debug                 (PolKitAction *action);
polkit_bool_t       polkit_action_validate              (PolKitAction *action);
polkit_bool_t       polkit_action_validate_id           (const char *action_id);

Description

This class is used to represent a PolicyKit action.

Details

PolKitAction

typedef struct _PolKitAction PolKitAction;

Objects of this class are used to record information about an action.


polkit_action_new ()

PolKitAction*       polkit_action_new                   (void);

Create a new PolKitAction object.

Returns :

the new object

polkit_action_ref ()

PolKitAction*       polkit_action_ref                   (PolKitAction *action);

Increase reference count.

action :

the action object

Returns :

the object

polkit_action_unref ()

void                polkit_action_unref                 (PolKitAction *action);

Decreases the reference count of the object. If it becomes zero, the object is freed. Before freeing, reference counts on embedded objects are decresed by one.

action :

the action object

polkit_action_set_action_id ()

polkit_bool_t       polkit_action_set_action_id         (PolKitAction *action,
                                                         const char *action_id);

Set the action identifier

action :

the action object

action_id :

action identifier

Returns :

TRUE only if the value validated and was set

polkit_action_get_action_id ()

polkit_bool_t       polkit_action_get_action_id         (PolKitAction *action,
                                                         char **out_action_id);

Get the action identifier.

action :

the action object

out_action_id :

Returns the action identifier. The caller shall not free this string.

Returns :

TRUE iff the value was returned.

polkit_action_debug ()

void                polkit_action_debug                 (PolKitAction *action);

Print debug details

action :

the object

polkit_action_validate ()

polkit_bool_t       polkit_action_validate              (PolKitAction *action);

Validate the object

action :

the object

Returns :

TRUE iff the object is valid.

polkit_action_validate_id ()

polkit_bool_t       polkit_action_validate_id           (const char *action_id);

Validate whether an action identifier is well formed. To be well formed, an action identifier needs to start with a lower case ASCII character and can only contain the characters "[a-z][0-9].-".

action_id :

the action identifier to validate

Returns :

TRUE iff the action identifier is well formed