summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-metafile-server.idl
blob: afa1a6617b752465f2e4656f5ce5effdfc6d3c8b (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */

/* nautilus-metafile-server.idl - Interface for components to access Nautilus metadata
 *
 * Copyright (C) 2001 Eazel, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef NAUTILUS_METAFILE_SERVER_IDL_INCLUDED
#define NAUTILUS_METAFILE_SERVER_IDL_INCLUDED

#include <Bonobo.idl>
#include <libnautilus/nautilus-view-component.idl>

module Nautilus {

	typedef sequence<string> FileNameList;

	/* NautilusFiles creates (and registers) MetafileMonitors in order
	 * to get notified of metafile changes.
	 */
	interface MetafileMonitor : ::Bonobo::Unknown {
		void metafile_changed (in FileNameList file_names);
		void metafile_ready ();
	};

	typedef sequence<string> MetadataList;

	/* A Metafile provides access to the metadata for the files
	 * in a directory.
	 *
	 * Note: file names within the directory are specified, by
	 * strings whose special characters have been URI encoded.
	 */
	interface Metafile : ::Bonobo::Unknown {

		/* returns whether the metadata has been read in yet */
		boolean  is_read ();

		/* getters for a file's metadata */
		string           get  (in string  file_name,
				       in string  key,
				       in string  default_value);
		MetadataList get_list (in string  file_name,
				       in string  list_key,
				       in string  list_subkey);

		/* setters for a file's metadata */
		void set      (in string       file_name,
			       in string       key,
			       in string       default_value,
			       in string       metadata);
		void set_list (in string       file_name,
			       in string       list_key,
			       in string       list_subkey,
			       in MetadataList list);
				     
		/* calls to keep metadata in sync with file operations */
		void copy	      (in string  source_file_name,
				       in URI     destination_directory_uri,
				       in string  destination_file_name);
		void remove	      (in string  file_name);
		void rename	      (in string  old_file_name,
				       in string  new_file_name);
		void rename_directory (in string  new_directory_uri);

		/* calls for registering a MetafileMonitor with a Metafile */
		void register_monitor   (in MetafileMonitor monitor);
		void unregister_monitor (in MetafileMonitor monitor);
	};

	/* Components use the MetafileFactory to get a Metafile for a directory. */
	interface MetafileFactory : ::Bonobo::Unknown {
		Metafile open (in URI directory);
	};
};

#endif /* NAUTILUS_METAFILE_SERVER_IDL_INCLUDED */