Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
helpWidget.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
5 * www.openflipper.org *
6 * *
7 *--------------------------------------------------------------------------- *
8 * This file is part of OpenFlipper. *
9 * *
10 * OpenFlipper is free software: you can redistribute it and/or modify *
11 * it under the terms of the GNU Lesser General Public License as *
12 * published by the Free Software Foundation, either version 3 of *
13 * the License, or (at your option) any later version with the *
14 * following exceptions: *
15 * *
16 * If other files instantiate templates or use macros *
17 * or inline functions from this file, or you compile this file and *
18 * link it with other files to produce an executable, this file does *
19 * not by itself cause the resulting executable to be covered by the *
20 * GNU Lesser General Public License. This exception does not however *
21 * invalidate any other reasons why the executable file might be *
22 * covered by the GNU Lesser General Public License. *
23 * *
24 * OpenFlipper is distributed in the hope that it will be useful, *
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27 * GNU Lesser General Public License for more details. *
28 * *
29 * You should have received a copy of the GNU LesserGeneral Public *
30 * License along with OpenFlipper. If not, *
31 * see <http://www.gnu.org/licenses/>. *
32 * *
33 \*===========================================================================*/
34 
35 /*===========================================================================*\
36 * *
37 * $Revision: 14428 $ *
38 * $LastChangedBy: moeller $ *
39 * $Date: 2012-04-23 11:10:02 +0200 (Mo, 23 Apr 2012) $ *
40 * *
41 \*===========================================================================*/
42 
43 
44 /*
45  * helpWidget.hh
46  *
47  * Created on: Apr 7, 2009
48  * Author: kremer
49  */
50 
51 #ifndef HELPWIDGET_HH_
52 #define HELPWIDGET_HH_
53 
54 #include "ui_helpWidget.hh"
55 #include <QtGui>
56 
57 #include <QtHelp>
58 #include <QTextDocument>
59 
60 #include <QHelpSearchEngine>
61 #include <QTabWidget>
62 
63 #include <iostream>
64 
65 #include "helpBrowser.hh"
66 
67 class HelpWidget : public QMainWindow, public Ui::HelpWidget
68 {
69  Q_OBJECT
70 
71  public:
72 
73  HelpWidget(QWidget* parent = 0, const QString& _homeSite = "", const bool _loadHomeSite = true);
74 
75  virtual ~HelpWidget();
76 
77  void setHomeSite(const QString& _homeSite);
78 
79 private slots:
80 
81  void startSearch();
82 
83  void goBack();
84 
85  void goForward();
86 
87  void goHome();
88 
89  void showSearchWidget();
90 
91  //the entry was already selected by user
92  void linkActivated(const QUrl& _url);
93 
94  //activate the url and jump to the entry
95  void activateLink(const QUrl& _url);
96 
97  void showFoundSite(const QUrl& _url);
98 
99  void showResults(int _hits);
100 
101  // updates the buttons an the content widget
102  // the content widget is synchronized with the helpBrowser
103  void update(const QUrl& url);
104 
105  void openFoundSite(QListWidgetItem* _item);
106 
107  //updates only the buttons (for/back)
108  void updateButtons();
109 
110  private:
111 
112  // For the search popup
113  QDockWidget* searchWidget_;
114 
115  QTabWidget* tabWidget_;
116 
117  HelpBrowser* textWindow_;
118 
119  QHelpEngine* helpEngine_;
120  QHelpSearchEngine* searchEngine_;
121 
122  QString homeSite_;
123 
124  int homeIndex_;
125 
126 };
127 
128 
129 #endif /* HELPWIDGET_HH_ */