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 PAGEPROPERTIESDIALOG_H 8 #define PAGEPROPERTIESDIALOG_H 9 10 #include "scribusapi.h" 11 #include <QDialog> 12 13 class QGroupBox; 14 class QLabel; 15 class QPushbutton; 16 class QComboBox; 17 class QCheckBox; 18 class QLabel; 19 class QGridLayout; 20 class QHBoxLayout; 21 class QVBoxLayout; 22 class ScrSpinBox; 23 class MarginWidget; 24 class ScribusDoc; 25 26 /*! \brief A dialog to setup the existing document margins. 27 In modal mode called from void ScribusMainWindow::changePageProperties() */ 28 class SCRIBUS_API PagePropertiesDialog : public QDialog 29 { 30 Q_OBJECT 31 32 public: 33 /*! \brief GUI setup 34 \param parent Scribus main window in this case 35 \param doc current document */ 36 PagePropertiesDialog( QWidget* parent, ScribusDoc* doc); ~PagePropertiesDialog()37 ~PagePropertiesDialog() {} 38 39 /*! \brief Returns recomputed "Links" index/value for facing pages. 40 \retval int 0 for max item, 1 for min. item++ for middle. Why? */ 41 int pageOrder(); 42 /*! \brief Current value of orientationQComboBox. 43 \retval int index of combobox */ 44 int getPageOrientation(); 45 /*! \brief Selected page width 46 \retval double X */ 47 double getPageWidth(); 48 /*! \brief Selected page height 49 \retval double Y */ 50 double getPageHeight(); 51 /*! \brief Bool value of moveObjects "property" 52 \retval bool true for moving */ 53 bool getMoveObjects(); 54 /*! \brief Returns prefsPageSizeName value 55 \retval QString prefsPageSizeName property */ 56 QString getPrefsPageSizeName(); 57 /*! \brief Top Margin 58 \retval double margin size */ 59 double top(); 60 /*! \brief Bottom Margin 61 \retval double margin size */ 62 double bottom(); 63 /*! \brief Left Margin 64 \retval double margin size */ 65 double left(); 66 /*! \brief Right Margin 67 \retval double margin size */ 68 double right(); 69 /*! \brief Master Page 70 \retval QString Master Page Name */ 71 QString masterPage(); 72 int getMarginPreset(); 73 74 public slots: 75 //! \brief as setOrientation for orientationQComboBox current item 76 void setPageSize(); 77 /*! \brief Sets page size and enables/disables size widgets. 78 \param gr A QString with name of the page size or "Custom" */ 79 void setSize(const QString & gr); 80 /*! \brief Sets page orientation and sizes regarding the given value 81 \param ori integer from orientationQComboBox item index */ 82 void setOrientation(int ori); 83 /*! \brief Recompute the page width for current unit. 84 It's called from width spinbox. 85 \param v new width */ 86 void setPageWidth(double v); 87 /*! \brief Recompute the page height for current unit. 88 It's called from width spinbox. 89 \param v new height */ 90 void setPageHeight(double v); 91 92 private: 93 MarginWidget* marginWidget; 94 QGroupBox* dsGroupBox7; 95 QGroupBox* groupMaster; 96 QLabel* masterPageLabel; 97 QComboBox* masterPageComboBox; 98 ScrSpinBox* widthSpinBox; 99 ScrSpinBox* heightSpinBox; 100 QLabel* widthQLabel; 101 QLabel* heightQLabel; 102 QLabel* TextLabel1; 103 QLabel* TextLabel2; 104 QComboBox* sizeQComboBox; 105 QComboBox* orientationQComboBox; 106 QComboBox* Links; 107 QLabel* TextLabel3; 108 QCheckBox* moveObjects; 109 QPushButton* pageFillColorButton; 110 QPushButton* cancelButton; 111 QPushButton* okButton; 112 double unitRatio; 113 double pageWidth; 114 double pageHeight; 115 //! \brief Old orientation. Before it's changed via combobox. 116 int oldOri; 117 QString prefsPageSizeName; 118 QGridLayout* dsGroupBox7Layout; 119 QVBoxLayout* dialogLayout; 120 QHBoxLayout* okCancelLayout; 121 QHBoxLayout* masterLayout; 122 123 124 }; 125 126 #endif 127