Subversion Repositories Scribus

Rev

Rev 2006 | Rev 2048 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
564 cbradney 1
/***************************************************************************
2
*   Copyright (C) 2004 by Craig Bradney                                   *
3
*   cbradney@zip.com.au                                                   *
4
*                                                                         *
5
*   This program is free software; you can redistribute it and/or modify  *
6
*   it under the terms of the GNU General Public License as published by  *
7
*   the Free Software Foundation; either version 2 of the License, or     *
8
*   (at your option) any later version.                                   *
9
*                                                                         *
10
*   This program is distributed in the hope that it will be useful,       *
11
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
*   GNU General Public License for more details.                          *
14
*                                                                         *
15
*   You should have received a copy of the GNU General Public License     *
16
*   along with this program; if not, write to the                         *
17
*   Free Software Foundation, Inc.,                                       *
18
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
***************************************************************************/
560 cbradney 20
 
3 paul 21
#ifndef HELPBROWSER_H
22
#define HELPBROWSER_H
23
 
560 cbradney 24
#include <qvariant.h>
3 paul 25
#include <qdialog.h>
560 cbradney 26
#include <qstring.h>
3 paul 27
 
560 cbradney 28
class QVBoxLayout;
29
class QHBoxLayout;
30
class QGridLayout;
31
class QSpacerItem;
32
class QTabWidget;
33
class QWidget;
34
class QListView;
35
class QListViewItem;
36
class QTextBrowser;
37
class QToolButton;
38
class QPopupMenu;
786 cbradney 39
class QSplitter;
2006 subik 40
class QLabel;
41
class QLineEdit;
42
class QPushButton;
2023 subik 43
class QMenuBar;
560 cbradney 44
 
3 paul 45
class HelpBrowser : public QWidget
560 cbradney 46
{
47
        Q_OBJECT
3 paul 48
 
49
public:
564 cbradney 50
        HelpBrowser( QWidget* parent, QString caption, QString guiLangage="en", QString jumpToSection="", QString jumpToFile="");
560 cbradney 51
        ~HelpBrowser();
3 paul 52
 
786 cbradney 53
protected:
54
        QVBoxLayout* helpBrowsermainLayout;
55
        QHBoxLayout* helpBrowserLayout;
56
        QHBoxLayout* tabLayout;
57
        QHBoxLayout* buttonLayout;
2006 subik 58
        QVBoxLayout* searchingMainLayout;
59
        QHBoxLayout* searchingButtonLayout;
560 cbradney 60
        QToolButton* homeButton;
61
        QToolButton* backButton;
62
        QToolButton* forwButton;
63
 
64
        QTabWidget* tabWidget;
65
        QWidget* tabContents;
2006 subik 66
        QWidget* tabSearching;
560 cbradney 67
        QListView* listView;
68
        QTextBrowser* textBrowser;
786 cbradney 69
        QSplitter* splitter;
1092 cbradney 70
        QString language;
2023 subik 71
        //! searching
2006 subik 72
        QLineEdit* searchingEdit;
73
        QPushButton* searchingButton;
74
        QListView* searchingView;
2023 subik 75
        //! menu
76
        QMenuBar *menuBar;
560 cbradney 77
 
78
        QPopupMenu* histMenu;
79
        struct histd {
168 Franz 80
                                        QString Url;
81
                                        QString Title;
564 cbradney 82
                                };
83
        QMap<int, histd> mHistory;
3 paul 84
 
2006 subik 85
        /*! Text to be finded in document */
86
        QString findText;
87
        /*! \brief Search in doc files in spec. dir.
88
        It uses directory-recursion. I hope that the documentation will have
89
        only 2-3 level dir structure so it doesn't matter.
90
        \author Petr Vanek <petr@yarpen.cz> */
91
        void searchingInDirectory(QString);
92
 
560 cbradney 93
protected slots:
94
        virtual void languageChange();
2006 subik 95
 
96
        /*! Load doc file when user select filename in content view. */
560 cbradney 97
        void itemSelected( QListViewItem *);
2006 subik 98
 
99
        /*! Load doc file when user select filename in search view.
100
        Then it performs some doc-finding and highlighting.
101
        \author Petr Vanek <petr@yarpen.cz> */
102
        void itemSearchSelected( QListViewItem *);
560 cbradney 103
        void sourceChanged(const QString& url);
104
        void histChosen(int i);
1092 cbradney 105
        void jumpToHelpSection(QString jumpToSection, QString jumpToFile="");
560 cbradney 106
        void loadHelp(QString filename);
1092 cbradney 107
        void loadMenu();
2006 subik 108
 
109
        /*! \brief Performs searching in documentation.
110
        It walks through installed documentation and searching in all text files
111
        \author Petr Vanek <petr@yarpen.cz> */
112
        void searchingButton_clicked();
113
 
114
        /*! \brief Find text in one document.
115
        Classical ctrl+f searching.
116
        \author Petr Vanek <petr@yarpen.cz> */
117
        void find();
118
 
119
        /*! \brief Find next occurences of the text in one document.
120
        \author Petr Vanek <petr@yarpen.cz> */
121
        void findNext();
2023 subik 122
 
123
        /*! \brief Find previous occurences of the text in one document.
124
        \author Petr Vanek <petr@yarpen.cz> */
125
        void findPrevious();
126
 
127
        /*! \brief Print the documentation.
128
        Based on the Qt example.
129
        */
130
        void print();
131
 
3 paul 132
};
133
 
134
#endif // HELPBROWSER_H
2023 subik 135