Chris@225: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@225: Chris@225: /* Chris@225: Sonic Visualiser Chris@225: An audio file viewer and annotation editor. Chris@225: Centre for Digital Music, Queen Mary, University of London. Chris@225: This file copyright 2007 QMUL. Chris@225: Chris@225: This program is free software; you can redistribute it and/or Chris@225: modify it under the terms of the GNU General Public License as Chris@225: published by the Free Software Foundation; either version 2 of the Chris@225: License, or (at your option) any later version. See the file Chris@225: COPYING included with this distribution for more information. Chris@225: */ Chris@225: Chris@1407: #ifndef SV_TIP_DIALOG_H Chris@1407: #define SV_TIP_DIALOG_H Chris@225: Chris@225: #include Chris@225: #include Chris@225: #include Chris@225: Chris@225: #include Chris@225: Chris@584: #include "base/Debug.h" Chris@584: Chris@225: class QLabel; Chris@225: class QXmlInputSource; Chris@225: Chris@225: class TipDialog : public QDialog Chris@225: { Chris@225: Q_OBJECT Chris@225: Chris@225: public: Chris@616: TipDialog(QWidget *parent = 0); Chris@225: virtual ~TipDialog(); Chris@225: Chris@225: bool isOK() { return !m_tips.empty(); } Chris@225: Chris@225: protected slots: Chris@225: void previous(); Chris@225: void next(); Chris@225: Chris@225: protected: Chris@225: int m_tipNumber; Chris@225: QLabel *m_label; Chris@225: QString m_caption; Chris@225: Chris@225: std::vector m_tips; Chris@225: Chris@225: void readTips(); Chris@225: void showTip(); Chris@225: Chris@225: class TipFileParser : public QXmlDefaultHandler Chris@225: { Chris@225: public: Chris@225: TipFileParser(TipDialog *dialog); Chris@225: virtual ~TipFileParser(); Chris@225: Chris@225: void parse(QXmlInputSource &source); Chris@225: Chris@1406: bool startElement(const QString &namespaceURI, Chris@225: const QString &localName, Chris@225: const QString &qName, Chris@1406: const QXmlAttributes& atts) override; Chris@225: Chris@1406: bool characters(const QString &) override; Chris@225: Chris@1406: bool endElement(const QString &namespaceURI, Chris@225: const QString &localName, Chris@1406: const QString &qName) override; Chris@225: Chris@1406: bool error(const QXmlParseException &exception) override; Chris@1406: bool fatalError(const QXmlParseException &exception) override; Chris@225: Chris@225: protected: Chris@225: TipDialog *m_dialog; Chris@225: Chris@225: bool m_inTip; Chris@225: bool m_inText; Chris@228: bool m_inHtml; Chris@225: }; Chris@225: }; Chris@225: Chris@225: #endif