X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiParagraph.h;h=408765bbe433c0472641b62ecd9ba28ad63e1f4a;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=133437d4ed051d0e09f4d237b7d170ccdaddf58a;hpb=a1cec91afaca91968b46e695533c10ad2a3f73d3;p=lyx.git diff --git a/src/frontends/qt4/GuiParagraph.h b/src/frontends/qt4/GuiParagraph.h index 133437d4ed..408765bbe4 100644 --- a/src/frontends/qt4/GuiParagraph.h +++ b/src/frontends/qt4/GuiParagraph.h @@ -6,71 +6,96 @@ * * \author Edwin Leuven * \author John Levon + * \author Abdelrazak Younes * * Full author contact details are available in file CREDITS. */ -#ifndef QPARAGRAPH_H -#define QPARAGRAPH_H +#ifndef GUIPARAGRAPH_H +#define GUIPARAGRAPH_H -#include "GuiDialogView.h" +#include "DialogView.h" +#include "GuiView.h" +#include "qt_helpers.h" +#include "ui_ParagraphUi.h" #include "Layout.h" -#include "ui_ParagraphUi.h" +#include "ParagraphParameters.h" #include -#include +#include +#include #include namespace lyx { namespace frontend { -class GuiParagraph; - -class GuiParagraphDialog : public QDialog, public Ui::ParagraphUi { +class GuiParagraph + : public DialogView, public Ui::ParagraphUi +{ Q_OBJECT public: - GuiParagraphDialog(GuiParagraph * form); + GuiParagraph(GuiView & lv); + + /// Dialog inherited methods + //@{ + void applyView(); + void updateView(); + void dispatchParams(); + void enableView(bool enable); + bool isBufferDependent() const { return true; } + virtual FuncCode getLfun() const { return LFUN_PARAGRAPH_PARAMS_APPLY; } + void saveSession() const; + void restoreSession(); + //@} + +private: /// void checkAlignmentRadioButtons(); /// void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT); /// - LyXAlignment getAlignmentFromDialog(); -protected: - void closeEvent (QCloseEvent * e); -private: - GuiParagraph * form_; - typedef std::map QPRadioMap; - QPRadioMap radioMap; - typedef std::map QPAlignmentLabels; - QPAlignmentLabels labelMap; - -protected Q_SLOTS: + LyXAlignment getAlignmentFromDialog() const; /// - void change_adaptor(); + ParagraphParameters const & params() const; /// - void enableLinespacingValue(int); -}; - - -class ControlParagraph; + bool haveMultiParSelection() const; + /// + bool canIndent() const; + /// + bool hasLabelwidth() const; + /// + LyXAlignment alignPossible() const; + /// + LyXAlignment alignDefault() const; -class GuiParagraph - : public QController > -{ -public: - friend class GuiParagraphDialog; +private Q_SLOTS: + /// + void changed(); + /// + void on_synchronizedViewCB_toggled(); + /// + void on_restorePB_clicked(); + /// + void on_linespacing_activated(int); + /// Apply changes + void on_applyPB_clicked(); + /// Apply changes and close + void on_okPB_clicked(); + /// Close/Cancel dialog + void on_closePB_clicked(); - GuiParagraph(Dialog &); private: - /// Apply changes - virtual void apply(); - /// update - virtual void update_contents(); - /// build the dialog - virtual void build_dialog(); + /// + typedef std::map RadioMap; + /// + RadioMap radioMap_; + + /// + QString alignDefaultLabel_; + /// + ParagraphParameters params_; }; } // namespace frontend