Fix string errors reported by Christian Kirbach
[nautilus-actions.git] / src / core / na-io-provider.h
blob8742127758c04764061388d8d44be27d0e230a5c
1 /*
2 * Nautilus-Actions
3 * A Nautilus extension which offers configurable context menu actions.
5 * Copyright (C) 2005 The GNOME Foundation
6 * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
7 * Copyright (C) 2009, 2010, 2011 Pierre Wieser and others (see AUTHORS)
9 * This Program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This Program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this Library; see the file COPYING. If not,
21 * write to the Free Software Foundation, Inc., 59 Temple Place,
22 * Suite 330, Boston, MA 02111-1307, USA.
24 * Authors:
25 * Frederic Ruaudel <grumz@grumz.net>
26 * Rodrigo Moya <rodrigo@gnome-db.org>
27 * Pierre Wieser <pwieser@trychlos.org>
28 * ... and many others (see AUTHORS)
31 #ifndef __CORE_NA_IO_PROVIDER_H__
32 #define __CORE_NA_IO_PROVIDER_H__
34 /* @title: NAIOProvider
35 * @short_description: The NAIOProvider Class Definition
36 * @include: core/na-io-provider.h
38 * #NAIOProvider is the Nautilus-Actions class which is used to manage
39 * external I/O Providers which implement #NAIIOProvider interface. Each
40 * #NAIOProvider objects may (or not) encapsulates one #NAIIOProvider
41 * provider.
43 * Internal Nautilus-Actions code should never directly call a
44 * #NAIIOProvider interface method, but rather should call the
45 * corresponding NAIOProvider class method.
47 * Two preferences are used for each i/o provider:
48 * 'readable': means that the i/o provider should be read when building
49 * the items hierarchy
50 * 'writable': means that the i/o provider is candidate when writing a
51 * new item; this also means that existing items are deletable.
53 * To be actually writable, a i/o provider must:
54 * - be set as 'writable' from a configuration point of view
55 * this may or not be edited depending of this is a mandatory or user
56 * preference
57 * - be willing to write: this is an intrisinc i/o provider attribute
58 * - be able to write: this is a runtime i/o provider property
60 * and the whole configuration must not have been locked by an admin.
63 #include "na-pivot.h"
65 G_BEGIN_DECLS
67 #define NA_IO_PROVIDER_TYPE ( na_io_provider_get_type())
68 #define NA_IO_PROVIDER( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_IO_PROVIDER_TYPE, NAIOProvider ))
69 #define NA_IO_PROVIDER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, NA_IO_PROVIDER_TYPE, NAIOProviderClass ))
70 #define NA_IS_IO_PROVIDER( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_IO_PROVIDER_TYPE ))
71 #define NA_IS_IO_PROVIDER_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_IO_PROVIDER_TYPE ))
72 #define NA_IO_PROVIDER_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_IO_PROVIDER_TYPE, NAIOProviderClass ))
74 typedef struct _NAIOProviderPrivate NAIOProviderPrivate;
76 typedef struct {
77 /*< private >*/
78 GObject parent;
79 NAIOProviderPrivate *private;
81 NAIOProvider;
83 typedef struct _NAIOProviderClassPrivate NAIOProviderClassPrivate;
85 typedef struct {
86 /*< private >*/
87 GObjectClass parent;
88 NAIOProviderClassPrivate *private;
90 NAIOProviderClass;
92 /* signal sent from a NAIIOProvider
93 * via the na_iio_provider_item_changed() function
95 #define IO_PROVIDER_SIGNAL_ITEM_CHANGED "io-provider-item-changed"
97 GType na_io_provider_get_type ( void );
99 NAIOProvider *na_io_provider_find_writable_io_provider( const NAPivot *pivot );
100 NAIOProvider *na_io_provider_find_io_provider_by_id ( const NAPivot *pivot, const gchar *id );
101 const GList *na_io_provider_get_io_providers_list ( const NAPivot *pivot );
102 void na_io_provider_unref_io_providers_list ( void );
104 gchar *na_io_provider_get_id ( const NAIOProvider *provider );
105 gchar *na_io_provider_get_name ( const NAIOProvider *provider );
106 gboolean na_io_provider_is_available ( const NAIOProvider *provider );
107 gboolean na_io_provider_is_conf_readable ( const NAIOProvider *provider, const NAPivot *pivot, gboolean *mandatory );
108 gboolean na_io_provider_is_able_to_write ( const NAIOProvider *provider );
109 gboolean na_io_provider_is_conf_writable ( const NAIOProvider *provider, const NAPivot *pivot, gboolean *mandatory );
110 gboolean na_io_provider_is_willing_to_write( const NAIOProvider *provider );
112 GList *na_io_provider_load_items( const NAPivot *pivot, guint loadable_set, GSList **messages );
114 /* ... */
116 guint na_io_provider_write_item ( const NAIOProvider *provider, const NAObjectItem *item, GSList **messages );
117 guint na_io_provider_delete_item ( const NAIOProvider *provider, const NAObjectItem *item, GSList **messages );
118 guint na_io_provider_duplicate_data( const NAIOProvider *provider, NAObjectItem *dest, const NAObjectItem *source, GSList **messages );
120 gchar *na_io_provider_get_readonly_tooltip( guint reason );
121 gchar *na_io_provider_get_return_code_label( guint code );
123 G_END_DECLS
125 #endif /* __CORE_NA_IO_PROVIDER_H__ */