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
|
2007-10-07 20:00:46 +00:00
|
|
|
* \author Abdelrazak Younes
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* 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-12-09 22:35:04 +00:00
|
|
|
#include "DialogView.h"
|
2008-02-18 07:14:42 +00:00
|
|
|
#include "ui_ParagraphUi.h"
|
|
|
|
|
|
|
|
#include "ParagraphParameters.h"
|
|
|
|
|
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-10-07 20:00:46 +00:00
|
|
|
class GuiParagraph
|
2007-12-09 22:35:04 +00:00
|
|
|
: public DialogView, public Ui::ParagraphUi
|
2007-09-05 20:33:29 +00:00
|
|
|
{
|
2007-04-24 19:37:34 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2007-11-23 09:44:02 +00:00
|
|
|
GuiParagraph(GuiView & lv);
|
2007-09-26 13:13:01 +00:00
|
|
|
|
2008-02-04 17:06:34 +00:00
|
|
|
/// Dialog inherited methods
|
|
|
|
//@{
|
2020-10-01 10:42:11 +03:00
|
|
|
void applyView() override;
|
|
|
|
void updateView() override;
|
|
|
|
void dispatchParams() override;
|
|
|
|
void enableView(bool enable) override;
|
|
|
|
bool isBufferDependent() const override { return true; }
|
|
|
|
FuncCode getLfun() const override { return LFUN_PARAGRAPH_PARAMS_APPLY; }
|
|
|
|
void saveSession(QSettings & settings) const override;
|
|
|
|
void restoreSession() override;
|
2008-02-04 17:06:34 +00:00
|
|
|
//@}
|
2007-09-26 13:13:01 +00:00
|
|
|
|
|
|
|
private:
|
2007-04-24 19:37:34 +00:00
|
|
|
///
|
|
|
|
void checkAlignmentRadioButtons();
|
|
|
|
///
|
|
|
|
void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
|
|
|
|
///
|
2008-09-29 10:29:35 +00:00
|
|
|
LyXAlignment getAlignmentFromDialog() const;
|
2007-09-05 20:33:29 +00:00
|
|
|
///
|
2008-02-04 17:06:34 +00:00
|
|
|
ParagraphParameters const & params() const;
|
|
|
|
///
|
2008-09-29 10:18:37 +00:00
|
|
|
bool haveMultiParSelection() const;
|
2008-02-04 17:06:34 +00:00
|
|
|
///
|
|
|
|
bool canIndent() const;
|
|
|
|
///
|
2009-05-23 07:45:46 +00:00
|
|
|
bool hasLabelwidth() const;
|
|
|
|
///
|
2008-02-04 17:06:34 +00:00
|
|
|
LyXAlignment alignPossible() const;
|
2021-01-07 13:05:37 +01:00
|
|
|
///
|
|
|
|
void setButtons(bool const in_sync);
|
2007-10-07 20:00:46 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private Q_SLOTS:
|
2007-04-24 19:37:34 +00:00
|
|
|
///
|
2007-09-26 13:13:01 +00:00
|
|
|
void changed();
|
2007-04-24 19:37:34 +00:00
|
|
|
///
|
2021-01-07 13:05:37 +01:00
|
|
|
void on_synchronizedViewCB_stateChanged(int state);
|
2007-09-26 13:13:01 +00:00
|
|
|
///
|
|
|
|
void on_linespacing_activated(int);
|
2006-03-05 17:24:44 +00:00
|
|
|
/// Apply changes
|
2018-07-10 09:04:42 +02:00
|
|
|
void on_buttonBox_clicked(QAbstractButton * button);
|
2007-10-07 20:00:46 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
2008-02-04 17:06:34 +00:00
|
|
|
typedef std::map<LyXAlignment, QRadioButton *> RadioMap;
|
2007-10-07 20:00:46 +00:00
|
|
|
///
|
2008-04-18 20:45:21 +00:00
|
|
|
RadioMap radioMap_;
|
|
|
|
|
2007-10-07 20:00:46 +00:00
|
|
|
///
|
2008-04-18 20:45:21 +00:00
|
|
|
QString alignDefaultLabel_;
|
2007-10-07 20:00:46 +00:00
|
|
|
///
|
2008-09-29 10:56:45 +00:00
|
|
|
ParagraphParameters params_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QPARAGRAPH_H
|