kdeui
kurllabel.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KURLLABEL_H
00022 #define KURLLABEL_H
00023
00024 #include <qlabel.h>
00025
00026 #include <kdelibs_export.h>
00027
00028 class QColor;
00029 class QCursor;
00030 class QPixmap;
00031
00071 class KDEUI_EXPORT KURLLabel : public QLabel
00072 {
00073 Q_OBJECT
00074 Q_PROPERTY (QString url READ url WRITE setURL)
00075 Q_PROPERTY (QString tipText READ tipText WRITE setTipText )
00076 Q_PROPERTY (QPixmap altPixmap READ altPixmap WRITE setAltPixmap)
00077 Q_PROPERTY (bool glowEnabled READ isGlowEnabled WRITE setGlow )
00078 Q_PROPERTY (bool floatEnabled READ isFloatEnabled WRITE setFloat )
00079 Q_PROPERTY (bool useTips READ useTips WRITE setUseTips )
00080 Q_PROPERTY (bool useCursor READ useCursor WRITE setUseCursor )
00081
00082 public:
00089 KURLLabel (QWidget* parent = 0L, const char* name = 0L);
00090
00103 KURLLabel (const QString& url, const QString& text = QString::null,
00104 QWidget* parent = 0L, const char* name = 0L);
00105
00109 virtual ~KURLLabel ();
00110
00114 const QString& url () const;
00115
00119 const QString& tipText () const;
00120
00126 bool useTips () const;
00127
00133 bool useCursor () const;
00134
00139 bool isGlowEnabled () const;
00140
00149 bool isFloatEnabled () const;
00150
00154 const QPixmap* altPixmap () const;
00155
00159 virtual void setMargin ( int margin );
00160
00164 virtual void setFocusPolicy ( FocusPolicy policy );
00165
00169 virtual void setSizePolicy ( QSizePolicy );
00170
00171 public slots:
00178 void setUnderline (bool on = true);
00179
00185 void setURL (const QString& url);
00186
00190 virtual void setFont (const QFont&);
00191
00199 void setUseTips (bool on = true);
00200
00208 void setTipText (const QString& tip);
00209
00216 void setHighlightedColor(const QColor& highcolor);
00217
00223 void setHighlightedColor(const QString& highcolor);
00224
00232 void setSelectedColor(const QColor& selcolor);
00233
00239 void setSelectedColor(const QString& selcolor);
00240
00244 virtual void setCursor ( const QCursor& cursor );
00245
00249 virtual void unsetCursor ();
00250
00261 void setUseCursor (bool on, QCursor* cursor = 0L);
00262
00270 void setGlow (bool glow = true);
00271
00283 void setFloat (bool do_float = true);
00284
00294 void setAltPixmap (const QPixmap& altPix);
00295
00296 signals:
00297
00303 void enteredURL (const QString& url);
00304
00308 void enteredURL ();
00309
00315 void leftURL (const QString& url);
00316
00320 void leftURL ();
00321
00327 void leftClickedURL(const QString& url);
00328
00332 void leftClickedURL();
00333
00339 void rightClickedURL(const QString& url);
00340
00344 void rightClickedURL();
00345
00351 void middleClickedURL(const QString& url);
00352
00356 void middleClickedURL();
00357
00358 protected:
00359
00363 virtual void mouseReleaseEvent ( QMouseEvent * e );
00364
00368 virtual void enterEvent (QEvent*);
00369
00373 virtual void leaveEvent (QEvent*);
00374
00378 virtual bool event (QEvent *e);
00379
00383 QRect activeRect() const;
00384
00385
00386 private slots:
00391 void updateColor ();
00392
00393 private:
00398 void setLinkColor (const QColor& col);
00399
00400 protected:
00401 virtual void virtual_hook( int id, void* data );
00402 private:
00403 class Private;
00404 Private* d;
00405 };
00406
00407 #endif // KURLLABEL_H