helpBrowser.hh 910 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
/*
 * helpBrowser.hh
 *
 *  Created on: Apr 8, 2009
 *      Author: kremer
 */

#ifndef HELPBROWSER_HH_
#define HELPBROWSER_HH_

#include <QtGui>
#include <QTextBrowser>
#include <QtHelp>

class HelpBrowser : public QTextBrowser {
	Q_OBJECT

public:
	HelpBrowser(QHelpEngine* _helpEngine, QWidget* parent = 0);

	~HelpBrowser();

	QVariant loadResource(int type, const QUrl& url);

	bool setCSSData(QString& _filename);

	void refreshCSS();

	bool isBackwardAvailable();

	bool isForwardAvailable();

signals:
	void sourceChanged ( const QString& src );

public slots:

	void setSource(const QUrl& url);

	void setSource(const QUrl& url, const QString& /* str */, bool _skipSave = false);

	void backward();

	void forward();

private:

	QHelpEngine* helpEngine_;

	QTextDocument* doc_;

	QString css_str_;
	QString css_file_;

	QStringList visitedPages_;
	int currentPage_;

};


#endif /* HELPBROWSER_HH_ */