00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KURLLABEL_H
00021 #define KURLLABEL_H
00022
00023 #include <qlabel.h>
00024
00025 class QColor;
00026 class QCursor;
00027 class QPixmap;
00028
00063 class KURLLabel : public QLabel
00064 {
00065 Q_OBJECT
00066 Q_PROPERTY (QString url READ url WRITE setURL)
00067 Q_PROPERTY (QPixmap altPixmap READ altPixmap WRITE setAltPixmap)
00068
00069 public:
00076 KURLLabel (QWidget* parent = 0L, const char* name = 0L);
00077
00087 KURLLabel (const QString& url, const QString& text = QString::null,
00088 QWidget* parent = 0L, const char* name = 0L);
00089
00093 virtual ~KURLLabel ();
00094
00098 const QString& url () const;
00099
00103 const QString& tipText () const;
00104
00110 bool useTips () const;
00111
00117 bool useCursor () const;
00118
00123 bool isGlowEnabled () const;
00124
00133 bool isFloatEnabled () const;
00134
00138 const QPixmap* altPixmap () const;
00139
00140 public slots:
00147 void setUnderline (bool on = true);
00148
00154 void setURL (const QString& url);
00155
00159 virtual void setFont (const QFont&);
00160
00168 void setUseTips (bool on = true);
00169
00177 void setTipText (const QString& tip);
00178
00185 void setHighlightedColor(const QColor& highcolor);
00186
00192 void setHighlightedColor(const QString& highcolor);
00193
00201 void setSelectedColor(const QColor& selcolor);
00202
00208 void setSelectedColor(const QString& selcolor);
00209
00220 void setUseCursor (bool on, QCursor* cursor = 0L);
00221
00229 void setGlow (bool glow = true);
00230
00242 void setFloat (bool do_float = true);
00243
00253 void setAltPixmap (const QPixmap& altPix);
00254
00255 signals:
00256
00262 void enteredURL (const QString& url);
00263
00267 void enteredURL ();
00268
00274 void leftURL (const QString& url);
00275
00279 void leftURL ();
00280
00286 void leftClickedURL(const QString& url);
00287
00291 void leftClickedURL();
00292
00298 void rightClickedURL(const QString& url);
00299
00303 void rightClickedURL();
00304
00310 void middleClickedURL(const QString& url);
00311
00315 void middleClickedURL();
00316
00317 protected:
00318
00322 virtual void mouseReleaseEvent (QMouseEvent*);
00323
00327 virtual void enterEvent (QEvent*);
00328
00332 virtual void leaveEvent (QEvent*);
00333
00334 private slots:
00339 void updateColor ();
00340
00341 private:
00346 void setLinkColor (const QColor& col);
00347
00348 protected:
00349 virtual void virtual_hook( int id, void* data );
00350 private:
00351 class Private;
00352 Private* d;
00353 };
00354
00355 #endif // KURLLABEL_H