Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qt/qtooltip.h 3.3.8 edited Jan 11 14:39 $ 00003 ** 00004 ** Definition of Tool Tips (or Balloon Help) for any widget or rectangle 00005 ** 00006 ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved. 00007 ** 00008 ** This file is part of the widgets module of the Qt GUI Toolkit. 00009 ** 00010 ** This file may be distributed under the terms of the Q Public License 00011 ** as defined by Trolltech ASA of Norway and appearing in the file 00012 ** LICENSE.QPL included in the packaging of this file. 00013 ** 00014 ** This file may be distributed and/or modified under the terms of the 00015 ** GNU General Public License version 2 as published by the Free Software 00016 ** Foundation and appearing in the file LICENSE.GPL included in the 00017 ** packaging of this file. 00018 ** 00019 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 00020 ** licenses may use this file in accordance with the Qt Commercial License 00021 ** Agreement provided with the Software. 00022 ** 00023 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00024 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00025 ** 00026 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00027 ** information about Qt Commercial License Agreements. 00028 ** See http://www.trolltech.com/qpl/ for QPL licensing information. 00029 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00030 ** 00031 ** Contact info@trolltech.com if any conditions of this licensing are 00032 ** not clear to you. 00033 ** 00034 **********************************************************************/ 00035 00036 #ifndef QTOOLTIP_H 00037 #define QTOOLTIP_H 00038 00039 #ifndef QT_H 00040 #include "qwidget.h" 00041 #endif // QT_H 00042 00043 #ifndef QT_NO_TOOLTIP 00044 00045 #if __GNUC__ - 0 > 3 00046 #pragma GCC system_header 00047 #endif 00048 00049 class QTipManager; 00050 class QIconViewToolTip; 00051 class QListViewToolTip; 00052 00053 class Q_EXPORT QToolTipGroup: public QObject 00054 { 00055 Q_OBJECT 00056 Q_PROPERTY( bool delay READ delay WRITE setDelay ) 00057 Q_PROPERTY( bool enabled READ enabled WRITE setEnabled ) 00058 00059 public: 00060 QToolTipGroup( QObject *parent, const char *name = 0 ); 00061 ~QToolTipGroup(); 00062 00063 bool delay() const; 00064 bool enabled() const; 00065 00066 public slots: 00067 void setDelay( bool ); 00068 void setEnabled( bool ); 00069 00070 signals: 00071 void showTip( const QString &); 00072 void removeTip(); 00073 00074 private: 00075 uint del:1; 00076 uint ena:1; 00077 00078 friend class QTipManager; 00079 00080 private: // Disabled copy constructor and operator= 00081 #if defined(Q_DISABLE_COPY) 00082 QToolTipGroup( const QToolTipGroup & ); 00083 QToolTipGroup& operator=( const QToolTipGroup & ); 00084 #endif 00085 }; 00086 00087 00088 class Q_EXPORT QToolTip: public Qt 00089 { 00090 public: 00091 QToolTip( QWidget *, QToolTipGroup * = 0 ); 00092 //### add virtual d'tor for 4.0 00093 00094 static void add( QWidget *, const QString &); 00095 static void add( QWidget *, const QString &, 00096 QToolTipGroup *, const QString& ); 00097 static void remove( QWidget * ); 00098 00099 static void add( QWidget *, const QRect &, const QString &); 00100 static void add( QWidget *, const QRect &, const QString &, 00101 QToolTipGroup *, const QString& ); 00102 static void remove( QWidget *, const QRect & ); 00103 00104 static QString textFor( QWidget *, const QPoint & pos = QPoint() ); 00105 00106 static void hide(); 00107 00108 static QFont font(); 00109 static void setFont( const QFont & ); 00110 static QPalette palette(); 00111 static void setPalette( const QPalette & ); 00112 00113 #ifndef QT_NO_COMPAT 00114 static void setEnabled( bool enable ) { setGloballyEnabled( enable ); } 00115 static bool enabled() { return isGloballyEnabled(); } 00116 #endif 00117 static void setGloballyEnabled( bool ); 00118 static bool isGloballyEnabled(); 00119 static void setWakeUpDelay(int); 00120 00121 protected: 00122 virtual void maybeTip( const QPoint & ) = 0; 00123 void tip( const QRect &, const QString &); 00124 void tip( const QRect &, const QString& , const QString &); 00125 void tip( const QRect &, const QString &, const QRect & ); 00126 void tip( const QRect &, const QString&, const QString &, const QRect &); 00127 00128 void clear(); 00129 00130 public: 00131 QWidget *parentWidget() const { return p; } 00132 QToolTipGroup *group() const { return g; } 00133 00134 private: 00135 QWidget *p; 00136 QToolTipGroup *g; 00137 static QFont *ttFont; 00138 static QPalette *ttPalette; 00139 00140 friend class QTipManager; 00141 }; 00142 00143 00144 #endif // QT_NO_TOOLTIP 00145 00146 #endif // QTOOLTIP_H