2008-05-05 Paolo Borelli <pborelli@katamail.com>
[nautilus.git] / libnautilus-extension / nautilus-info-provider.h
blobded7748d06598791b23cfe5b630119d5717a1254
1 /*
2 * nautilus-info-provider.h - Interface for Nautilus extensions that
3 * provide info about files.
5 * Copyright (C) 2003 Novell, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Author: Dave Camp <dave@ximian.com>
25 /* This interface is implemented by Nautilus extensions that want to
26 * provide information about files. Extensions are called when Nautilus
27 * needs information about a file. They are passed a NautilusFileInfo
28 * object which should be filled with relevant information */
30 #ifndef NAUTILUS_INFO_PROVIDER_H
31 #define NAUTILUS_INFO_PROVIDER_H
33 #include <glib-object.h>
34 #include "nautilus-extension-types.h"
35 #include "nautilus-file-info.h"
37 G_BEGIN_DECLS
39 #define NAUTILUS_TYPE_INFO_PROVIDER (nautilus_info_provider_get_type ())
40 #define NAUTILUS_INFO_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_INFO_PROVIDER, NautilusInfoProvider))
41 #define NAUTILUS_IS_INFO_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_INFO_PROVIDER))
42 #define NAUTILUS_INFO_PROVIDER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NAUTILUS_TYPE_INFO_PROVIDER, NautilusInfoProviderIface))
44 typedef struct _NautilusInfoProvider NautilusInfoProvider;
45 typedef struct _NautilusInfoProviderIface NautilusInfoProviderIface;
47 typedef void (*NautilusInfoProviderUpdateComplete) (NautilusInfoProvider *provider,
48 NautilusOperationHandle *handle,
49 NautilusOperationResult result,
50 gpointer user_data);
52 struct _NautilusInfoProviderIface {
53 GTypeInterface g_iface;
55 NautilusOperationResult (*update_file_info) (NautilusInfoProvider *provider,
56 NautilusFileInfo *file,
57 GClosure *update_complete,
58 NautilusOperationHandle **handle);
59 void (*cancel_update) (NautilusInfoProvider *provider,
60 NautilusOperationHandle *handle);
63 /* Interface Functions */
64 GType nautilus_info_provider_get_type (void);
65 NautilusOperationResult nautilus_info_provider_update_file_info (NautilusInfoProvider *provider,
66 NautilusFileInfo *file,
67 GClosure *update_complete,
68 NautilusOperationHandle **handle);
69 void nautilus_info_provider_cancel_update (NautilusInfoProvider *provider,
70 NautilusOperationHandle *handle);
74 /* Helper functions for implementations */
75 void nautilus_info_provider_update_complete_invoke (GClosure *update_complete,
76 NautilusInfoProvider *provider,
77 NautilusOperationHandle *handle,
78 NautilusOperationResult result);
80 G_END_DECLS
82 #endif