00001
00002
00003
00004
00005
00006
00007 #ifndef CHECKLIST_GUIDE_BROWSER_H
00008 #define CHECKLIST_GUIDE_BROWSER_H
00009
00010 #include "CmdMediator.h"
00011 #include <QHash>
00012 #include <QTextBrowser>
00013
00015 class ChecklistGuideBrowser : public QTextBrowser
00016 {
00017 Q_OBJECT;
00018
00019 public:
00021 ChecklistGuideBrowser();
00022
00024 virtual void setTemplateHtml (const QString &html,
00025 const QStringList &curveNames);
00026
00028 void update (const CmdMediator &cmdMediator,
00029 bool documentIsExported);
00030
00031 private slots:
00032 void slotAnchorClicked (const QUrl &url);
00033
00034 private:
00035
00036 QString ahref (QString &html,
00037 const QString &name) const;
00038
00039 void check (QString &html,
00040 const QString &anchor,
00041 bool isChecked) const;
00042 void divHide (QString &html,
00043 const QString &anchor) const;
00044 void divShow (QString &html,
00045 const QString &anchor) const;
00046
00049 QString processAhrefs (const QString &htmlBefore);
00050
00052 QString processCheckboxes (const QString &htmlBefore);
00053
00055 QString processDivs (const QString &htmlBefore);
00056
00058 void refresh ();
00059
00060 void repopulateCheckedTags (const CmdMediator &cmdMediator,
00061 bool documentIsExported);
00062
00063 QString m_templateHtml;
00064 QStringList m_curveNames;
00065
00066
00067
00068
00069 QString m_anchor;
00070 QHash<QString, bool> m_checkedTags;
00071 };
00072
00073 #endif // CHECKLIST_GUIDE_BROWSER_H