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
|
|
|
|
//@{
|
2008-04-19 16:56:40 +00:00
|
|
|
void applyView();
|
2007-09-26 13:13:01 +00:00
|
|
|
void updateView();
|
2008-02-04 17:06:34 +00:00
|
|
|
void dispatchParams();
|
2008-02-08 16:08:45 +00:00
|
|
|
void enableView(bool enable);
|
2008-02-04 17:06:34 +00:00
|
|
|
bool isBufferDependent() const { return true; }
|
2008-03-15 01:20:36 +00:00
|
|
|
virtual FuncCode getLfun() const { return LFUN_PARAGRAPH_PARAMS_APPLY; }
|
2008-05-14 14:08:58 +00:00
|
|
|
void saveSession() const;
|
|
|
|
void restoreSession();
|
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;
|
|
|
|
///
|
|
|
|
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();
|
2008-04-19 16:56:40 +00:00
|
|
|
/// Apply changes and close
|
|
|
|
void on_okPB_clicked();
|
|
|
|
/// Close/Cancel dialog
|
|
|
|
void on_closePB_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-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
|