nautilus-sendto-plugin

## nautilus-sendto-plugin nautilus-sendto-plugin — nautilus-sento plug-in |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

    #include <bluetooth-plugin.h>

                        NstPluginInfo;
                        NstPlugin;
    enum                NstPluginCapabilities;
    #define             NST_INIT_PLUGIN                     (plugininfo)

## Description

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

## Details

### NstPluginInfo

    typedef struct {
    	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) ;
    } NstPluginInfo;

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

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 nautilus-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.

### NstPlugin

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

A structure as used in nautilus-sendto.

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

### enum NstPluginCapabilities

    typedef enum {
    	NAUTILUS_CAPS_NONE = 0,
    	NAUTILUS_CAPS_SEND_DIRECTORIES = 1 << 0,
    	NAUTILUS_CAPS_SEND_IMAGES = 1 << 1,
    } NstPluginCapabilities;

Capabilities of the plugin.

`NAUTILUS_CAPS_NONE` | No capabilities
`NAUTILUS_CAPS_SEND_DIRECTORIES` | The plugin can send whole directories without compression
`NAUTILUS_CAPS_SEND_IMAGES` | The plugin only sends images which could be resized

### NST_INIT_PLUGIN()

    #define             NST_INIT_PLUGIN(plugininfo)

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

`plugininfo` : | a NstPluginInfo structure representing the plugin