summaryrefslogtreecommitdiff
path: root/libnautilus/nautilus-view-component.idl
blob: 30e68a1a062bedc94c52f7e3291d2f81aaff6af8 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */

#ifndef NAUTILUS_VIEW_COMPONENT_IDL
#define NAUTILUS_VIEW_COMPONENT_IDL

#if !defined(NAUTILUS_VIEW_COMPONENT_COMPILATION) && defined(__ORBIT_IDL__)
%{
#pragma include_defs libnautilus/nautilus-view-component.h
%}
#pragma inhibit push
#endif


#include <Bonobo.idl>

/* FIXME bugzilla.eazel.com 2974: Use of doubles causes alignment
 * problems in Solaris due to an ORBit bug; we use floats throughout
 * this file as a workaround.
 */

module Nautilus {

	/* URIs are just plain strings, but we use a typedef to make
	 * the interface definitions clearer.
	 */
	typedef string URI;
	typedef sequence<URI> URIList;

	/* The View interface is used by the Nautilus shell to control
	 * the view. A view that is a Bonobo::Control can choose to
	 * implement the View interface for additional finer control
	 * by Nautilus.
	 */
	interface View : ::Bonobo::Unknown {
		/* Called to tell the view about location changes.
		 * Called again with the same location again to request a
		 * reload.
		 */
		oneway void load_location (in URI location);
		oneway void stop_loading ();
		
		/* Called to tell the view about selection changes. */
		oneway void selection_changed (in URIList selection);

		/* Called to tell the view about title changes. */
		oneway void title_changed (in string title);
	};
	
	/* The ViewFrame interface is used by the view to communicate
	 * with the Nautilus shell. It's implemented as an interface
	 * on the Bonobo::ControlFrame for the view.
	 */
	interface ViewFrame : ::Bonobo::Unknown {
		/* Called by the view component to change the location
		 * shown in the window or to open a new window. In the
		 * case of a new window, you can specify the initial
		 * selection in the new location.
		 */
		oneway void open_location (in URI location);
		oneway void open_location_in_new_window (in URI location,
							 in URIList selection);

		/* Called by a view component to announce a change in the
		 * selection. This selection change will be reported back
		 * to the original view along with the others.
		 */
		oneway void report_selection_change (in URIList selection);

		/* Called by a view component to change the contents
		 * of the status bar.
		 */
		oneway void report_status (in string status);

		/* Called by a view component to give an update about
		 * progress loading the view for the current
		 * location. Calling underway repeatedly tells the
		 * shell that the view is making progress. For views
		 * that know how far along they are, calling
		 * report_load_progress (instead of
		 * report_load_underway) with a number from 0.0 to 1.0
		 * expresses how much of the total is done. When the
		 * load is complete or has failed, either
		 * report_load_failed or report_load_complete
		 * indicates that.
		 */
		oneway void report_load_underway ();

		oneway void report_load_progress (in float fraction_done);
		oneway void report_load_complete ();
		oneway void report_load_failed ();

		/* Called by a view component to change the title. */
		oneway void set_title (in string new_title);
	};		

	typedef float ZoomLevel;
	typedef sequence<ZoomLevel> ZoomLevelList;
	
	/* The interface for something zoomable. Nautilus looks for
	 * this interface on Bonobo controls that it uses as views. If
	 * the interface is present, it shows a widget in the toolbar
	 * for zooming. It's still the component's job to save the
	 * zoom level.
	 */
	interface Zoomable : ::Bonobo::Unknown {
		/* Set this attribute to make the thing zoom. */
		attribute float zoom_level;

		/* Information about the type of zooming that's supported. */
		readonly attribute float min_zoom_level;
		readonly attribute float max_zoom_level;
		readonly attribute boolean is_continuous;
		readonly attribute ZoomLevelList preferred_zoom_levels;
		
		/* High level operations.
		 * These can cause a change in the zoom level.
		 * The zoomable itself must decide what the concepts
		 * "one level in", "one level out", and "to fit" mean.
		 */
		oneway void zoom_in ();
		oneway void zoom_out ();
		oneway void zoom_to_fit ();
	};
	
	/* A zoomable has the responsibility to look for this
	 * interface on its Bonobo control frame and call
	 * zoom_level_changed whenever it changes the zoom level (on
	 * its own or due to calls from the zoomable interface).
	 */
	interface ZoomableFrame : ::Bonobo::Unknown {
		oneway void report_zoom_level_changed (in float zoom_level);
	};

	/* The specifications for a history list item. The structure
	 * contains the title of the item, and the location it's for.
	 */
	struct HistoryItem {
		string title;
		URI location;
	};
	typedef sequence<HistoryItem> HistoryList;

	/* An interface that a component can use to get at the history
	 * list stored in Nautilus.
	 */
	interface HistoryFrame : ::Bonobo::Unknown {
		/* Called by a view component to get the Nautilus
		 * history list.
		 */		 
		HistoryList get_history_list ();
	};

};

#if !defined(NAUTILUS_VIEW_COMPONENT_COMPILATION) && defined(__ORBIT_IDL__)
#pragma inhibit pop
#endif

#endif /* NAUTILUS_VIEW_COMPONENT_IDL */