itom 2.2.1
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2016, Institut fuer Technische Optik (ITO), 00005 Universitaet Stuttgart, Germany 00006 00007 This file is part of itom. 00008 00009 itom is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Library General Public Licence as published by 00011 the Free Software Foundation; either version 2 of the Licence, or (at 00012 your option) any later version. 00013 00014 itom is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00017 General Public Licence for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with itom. If not, see <http://www.gnu.org/licenses/>. 00021 *********************************************************************** */ 00022 00023 #ifndef HELPVIEWER_H 00024 #define HELPVIEWER_H 00025 00026 #include "../global.h" 00027 00028 #ifdef ITOM_USEHELPVIEWER 00029 00030 #include <qmainwindow.h> 00031 00032 class QWebEngineView; //forward declaration 00033 class QHelpEngine; //forward declaration 00034 class QLineEdit;//forward declaration 00035 class QUrl;//forward declaration 00036 class QMainWindow;//forward declaration 00037 00038 namespace ito { 00039 00040 class WidgetFindWord; //forward declaration 00041 class QtHelpUrlSchemeHandler; //forward declaration 00042 00043 class HelpViewer : public QMainWindow 00044 { 00045 Q_OBJECT 00046 00047 public: 00048 HelpViewer(QWidget *parent = NULL); 00049 ~HelpViewer(); 00050 00051 void setCollectionFile(const QString &collectionFile); 00052 void getHelpViewer(const QWidget &helpViewer); 00053 00054 private: 00055 QWebEngineView *m_pView; 00056 WidgetFindWord *m_pFindWord; 00057 QString m_collectionFile; 00058 QHelpEngine *m_pHelpEngine; 00059 QtHelpUrlSchemeHandler *m_pSchemeHandler; 00060 qreal m_pDefaultZoomFactor; 00061 qreal m_pZoomFactor; 00062 QLineEdit *m_plineEditIndex; 00063 bool m_pSearched = false; 00064 00065 protected: 00066 void keyPressEvent(QKeyEvent *event); 00067 00068 private slots: 00069 void linkActivated(const QUrl &url); 00070 void linkActivated(const QUrl &url, const QString &text); 00071 void urlChanged(const QUrl &url); 00072 void setupFinished(); 00073 void expandContent(); 00074 void mnuCloseWindow(); 00075 void mnuZoomInWindow(); 00076 void mnuZoomOutWindow(); 00077 void mnuDefaultZoomWindow(); 00078 void textChanged(const QString &text); 00079 void returnPressed(); 00080 void search(); 00081 void requestShowLink(const QUrl &url); 00082 void searchingStarted(); 00083 void searchingFinished(const int &hits); 00084 void indexingStarted(); 00085 void indexingFinished(); 00086 void clicked(const QModelIndex &index); 00087 void findNextWord(QString expr, bool regExpr, bool caseSensitive, bool wholeWord, bool wrap, bool forward, bool isQuickSeach); 00088 void hideFindWordBar(); 00089 void showFindWordBar(); 00090 void visibilityChangedIndexWidget(bool visible); 00091 void visibilityChangedSearchWidget(bool visible); 00092 void loadFinished(bool ok); 00093 00094 }; 00095 00096 } //end namespace ito 00097 00098 #endif 00099 #endif