AmtkActionInfoStore: Tepl 3 Reference Manual

## AmtkActionInfoStore AmtkActionInfoStore — A store of AmtkActionInfo's |

## Functions

AmtkActionInfoStore * | amtk_action_info_store_new ()
void | amtk_action_info_store_add ()
void | amtk_action_info_store_add_entries ()
AmtkActionInfo * | amtk_action_info_store_lookup ()
void | amtk_action_info_store_check_all_used ()

## Types and Values

| AmtkActionInfoStore

## Object Hierarchy

        GObject
        ╰── AmtkActionInfoStore

## Includes

    #include <amtk/amtk.h>

## Description

AmtkActionInfoStore contains a set of AmtkActionInfo's. It is add-only, an AmtkActionInfo cannot be removed.

AmtkActionInfoStore is designed so that libraries can provide their own store, to share action information (with translations) and possibly the GAction implementations as well.

A library AmtkActionInfoStore must namespace the action names to not have conflicts when an AmtkActionInfo is added to the AmtkActionInfoCentralStore. Examples of namespaced action names: `"win.amtk-save"` or `"app.amtk-quit"`.

Once an AmtkActionInfo has been added to an AmtkActionInfoStore, it is discouraged to modify it afterwards. An AmtkActionInfoStore is meant to be something static, created on application startup. See the paragraph about static objects in AmtkFactory.

## Functions

### amtk_action_info_store_new ()

    AmtkActionInfoStore *
    amtk_action_info_store_new (void);

#### Returns

a new AmtkActionInfoStore.

Since: 3.0

### amtk_action_info_store_add ()

    void
    amtk_action_info_store_add (AmtkActionInfoStore *store,
                                AmtkActionInfo *info);

Inserts `info` into `store` and into the AmtkActionInfoCentralStore. Both the `store` and central store must not already contain an AmtkActionInfo with the same action name. The stores take their own reference on `info` .

#### Parameters

store | an AmtkActionInfoStore. |
info | an AmtkActionInfo. |

Since: 2.0

### amtk_action_info_store_add_entries ()

    void
    amtk_action_info_store_add_entries (AmtkActionInfoStore *store,
                                        const AmtkActionInfoEntry *entries,
                                        gint n_entries,
                                        const gchar *translation_domain);

Calls `amtk_action_info_store_add()` for each entry.

If `translation_domain` is not `NULL`, `g_dgettext()` is used to translate the `label` and `tooltip` of each entry before setting them to the AmtkActionInfo.

An API similar to `g_action_map_add_action_entries()`.

#### Parameters

store | an AmtkActionInfoStore. |
entries | a pointer to the first item in an array of AmtkActionInfoEntry structs. | [array length=n_entries][element-type AmtkActionInfoEntry]
n_entries | the length of `entries` , or -1 if `entries` is `NULL`-terminated. |
translation_domain | a gettext domain, or `NULL`. | [nullable]

Since: 2.0

### amtk_action_info_store_lookup ()

    AmtkActionInfo *
    amtk_action_info_store_lookup (AmtkActionInfoStore *store,
                                   const gchar *action_name);

#### Parameters

store | an AmtkActionInfoStore. |
action_name | an action name. |

#### Returns

the found AmtkActionInfo, or `NULL`.

[transfer none]

Since: 2.0

### amtk_action_info_store_check_all_used ()

    void
    amtk_action_info_store_check_all_used (AmtkActionInfoStore *store);

Checks for each AmtkActionInfo of `store` that it has been used (see `amtk_action_info_has_been_used()`). If an AmtkActionInfo has not been used, a warning is printed and might indicate dead code.

You probably want to call this function on the application store after creating the menu and toolbar. But it can also be useful for a store provided by a library, to easily see which actions are not used by the application.

#### Parameters

store | an AmtkActionInfoStore. |

Since: 2.0

## Types and Values

### AmtkActionInfoStore

    typedef struct _AmtkActionInfoStore AmtkActionInfoStore;

## See Also

AmtkActionInfo, AmtkActionInfoCentralStore