2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QParagraph.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QPARAGRAPH_H
|
|
|
|
#define QPARAGRAPH_H
|
|
|
|
|
|
|
|
#include "QDialogView.h"
|
2007-04-24 19:37:34 +00:00
|
|
|
|
2007-04-29 22:04:32 +00:00
|
|
|
#include "Layout.h"
|
|
|
|
#include "ui/ParagraphUi.h"
|
|
|
|
|
2007-04-24 19:37:34 +00:00
|
|
|
#include <QDialog>
|
|
|
|
#include <QCloseEvent>
|
2007-04-29 22:04:32 +00:00
|
|
|
|
|
|
|
#include <map>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
2007-05-28 22:27:45 +00:00
|
|
|
|
2007-04-24 19:37:34 +00:00
|
|
|
class QParagraph;
|
|
|
|
|
|
|
|
class QParagraphDialog : public QDialog, public Ui::QParagraphUi {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QParagraphDialog(QParagraph * form);
|
|
|
|
///
|
|
|
|
void checkAlignmentRadioButtons();
|
|
|
|
///
|
|
|
|
void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
|
|
|
|
///
|
|
|
|
LyXAlignment getAlignmentFromDialog();
|
|
|
|
protected:
|
|
|
|
void closeEvent (QCloseEvent * e);
|
|
|
|
private:
|
|
|
|
QParagraph * form_;
|
|
|
|
typedef std::map<LyXAlignment, QRadioButton *> QPRadioMap;
|
|
|
|
QPRadioMap radioMap;
|
2007-06-28 00:48:06 +00:00
|
|
|
typedef std::map<LyXAlignment, std::string> QPAlignmentLabels;
|
|
|
|
QPAlignmentLabels labelMap;
|
|
|
|
|
2007-04-24 19:37:34 +00:00
|
|
|
protected Q_SLOTS:
|
|
|
|
///
|
|
|
|
void change_adaptor();
|
|
|
|
///
|
|
|
|
void enableLinespacingValue(int);
|
|
|
|
};
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
class ControlParagraph;
|
|
|
|
|
|
|
|
class QParagraph
|
|
|
|
: public QController<ControlParagraph, QView<QParagraphDialog> >
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
friend class QParagraphDialog;
|
|
|
|
|
|
|
|
QParagraph(Dialog &);
|
|
|
|
private:
|
|
|
|
/// Apply changes
|
|
|
|
virtual void apply();
|
|
|
|
/// update
|
|
|
|
virtual void update_contents();
|
|
|
|
/// build the dialog
|
|
|
|
virtual void build_dialog();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QPARAGRAPH_H
|