## PeonyMenuProvider

PeonyMenuProvider — Interface to provide additional menu items

## Functions

GList * | peony_menu_provider_get_file_items ()
GList * | peony_menu_provider_get_background_items ()
GList * | peony_menu_provider_get_toolbar_items ()
void | peony_menu_provider_emit_items_updated_signal ()

## Signals

void | items-updated | Run Last

## Types and Values

| PeonyMenuProvider
struct | PeonyMenuProviderIface

## Object Hierarchy

        GInterface
        ╰── PeonyMenuProvider

## Prerequisites

PeonyMenuProvider requires GObject.

## Includes

    #include <libpeony-extension/peony-menu-provider.h>

## Description

PeonyMenuProvider allows extension to provide additional menu items in the file manager menus.

## Functions

### peony_menu_provider_get_file_items ()

    GList *
    peony_menu_provider_get_file_items (PeonyMenuProvider *provider,
                                        GtkWidget *window,
                                        GList *files);

#### Parameters

provider | a PeonyMenuProvider |
window | the parent GtkWidget window |
files | a list of PeonyFileInfo. | [element-type PeonyFileInfo]

#### Returns

the provided list of PeonyMenuItem.

[element-type PeonyMenuItem][transfer full]

### peony_menu_provider_get_background_items ()

    GList *
    peony_menu_provider_get_background_items
                                   (PeonyMenuProvider *provider,
                                    GtkWidget *window,
                                    PeonyFileInfo *current_folder);

#### Parameters

provider | a PeonyMenuProvider |
window | the parent GtkWidget window |
current_folder | the folder for which background items are requested |

#### Returns

the provided list of PeonyMenuItem.

[element-type PeonyMenuItem][transfer full]

### peony_menu_provider_get_toolbar_items ()

    GList *
    peony_menu_provider_get_toolbar_items (PeonyMenuProvider *provider,
                                           GtkWidget *window,
                                           PeonyFileInfo *current_folder);

#### Parameters

provider | a PeonyMenuProvider |
window | the parent GtkWidget window |
current_folder | the folder for which toolbar items are requested |

#### Returns

the provided list of PeonyMenuItem.

[element-type PeonyMenuItem][transfer full]

### peony_menu_provider_emit_items_updated_signal ()

    void
    peony_menu_provider_emit_items_updated_signal
                                   (PeonyMenuProvider *provider);

## Types and Values

### PeonyMenuProvider

    typedef struct _PeonyMenuProvider PeonyMenuProvider;

### struct PeonyMenuProviderIface

    struct PeonyMenuProviderIface {
        GTypeInterface g_iface;

        GList *(*get_file_items)       (PeonyMenuProvider *provider,
                                        GtkWidget        *window,
                                        GList            *files);
        GList *(*get_background_items) (PeonyMenuProvider *provider,
                                        GtkWidget        *window,
                                        PeonyFileInfo     *current_folder);
        GList *(*get_toolbar_items)    (PeonyMenuProvider *provider,
                                        GtkWidget        *window,
                                        PeonyFileInfo     *current_folder);
    };

Interface for extensions to provide additional menu items.

#### Members

`get_file_items` () | Returns a GList of PeonyMenuItem. See `peony_menu_provider_get_file_items()` for details. |
`get_background_items` () | Returns a GList of PeonyMenuItem. See `peony_menu_provider_get_background_items()` for details. |
`get_toolbar_items` () | Returns a GList of PeonyMenuItem. See `peony_menu_provider_get_toolbar_items()` for details. |

## Signal Details

### The `“items-updated”` signal

    void
    user_function (PeonyMenuProvider *peonymenuprovider,
                   gpointer           user_data)

Flags: Run Last