Subversion Repositories Scribus

Rev

Rev 1092 | Rev 2023 | 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;
560 cbradney 43
 
3 paul 44
class HelpBrowser : public QWidget
560 cbradney 45
{
46
        Q_OBJECT
3 paul 47
 
48
public:
564 cbradney 49
        HelpBrowser( QWidget* parent, QString caption, QString guiLangage="en", QString jumpToSection="", QString jumpToFile="");
560 cbradney 50
        ~HelpBrowser();
3 paul 51
 
786 cbradney 52
protected:
53
        QVBoxLayout* helpBrowsermainLayout;
54
        QHBoxLayout* helpBrowserLayout;
55
        QHBoxLayout* tabLayout;
56
        QHBoxLayout* buttonLayout;
2006 subik 57
        QVBoxLayout* searchingMainLayout;
58
        QHBoxLayout* searchingButtonLayout;
560 cbradney 59
        QToolButton* homeButton;
60
        QToolButton* backButton;
61
        QToolButton* forwButton;
62
 
63
        QTabWidget* tabWidget;
64
        QWidget* tabContents;
2006 subik 65
        QWidget* tabSearching;
560 cbradney 66
        QListView* listView;
67
        QTextBrowser* textBrowser;
786 cbradney 68
        QSplitter* splitter;
1092 cbradney 69
        QString language;
2006 subik 70
        // searching
71
        QLineEdit* searchingEdit;
72
        QPushButton* searchingButton;
73
        QListView* searchingView;
560 cbradney 74
 
75
        QPopupMenu* histMenu;
76
        struct histd {
168 Franz 77
                                        QString Url;
78
                                        QString Title;
564 cbradney 79
                                };
80
        QMap<int, histd> mHistory;
3 paul 81
 
2006 subik 82
        /*! Text to be finded in document */
83
        QString findText;
84
        /*! \brief Search in doc files in spec. dir.
85
        It uses directory-recursion. I hope that the documentation will have
86
        only 2-3 level dir structure so it doesn't matter.
87
        \author Petr Vanek <petr@yarpen.cz> */
88
        void searchingInDirectory(QString);
89
 
560 cbradney 90
protected slots:
91
        virtual void languageChange();
2006 subik 92
 
93
        /*! Load doc file when user select filename in content view. */
560 cbradney 94
        void itemSelected( QListViewItem *);
2006 subik 95
 
96
        /*! Load doc file when user select filename in search view.
97
        Then it performs some doc-finding and highlighting.
98
        \author Petr Vanek <petr@yarpen.cz> */
99
        void itemSearchSelected( QListViewItem *);
560 cbradney 100
        void sourceChanged(const QString& url);
101
        void histChosen(int i);
1092 cbradney 102
        void jumpToHelpSection(QString jumpToSection, QString jumpToFile="");
560 cbradney 103
        void loadHelp(QString filename);
1092 cbradney 104
        void loadMenu();
2006 subik 105
 
106
        /*! \brief Performs searching in documentation.
107
        It walks through installed documentation and searching in all text files
108
        \author Petr Vanek <petr@yarpen.cz> */
109
        void searchingButton_clicked();
110
 
111
        /*! \brief Find text in one document.
112
        Classical ctrl+f searching.
113
        \author Petr Vanek <petr@yarpen.cz> */
114
        void find();
115
 
116
        /*! \brief Find next occurences of the text in one document.
117
        \author Petr Vanek <petr@yarpen.cz> */
118
        void findNext();
3 paul 119
};
120
 
121
#endif // HELPBROWSER_H