1 #ifndef PAGEWIDGET_H 2 #define PAGEWIDGET_H 3 4 #include "method.h" 5 6 #include <QSplitter> 7 #include <QTreeWidget> 8 9 class BookBrowser; 10 11 class PageWidget : public QSplitter 12 { 13 Q_OBJECT 14 public: 15 PageWidget(QWidget *parent, const SearchMethod&); 16 17 virtual RET_SEARCH search(const Query&) = 0; 18 19 void zoomIn(); 20 void zoomOut(); bookBrowser()21 BookBrowser* bookBrowser() 22 { 23 return bookBrowser_; 24 } 25 method()26 inline SearchMethod method() const 27 { 28 return method_; 29 } 30 31 public slots: 32 void setBookTreeVisible(bool visible); 33 34 protected: 35 BookBrowser *bookBrowser_; 36 QTreeWidget *bookTree; 37 SearchMethod method_; 38 39 static const QString CutString; 40 static const QString IntString; 41 42 static bool checkStop(); 43 static QString toAnchor(const QString &str, int num); 44 45 signals: 46 void statusRequested(const QString &str); 47 void selectionRequested(const QString& str); 48 49 private: 50 void scrollTo(QTreeWidgetItem *to); 51 52 private slots: scrollTo(QTreeWidgetItem * to,int)53 void scrollTo(QTreeWidgetItem *to, int) 54 { 55 scrollTo(to); 56 } scrollTo(QTreeWidgetItem * to,QTreeWidgetItem *)57 void scrollTo(QTreeWidgetItem *to, QTreeWidgetItem*) 58 { 59 scrollTo(to); 60 } 61 void changeFont(const QFont &font); 62 void popupSlide(const QPoint &pos); 63 }; 64 65 #endif // PAGEWIDGET_H 66