2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiParagraph.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#ifndef GUIPARAGRAPH_H
|
|
|
|
#define GUIPARAGRAPH_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiDialogView.h"
|
2007-08-31 22:16:11 +00:00
|
|
|
#include "ControlParagraph.h"
|
2007-04-29 22:04:32 +00:00
|
|
|
#include "Layout.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_ParagraphUi.h"
|
2007-04-29 22:04:32 +00:00
|
|
|
|
2007-04-24 19:37:34 +00:00
|
|
|
#include <QDialog>
|
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-08-31 05:53:55 +00:00
|
|
|
class GuiParagraph;
|
2007-04-24 19:37:34 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiParagraphDialog : public QDialog, public Ui::ParagraphUi {
|
2007-04-24 19:37:34 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiParagraphDialog(GuiParagraph * form);
|
2007-04-24 19:37:34 +00:00
|
|
|
///
|
|
|
|
void checkAlignmentRadioButtons();
|
|
|
|
///
|
|
|
|
void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
|
|
|
|
///
|
|
|
|
LyXAlignment getAlignmentFromDialog();
|
|
|
|
protected:
|
|
|
|
void closeEvent (QCloseEvent * e);
|
|
|
|
private:
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiParagraph * form_;
|
2007-04-24 19:37:34 +00:00
|
|
|
typedef std::map<LyXAlignment, QRadioButton *> QPRadioMap;
|
|
|
|
QPRadioMap radioMap;
|
2007-07-09 19:01:27 +00:00
|
|
|
typedef std::map<LyXAlignment, docstring> QPAlignmentLabels;
|
2007-06-28 00:48:06 +00:00
|
|
|
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
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
class GuiParagraph : public GuiView<GuiParagraphDialog>
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
friend class GuiParagraphDialog;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-03 05:59:32 +00:00
|
|
|
GuiParagraph(GuiDialog &);
|
2007-08-31 22:16:11 +00:00
|
|
|
/// parent controller
|
|
|
|
ControlParagraph & controller()
|
|
|
|
{ return static_cast<ControlParagraph &>(this->getController()); }
|
|
|
|
/// parent controller
|
|
|
|
ControlParagraph const & controller() const
|
|
|
|
{ return static_cast<ControlParagraph const &>(this->getController()); }
|
2006-03-05 17:24:44 +00:00
|
|
|
private:
|
|
|
|
/// Apply changes
|
2007-09-03 20:28:26 +00:00
|
|
|
virtual void applyView();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update
|
|
|
|
virtual void update_contents();
|
|
|
|
/// build the dialog
|
|
|
|
virtual void build_dialog();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QPARAGRAPH_H
|