ktip.h
/*****************************************************************
Copyright (c) 2000-2003 Matthias Hoelzer-Kluepfel <mhk@kde.org>
Tobias Koenig <tokoe@kde.org>
Daniel Molkentin <molkentin@kde.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/
#ifndef __K_TIP_H__
#define __K_TIP_H__
#include <qstringlist.h>
#include <kdialog.h>
class QCheckBox;
class KTextBrowser;
class KDEUI_EXPORT KTipDatabase
{
public:
KTipDatabase(const QString &tipFile = QString::null);
KTipDatabase(const QStringList &tipFiles);
QString tip() const;
void nextTip();
void prevTip();
private:
void loadTips(const QString &tipFile);
void addTips(const QString &tipFile);
QStringList mTips;
int mCurrent;
class KTipDatabasePrivate;
KTipDatabasePrivate *d;
};
class KDEUI_EXPORT KTipDialog : public KDialog
{
Q_OBJECT
public:
KTipDialog(KTipDatabase *db, QWidget *parent = 0, const char *name = 0);
~KTipDialog();
static void showTip(QWidget *parent, const QString &tipFile = QString::null, bool force=false);
static void showMultiTip(QWidget *parent, const QStringList &tipFiles, bool force=false);
static void showTip(const QString &tipFile = QString::null, bool force = false);
static void setShowOnStart(bool show);
protected:
bool eventFilter(QObject *, QEvent *);
virtual void virtual_hook( int id, void* data );
private slots:
void nextTip();
void prevTip();
void showOnStart(bool);
private:
KTipDatabase *mDatabase;
QCheckBox *mTipOnStart;
KTextBrowser *mTipText;
class KTipDialogPrivate;
KTipDialogPrivate *d;
static KTipDialog *mInstance;
QColor mBaseColor, mBlendedColor, mTextColor;
};
#endif
KTipDatabase
A database for tips-of-the-day.
Definition: ktip.h:55
KDialog
Dialog with extended non-modal support and methods for KDE standard compliance.
Definition: kdialog.h:52
KTextBrowser
Extended QTextBrowser.
Definition: ktextbrowser.h:42
KTipDialog
A Tip-of-the-Day dialog.
Definition: ktip.h:108

KDE Home | KDE Accessibility Home | Description of Access Keys