3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
15 #include "parageneraldlg.h"
16 #include "paraextradlg.h"
19 #include "lyxparagraph.h"
22 #include "dlg/paradlgdata.h"
24 // to connect apply() and close()
25 #include "FormParagraph.h"
27 class ParaDialog : public ParaDialogData {
30 ParaDialog(FormParagraph * form, QWidget * parent=0, char const * name=0,
31 bool modal=false, WFlags f=0);
34 void setReadOnly(bool);
35 void setLabelWidth(char const *);
37 void setChecks(bool, bool, bool, bool, bool);
38 void setSpace(VSpace::vspace_kind, VSpace::vspace_kind, bool, bool);
39 void setAboveLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
40 void setBelowLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
41 void setExtra(float, LyXGlueLength::UNIT, const string, int, bool, bool, LyXParagraph::PEXTRA_TYPE);
43 char const * getLabelWidth() const {
44 return generalpage->labelwidth->text();
47 LyXAlignment getAlign() const {
48 switch (generalpage->justification->currentItem()) {
49 case 0: return LYX_ALIGN_BLOCK;
50 case 1: return LYX_ALIGN_CENTER;
51 case 2: return LYX_ALIGN_LEFT;
52 case 3: return LYX_ALIGN_RIGHT;
54 return LYX_ALIGN_BLOCK;
57 bool getAboveKeep() const {
58 return generalpage->abovepage->keepabove->isChecked();
61 bool getBelowKeep() const {
62 return generalpage->belowpage->keepbelow->isChecked();
65 bool getLineAbove() const {
66 return generalpage->lineabove->isChecked();
69 bool getLineBelow() const {
70 return generalpage->linebelow->isChecked();
73 bool getPagebreakAbove() const {
74 return generalpage->abovepage->pagebreakabove->isChecked();
77 bool getPagebreakBelow() const {
78 return generalpage->belowpage->pagebreakbelow->isChecked();
81 bool getNoIndent() const {
82 return generalpage->noindent->isChecked();
85 VSpace::vspace_kind getSpaceAboveKind() const {
86 return getSpaceKind(generalpage->abovepage->spaceabove->currentItem());
89 VSpace::vspace_kind getSpaceBelowKind() const {
90 return getSpaceKind(generalpage->belowpage->spacebelow->currentItem());
93 LyXGlueLength getAboveLength() const;
95 LyXGlueLength getBelowLength() const;
97 LyXLength getExtraWidth() const;
99 string getExtraWidthPercent() const;
101 LyXParagraph::PEXTRA_TYPE getExtraType() const {
102 switch (extrapage->type->currentItem()) {
103 case 0: return LyXParagraph::PEXTRA_NONE;
104 case 1: return LyXParagraph::PEXTRA_INDENT;
105 case 2: return LyXParagraph::PEXTRA_MINIPAGE;
106 case 3: return LyXParagraph::PEXTRA_FLOATFLT;
108 return LyXParagraph::PEXTRA_NONE;
111 LyXParagraph::MINIPAGE_ALIGNMENT getExtraAlign() const {
112 if (extrapage->top->isChecked())
113 return LyXParagraph::MINIPAGE_ALIGN_TOP;
114 if (extrapage->middle->isChecked())
115 return LyXParagraph::MINIPAGE_ALIGN_MIDDLE;
116 return LyXParagraph::MINIPAGE_ALIGN_BOTTOM;
119 bool getHfillBetween() const {
120 return extrapage->hfillbetween->isChecked();
123 bool getStartNewMinipage() const {
124 return extrapage->startnewminipage->isChecked();
128 void closeEvent(QCloseEvent * e);
131 FormParagraph * form_;
133 /// the general tab page
134 ParaGeneralDialog * generalpage;
135 /// the extra options tab page
136 ParaExtraDialog * extrapage;
138 VSpace::vspace_kind getSpaceKind(int val) const {
140 case 0: return VSpace::NONE;
141 case 1: return VSpace::DEFSKIP;
142 case 2: return VSpace::SMALLSKIP;
143 case 3: return VSpace::MEDSKIP;
144 case 4: return VSpace::BIGSKIP;
145 case 5: return VSpace::VFILL;
146 case 6: return VSpace::LENGTH;
148 lyxerr[Debug::GUI] << "Unknown kind combo entry " << val << std::endl;
155 void ok_adaptor(void) {
161 void apply_adaptor(void) {
165 void restore_adaptor(void) {
166 // this will reset to known values
170 void cancel_adaptor(void) {