1 /* 2 For general Scribus (>=1.3.2) copyright and licensing information please refer 3 to the COPYING file provided with the program. Following this notice may exist 4 a copyright and/or license notice that predates the release of Scribus 1.3.2 5 for which a new license (GPL+exception) is in place. 6 */ 7 #ifndef PAGESELECTOR_H 8 #define PAGESELECTOR_H 9 10 #include <QWidget> 11 12 class QEvent; 13 class QHBoxLayout; 14 class QLabel; 15 class QLineEdit; 16 class QPushButton; 17 class QIntValidator; 18 19 #include "scribusapi.h" 20 #include "styleoptions.h" 21 22 class QComboBox; 23 24 class SCRIBUS_API PageSelector : public QWidget 25 { 26 Q_OBJECT 27 28 public: 29 PageSelector(QWidget* parent, int maximumPage = 0 ); ~PageSelector()30 ~PageSelector() {}; 31 32 bool hasFocus(); 33 void focusPolicy(Qt::FocusPolicy policy); 34 void setFont(const QFont& font); 35 int getCurrentPage(); 36 37 public slots: 38 virtual void setGUIForPage(int i); 39 virtual void setMaximum(int i); 40 void iconSetChange(); 41 void languageChange(); 42 void clearFocus(); 43 44 private slots: 45 virtual void gotoPage(int); 46 virtual void goToStart(); 47 virtual void goToEnd(); 48 virtual void goBackward(); 49 virtual void goForward(); 50 51 protected: 52 QPushButton* startButton { nullptr }; 53 QPushButton* backButton { nullptr }; 54 QPushButton* forwardButton { nullptr }; 55 QPushButton* lastButton { nullptr }; 56 QHBoxLayout *pageSelectorLayout { nullptr }; 57 QLabel *pageCountLabel { nullptr }; 58 QComboBox *m_pageCombo { nullptr }; 59 QIntValidator *m_validator { nullptr }; 60 61 int m_lastPage { 1 }; 62 int m_currentPage { 1 }; 63 QString pageCountString; 64 65 void changeEvent(QEvent *e) override; 66 67 signals: 68 void pageChanged(int); 69 }; 70 71 #endif // PAGESELECTOR_H 72