.TH "KURLLabel" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KURLLabel \- A label class that supports displaying an active hyperlink. A drop-in replacement for \fBQLabel\fP that displays hyperlinks.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kurllabel.h>\fP
.PP
Inherits \fBQLabel\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetUnderline\fP (bool on=true)"
.br
.RI "\fITurns on or off the underlining. \fP"
.ti -1c
.RI "void \fBsetURL\fP (const  \fBQString\fP &url)"
.br
.RI "\fISets the URL for this label to \fCurl\fP. \fP"
.ti -1c
.RI "virtual void \fBsetFont\fP (const  \fBQFont\fP &)"
.br
.RI "\fIOverridden for internal reasons; the API remains unaffected. \fP"
.ti -1c
.RI "void \fBsetUseTips\fP (bool on=true)"
.br
.RI "\fITurns on or off the tool tip feature. \fP"
.ti -1c
.RI "void \fBsetTipText\fP (const  \fBQString\fP &tip)"
.br
.RI "\fISpecifies what text to display when tooltips are turned on. \fP"
.ti -1c
.RI "void \fBsetHighlightedColor\fP (const  \fBQColor\fP &highcolor)"
.br
.RI "\fISets the highlight color. \fP"
.ti -1c
.RI "void \fBsetHighlightedColor\fP (const  \fBQString\fP &highcolor)"
.br
.RI "\fIThis is an overloaded version for convenience. \fP"
.ti -1c
.RI "void \fBsetSelectedColor\fP (const  \fBQColor\fP &selcolor)"
.br
.RI "\fISets the selected color. \fP"
.ti -1c
.RI "void \fBsetSelectedColor\fP (const  \fBQString\fP &selcolor)"
.br
.RI "\fIThis is an overloaded version for convenience. \fP"
.ti -1c
.RI "void \fBsetUseCursor\fP (bool on, \fBQCursor\fP *cursor=0L)"
.br
.RI "\fITurns the custom cursor feature on or off. \fP"
.ti -1c
.RI "void \fBsetGlow\fP (bool glow=true)"
.br
.RI "\fITurns on or off the 'glow' feature. \fP"
.ti -1c
.RI "void \fBsetFloat\fP (bool do_float=true)"
.br
.RI "\fITurns on or off the 'float' feature. \fP"
.ti -1c
.RI "void \fBsetAltPixmap\fP (const  \fBQPixmap\fP &altPix)"
.br
.RI "\fISets the 'alt' pixmap. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBenteredURL\fP (const  \fBQString\fP &url)"
.br
.RI "\fIEmitted when the mouse has passed over the label. \fP"
.ti -1c
.RI "void \fBenteredURL\fP ()"
.br
.RI "\fIEmitted when the mouse has passed over the label. \fP"
.ti -1c
.RI "void \fBleftURL\fP (const  \fBQString\fP &url)"
.br
.RI "\fIEmitted when the mouse is no longer over the label. \fP"
.ti -1c
.RI "void \fBleftURL\fP ()"
.br
.RI "\fIEmitted when the mouse is no longer over the label. \fP"
.ti -1c
.RI "void \fBleftClickedURL\fP (const  \fBQString\fP &url)"
.br
.RI "\fIEmitted when the user clicked the left mouse button on this label. \fP"
.ti -1c
.RI "void \fBleftClickedURL\fP ()"
.br
.RI "\fIEmitted when the user clicked the left mouse button on this label. \fP"
.ti -1c
.RI "void \fBrightClickedURL\fP (const  \fBQString\fP &url)"
.br
.RI "\fIEmitted when the user clicked the right mouse button on this label. \fP"
.ti -1c
.RI "void \fBrightClickedURL\fP ()"
.br
.RI "\fIEmitted when the user clicked the left mouse button on this label. \fP"
.ti -1c
.RI "void \fBmiddleClickedURL\fP (const  \fBQString\fP &url)"
.br
.RI "\fIEmitted when the user clicked the middle mouse button on this label. \fP"
.ti -1c
.RI "void \fBmiddleClickedURL\fP ()"
.br
.RI "\fIEmitted when the user clicked the left mouse button on this label. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURLLabel\fP (\fBQWidget\fP *parent=0L, const  char *name=0L)"
.br
.RI "\fIDefault constructor. \fP"
.ti -1c
.RI "\fBKURLLabel\fP (const  \fBQString\fP &url, const  \fBQString\fP &\fBtext\fP=QString::null, \fBQWidget\fP *parent=0L, const  char *name=0L)"
.br
.RI "\fIConvenience constructor. \fP"
.ti -1c
.RI "virtual \fB~KURLLabel\fP ()"
.br
.RI "\fIDestructs the label. \fP"
.ti -1c
.RI "const  \fBQString\fP & \fBurl\fP () const "
.br
.RI "\fIReturns the URL. \fP"
.ti -1c
.RI "const  \fBQString\fP & \fBtipText\fP () const "
.br
.RI "\fIReturns the current tooltip text. \fP"
.ti -1c
.RI "bool \fBuseTips\fP () const "
.br
.ti -1c
.RI "bool \fBuseCursor\fP () const "
.br
.ti -1c
.RI "bool \fBisGlowEnabled\fP () const "
.br
.RI "\fIWhen this is on, the text will switch to the selected color whenever the mouse passes over it. \fP"
.ti -1c
.RI "bool \fBisFloatEnabled\fP () const "
.br
.RI "\fIThis 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. \fP"
.ti -1c
.RI "const  \fBQPixmap\fP * \fBaltPixmap\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBmouseReleaseEvent\fP (\fBQMouseEvent\fP *)"
.br
.RI "\fIOverridden for internal reasons; the API remains unaffected. \fP"
.ti -1c
.RI "virtual void \fBenterEvent\fP (\fBQEvent\fP *)"
.br
.RI "\fIOverridden for internal reasons; the API remains unaffected. \fP"
.ti -1c
.RI "virtual void \fBleaveEvent\fP (\fBQEvent\fP *)"
.br
.RI "\fIOverridden for internal reasons; the API remains unaffected. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
A label class that supports displaying an active hyperlink. A drop-in replacement for \fBQLabel\fP that displays hyperlinks. 

KURLLabel is a drop-in replacement for \fBQLabel\fP 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.
.PP
KURLLabel also provides signals for several events, including the mouse leaving and entering the text area and all forms of mouse clicking.
.PP
A typical usage would be something like so:
.PP
.PP
.nf

     KURLLabel *address = new KURLLabel(this);
     address->setText('My homepage');
     address->setURL('http://www.home.com/~me');
     connect(address, SIGNAL(\fBleftClickedURL(const QString&)\fP),
                      SLOT(processMyURL(const QString&)));
 
.PP
.PP
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 \fBleftClickedURL\fP() would be emitted with 'http://www.home.com/~me' as its argument.
.PP
\fBAuthor:\fP
.RS 4
Kurt Granroth <granroth@kde.org> (Interface) 
.PP
Peter Putzer <putzer@kde.org> (Rewrite) 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkurllabel.h\fP,v 1.20 2002/03/04 00:51:52 lunakl Exp 
.RE
.PP
.RE
.PP

.PP
Definition at line 63 of file kurllabel.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURLLabel::KURLLabel (\fBQWidget\fP * parent = 0L, const char * name = 0L)"
.PP
Default constructor. Use \fBsetURL\fP() and \fBsetText\fP() or \fBQListView::setPixmap\fP() to set the resp. properties. Definition at line 66 of file kurllabel.cpp.
.PP
References KCursor::handCursor(), KStdAccel::name(), and setFont().
.SS "KURLLabel::KURLLabel (const \fBQString\fP & url, const \fBQString\fP & text = QString::null, \fBQWidget\fP * parent = 0L, const char * name = 0L)"
.PP
Convenience constructor. \fBParameters:\fP
.RS 4
\fIurl\fP is the URL emitted when the label is clicked. 
.br
\fItext\fP is the displayed string. If it's equal to QString::null the \fCurl\fP will be used instead.
.RE
.PP
\fCparent\fP and \fCname\fP are passed to \fBQLabel\fP. Definition at line 56 of file kurllabel.cpp.
.PP
References KCursor::handCursor(), KStdAccel::name(), and setFont().
.SS "KURLLabel::~\fBKURLLabel\fP ()\fC [virtual]\fP"
.PP
Destructs the label. Definition at line 75 of file kurllabel.cpp.
.SH "Member Function Documentation"
.PP 
.SS "const  \fBQString\fP & KURLLabel::url () const"
.PP
Returns the URL. Definition at line 151 of file kurllabel.cpp.
.SS "const  \fBQString\fP & KURLLabel::tipText () const"
.PP
Returns the current tooltip text. Definition at line 197 of file kurllabel.cpp.
.SS "bool KURLLabel::useTips () const"
.PP
\fBReturns:\fP
.RS 4
true if a tooltip will be displayed.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetTipText()\fP 
.RE
.PP
Definition at line 192 of file kurllabel.cpp.
.SS "bool KURLLabel::useCursor () const"
.PP
\fBReturns:\fP
.RS 4
true if the cursor will change while over the URL.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetUseCursor\fP () 
.RE
.PP
Definition at line 170 of file kurllabel.cpp.
.SS "bool KURLLabel::isGlowEnabled () const"
.PP
When this is on, the text will switch to the selected color whenever the mouse passes over it. Definition at line 238 of file kurllabel.cpp.
.SS "bool KURLLabel::isFloatEnabled () const"
.PP
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. Definition at line 243 of file kurllabel.cpp.
.SS "const  \fBQPixmap\fP * KURLLabel::altPixmap () const"
.PP
\fBReturns:\fP
.RS 4
the alternate pixmap (may be 0L if none was set). 
.RE
.PP
Definition at line 253 of file kurllabel.cpp.
.SS "void KURLLabel::setUnderline (bool on = true)\fC [slot]\fP"
.PP
Turns on or off the underlining. When this is on, the text will be underlined. By default, it is \fCtrue\fP. Definition at line 117 of file kurllabel.cpp.
.PP
References setFont().
.PP
Referenced by KDialogBase::enableLinkedHelp(), enterEvent(), and leaveEvent().
.SS "void KURLLabel::setURL (const \fBQString\fP & url)\fC [slot]\fP"
.PP
Sets the URL for this label to \fCurl\fP. \fBSee also:\fP
.RS 4
\fBurl\fP 
.RE
.PP
Definition at line 141 of file kurllabel.cpp.
.PP
References setUseTips().
.SS "void KURLLabel::setFont (const \fBQFont\fP &)\fC [virtual, slot]\fP"
.PP
Overridden for internal reasons; the API remains unaffected. Reimplemented from \fBQLabel\fP.
.PP
Definition at line 109 of file kurllabel.cpp.
.PP
References QLabel::setFont(), and QFont::setUnderline().
.PP
Referenced by KURLLabel(), and setUnderline().
.SS "void KURLLabel::setUseTips (bool on = true)\fC [slot]\fP"
.PP
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 \fCfalse\fP. Definition at line 175 of file kurllabel.cpp.
.PP
References QToolTip::add(), and QToolTip::remove().
.PP
Referenced by setTipText(), and setURL().
.SS "void KURLLabel::setTipText (const \fBQString\fP & tip)\fC [slot]\fP"
.PP
Specifies what text to display when tooltips are turned on. If this is not used, the tip will default to the URL.
.PP
\fBSee also:\fP
.RS 4
\fBsetUseTips()\fP 
.RE
.PP
Definition at line 185 of file kurllabel.cpp.
.PP
References setUseTips().
.SS "void KURLLabel::setHighlightedColor (const \fBQColor\fP & highcolor)\fC [slot]\fP"
.PP
Sets the highlight color. This is the default foreground color (non-selected). By default, it is \fCblue\fP. Definition at line 202 of file kurllabel.cpp.
.PP
Referenced by setHighlightedColor().
.SS "void KURLLabel::setHighlightedColor (const \fBQString\fP & highcolor)\fC [slot]\fP"
.PP
This is an overloaded version for convenience. \fBSee also:\fP
.RS 4
\fBsetHighlightedColor()\fP 
.RE
.PP
Definition at line 210 of file kurllabel.cpp.
.PP
References setHighlightedColor().
.SS "void KURLLabel::setSelectedColor (const \fBQColor\fP & selcolor)\fC [slot]\fP"
.PP
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 \fCred\fP. Definition at line 215 of file kurllabel.cpp.
.PP
Referenced by setSelectedColor().
.SS "void KURLLabel::setSelectedColor (const \fBQString\fP & selcolor)\fC [slot]\fP"
.PP
This is an overloaded version for convenience. \fBSee also:\fP
.RS 4
\fBsetSelectedColor()\fP 
.RE
.PP
Definition at line 223 of file kurllabel.cpp.
.PP
References setSelectedColor().
.SS "void KURLLabel::setUseCursor (bool on, \fBQCursor\fP * cursor = 0L)\fC [slot]\fP"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIon\fP whether a custom cursor should be displayed. 
.br
\fIcursor\fP is the custom cursor. \fC0L\fP indicates the default 'hand cursor'. 
.RE
.PP
Definition at line 156 of file kurllabel.cpp.
.PP
References KCursor::handCursor().
.SS "void KURLLabel::setGlow (bool glow = true)\fC [slot]\fP"
.PP
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 \fCtrue\fP. Definition at line 228 of file kurllabel.cpp.
.SS "void KURLLabel::setFloat (bool do_float = true)\fC [slot]\fP"
.PP
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 \fCfalse\fP. Definition at line 233 of file kurllabel.cpp.
.PP
Referenced by KDialogBase::enableLinkedHelp().
.SS "void KURLLabel::setAltPixmap (const \fBQPixmap\fP & altPix)\fC [slot]\fP"
.PP
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.
.PP
\fBSee also:\fP
.RS 4
\fBaltPixmap()\fP 
.RE
.PP
Definition at line 248 of file kurllabel.cpp.
.SS "void KURLLabel::enteredURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the mouse has passed over the label. \fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::enteredURL ()\fC [signal]\fP"
.PP
Emitted when the mouse has passed over the label. Referenced by enterEvent().
.SS "void KURLLabel::leftURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the mouse is no longer over the label. \fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::leftURL ()\fC [signal]\fP"
.PP
Emitted when the mouse is no longer over the label. Referenced by leaveEvent().
.SS "void KURLLabel::leftClickedURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the user clicked the left mouse button on this label. \fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::leftClickedURL ()\fC [signal]\fP"
.PP
Emitted when the user clicked the left mouse button on this label. Referenced by mouseReleaseEvent().
.SS "void KURLLabel::rightClickedURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the user clicked the right mouse button on this label. \fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::rightClickedURL ()\fC [signal]\fP"
.PP
Emitted when the user clicked the left mouse button on this label. Referenced by mouseReleaseEvent().
.SS "void KURLLabel::middleClickedURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the user clicked the middle mouse button on this label. \fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::middleClickedURL ()\fC [signal]\fP"
.PP
Emitted when the user clicked the left mouse button on this label. Referenced by mouseReleaseEvent().
.SS "void KURLLabel::mouseReleaseEvent (\fBQMouseEvent\fP *)\fC [protected, virtual]\fP"
.PP
Overridden for internal reasons; the API remains unaffected. Definition at line 80 of file kurllabel.cpp.
.PP
References QMouseEvent::button(), leftClickedURL(), middleClickedURL(), and rightClickedURL().
.SS "void KURLLabel::enterEvent (\fBQEvent\fP *)\fC [protected, virtual]\fP"
.PP
Overridden for internal reasons; the API remains unaffected. Definition at line 258 of file kurllabel.cpp.
.PP
References enteredURL(), QLabel::pixmap(), QLabel::setPixmap(), and setUnderline().
.SS "void KURLLabel::leaveEvent (\fBQEvent\fP *)\fC [protected, virtual]\fP"
.PP
Overridden for internal reasons; the API remains unaffected. Definition at line 284 of file kurllabel.cpp.
.PP
References leftURL(), QLabel::pixmap(), QLabel::setPixmap(), and setUnderline().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
