kdeui Library API Documentation

kurllabel.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 1998 Kurt Granroth <granroth@kde.org>
00003    Copyright (C) 2000 Peter Putzer <putzer@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef KURLLABEL_H
00021 #define KURLLABEL_H
00022 
00023 #include <qlabel.h>
00024 
00025 #include <kdelibs_export.h>
00026 
00027 class QColor;
00028 class QCursor;
00029 class QPixmap;
00030 
00066 class KDEUI_EXPORT KURLLabel : public QLabel
00067 {
00068   Q_OBJECT
00069   Q_PROPERTY (QString url READ url WRITE setURL)
00070   Q_PROPERTY (QString tipText READ tipText WRITE setTipText )
00071   Q_PROPERTY (QPixmap altPixmap READ altPixmap WRITE setAltPixmap)
00072   Q_PROPERTY (bool glowEnabled READ isGlowEnabled WRITE setGlow )
00073   Q_PROPERTY (bool floatEnabled READ isFloatEnabled WRITE setFloat )
00074   Q_PROPERTY (bool useTips READ useTips WRITE setUseTips )
00075   Q_PROPERTY (bool useCursor READ useCursor WRITE setUseCursor )
00076 
00077 public:
00084   KURLLabel (QWidget* parent = 0L, const char* name = 0L);
00085 
00098   KURLLabel (const QString& url, const QString& text = QString::null,
00099               QWidget* parent = 0L, const char* name = 0L);
00100 
00104   virtual ~KURLLabel ();
00105 
00109   const QString& url () const;
00110 
00114   const QString& tipText () const;
00115 
00121   bool useTips () const;
00122 
00128   bool useCursor () const;
00129 
00134   bool isGlowEnabled () const;
00135 
00144   bool isFloatEnabled () const;
00145 
00149   const QPixmap* altPixmap () const;
00150 
00151 public slots:
00158   void setUnderline (bool on = true);
00159 
00165   void setURL (const QString& url);
00166 
00170   virtual void setFont (const QFont&);
00171 
00179   void setUseTips (bool on = true);
00180 
00188   void setTipText (const QString& tip);
00189 
00196   void setHighlightedColor(const QColor& highcolor);
00197 
00203   void setHighlightedColor(const QString& highcolor);
00204 
00212   void setSelectedColor(const QColor& selcolor);
00213 
00219   void setSelectedColor(const QString& selcolor);
00220 
00231   void setUseCursor (bool on, QCursor* cursor = 0L);
00232 
00240   void setGlow (bool glow = true);
00241 
00253   void setFloat (bool do_float = true);
00254 
00264   void setAltPixmap (const QPixmap& altPix);
00265 
00266 signals:
00267 
00273   void enteredURL (const QString& url);
00274 
00278   void enteredURL ();
00279 
00285   void leftURL (const QString& url);
00286 
00290   void leftURL ();
00291 
00297   void leftClickedURL(const QString& url);
00298 
00302   void leftClickedURL();
00303 
00309   void rightClickedURL(const QString& url);
00310 
00314   void rightClickedURL();
00315 
00321   void middleClickedURL(const QString& url);
00322 
00326   void middleClickedURL();
00327 
00328 protected:
00329 
00333   virtual void mouseReleaseEvent (QMouseEvent*);
00334 
00338   virtual void enterEvent (QEvent*);
00339 
00343   virtual void leaveEvent (QEvent*);
00344 
00348   virtual bool event (QEvent *e);
00349 
00350 
00351 private slots:
00356   void updateColor ();
00357 
00358 private:
00363   void setLinkColor (const QColor& col);
00364 
00365 protected:
00366   virtual void virtual_hook( int id, void* data );
00367 private:
00368   class Private;
00369   Private* d;
00370 };
00371 
00372 #endif // KURLLABEL_H
KDE Logo
This file is part of the documentation for kdeui Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Jul 20 13:48:34 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003