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 <kdeui_export.h>
00025
00026 #include <QtGui/QColor>
00027 #include <QtGui/QLabel>
00028 #include <QtGui/QPixmap>
00029
00030 class QCursor;
00031
00069 class KDEUI_EXPORT KUrlLabel : public QLabel
00070 {
00071 Q_OBJECT
00072 Q_PROPERTY(QString url READ url WRITE setUrl)
00073 Q_PROPERTY(QString tipText READ tipText WRITE setTipText )
00074 Q_PROPERTY(QPixmap alternatePixmap READ alternatePixmap WRITE setAlternatePixmap )
00075 Q_PROPERTY(bool glowEnabled READ isGlowEnabled WRITE setGlowEnabled )
00076 Q_PROPERTY(bool floatEnabled READ isFloatEnabled WRITE setFloatEnabled )
00077 Q_PROPERTY(bool useTips READ useTips WRITE setUseTips )
00078 Q_PROPERTY(bool useCursor READ useCursor WRITE setUseCursor )
00079
00080 public:
00087 explicit KUrlLabel( QWidget* parent = 0L );
00088
00100 explicit KUrlLabel( const QString& url, const QString& text = QString(),
00101 QWidget* parent = 0L );
00102
00106 virtual ~KUrlLabel();
00107
00111 QString url() const;
00112
00116 QString tipText() const;
00117
00123 bool useTips() const;
00124
00130 bool useCursor() const;
00131
00136 bool isGlowEnabled() const;
00137
00146 bool isFloatEnabled() const;
00147
00151 const QPixmap* alternatePixmap() const;
00152
00153 public Q_SLOTS:
00160 void setUnderline( bool on = true );
00161
00167 void setUrl( const QString& url );
00168
00172 virtual void setFont( const QFont &font );
00173
00181 void setUseTips ( bool on = true );
00182
00190 void setTipText( const QString& tip );
00191
00198 void setHighlightedColor( const QColor& highcolor );
00199
00205 void setHighlightedColor( const QString& highcolor );
00206
00214 void setSelectedColor( const QColor& color );
00215
00221 void setSelectedColor( const QString& color );
00222
00233 void setUseCursor( bool on, QCursor* cursor = 0L );
00234
00242 void setGlowEnabled( bool glow = true );
00243
00255 void setFloatEnabled( bool do_float = true );
00256
00266 void setAlternatePixmap( const QPixmap& pixmap );
00267
00268 Q_SIGNALS:
00269
00275 void enteredUrl( const QString& url );
00276
00280 void enteredUrl();
00281
00287 void leftUrl( const QString& url );
00288
00292 void leftUrl();
00293
00299 void leftClickedUrl( const QString& url );
00300
00304 void leftClickedUrl();
00305
00311 void rightClickedUrl( const QString& url );
00312
00316 void rightClickedUrl();
00317
00323 void middleClickedUrl( const QString& url );
00324
00328 void middleClickedUrl();
00329
00330 protected:
00334 virtual void mouseReleaseEvent( QMouseEvent* );
00335
00339 virtual void enterEvent( QEvent* );
00340
00344 virtual void leaveEvent( QEvent* );
00345
00349 virtual bool event( QEvent* );
00350
00351 private:
00352 class Private;
00353 Private* const d;
00354
00355 Q_PRIVATE_SLOT( d, void updateColor() )
00356 };
00357
00358 #endif