X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiParagraph.h;h=408765bbe433c0472641b62ecd9ba28ad63e1f4a;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=75f5e16389089b5419c8725f5ab65e90a4401fe7;hpb=72801c16e24132c00408c6e61d5fb7fe9866d5d4;p=lyx.git diff --git a/src/frontends/qt4/GuiParagraph.h b/src/frontends/qt4/GuiParagraph.h index 75f5e16389..408765bbe4 100644 --- a/src/frontends/qt4/GuiParagraph.h +++ b/src/frontends/qt4/GuiParagraph.h @@ -14,38 +14,41 @@ #ifndef GUIPARAGRAPH_H #define GUIPARAGRAPH_H -// Uncomment this if you prefer dock widget -//#define USE_DOCK_WIDGET +#include "DialogView.h" +#include "GuiView.h" +#include "qt_helpers.h" +#include "ui_ParagraphUi.h" #include "Layout.h" -#include "ui_ParagraphUi.h" -#include "Dialog.h" #include "ParagraphParameters.h" -#include "GuiView.h" -#include "qt_helpers.h" -#include "debug.h" -#include #include -#include #include #include #include -#include namespace lyx { namespace frontend { class GuiParagraph - : public QDialog, public Ui::ParagraphUi, public Dialog + : public DialogView, public Ui::ParagraphUi { Q_OBJECT public: - GuiParagraph(LyXView & lv); + GuiParagraph(GuiView & lv); - /// update + /// 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: /// @@ -53,67 +56,19 @@ private: /// void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT); /// - LyXAlignment getAlignmentFromDialog(); + LyXAlignment getAlignmentFromDialog() const; /// - typedef std::map RadioMap; - RadioMap radioMap; - typedef std::map AlignmentLabels; - AlignmentLabels labelMap; - - QString const alignDefaultLabel; - - void applyView() {} - void hideView() - { - clearParams(); - QDialog::hide(); - } - void showData(std::string const & data) - { - initialiseParams(data); - showView(); - } - void showView() - { - updateView(); // make sure its up-to-date - QDialog::show(); - raise(); - activateWindow(); - } - bool isVisibleView() const { return QDialog::isVisible(); } - void checkStatus() { updateView(); } - void redraw() { redrawView(); } - void redrawView() {} - void updateData(std::string const & data) - { - initialiseParams(data); - updateView(); - } - void partialUpdateView(int /*id*/) {} - std::string name() const { return "paragraph"; } - -private: - std::string name_; - - void showEvent(QShowEvent * e) - { -#if (QT_VERSION >= 0x040200) - QSettings settings; - std::string key = name_ + "/geometry"; - QDialog::restoreGeometry(settings.value(key.c_str()).toByteArray()); -#endif - QDialog::showEvent(e); - } - - void closeEvent(QCloseEvent * e) - { -#if (QT_VERSION >= 0x040200) - QSettings settings; - std::string key = name_ + "/geometry"; - settings.setValue(key.c_str(), QDialog::saveGeometry()); -#endif - QDialog::closeEvent(e); - } + ParagraphParameters const & params() const; + /// + bool haveMultiParSelection() const; + /// + bool canIndent() const; + /// + bool hasLabelwidth() const; + /// + LyXAlignment alignPossible() const; + /// + LyXAlignment alignDefault() const; private Q_SLOTS: /// @@ -126,31 +81,21 @@ private Q_SLOTS: 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(); private: /// - bool initialiseParams(std::string const & /*data*/) { return true; } - /// clean-up on hide. - void clearParams() {} - /// - void dispatchParams(); - /// - bool isBufferDependent() const { return true; } - /// - ParagraphParameters & params(); - /// - ParagraphParameters const & params() const; + typedef std::map RadioMap; /// - bool haveMulitParSelection(); + RadioMap radioMap_; + /// - bool canIndent() const; + QString alignDefaultLabel_; /// - LyXAlignment alignPossible() const; - /// - LyXAlignment alignDefault() const; - -private: - ParagraphParameters multiparsel_; + ParagraphParameters params_; }; } // namespace frontend