summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KURLDrag.java
blob: 45e00e3dee6571ff7b35b33e0dfce1a8aa9f1010 (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
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.TQMimeSourceInterface;
import org.kde.qt.QtSupport;
import java.util.ArrayList;
import org.kde.qt.TQMimeSource;
import org.kde.qt.TQWidget;
import org.kde.qt.TQUriDrag;

/**

 This class is to be used instead of TQUriDrag when using KURL.
 The reason is: TQUriDrag (and the XDND/W3C standards) expect URLs to
 be encoded in UTF-8 (unicode), but KURL uses the current locale
 by default.
 The other reasons for using this class are:

	<li>
	it exports text/plain (for dropping/pasting into lineedits, mails etc.)
	</li>
	
	<li>
	it has support for metadata, shipped as part of the dragobject
	 This is important, for instance to set a correct HTTP referrer (some websites
	 retquire it for downloading e.g. an image).
	</li>
	 To create a drag object, use the KURLDrag constructor.
 To handle drops, use TQUriDrag.canDecode() and KURLDrag.decode()
 		@short    This class is to be used instead of TQUriDrag when using KURL.

*/
public class KURLDrag extends TQUriDrag  {
	protected KURLDrag(Class dummy){super((Class) null);}
	/**	
		 Constructs an object to drag the list of URLs in <code>urls.</code>
		 The <code>dragSource</code> and <code>name</code> arguments are passed on to TQUriDrag,
		 and the list of urls is converted to UTF-8 before being passed
		 to TQUriDrag.
			@param urls the list of URLs
			@param dragSource the parent of the TQObject. Should be set when doing drag-n-drop,
		 but should be 0 when copying to the clipboard
			@param name the name of the TQObject
		   		@short    Constructs an object to drag the list of URLs in <code>urls.</code>
	*/
	public KURLDrag(ArrayList urls, TQWidget dragSource, String name) {
		super((Class) null);
		newKURLDrag(urls,dragSource,name);
	}
	private native void newKURLDrag(ArrayList urls, TQWidget dragSource, String name);
	public KURLDrag(ArrayList urls, TQWidget dragSource) {
		super((Class) null);
		newKURLDrag(urls,dragSource);
	}
	private native void newKURLDrag(ArrayList urls, TQWidget dragSource);
	public KURLDrag(ArrayList urls) {
		super((Class) null);
		newKURLDrag(urls);
	}
	private native void newKURLDrag(ArrayList urls);
	/**	
		 Constructs an object to drag the list of URLs in <code>urls.</code>
		 This version also includes metadata.
			@param urls the list of URLs
			@param metaData a map containing meta data
			@param dragSource the parent of the TQObject. Should be set when doing drag-n-drop,
		 but should be 0 when copying to the clipboard
			@param name the name of the TQObject
				@short    Constructs an object to drag the list of URLs in <code>urls.</code>
		@see #metaData
	*/
	// KURLDrag* KURLDrag(const KURL::List& arg1,const TQMap<TQString, TQString>& arg2,TQWidget* arg3,const char* arg4); >>>> NOT CONVERTED
	// KURLDrag* KURLDrag(const KURL::List& arg1,const TQMap<TQString, TQString>& arg2,TQWidget* arg3); >>>> NOT CONVERTED
	// KURLDrag* KURLDrag(const KURL::List& arg1,const TQMap<TQString, TQString>& arg2); >>>> NOT CONVERTED
	/**	
		 By default, KURLDrag also exports the URLs as plain text, for e.g. dropping onto a text editor.
		 But in some cases this might not be wanted, e.g. if using the KURLDrag in a KMultipleDrag
		 and another component of the multiple-drag provides better plain text data.
		 In such a case, setExportAsText( false ) should be called.
				@short    By default, KURLDrag also exports the URLs as plain text, for e.
	*/
	public native void setExportAsText(boolean exp);
	/**	
		 Meta-data to associate with those URLs.
		 This is an alternative way of setting the metadata:
		 either use the constructor to pass it all at once, or use
		 drag.metaData()["key"] = data;
				@short    Meta-data to associate with those URLs.
		@see TransferJob
	*/
	// TQMap<TQString, TQString>& metaData(); >>>> NOT CONVERTED
	public native String format(int i);
	public native byte[] encodedData(String mime);
	/**	
		 Convenience method that decodes the contents of <code>e</code>
		 into a list of KURLs. Decoding will fail if at least one decoded value
		 is not a valid KURL.
			@param e the mime source
			@param urls the list of urls will be written here
				@return true if successful, false otherwise
   
		@short    Convenience method that decodes the contents of <code>e</code>  into a list of KURLs.
	*/
	public static native boolean decode(TQMimeSourceInterface e, ArrayList urls);
	/**	
		 Convenience method that decodes the contents of <code>e</code>
		 into a list of KURLs and a set of metadata. Decoding will fail if
		 at least one decoded value is not a valid KURL.
		 You should be using this one, if possible.
			@param e the mime source
			@param urls the list of urls will be written here
			@param metaData the metadata map will be written here
				@return true if successful, false otherwise
   
		@short    Convenience method that decodes the contents of <code>e</code>  into a list of KURLs and a set of metadata.
	*/
	// bool decode(const TQMimeSource* arg1,KURL::List& arg2,TQMap<TQString, TQString>& arg3); >>>> NOT CONVERTED
	/**	
		 Converts a URL to a string representation suitable for dragging.
				@short    Converts a URL to a string representation suitable for dragging.
	*/
	public static native String urlToString(KURL url);
	/**	
		 Converts a string used for dragging to a URL.
				@short    Converts a string used for dragging to a URL.
	*/
	public static native KURL stringToUrl(String s);
	/** Deletes the wrapped C++ instance */
	protected native void finalize() throws InternalError;
	/** Delete the wrapped C++ instance ahead of finalize() */
	public native void dispose();
	/** Has the wrapped C++ instance been deleted? */
	public native boolean isDisposed();
}