2001-02-12 14:09:09 +00:00
|
|
|
/**
|
|
|
|
* \file paradlg.h
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author John Levon
|
2000-10-17 08:27:35 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PARADLG_H
|
|
|
|
#define PARADLG_H
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <gettext.h>
|
|
|
|
|
|
|
|
#include "parageneraldlg.h"
|
|
|
|
#include "paraextradlg.h"
|
2001-02-12 14:09:09 +00:00
|
|
|
|
|
|
|
#include "vspace.h"
|
2001-06-25 00:06:33 +00:00
|
|
|
#include "paragraph.h"
|
2001-02-12 14:09:09 +00:00
|
|
|
#include "debug.h"
|
2000-10-17 08:27:35 +00:00
|
|
|
|
2000-12-04 17:18:01 +00:00
|
|
|
#include "dlg/paradlgdata.h"
|
|
|
|
|
2000-10-17 08:27:35 +00:00
|
|
|
// to connect apply() and close()
|
|
|
|
#include "FormParagraph.h"
|
|
|
|
|
2000-12-04 17:18:01 +00:00
|
|
|
class ParaDialog : public ParaDialogData {
|
2001-02-12 14:09:09 +00:00
|
|
|
Q_OBJECT
|
2000-10-17 08:27:35 +00:00
|
|
|
public:
|
2001-02-12 14:09:09 +00:00
|
|
|
ParaDialog(FormParagraph * form, QWidget * parent=0, char const * name=0,
|
2000-10-17 08:27:35 +00:00
|
|
|
bool modal=false, WFlags f=0);
|
|
|
|
~ParaDialog();
|
|
|
|
|
|
|
|
void setReadOnly(bool);
|
2001-02-12 14:09:09 +00:00
|
|
|
void setLabelWidth(char const *);
|
2000-10-17 08:27:35 +00:00
|
|
|
void setAlign(int);
|
|
|
|
void setChecks(bool, bool, bool, bool, bool);
|
|
|
|
void setSpace(VSpace::vspace_kind, VSpace::vspace_kind, bool, bool);
|
|
|
|
void setAboveLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
|
|
|
|
void setBelowLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
char const * getLabelWidth() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return generalpage->line_labelwidth->text();
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LyXAlignment getAlign() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
switch (generalpage->combo_justification->currentItem()) {
|
2001-02-12 14:09:09 +00:00
|
|
|
case 0: return LYX_ALIGN_BLOCK;
|
|
|
|
case 1: return LYX_ALIGN_CENTER;
|
|
|
|
case 2: return LYX_ALIGN_LEFT;
|
|
|
|
case 3: return LYX_ALIGN_RIGHT;
|
|
|
|
}
|
|
|
|
return LYX_ALIGN_BLOCK;
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
|
|
|
|
2000-12-04 17:18:01 +00:00
|
|
|
bool getAboveKeep() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return generalpage->abovepage->check_keepabove->isChecked();
|
2000-12-04 17:18:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool getBelowKeep() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return generalpage->belowpage->check_keepbelow->isChecked();
|
2000-12-04 17:18:01 +00:00
|
|
|
}
|
|
|
|
|
2000-10-17 08:27:35 +00:00
|
|
|
bool getLineAbove() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return generalpage->check_lineabove->isChecked();
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
2001-02-12 14:09:09 +00:00
|
|
|
|
2000-10-17 08:27:35 +00:00
|
|
|
bool getLineBelow() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return generalpage->check_linebelow->isChecked();
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool getPagebreakAbove() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return generalpage->abovepage->check_pagebreakabove->isChecked();
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool getPagebreakBelow() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return generalpage->belowpage->check_pagebreakbelow->isChecked();
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool getNoIndent() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return generalpage->check_noindent->isChecked();
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VSpace::vspace_kind getSpaceAboveKind() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return getSpaceKind(generalpage->abovepage->combo_spaceabove->currentItem());
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
2001-02-12 14:09:09 +00:00
|
|
|
|
2000-10-17 08:27:35 +00:00
|
|
|
VSpace::vspace_kind getSpaceBelowKind() const {
|
2001-04-02 15:12:55 +00:00
|
|
|
return getSpaceKind(generalpage->belowpage->combo_spacebelow->currentItem());
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LyXGlueLength getAboveLength() const;
|
|
|
|
|
|
|
|
LyXGlueLength getBelowLength() const;
|
|
|
|
protected:
|
2001-02-12 14:09:09 +00:00
|
|
|
void closeEvent(QCloseEvent * e);
|
|
|
|
|
2000-10-17 08:27:35 +00:00
|
|
|
private:
|
2001-02-12 14:09:09 +00:00
|
|
|
FormParagraph * form_;
|
2000-10-17 08:27:35 +00:00
|
|
|
|
|
|
|
/// the general tab page
|
2001-02-12 14:09:09 +00:00
|
|
|
ParaGeneralDialog * generalpage;
|
2001-04-02 15:12:55 +00:00
|
|
|
|
2000-10-17 08:27:35 +00:00
|
|
|
VSpace::vspace_kind getSpaceKind(int val) const {
|
|
|
|
switch (val) {
|
|
|
|
case 0: return VSpace::NONE;
|
|
|
|
case 1: return VSpace::DEFSKIP;
|
|
|
|
case 2: return VSpace::SMALLSKIP;
|
|
|
|
case 3: return VSpace::MEDSKIP;
|
|
|
|
case 4: return VSpace::BIGSKIP;
|
|
|
|
case 5: return VSpace::VFILL;
|
|
|
|
case 6: return VSpace::LENGTH;
|
|
|
|
default:
|
2000-11-22 18:38:31 +00:00
|
|
|
lyxerr[Debug::GUI] << "Unknown kind combo entry " << val << std::endl;
|
2000-10-17 08:27:35 +00:00
|
|
|
}
|
|
|
|
return VSpace::NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
private slots:
|
2000-12-04 17:18:01 +00:00
|
|
|
|
|
|
|
void ok_adaptor(void) {
|
|
|
|
apply_adaptor();
|
2000-10-17 08:27:35 +00:00
|
|
|
form_->close();
|
|
|
|
hide();
|
|
|
|
}
|
|
|
|
|
2000-12-04 17:18:01 +00:00
|
|
|
void apply_adaptor(void) {
|
|
|
|
form_->apply();
|
|
|
|
}
|
|
|
|
|
|
|
|
void restore_adaptor(void) {
|
|
|
|
// this will reset to known values
|
|
|
|
form_->update();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cancel_adaptor(void) {
|
2000-10-17 08:27:35 +00:00
|
|
|
form_->close();
|
|
|
|
hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
#endif // PARADLG_H
|