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-10-07 20:34:09 +00:00
|
|
|
// Uncomment this if you prefer dock widget
|
|
|
|
//#define USE_DOCK_WIDGET
|
|
|
|
|
2007-04-29 22:04:32 +00:00
|
|
|
#include "Layout.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_ParagraphUi.h"
|
2007-12-09 22:35:04 +00:00
|
|
|
#include "DialogView.h"
|
2007-10-07 20:00:46 +00:00
|
|
|
#include "ParagraphParameters.h"
|
|
|
|
#include "GuiView.h"
|
|
|
|
#include "qt_helpers.h"
|
2007-11-29 07:04:28 +00:00
|
|
|
#include "support/debug.h"
|
2007-04-29 22:04:32 +00:00
|
|
|
|
2007-10-07 20:00:46 +00:00
|
|
|
#include <QCloseEvent>
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QSettings>
|
|
|
|
#include <QShowEvent>
|
|
|
|
#include <QGridLayout>
|
2007-09-26 13:13:01 +00:00
|
|
|
|
2007-04-29 22:04:32 +00:00
|
|
|
#include <map>
|
2007-10-07 20:00:46 +00:00
|
|
|
#include <string>
|
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
|
|
|
|
//@{
|
2007-09-26 13:13:01 +00:00
|
|
|
void updateView();
|
2008-02-04 17:06:34 +00:00
|
|
|
void dispatchParams();
|
|
|
|
bool isBufferDependent() const { return true; }
|
|
|
|
//@}
|
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);
|
|
|
|
///
|
|
|
|
LyXAlignment getAlignmentFromDialog();
|
2007-09-05 20:33:29 +00:00
|
|
|
///
|
2008-02-04 17:06:34 +00:00
|
|
|
ParagraphParameters & params();
|
|
|
|
///
|
|
|
|
ParagraphParameters const & params() const;
|
|
|
|
///
|
|
|
|
bool haveMulitParSelection();
|
|
|
|
///
|
|
|
|
bool canIndent() const;
|
|
|
|
///
|
|
|
|
LyXAlignment alignPossible() const;
|
|
|
|
///
|
|
|
|
LyXAlignment alignDefault() const;
|
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
|
|
|
///
|
2007-09-26 13:13:01 +00:00
|
|
|
void on_synchronizedViewCB_toggled();
|
|
|
|
///
|
|
|
|
void on_restorePB_clicked();
|
|
|
|
///
|
|
|
|
void on_linespacing_activated(int);
|
2006-03-05 17:24:44 +00:00
|
|
|
/// Apply changes
|
2007-09-26 13:13:01 +00:00
|
|
|
void on_applyPB_clicked();
|
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-02-04 17:06:34 +00:00
|
|
|
RadioMap radioMap;
|
2007-10-07 20:00:46 +00:00
|
|
|
///
|
2008-02-04 17:06:34 +00:00
|
|
|
typedef std::map<LyXAlignment, docstring> AlignmentLabels;
|
2007-10-07 20:00:46 +00:00
|
|
|
///
|
2008-02-04 17:06:34 +00:00
|
|
|
AlignmentLabels labelMap;
|
2007-10-07 20:00:46 +00:00
|
|
|
///
|
2008-02-04 17:06:34 +00:00
|
|
|
QString const alignDefaultLabel;
|
2007-10-07 20:00:46 +00:00
|
|
|
///
|
|
|
|
ParagraphParameters multiparsel_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QPARAGRAPH_H
|