summaryrefslogtreecommitdiffstats
path: root/tdejava/koala/org/trinitydesktop/koala/BrowserExtension.java
blob: a571d9338bc30111b49e2cb174a40cf7190e0cdb (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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
//Auto-generated by kalyptus. DO NOT EDIT.
package org.trinitydesktop.koala;

import org.trinitydesktop.qt.Qt;
import org.trinitydesktop.qt.TQMetaObject;
import org.trinitydesktop.qt.QtSupport;
import org.trinitydesktop.qt.TQObject;
import org.trinitydesktop.qt.TQDataStream;
import org.trinitydesktop.qt.TQPoint;
import java.util.ArrayList;
import org.trinitydesktop.qt.TQObject;

/**

 The Browser Extension is an extension (yes, no kidding) to
 KParts.ReadOnlyPart, which allows a better integration of parts
 with browsers (in particular Konqueror).
 Remember that ReadOnlyPart only has openURL(KURL), with no other settings.
 For full-fledged browsing, we need much more than that, including
 many arguments about how to open this URL (see URLArgs), allowing
 parts to save and restore their data into the back/forward history,
 allowing parts to control the location bar URL, to requests URLs
 to be opened by the hosting browser, etc.
 The part developer needs to define its own class derived from BrowserExtension,
 to implement the methods [and the standard-actions slots, see below].
 The way to associate the BrowserExtension with the part is to simply
 create the BrowserExtension as a child of the part (in TQObject's terms).
 The hosting application will look for it automatically.
 Another aspect of the browser integration is that a set of standard
 actions are provided by the browser, but implemented by the part
 (for the actions it supports).
 The following standard actions are defined by the host of the view :
 [selection-dependent actions]

	<li>
	<code>cut</code> : Copy selected items to clipboard and store 'not cut' in clipboard.
	</li>

	<li>
	<code>copy</code> : Copy selected items to clipboard and store 'cut' in clipboard.
	</li>

	<li>
	<code>paste</code> : Paste clipboard into view URL.
	</li>

	<li>
	<code>pasteTo</code>(KURL) : Paste clipboard into given URL.
	</li>

	<li>
	<code>rename</code> : Rename item in place.
	</li>

	<li>
	<code>trash</code> : Move selected items to trash.
	</li>

	<li>
	<code>del</code> : Delete selected items (couldn't call it delete!).
	</li>

	<li>
	<code>shred</code> : Shred selected items (secure deletion) - DEPRECATED.
	</li>

	<li>
	<code>properties</code> : Show file/document properties.
	</li>

	<li>
	<code>editMimeType</code> : show file/document's mimetype properties.
	</li>

	<li>
	<code>searchProvider</code> : Lookup selected text at default search provider
	</li>
	 [normal actions]

	<li>
	<code>print</code> : Print :-)
	</li>

	<li>
	<code>reparseConfiguration</code> : Re-read configuration and apply it.
	</li>

	<li>
	<code>refreshMimeTypes</code> : If the view uses mimetypes it should re-determine them.
	</li>
	 The view defines a slot with the name of the action in order to implement the action.
 The browser will detect the slot automatically and connect its action to it when
 appropriate (i.e. when the view is active).
 The selection-dependent actions are disabled by default and the view should
 enable them when the selection changes, emitting enableAction().
 The normal actions do not depend on the selection.
 You need to enable 'print' when printing is possible - you can even do that
 in the constructor.
 A special case is the configuration slots, not connected to any action directly,
 and having parameters.
 [configuration slot]

	<li>
	<code>setSaveViewPropertiesLocally</code>( boolean ): If <code>true</code>, view properties are saved into .directory
	                                       otherwise, they are saved globally.
	</li>

	<li>
	<code>disableScrolling</code>: no scrollbars

	</li> See {@link BrowserExtensionSignals} for signals emitted by BrowserExtension
		@short    The Browser Extension is an extension (yes, no kidding) to  KParts.ReadOnlyPart, which allows a better integration of parts  with browsers (in particular Konqueror).

*/
public class BrowserExtension extends TQObject  {
	protected BrowserExtension(Class dummy){super((Class) null);}
	public native TQMetaObject metaObject();
	public native String className();
	/**
		 Constructor
			@param parent The KParts.ReadOnlyPart that this extension ... "extends" :)
			@param name An optional name for the extension.
		   		@short    Constructor
	*/
	public BrowserExtension(ReadOnlyPart parent, String name) {
		super((Class) null);
		newBrowserExtension(parent,name);
	}
	private native void newBrowserExtension(ReadOnlyPart parent, String name);
	public BrowserExtension(ReadOnlyPart parent) {
		super((Class) null);
		newBrowserExtension(parent);
	}
	private native void newBrowserExtension(ReadOnlyPart parent);
	/**
		 Set the parameters to use for opening the next URL.
		 This is called by the "hosting" application, to pass parameters to the part.
				@short    Set the parameters to use for opening the next URL.
		@see URLArgs
	*/
	public native void setURLArgs(URLArgs args);
	/**
		 Retrieve the set of parameters to use for opening the URL
		 (this must be called from openURL() in the part).
				@short    Retrieve the set of parameters to use for opening the URL  (this must be called from openURL() in the part).
		@see URLArgs
	*/
	public native URLArgs urlArgs();
	/**
		 Returns the current x offset.
			 For a scrollview, implement this using contentsX().
		   		@short    Returns the current x offset.
	*/
	public native int xOffset();
	/**
		 Returns the current y offset.
			 For a scrollview, implement this using contentsY().
		   		@short    Returns the current y offset.
	*/
	public native int yOffset();
	/**
		 Used by the browser to save the current state of the view
		 (in order to restore it if going back in navigation).
			 If you want to save additional properties, reimplement it
		 but don't forget to call the parent method (probably first).
		   		@short    Used by the browser to save the current state of the view  (in order to restore it if going back in navigation).
	*/
	public native void saveState(TQDataStream stream);
	/**
		 Used by the browser to restore the view in the state
		 it was when we left it.
			 If you saved additional properties, reimplement it
		 but don't forget to call the parent method (probably first).
		   		@short    Used by the browser to restore the view in the state  it was when we left it.
	*/
	public native void restoreState(TQDataStream stream);
	/**
		 Returns whether url drop handling is enabled.
		 See setURLDropHandlingEnabled for more information about this
		 property.
		   		@short    Returns whether url drop handling is enabled.
	*/
	public native boolean isURLDropHandlingEnabled();
	/**
		 Enables or disables url drop handling. URL drop handling is a property
		 describing whether the hosting shell component is allowed to install an
		 event filter on the part's widget, to listen for URI drop events.
		 Set it to true if you are exporting a BrowserExtension implementation and
		 do not provide any special URI drop handling. If set to false you can be
		 sure to receive all those URI drop events unfiltered. Also note that the
		 implementation as of Konqueror installs the event filter only on the part's
		 widget itself, not on child widgets.
		   		@short    Enables or disables url drop handling.
	*/
	public native void setURLDropHandlingEnabled(boolean enable);
	public native void setBrowserInterface(BrowserInterface impl);
	public native BrowserInterface browserInterface();
	/**
				@return the status (enabled/disabled) of an action.
 When the enableAction signal is emitted, the browserextension
 stores the status of the action internally, so that it's possible
 to query later for the status of the action, using this method.

		@short
	*/
	public native boolean isActionEnabled(String name);
	/**
				@return the text of an action, if it was set explicitely by the part.
 When the setActionText signal is emitted, the browserextension
 stores the text of the action internally, so that it's possible
 to query later for the text of the action, using this method.

		@short
	*/
	public native String actionText(String name);
	/**
		 Asks the hosting browser to perform a paste (using openURLRequestDelayed)
				@short    Asks the hosting browser to perform a paste (using openURLRequestDelayed)
	*/
	public native void pasteRequest();
	/**
		 Returns a map containing the action names as keys and corresponding
		 TQ_SLOT()'ified method names as data entries.
			 This is very useful for
		 the host component, when connecting the own signals with the
		 extension's slots.
		 Basically you iterate over the map, check if the extension implements
		 the slot and connect to the slot using the data value of your map
		 iterator.
		 Checking if the extension implements a certain slot can be done like this:
			 <pre>
		   extension.metaObject().slotNames().contains( actionName + "()" )
		 </pre>
			 (note that <code>actionName</code> is the iterator's key value if already
		  iterating over the action slot map, returned by this method)
			 Connecting to the slot can be done like this:
			 <pre>
		   connect( yourObject, TQ_SIGNAL("yourSignal()"),
		            extension, mapIterator.data() )
		 </pre>
			 (where "mapIterator" is your TQMap<String,String> iterator)
		   		@short    Returns a map containing the action names as keys and corresponding  TQ_SLOT()'ified method names as data entries.
	*/
	// KParts::BrowserExtension::ActionSlotMap actionSlotMap(); >>>> NOT CONVERTED
	/**
				@return a pointer to the static action-slot map. Preferred method to get it.
 The map is created if it doesn't exist yet

		@short
	*/
	// KParts::BrowserExtension::ActionSlotMap* actionSlotMapPtr(); >>>> NOT CONVERTED
	/**
		 Queries <code>obj</code> for a child object which inherits from this
		 BrowserExtension class. Convenience method.
		   		@short    Queries <code>obj</code> for a child object which inherits from this  BrowserExtension class.
	*/
	public static native BrowserExtension childObject(TQObject arg1);
}