summaryrefslogtreecommitdiffstats
path: root/tdejava/koala/org/trinitydesktop/koala/KURLLabel.java
blob: acba0f8d3bd25f11103680937fe3e174c65a1209 (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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
//Auto-generated by kalyptus. DO NOT EDIT.
package org.trinitydesktop.koala;

import org.trinitydesktop.qt.Qt;
import org.trinitydesktop.qt.TQColor;
import org.trinitydesktop.qt.TQFont;
import org.trinitydesktop.qt.TQMetaObject;
import org.trinitydesktop.qt.QtSupport;
import org.trinitydesktop.qt.TQPixmap;
import org.trinitydesktop.qt.TQMouseEvent;
import org.trinitydesktop.qt.TQCursor;
import org.trinitydesktop.qt.TQEvent;
import org.trinitydesktop.qt.TQWidget;
import org.trinitydesktop.qt.TQLabel;

/**

 KURLLabel is a drop-in replacement for TQLabel that handles text
 in a fashion similar to how an HTML widget handles hyperlinks.  The
 text can be underlined (or not) and set to different colors.  It
 can also "glow" (cycle colors) when the mouse passes over it.
 KURLLabel also provides signals for several events, including
 the mouse leaving and entering the text area and all forms of
 mouse clicking.
 A typical usage would be something like so:
 <pre>
 KURLLabel address = new KURLLabel(this);
 address.setText("My homepage");
 address.setURL("http://www.home.com/~me");
 connect(address, SIGNAL("leftClickedURL(String)"),
                  SLOT("processMyURL(String)"));
 </pre>
 In this example, the text "My homepage" would be displayed
 as blue, underlined text.  When the mouse passed over it,
 it would "glow" red.  When the user clicks on the text, the
 signal leftClickedURL() would be emitted with "http://www.home.com/~me"
 as its argument.
 \image html kurllabel.png "KDE URL Label"
  See {@link KURLLabelSignals} for signals emitted by KURLLabel
		@author Peter Putzer <putzer@kde.org> (Rewrite)

		@version $Id$

		@short A drop-in replacement for TQLabel that displays hyperlinks.

*/
public class KURLLabel extends TQLabel  {
	protected KURLLabel(Class dummy){super((Class) null);}
	public native TQMetaObject metaObject();
	public native String className();
	/**
		 Default constructor.
			 Use setURL() and setText() or TQListView.setPixmap()
		 to set the resp. properties.
		   		@short    Default constructor.
	*/
	public KURLLabel(TQWidget parent, String name) {
		super((Class) null);
		newKURLLabel(parent,name);
	}
	private native void newKURLLabel(TQWidget parent, String name);
	public KURLLabel(TQWidget parent) {
		super((Class) null);
		newKURLLabel(parent);
	}
	private native void newKURLLabel(TQWidget parent);
	public KURLLabel() {
		super((Class) null);
		newKURLLabel();
	}
	private native void newKURLLabel();
	/**
		 Convenience constructor.
			@param url is the URL emitted when the label is clicked.
			@param text is the displayed string. If it's equal to null
		 the <code>url</code> will be used instead.
			@param parent Passed to lower level constructor
			@param name Passed to lower level constructor
			 <code>parent</code> and <code>name</code> are passed to TQLabel, which in turn passes
		 them further down
		   		@short    Convenience constructor.
	*/
	public KURLLabel(String url, String text, TQWidget parent, String name) {
		super((Class) null);
		newKURLLabel(url,text,parent,name);
	}
	private native void newKURLLabel(String url, String text, TQWidget parent, String name);
	public KURLLabel(String url, String text, TQWidget parent) {
		super((Class) null);
		newKURLLabel(url,text,parent);
	}
	private native void newKURLLabel(String url, String text, TQWidget parent);
	public KURLLabel(String url, String text) {
		super((Class) null);
		newKURLLabel(url,text);
	}
	private native void newKURLLabel(String url, String text);
	public KURLLabel(String url) {
		super((Class) null);
		newKURLLabel(url);
	}
	private native void newKURLLabel(String url);
	/**
		 Returns the URL.
		   		@short    Returns the URL.
	*/
	public native String url();
	/**
		 Returns the current tooltip text.
		   		@short    Returns the current tooltip text.
	*/
	public native String tipText();
	/**
				@return true if a tooltip will be displayed.

		@short
		@see #setTipText
	*/
	public native boolean useTips();
	/**
				@return true if the cursor will change while over the URL.

		@short
		@see #setUseCursor
	*/
	public native boolean useCursor();
	/**
		 When this is on, the text will switch to the selected
		 color whenever the mouse passes over it.
		   		@short    When this is on, the text will switch to the selected  color whenever the mouse passes over it.
	*/
	public native boolean isGlowEnabled();
	/**
		 This feature is very similar to the "glow" feature in that the color of the
		 label switches to the selected color when the cursor passes
		 over it. In addition, underlining is turned on for as
		 long as the mouse is overhead. Note that if "glow" and
		 underlining are both already turned on, this feature
		 will have no visible effect.
		   		@short    This feature is very similar to the "glow" feature in that the color of the  label switches to the selected color when the cursor passes  over it.
	*/
	public native boolean isFloatEnabled();
	/**
				@return the alternate pixmap (may be 0L if none was set).

		@short
	*/
	public native TQPixmap altPixmap();
	/**
		 Turns on or off the underlining.
			  When this is on, the
		 text will be underlined.  By default, it is <code>true.</code>
		   		@short    Turns on or off the underlining.
	*/
	public native void setUnderline(boolean on);
	public native void setUnderline();
	/**
		 Sets the URL for this label to <code>url.</code>
				@short    Sets the URL for this label to <code>url.</code>
		@see #url
	*/
	public native void setURL(String url);
	/**
		 Overridden for internal reasons; the API remains unaffected.
		   		@short    Overridden for internal reasons; the API remains unaffected.
	*/
	public native void setFont(TQFont arg1);
	/**
		 Turns on or off the tool tip feature.
			 When this is on, the URL will be displayed as a
		 tooltip whenever the mouse passes passes over it.
		 By default, it is <code>false.</code>
		   		@short    Turns on or off the tool tip feature.
	*/
	public native void setUseTips(boolean on);
	public native void setUseTips();
	/**
		 Specifies what text to display when tooltips are turned on.
			 If this is not used, the tip will default to the URL.
				@short    Specifies what text to display when tooltips are turned on.
		@see #setUseTips
	*/
	public native void setTipText(String tip);
	/**
		 Sets the highlight color.
			 This is the default foreground
		 color (non-selected).  By default, it is <code>blue.</code>
		   		@short    Sets the highlight color.
	*/
	public native void setHighlightedColor(TQColor highcolor);
	/**
		 This is an overloaded version for convenience.
				@short    This is an overloaded version for convenience.
		@see #setHighlightedColor
	*/
	public native void setHighlightedColor(String highcolor);
	/**
		 Sets the selected color.
			 This is the color the text will change
		 to when either a mouse passes over it and "glow" mode is on or
		 when it is selected (clicked).  By default, it is <code>red.</code>
		   		@short    Sets the selected color.
	*/
	public native void setSelectedColor(TQColor selcolor);
	/**
		 This is an overloaded version for convenience.
				@short    This is an overloaded version for convenience.
		@see #setSelectedColor
	*/
	public native void setSelectedColor(String selcolor);
	/**
		 Turns the custom cursor feature on or off.
			 When this is on, the cursor will change to a custom cursor
		 (default is a "pointing hand") whenever the cursor passes
		 over the label. By default, it is on.
			@param on whether a custom cursor should be displayed.
			@param cursor is the custom cursor. <code>null</code> indicates the default "hand cursor".
		   		@short    Turns the custom cursor feature on or off.
	*/
	public native void setUseCursor(boolean on, TQCursor cursor);
	public native void setUseCursor(boolean on);
	/**
		 Turns on or off the "glow" feature.
			 When this is on, the text will switch to the
		 selected color whenever the mouse
		 passes over it. By default, it is <code>true.</code>
		   		@short    Turns on or off the "glow" feature.
	*/
	public native void setGlow(boolean glow);
	public native void setGlow();
	/**
		 Turns on or off the "float" feature.
			 This feature is very similar to the "glow" feature in
		 that the color of the label switches to the selected
		 color when the cursor passes over it. In addition,
		 underlining is turned on for as long as the mouse is overhead.
		 Note that if "glow" and underlining are both already turned
		 on, this feature will have no visible effect.
		 By default, it is <code>false.</code>
		   		@short    Turns on or off the "float" feature.
	*/
	public native void setFloat(boolean do_float);
	public native void setFloat();
	/**
		 Sets the "alt" pixmap.
			 This pixmap will be displayed when the
		 cursor passes over the label.  The effect is similar to the
		 trick done with 'onMouseOver' in javascript.
				@short    Sets the "alt" pixmap.
		@see #altPixmap
	*/
	public native void setAltPixmap(TQPixmap altPix);
	/**
		 Overridden for internal reasons; the API remains unaffected.
		   		@short    Overridden for internal reasons; the API remains unaffected.
	*/
	protected native void mouseReleaseEvent(TQMouseEvent arg1);
	/**
		 Overridden for internal reasons; the API remains unaffected.
		   		@short    Overridden for internal reasons; the API remains unaffected.
	*/
	protected native void enterEvent(TQEvent arg1);
	/**
		 Overridden for internal reasons; the API remains unaffected.
		   		@short    Overridden for internal reasons; the API remains unaffected.
	*/
	protected native void leaveEvent(TQEvent arg1);
	/**
		 Catch parent palette changes
		   		@short    Catch parent palette changes
	*/
	public native boolean event(TQEvent e);
	/** 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();
}