ktip.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __K_TIP_H__
00027 #define __K_TIP_H__
00028
00029 #include <qstringlist.h>
00030
00031 #include <kdialog.h>
00032
00033 class QCheckBox;
00034
00035 class KTextBrowser;
00036
00055 class KDEUI_EXPORT KTipDatabase
00056 {
00057 public:
00064 KTipDatabase(const QString &tipFile = QString::null);
00065
00072 KTipDatabase(const QStringList &tipFiles);
00073
00077 QString tip() const;
00078
00082 void nextTip();
00083
00087 void prevTip();
00088
00089 private:
00090 void loadTips(const QString &tipFile);
00091
00092 void addTips(const QString &tipFile);
00093
00094 QStringList mTips;
00095
00096 int mCurrent;
00097 class KTipDatabasePrivate;
00098 KTipDatabasePrivate *d;
00099 };
00100
00108 class KDEUI_EXPORT KTipDialog : public KDialog
00109 {
00110 Q_OBJECT
00111 public:
00119 KTipDialog(KTipDatabase *db, QWidget *parent = 0, const char *name = 0);
00120 ~KTipDialog();
00121
00138 static void showTip(QWidget *parent, const QString &tipFile = QString::null, bool force=false);
00139
00151 static void showMultiTip(QWidget *parent, const QStringList &tipFiles, bool force=false);
00152
00159 static void showTip(const QString &tipFile = QString::null, bool force = false);
00160
00167 static void setShowOnStart(bool show);
00168
00169 protected:
00170 bool eventFilter(QObject *, QEvent *);
00171 virtual void virtual_hook( int id, void* data );
00172
00173 private slots:
00174 void nextTip();
00175 void prevTip();
00176 void showOnStart(bool);
00177
00178 private:
00179 KTipDatabase *mDatabase;
00180
00181 QCheckBox *mTipOnStart;
00182 KTextBrowser *mTipText;
00183
00184 class KTipDialogPrivate;
00185 KTipDialogPrivate *d;
00186
00187 static KTipDialog *mInstance;
00188
00189 QColor mBaseColor, mBlendedColor, mTextColor;
00190 };
00191
00192 #endif
|