SpeedCrunch
0.11
|
00001 // This file is part of the SpeedCrunch project 00002 // Copyright (C) 2007 Petri Damstén <damu@iki.fi> 00003 // Copyright (C) 2008-2014 Helder Correia <helder.pereira.correia@gmail.com> 00004 // 00005 // This program is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU General Public License 00007 // as published by the Free Software Foundation; either version 2 00008 // of the License, or (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; see the file COPYING. If not, write to 00017 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 // Boston, MA 02110-1301, USA. 00019 00020 #ifndef GUI_BOOKDOCK_H 00021 #define GUI_BOOKDOCK_H 00022 00023 #include "core/book.h" 00024 00025 #include <QDockWidget> 00026 #include <QTextBrowser> 00027 00028 class QUrl; 00029 00030 class TextBrowser : public QTextBrowser { 00031 Q_OBJECT 00032 public: 00033 TextBrowser(QWidget* parent) : QTextBrowser(parent) { } 00034 public slots: 00035 virtual void setSource(const QUrl&) { } 00036 }; 00037 00038 class BookDock : public QDockWidget { 00039 Q_OBJECT 00040 00041 public: 00042 BookDock(QWidget* parent = 0); 00043 00044 signals: 00045 void expressionSelected(const QString&); 00046 00047 public slots: 00048 void openPage(const QUrl&); 00049 void retranslateText(); 00050 00051 protected: 00052 virtual void changeEvent(QEvent*); 00053 00054 private slots: 00055 void handleAnchorClick(const QUrl&); 00056 00057 private: 00058 Q_DISABLE_COPY(BookDock) 00059 Book* m_book; 00060 TextBrowser* m_browser; 00061 }; 00062 00063 #endif // GUI_BOOKDOCK_H