Back to index

scribus-ng  1.3.4.dfsg+svn20071115
helpbrowser.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008 *   Copyright (C) 2004 by Craig Bradney                                   *
00009 *   cbradney@zip.com.au                                                   *
00010 *   Copyright (C) 2005 by Petr Vanek                                      *
00011 *   petr@yarpen.cz                                                        *
00012 *                                                                         *
00013 *   This program is free software; you can redistribute it and/or modify  *
00014 *   it under the terms of the GNU General Public License as published by  *
00015 *   the Free Software Foundation; either version 2 of the License, or     *
00016 *   (at your option) any later version.                                   *
00017 *                                                                         *
00018 *   This program is distributed in the hope that it will be useful,       *
00019 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00020 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00021 *   GNU General Public License for more details.                          *
00022 *                                                                         *
00023 *   You should have received a copy of the GNU General Public License     *
00024 *   along with this program; if not, write to the                         *
00025 *   Free Software Foundation, Inc.,                                       *
00026 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00027 ***************************************************************************/
00028 
00029 #ifndef HELPBROWSER_H
00030 #define HELPBROWSER_H
00031 
00032 #include <qvariant.h>
00033 #include <qdialog.h>
00034 #include <qstring.h>
00035 #include <qlistview.h>
00036 #include <qtextbrowser.h>
00037 #include "scribusapi.h"
00038 
00039 class QVBoxLayout;
00040 class QHBoxLayout;
00041 class QGridLayout;
00042 class QSpacerItem;
00043 class QTabWidget;
00044 class QWidget;
00045 class QToolButton;
00046 class QPopupMenu;
00047 class QSplitter;
00048 class QLabel;
00049 class QLineEdit;
00050 class QPushButton;
00051 class QMenuBar;
00052 class PrefsContext;
00053 
00054 
00056 struct histd {
00057        QString url;
00058        QString title;
00059 };
00060 
00061 
00062 
00068 class SCRIBUS_API HelpListItem : public QListViewItem
00069 {
00070 public:
00072        HelpListItem(QListView *parent, QString c1, QString c2, QString c3) : QListViewItem(parent, c1, c2, c3){};
00073 
00081        int compare(QListViewItem *i, int col, bool asc) const;
00082 };
00083 
00087 class SCRIBUS_API TextBrowser : public QTextBrowser
00088 {
00089        Q_OBJECT
00090 public:
00091        TextBrowser(QWidget * parent = 0, const char * name = 0);
00092 
00093 public slots:
00097        virtual void setSource(const QString& name);
00098        virtual void overLink(const QString& link);
00099 };
00100 
00101 
00103 class SCRIBUS_API HelpBrowser : public QWidget
00104 {
00105        Q_OBJECT
00106 
00107 public:
00108        HelpBrowser( QWidget* parent, QString caption, QString guiLangage="en", QString jumpToSection="", QString jumpToFile="");
00109        ~HelpBrowser();
00110 
00112        QPopupMenu* histMenu;
00114        QMap<int, histd> mHistory;
00117        void setText(QString str);
00118 
00119 protected:
00121        QVBoxLayout* helpBrowsermainLayout;
00122        QHBoxLayout* helpBrowserLayout;
00123        QHBoxLayout* tabLayout;
00124        QHBoxLayout* buttonLayout;
00125        QVBoxLayout* searchingMainLayout;
00126        QHBoxLayout* searchingButtonLayout;
00128        QToolButton* homeButton;
00130        QToolButton* backButton;
00131        QToolButton* forwButton;
00133        QHBoxLayout* bookmarksButtonLayout;
00134        QVBoxLayout* bookmarksMainLayout;
00135 
00137        QTabWidget* tabWidget;
00139        QWidget* tabContents;
00141        QListView* listView;
00143        QTextBrowser* textBrowser;
00145        QSplitter* splitter;
00147        QString language;
00149        QWidget* tabSearching;
00150        QLineEdit* searchingEdit;
00151        QPushButton* searchingButton;
00152        QListView* searchingView;
00154        QWidget* tabBookmarks;
00155        QPushButton* bookmarkButton;
00156        QPushButton* deleteBookmarkButton;
00157        QPushButton* deleteAllBookmarkButton;
00158        QListView* bookmarksView;
00160        QMenuBar *menuBar;
00161 
00163        QString findText;
00165        PrefsContext* prefs;
00166 
00171        void searchingInDirectory(QString);
00172 
00174        void readBookmarks();
00175 
00177        void readHistory();
00178 
00179 protected slots:
00180        virtual void languageChange();
00181 
00183        void itemSelected( QListViewItem *);
00184 
00188        void itemSearchSelected( QListViewItem *);
00191        void itemBookmarkSelected( QListViewItem *);
00192        void histChosen(int i);
00193        void jumpToHelpSection(QString jumpToSection, QString jumpToFile="");
00194        void loadHelp(QString filename);
00195        void loadMenu();
00196 
00200        void searchingButton_clicked();
00201 
00205        void find();
00206 
00209        void findNext();
00210 
00213        void findPrevious();
00214 
00218        void print();
00219 
00221        void bookmarkButton_clicked();
00222 
00224        void deleteBookmarkButton_clicked();
00225 
00227        void deleteAllBookmarkButton_clicked();
00228 
00229 };
00230 
00231 #endif // HELPBROWSER_H
00232