Scribus
Open source desktop publishing at your fingertips
aligndistribute.h
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  begin : June 2005
9  copyright : (C) 2005 by Craig Bradney
10  email : cbradney@zip.com.au
11 ***************************************************************************/
12 
13 /***************************************************************************
14 * *
15 * Scribus is free software; you can redistribute it and/or modify *
16 * it under the terms of the GNU General Public License as published by *
17 * the Free Software Foundation; either version 2 of the License, or *
18 * (at your option) any later version. *
19 * *
20 ***************************************************************************/
21 
22 #ifndef ALIGNDISTRIBUTEPALETTE_H
23 #define ALIGNDISTRIBUTEPALETTE_H
24 
25 #include "ui_aligndistribute.h"
26 
27 #include <QVariant>
28 #include <QPixmap>
29 #include <QDialog>
30 #include <QLabel>
31 #include <QList>
32 
33 class QEvent;
34 
35 #include "scribusapi.h"
36 #include "scribusdoc.h"
37 #include "ui/scdockpalette.h"
38 
39 class QComboBox;
40 class QLabel;
41 class QLineEdit;
42 class QSpacerItem;
43 class QToolButton;
44 class ScrSpinBox;
45 class ScribusMainWindow;
46 class ScribusView;
47 class UndoManager;
48 
49 struct AlignObjs;
50 
51 
54 class SCRIBUS_API AlignDistributePalette : public ScDockPalette, Ui::AlignDistribute
55 {
56  Q_OBJECT
57 
58 public:
59  AlignDistributePalette( QWidget* parent = 0, const char* name = 0);
61 
62  virtual void setDoc( ScribusDoc* newDoc );
63  void unitChange();
64 
65  virtual void changeEvent(QEvent *e);
66 
67 public slots:
68  void setGuide(int, qreal);
69 
70 protected:
71  ScribusView *currView;
72 
73 protected slots:
74  virtual void languageChange();
75 
76  void alignLeftOut();
77  void alignRightOut();
78  void alignBottomIn();
79  void alignRightIn();
80  void alignBottomOut();
81  void alignCenterHor();
82  void alignLeftIn();
83  void alignCenterVer();
84  void alignTopOut();
85  void alignTopIn();
86  void distributeDistH(bool usingDistance=false);
87  void distributeDistValH();
88  void distributeDistAcrossPage();
89  void distributeDistAcrossMargins();
90  void distributeRight();
91  void distributeBottom();
92  void distributeCenterH();
93  void distributeDistV(bool usingDistance=false);
94  void distributeDistValV();
95  void distributeDistDownPage();
96  void distributeDistDownMargins();
97  void distributeLeft();
98  void distributeCenterV();
99  void distributeTop();
100  void swapLeft();
101  void swapRight();
102 
103  void alignToChanged(int);
104  void alignMethodChanged(int);
105 
106 private:
107  void init();
108  UndoManager *undoManager;
109  ScribusDoc::AlignTo currAlignTo;
110  ScribusDoc::AlignMethod currAlignMethod;
111  QList<AlignObjs> *alignObjects;
112  ScribusDoc *currDoc;
113  qreal unitRatio;
114  int guideDirection;
115  qreal guidePosition;
116  QString guideInfoText, guideInfoTextNone;
117  void enableGuideButtons();
118 
119 signals:
120  void documentChanged();
121 
122 };
123 
124 #endif // ALIGNDISTRIBUTEPALETTE_H
Definition: scdockpalette.h:38
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
Align/Distribute palette.
Definition: aligndistribute.h:54
the Document Class
Definition: scribusdoc.h:90
ScrSpinBox is a Qt4 replacement for our old ScrSpinBox using Qt3.
Definition: scrspinbox.h:21
Definition: scribusstructs.h:286
AlignTo
Some internal align tools.
Definition: scribusdoc.h:991
UndoManager handles the undo stack.
Definition: undomanager.h:81
Definition: scribusview.h:87