1 /* 2 * nemo-info-provider.h - Type definitions for Nemo extensions 3 * 4 * Copyright (C) 2003 Novell, Inc. 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the Free 18 * Software Foundation, Inc., 51 Franklin Street, Suite 500, MA 02110-1335, USA. 19 * 20 * Author: Dave Camp <dave@ximian.com> 21 * 22 */ 23 24 /* This interface is implemented by Nemo extensions that want to 25 * provide information about files. Extensions are called when Nemo 26 * needs information about a file. They are passed a NemoFileInfo 27 * object which should be filled with relevant information */ 28 29 #ifndef NEMO_EXTENSION_TYPES_H 30 #define NEMO_EXTENSION_TYPES_H 31 32 #include <glib-object.h> 33 34 G_BEGIN_DECLS 35 36 /** 37 * SECTION:nemo-extension-types 38 * @Title: Types and Enums 39 * @Short_description: Module initialization functions, enums, handle struct 40 **/ 41 42 /** 43 * NemoOperationHandle: 44 * 45 * Handle for asynchronous interfaces. These are opaque handles that must 46 * be unique within an extension object. These are returned by operations 47 * that return NEMO_OPERATION_IN_PROGRESS. 48 * 49 * For python extensions, the handle is a dummy struct created by the nemo 50 * python bindings on the extension's behalf. It can be used as a unique 51 * key for a dict, for instance, for keeping track of multiple operations 52 * at once. 53 */ 54 typedef struct _NemoOperationHandle NemoOperationHandle; 55 56 /** 57 * NemoOperationResult: 58 * @NEMO_OPERATION_COMPLETE: Returned if the call succeeded, and the extension is done 59 * with the request. 60 * @NEMO_OPERATION_FAILED: Returned if the call failed. 61 * @NEMO_OPERATION_IN_PROGRESS: Returned if the extension has begun an async operation. 62 * For C extensions, if this is returned, the extension must set the handle parameter. 63 * For python extensions, handle is already filled, and unique, and can be used for 64 * identifying purposes within the extension. In either case, the extension must call 65 * the callback closure when the operation is complete (complete_invoke.) 66 */ 67 typedef enum { 68 NEMO_OPERATION_COMPLETE, 69 NEMO_OPERATION_FAILED, 70 NEMO_OPERATION_IN_PROGRESS 71 } NemoOperationResult; 72 73 void nemo_module_initialize (GTypeModule *module); 74 void nemo_module_shutdown (void); 75 void nemo_module_list_types (const GType **types, 76 int *num_types); 77 78 G_END_DECLS 79 80 #endif 81