## PolkitBackendActionLookup PolkitBackendActionLookup — Interface used to provide data to authentication dialogs |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #define             POLKIT_BACKEND_ACTION_LOOKUP_EXTENSION_POINT_NAME
                        PolkitBackendActionLookup;
                        PolkitBackendActionLookupIface;
    gchar *             polkit_backend_action_lookup_get_message
                                                            (PolkitBackendActionLookup *lookup,
                                                             const gchar *action_id,
                                                             PolkitDetails *details,
                                                             PolkitActionDescription *action_description);
    gchar *             polkit_backend_action_lookup_get_icon_name
                                                            (PolkitBackendActionLookup *lookup,
                                                             const gchar *action_id,
                                                             PolkitDetails *details,
                                                             PolkitActionDescription *action_description);
    PolkitDetails *     polkit_backend_action_lookup_get_details
                                                            (PolkitBackendActionLookup *lookup,
                                                             const gchar *action_id,
                                                             PolkitDetails *details,
                                                             PolkitActionDescription *action_description);

## Object Hierarchy

      GInterface
       +----PolkitBackendActionLookup

## Prerequisites

PolkitBackendActionLookup requires GObject.

## Description

An interface that is used by backends to provide localized data shown in authentication dialogs.

This inteface is intended for mechanisms to customize the message to show - a mechanism can provide a GIOModule that registers one or more extensions that implement this interface. Every time an authentication dialog is shown, the registered extensions are consulted in priority order.

This is useful if your mechanism wants to put up a message such as "Authentication is required to install 'Totem Movie Player'", e.g. messages that include more information than just the action name.

Code implementing this interface cannot block or do any IO when methods are invoked. If information is needed to format the message or details, prepare it in advance and pass it as part of the `details` object when doing the `polkit_authority_check_authorization()` call. Then the code in this interface can use that information to return localized data.

Note that `setlocale()` and the `LANG` environment variable will be set up to match the locale of the authentication agent that is the receiver of the information. This means that code implementing this interface can use `dgettext()` or similar machinery to look up translations.

## Details

### POLKIT_BACKEND_ACTION_LOOKUP_EXTENSION_POINT_NAME

    #define POLKIT_BACKEND_ACTION_LOOKUP_EXTENSION_POINT_NAME "polkit-backend-action-lookup-1"

Extension point name for looking up action information.

### PolkitBackendActionLookup

    typedef struct _PolkitBackendActionLookup PolkitBackendActionLookup;

Opaque object for PolkitBackendActionLookupIface.

### PolkitBackendActionLookupIface

    typedef struct {
      /* VTable */

      gchar *           (*get_message)   (PolkitBackendActionLookup *lookup,
                                          const gchar               *action_id,
                                          PolkitDetails             *details,
                                          PolkitActionDescription   *action_description);

      gchar *           (*get_icon_name) (PolkitBackendActionLookup *lookup,
                                          const gchar               *action_id,
                                          PolkitDetails             *details,
                                          PolkitActionDescription   *action_description);

      PolkitDetails *   (*get_details)   (PolkitBackendActionLookup *lookup,
                                          const gchar               *action_id,
                                          PolkitDetails             *details,
                                          PolkitActionDescription   *action_description);
    } PolkitBackendActionLookupIface;

Interface that is used by backends to provide localized data shown in authentication dialogs.

`get_message` () | See `polkit_backend_action_lookup_get_message()`.
`get_icon_name` () | See `polkit_backend_action_lookup_get_icon_name()`.
`get_details` () | See `polkit_backend_action_lookup_get_details()`.

### polkit_backend_action_lookup_get_message ()

    gchar *             polkit_backend_action_lookup_get_message
                                                            (PolkitBackendActionLookup *lookup,
                                                             const gchar *action_id,
                                                             PolkitDetails *details,
                                                             PolkitActionDescription *action_description);

Computes a message to show in an authentication dialog for `action_id` and `details`.

`lookup` : | A PolkitBackendActionLookup.
`action_id` : | The action to get the message for.
`details` : | Details passed to `polkit_authority_check_authorization()`.
`action_description` : | A PolkitActionDescription object for `action_id`.
Returns : | A localized string to show in the authentication dialog or `NULL`. Caller must free this string.

### polkit_backend_action_lookup_get_icon_name ()

    gchar *             polkit_backend_action_lookup_get_icon_name
                                                            (PolkitBackendActionLookup *lookup,
                                                             const gchar *action_id,
                                                             PolkitDetails *details,
                                                             PolkitActionDescription *action_description);

Computes a themed icon name to show in an authentication dialog for `action_id` and `details`.

`lookup` : | A PolkitBackendActionLookup.
`action_id` : | The action to get the themed icon for.
`details` : | Details passed to `polkit_authority_check_authorization()`.
`action_description` : | A PolkitActionDescription object for `action_id`.
Returns : | A themed icon name or `NULL`. Caller must free this string.

### polkit_backend_action_lookup_get_details ()

    PolkitDetails *     polkit_backend_action_lookup_get_details
                                                            (PolkitBackendActionLookup *lookup,
                                                             const gchar *action_id,
                                                             PolkitDetails *details,
                                                             PolkitActionDescription *action_description);

Computes localized details to show in an authentication dialog for `action_id` and `details`.

`lookup` : | A PolkitBackendActionLookup.
`action_id` : | The action to get the details for.
`details` : | Details passed to `polkit_authority_check_authorization()`.
`action_description` : | A PolkitActionDescription object for `action_id`.
Returns : | A PolkitDetails object with localized details or `NULL`. Caller must free the result.