X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiListings.h;h=b9717d35e7b8a671f301bf32e317bedb33b9716c;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=092dcfa7b5295d2bc411a849a654e0de8daa24c0;hpb=212386be8a1573fb52b5da718961835816a3c8e2;p=lyx.git diff --git a/src/frontends/qt4/GuiListings.h b/src/frontends/qt4/GuiListings.h index 092dcfa7b5..b9717d35e7 100644 --- a/src/frontends/qt4/GuiListings.h +++ b/src/frontends/qt4/GuiListings.h @@ -12,32 +12,29 @@ #ifndef GUILISTINGS_H #define GUILISTINGS_H -#include "GuiDialogView.h" -#include "ControlListings.h" +#include "GuiDialog.h" #include "ui_ListingsUi.h" - -#include +#include "insets/InsetListingsParams.h" namespace lyx { namespace frontend { -class GuiListings; - -class GuiListingsDialog : public QDialog, public Ui::ListingsUi { +class GuiListings : public GuiDialog, public Ui::ListingsUi +{ Q_OBJECT public: - GuiListingsDialog(GuiListings * form); + GuiListings(GuiView & lv); /// get values from all the widgets and form a string std::string construct_params(); /// validate listings parameters and return an error message, if any docstring validate_listings_params(); -protected Q_SLOTS: - virtual void change_adaptor(); +private Q_SLOTS: + void change_adaptor(); /// AFAIK, QValidator only works for QLineEdit so /// I have to validate listingsED (QTextEdit) manually. /// This function displays a hint or error message returned by /// validate_listings_params - void set_listings_msg(); + void setListingsMsg(); /// turn off inline when float is clicked void on_floatCB_stateChanged(int state); /// turn off float when inline is clicked @@ -46,34 +43,26 @@ protected Q_SLOTS: void on_numberSideCO_currentIndexChanged(int); /// show dialect when language is chosen void on_languageCO_currentIndexChanged(int); -protected: - virtual void closeEvent(QCloseEvent * e); -private: - GuiListings * form_; -}; - - -class GuiListings : public GuiView { -public: - friend class GuiListingsDialog; - - GuiListings(GuiDialog &); - /// parent controller - ControlListings & controller() - { return static_cast(this->getController()); } - /// parent controller - ControlListings const & controller() const - { return static_cast(this->getController()); } private: + /// return false if validate_listings_params returns error + bool isValid(); /// Apply changes - virtual void apply(); + void applyView(); /// update - virtual void update_contents(); - /// build the dialog - virtual void build_dialog(); -protected: - /// return false if validate_listings_params returns error - virtual bool isValid(); + void updateContents(); + /// + bool initialiseParams(std::string const & data); + /// clean-up on hide. + void clearParams(); + /// clean-up on hide. + void dispatchParams(); + /// + bool isBufferDependent() const { return true; } + /// + void setParams(InsetListingsParams const &); + + /// + InsetListingsParams params_; }; } // namespace frontend