Subversion Repositories Scribus

Rev

Rev 15081 | Rev 20371 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
13762 cbradney 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
 
8
#ifndef NEWMARGINWIDGET_H
9
#define NEWMARGINWIDGET_H
10
 
11
#include "ui_newmarginwidgetbase.h"
12
#include "scribusapi.h"
14221 cbradney 13
#include "scribusstructs.h"
13762 cbradney 14
 
15
class SCRIBUS_API NewMarginWidget : public QWidget, Ui::NewMarginWidget
16
{
17
        Q_OBJECT
18
 
19
        public:
20
                NewMarginWidget(QWidget* parent=0);
21
                ~NewMarginWidget();
14216 cbradney 22
 
14229 cbradney 23
                void setup(const MarginStruct& margs, int layoutType, int unitIndex=0, bool showPreset=true, bool showPrinterMargins=true);
24
                /*! \brief Setup the labels by facing pages option */
25
                void setFacingPages(bool facing, int pagetype = 0);
26
                /*! \brief Setup the spinboxes properties (min/max value etc.) by width */
14216 cbradney 27
                void setPageWidth(double);
14229 cbradney 28
                /*! \brief Setup the spinboxes properties (min/max value etc.) by height */
14216 cbradney 29
                void setPageHeight(double);
14229 cbradney 30
                /*! \brief Set the page size for margin getting from cups */
14216 cbradney 31
                void setPageSize(const QString&);
19371 jghali 32
                void setNewUnit(int unitIndex);
15081 cbradney 33
                void setNewValues(const MarginStruct& margs);
14229 cbradney 34
                /*! \brief Setup the presetCombo without changing the margin values, only used by tabdocument */
35
                void setMarginPreset(int p);
15081 cbradney 36
                const MarginStruct & margins() const { return marginData; };
14229 cbradney 37
 
38
        public slots:
39
                void languageChange();
14226 cbradney 40
                void setTop();
41
                void setBottom();
42
                void setLeft();
43
                void setRight();
14229 cbradney 44
                void slotLinkMargins();
14226 cbradney 45
                void setPreset();
14221 cbradney 46
 
14229 cbradney 47
        protected slots:
48
                void setMarginsToPrinterMargins();
14226 cbradney 49
 
14221 cbradney 50
        protected:
14226 cbradney 51
                void updateMarginSpinValues();
52
 
14221 cbradney 53
                MarginStruct marginData;
54
                MarginStruct savedMarginData;
55
                int savedPresetItem;
14226 cbradney 56
                bool facingPages;
57
                int m_unitIndex;
58
                double m_unitRatio;
59
                QString m_pageSize;
60
                double pageWidth;
61
                double pageHeight;
62
                int pageType;
14229 cbradney 63
                bool usingPreset;
64
                bool usingPrinterMargins;
13762 cbradney 65
};
66
 
67
#endif // NEWMARGINWIDGET_H
14226 cbradney 68
 
69
 
70