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 class QColor; 00026 class QCursor; 00027 class QPixmap; 00028 00064 class KURLLabel : public QLabel 00065 { 00066 Q_OBJECT 00067 Q_PROPERTY (QString url READ url WRITE setURL) 00068 Q_PROPERTY (QString tipText READ tipText WRITE setTipText ) 00069 Q_PROPERTY (QPixmap altPixmap READ altPixmap WRITE setAltPixmap) 00070 Q_PROPERTY (bool glowEnabled READ isGlowEnabled WRITE setGlow ) 00071 Q_PROPERTY (bool floatEnabled READ isFloatEnabled WRITE setFloat ) 00072 Q_PROPERTY (bool useTips READ useTips WRITE setUseTips ) 00073 Q_PROPERTY (bool useCursor READ useCursor WRITE setUseCursor ) 00074 00075 public: 00082 KURLLabel (QWidget* parent = 0L, const char* name = 0L); 00083 00096 KURLLabel (const QString& url, const QString& text = QString::null, 00097 QWidget* parent = 0L, const char* name = 0L); 00098 00102 virtual ~KURLLabel (); 00103 00107 const QString& url () const; 00108 00112 const QString& tipText () const; 00113 00119 bool useTips () const; 00120 00126 bool useCursor () const; 00127 00132 bool isGlowEnabled () const; 00133 00142 bool isFloatEnabled () const; 00143 00147 const QPixmap* altPixmap () const; 00148 00149 public slots: 00156 void setUnderline (bool on = true); 00157 00163 void setURL (const QString& url); 00164 00168 virtual void setFont (const QFont&); 00169 00177 void setUseTips (bool on = true); 00178 00186 void setTipText (const QString& tip); 00187 00194 void setHighlightedColor(const QColor& highcolor); 00195 00201 void setHighlightedColor(const QString& highcolor); 00202 00210 void setSelectedColor(const QColor& selcolor); 00211 00217 void setSelectedColor(const QString& selcolor); 00218 00229 void setUseCursor (bool on, QCursor* cursor = 0L); 00230 00238 void setGlow (bool glow = true); 00239 00251 void setFloat (bool do_float = true); 00252 00262 void setAltPixmap (const QPixmap& altPix); 00263 00264 signals: 00265 00271 void enteredURL (const QString& url); 00272 00276 void enteredURL (); 00277 00283 void leftURL (const QString& url); 00284 00288 void leftURL (); 00289 00295 void leftClickedURL(const QString& url); 00296 00300 void leftClickedURL(); 00301 00307 void rightClickedURL(const QString& url); 00308 00312 void rightClickedURL(); 00313 00319 void middleClickedURL(const QString& url); 00320 00324 void middleClickedURL(); 00325 00326 protected: 00327 00331 virtual void mouseReleaseEvent (QMouseEvent*); 00332 00336 virtual void enterEvent (QEvent*); 00337 00341 virtual void leaveEvent (QEvent*); 00342 00346 virtual bool event (QEvent *e); 00347 00348 00349 private slots: 00354 void updateColor (); 00355 00356 private: 00361 void setLinkColor (const QColor& col); 00362 00363 protected: 00364 virtual void virtual_hook( int id, void* data ); 00365 private: 00366 class Private; 00367 Private* d; 00368 }; 00369 00370 #endif // KURLLABEL_H
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Sep 29 09:40:35 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003