1 | /**********************************************************************
|
---|
2 | ** Copyright (C) 2000-2007 Trolltech ASA. All rights reserved.
|
---|
3 | **
|
---|
4 | ** This file is part of the Qt Assistant.
|
---|
5 | **
|
---|
6 | ** This file may be distributed and/or modified under the terms of the
|
---|
7 | ** GNU General Public License version 2 as published by the Free Software
|
---|
8 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
9 | ** packaging of this file.
|
---|
10 | **
|
---|
11 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
12 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
13 | ** Agreement provided with the Software.
|
---|
14 | **
|
---|
15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
17 | **
|
---|
18 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
19 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
20 | ** information about Qt Commercial License Agreements.
|
---|
21 | **
|
---|
22 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
23 | ** not clear to you.
|
---|
24 | **
|
---|
25 | **********************************************************************/
|
---|
26 |
|
---|
27 | #ifndef HELPWINDOW_H
|
---|
28 | #define HELPWINDOW_H
|
---|
29 |
|
---|
30 | #include <qtextbrowser.h>
|
---|
31 |
|
---|
32 | class MainWindow;
|
---|
33 | class QKeyEvent;
|
---|
34 | class QMime;
|
---|
35 | class QMouseEvent;
|
---|
36 |
|
---|
37 | class HelpWindow : public QTextBrowser
|
---|
38 | {
|
---|
39 | Q_OBJECT
|
---|
40 | public:
|
---|
41 | HelpWindow( MainWindow *m, QWidget *parent = 0, const char *name = 0 );
|
---|
42 | void setSource( const QString &name );
|
---|
43 | QPopupMenu *createPopupMenu( const QPoint& pos );
|
---|
44 | void blockScrolling( bool b );
|
---|
45 | void openLinkInNewWindow( const QString &link );
|
---|
46 | void openLinkInNewPage( const QString &link );
|
---|
47 | void addMimePath( const QString &path );
|
---|
48 |
|
---|
49 | void contentsMousePressEvent(QMouseEvent *e);
|
---|
50 | void keyPressEvent(QKeyEvent *);
|
---|
51 |
|
---|
52 | bool isBackwardAvailable() const { return backAvail; }
|
---|
53 | bool isForwardAvailable() const { return fwdAvail; }
|
---|
54 |
|
---|
55 | signals:
|
---|
56 | void chooseWebBrowser();
|
---|
57 |
|
---|
58 | public slots:
|
---|
59 | void copy();
|
---|
60 | protected slots:
|
---|
61 | void ensureCursorVisible();
|
---|
62 |
|
---|
63 | private slots:
|
---|
64 | void openLinkInNewWindow();
|
---|
65 | void openLinkInNewPage();
|
---|
66 | void updateForward(bool);
|
---|
67 | void updateBackward(bool);
|
---|
68 |
|
---|
69 | private:
|
---|
70 | MainWindow *mw;
|
---|
71 | QString lastAnchor;
|
---|
72 | bool blockScroll;
|
---|
73 | bool shiftPressed;
|
---|
74 | bool newWindow;
|
---|
75 | QMimeSourceFactory *mimeSourceFactory;
|
---|
76 | bool fwdAvail;
|
---|
77 | bool backAvail;
|
---|
78 | };
|
---|
79 |
|
---|
80 | #endif
|
---|