## peony-sendto-plugin

peony-sendto-plugin — peony-sento plug-in

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | NST_INIT_PLUGIN()

## Types and Values

struct | NstPluginInfo
struct | NstPlugin
enum | NstPluginCapabilities

## Object Hierarchy

        GFlags
        ╰── NstPluginCapabilities

## Includes

    #include <bluetooth-plugin.h>

## Description

Plug-ins can be used to extend peony-sendto.

## Functions

### NST_INIT_PLUGIN()

    #define             NST_INIT_PLUGIN(plugininfo)

Call this on an NstPluginInfo structure to make it available to peony-sendto.

#### Parameters

plugininfo | a NstPluginInfo structure representing the plugin |

## Types and Values

### struct NstPluginInfo

    struct NstPluginInfo {
    	gchar                             *icon;
    	gchar                             *id;
    	gchar                             *description;
    	gchar                             *gettext_package;
    	NstPluginCapabilities              capabilities;
    	gboolean (*init)                  (NstPlugin *plugin);
    	GtkWidget* (*get_contacts_widget) (NstPlugin *plugin);
    	gboolean (*validate_destination)  (NstPlugin *plugin, GtkWidget *contact_widget, char **error);
    	gboolean (*send_files)            (NstPlugin *plugin,
    					   GtkWidget *contact_widget,
    					   GList *file_list);
    	gboolean (*destroy)               (NstPlugin *plugin) ;
    };

A structure representing a peony-sendto plugin. You should also call `NST_INIT_PLUGIN()` on the plugin structure to export it.

#### Members

gchar *`icon`; | The icon name for the plugin selection drop-down |
gchar *`id`; | A unique ID representing the plugin |
gchar *`description`; | The label used in the plugin selection drop-down |
gchar *`gettext_package`; | The domain to use to translate the description, `NULL` if the plugin is part of peony-sendto |
NstPluginCapabilities `capabilities`; | a bitmask of NstPluginCapabilities |
`init` () | Check for dependencies, and return `FALSE` if dependencies such as programs are missing. |
`get_contacts_widget` () | Return the contact widget, the widget to select the destination of the files |
`validate_destination` () | Validate whether the destination can receive the file. This callback is optional. |
`send_files` () | Actually send the files to the selected destination. The file list is a GList of URI strings. |
`destroy` () | Free all the resources used by the plugin. |

### struct NstPlugin

    struct NstPlugin {
    	GModule *module;
    	NstPluginInfo *info;
    };

A structure as used in peony-sendto.

#### Members

GModule *`module`; | the GModule for the opened shared library |
NstPluginInfo *`info`; | a NstPluginInfo structure |

### enum NstPluginCapabilities

Capabilities of the plugin.

#### Members

PEONY_CAPS_NONE | No capabilities |
PEONY_CAPS_SEND_DIRECTORIES | The plugin can send whole directories without compression |
PEONY_CAPS_SEND_IMAGES | The plugin only sends images which could be resized |