itom  4.1.0
helpViewer.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef HELPVIEWER_H
24 #define HELPVIEWER_H
25 
26 #include "../global.h"
27 
28 #ifdef ITOM_USEHELPVIEWER
29 
30 #include <qmainwindow.h>
31 
32 class QWebEngineView; //forward declaration
33 class QHelpEngine; //forward declaration
34 class QLineEdit;//forward declaration
35 class QUrl;//forward declaration
36 class QMainWindow;//forward declaration
37 
38 namespace ito {
39 
40 class WidgetFindWord; //forward declaration
41 class QtHelpUrlSchemeHandler; //forward declaration
42 
43 class HelpViewer : public QMainWindow
44 {
45  Q_OBJECT
46 
47 public:
48  HelpViewer(QWidget *parent = NULL);
49  ~HelpViewer();
50 
51  void setCollectionFile(const QString &collectionFile);
52  void getHelpViewer(const QWidget &helpViewer);
53 
54 private:
55  QWebEngineView *m_pView;
56  WidgetFindWord *m_pFindWord;
57  QString m_collectionFile;
58  QHelpEngine *m_pHelpEngine;
59  QtHelpUrlSchemeHandler *m_pSchemeHandler;
60  qreal m_pDefaultZoomFactor;
61  qreal m_pZoomFactor;
62  QLineEdit *m_plineEditIndex;
63  bool m_pSearched = false;
64 
65 protected:
66  void keyPressEvent(QKeyEvent *event);
67  void mousePressEvent(QMouseEvent *event);
68 
69 private slots:
70  void linkActivated(const QUrl &url);
71  void linkActivated(const QUrl &url, const QString &text);
72  void urlChanged(const QUrl &url);
73  void setupFinished();
74  void expandContent();
75  void mnuCloseWindow();
76  void mnuZoomInWindow();
77  void mnuZoomOutWindow();
78  void mnuDefaultZoomWindow();
79  void textChanged(const QString &text);
80  void returnPressed();
81  void search();
82  void requestShowLink(const QUrl &url);
83  void searchingStarted();
84  void searchingFinished(const int &hits);
85  void indexingStarted();
86  void indexingFinished();
87  void clicked(const QModelIndex &index);
88  void findNextWord(QString expr, bool regExpr, bool caseSensitive, bool wholeWord, bool wrap, bool forward, bool isQuickSeach);
89  void hideFindWordBar();
90  void showFindWordBar();
91  void visibilityChangedIndexWidget(bool visible);
92  void visibilityChangedSearchWidget(bool visible);
93  void loadFinished(bool ok);
94 
95 };
96 
97 } //end namespace ito
98 
99 #endif
100 #endif
Definition: apiFunctionsGraph.cpp:39