June 2025 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
001: /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 002: 003: /* 004: * Copyright (C) 2004 Roberto Majadas 005: * Copyright (C) 2009 Bastien Nocera <hadess@hadess.net> 006: * 007: * This program is free software; you can redistribute it and/or 008: * modify it under the terms of the GNU General Public License as 009: * published by the Free Software Foundation; either version 2 of the 010: * License, or (at your option) any later version. 011: * 012: * This program is distributed in the hope that it will be useful, 013: * but WITHOUT ANY WARRANTY; without even the implied warranty of 014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015: * General Public License for more av. 016: * 017: * You should have received a copy of the GNU General Public 018: * License along with this program; if not, write to the 019: * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 020: * Boston, MA 02110-1301 USA. 021: * 022: * Authors: Roberto Majadas <roberto.majadas@openshine.com> 023: * Bastien Nocera <hadess@hadess.net> 024: */ 025: 026: #ifndef _NAUTILUS_SENDTO_PLUGIN_H_ 027: #define _NAUTILUS_SENDTO_PLUGIN_H_ 028: 029: #include <gmodule.h> 030: #include <gtk/gtk.h> 031: 032: /** 033: * SECTION:nautilus-sendto-plugin 034: * @short_description: nautilus-sento plug-in 035: * @stability: Stable 036: * @include: bluetooth-plugin.h 037: * 038: * Plug-ins can be used to extend nautilus-sendto. 039: **/ 040: 041: typedef struct _NstPluginInfo NstPluginInfo; 042: typedef struct _NstPlugin NstPlugin; 043: 044: /** 045: * NstPluginCapabilities: 046: * @NAUTILUS_CAPS_NONE: No capabilities 047: * @NAUTILUS_CAPS_SEND_DIRECTORIES: The plugin can send whole directories without compression 048: * @NAUTILUS_CAPS_SEND_IMAGES: The plugin only sends images which could be resized 049: * 050: * Capabilities of the plugin. 051: **/ 052: typedef enum { 053: NAUTILUS_CAPS_NONE = 0, 054: NAUTILUS_CAPS_SEND_DIRECTORIES = 1 << 0, 055: NAUTILUS_CAPS_SEND_IMAGES = 1 << 1, 056: } NstPluginCapabilities; 057: 058: /** 059: * NstPluginInfo: 060: * @icon: The icon name for the plugin selection drop-down 061: * @id: A unique ID representing the plugin 062: * @description: The label used in the plugin selection drop-down 063: * @gettext_package: The domain to use to translate the description, %NULL if the plugin is part of nautilus-sendto 064: * @capabilities: a bitmask of #NstPluginCapabilities 065: * @init: Check for dependencies, and return %FALSE if dependencies such as programs are missing. 066: * @get_contacts_widget: Return the contact widget, the widget to select the destination of the files 067: * @validate_destination: Validate whether the destination can receive the file. This callback is optional. 068: * @send_files: Actually send the files to the selected destination. The file list is a #GList of URI strings. 069: * @destroy: Free all the resources used by the plugin. 070: * 071: * A structure representing a nautilus-sendto plugin. You should also call NST_INIT_PLUGIN() on the plugin structure to export it. 072: **/ 073: struct _NstPluginInfo 074: { 075: gchar *icon; 076: gchar *id; 077: gchar *description; 078: gchar *gettext_package; 079: NstPluginCapabilities capabilities; 080: gboolean (*init) (NstPlugin *plugin); 081: GtkWidget* (*get_contacts_widget) (NstPlugin *plugin); 082: gboolean (*validate_destination) (NstPlugin *plugin, GtkWidget *contact_widget, char **error); 083: gboolean (*send_files) (NstPlugin *plugin, 084: GtkWidget *contact_widget, 085: GList *file_list); 086: gboolean (*destroy) (NstPlugin *plugin) ; 087: }; 088: 089: /** 090: * NstPlugin: 091: * @module: the #GModule for the opened shared library 092: * @info: a #NstPluginInfo structure 093: * 094: * A structure as used in nautilus-sendto. 095: **/ 096: struct _NstPlugin 097: { 098: GModule *module; 099: NstPluginInfo *info; 100: }; 101: 102: /** 103: * NST_INIT_PLUGIN: 104: * @plugininfo: a #NstPluginInfo structure representing the plugin 105: * 106: * Call this on an #NstPluginInfo structure to make it available to nautilus-sendto. 107: **/ 108: # define NST_INIT_PLUGIN(plugininfo) \ 109: gboolean nst_init_plugin(NstPlugin *plugin); \ 110: G_MODULE_EXPORT gboolean nst_init_plugin(NstPlugin *plugin) { \ 111: plugin->info = &(plugininfo); \ 112: return TRUE; \ 113: } 114: 115: #endif /* _NAUTILUS_SENDTO_PLUGIN_H_ */ 116: 117: