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 PAGEPALETTE_MASTERPAGES_H 8 #define PAGEPALETTE_MASTERPAGES_H 9 10 class QCloseEvent; 11 class QHBoxLayout; 12 class QListWidget; 13 class QListWidgetItem; 14 class QToolButton; 15 class QVBoxLayout; 16 17 #include "scribusapi.h" 18 #include "ui_pagepalette_masterpagesbase.h" 19 class ScribusDoc; 20 class ScribusView; 21 22 23 /*! \brief A dialog to manage/edit Master Pages 24 */ 25 class SCRIBUS_API PagePalette_MasterPages : public QWidget, Ui::PagePalette_MasterPagesBase 26 { 27 Q_OBJECT 28 29 friend class PagePalette; 30 31 public: 32 PagePalette_MasterPages( QWidget* parent, ScribusView *pCurrentView, const QString& masterPageName); ~PagePalette_MasterPages()33 ~PagePalette_MasterPages() {}; 34 35 void setView(ScribusView* view, const QString& masterPageName = ""); 36 37 void updateMasterPageList(void); 38 void updateMasterPageList(QString MasterPageName); 39 40 public slots: 41 void iconSetChange(); 42 void languageChange(); 43 void styleChange(); 44 void selectMasterPage(const QString& name); 45 46 private: 47 QString m_currentPage; 48 ScribusDoc *m_doc; 49 ScribusView *m_view; 50 51 protected: 52 void connectSignals(); 53 void disconnectSignals(); 54 55 void changeEvent(QEvent *e) override; 56 57 bool isReservedName(const QString& name) const; 58 QString getNonReservedName(const QString& name) const; 59 /*! 60 * \retval the current name or, if it's a standard one, the translated version 61 */ 62 QString getTranslatedReservedName(const QString& name) const; 63 64 private slots: 65 void duplicateMasterPage(); 66 void deleteMasterPage(); 67 void newMasterPage(); 68 void renameMasterPage(QListWidgetItem * item); 69 void importPage(); 70 void selectMasterPage(QListWidgetItem *item); 71 72 signals: 73 void removePage(int); 74 void finished(); 75 }; 76 77 #endif // MUSTERPAGES_H 78