]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiListings.h
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiListings.h
index 71202e504ad4942a1f380e109e15637818e8675c..b9717d35e7b8a671f301bf32e317bedb33b9716c 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 /**
- * \file QListings.h
+ * \file GuiListings.h
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
@@ -9,35 +9,32 @@
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef QLISTINGS_H
-#define QLISTINGS_H
+#ifndef GUILISTINGS_H
+#define GUILISTINGS_H
 
-#include "GuiDialogView.h"
+#include "GuiDialog.h"
 #include "ui_ListingsUi.h"
-
-#include <QDialog>
-#include <QCloseEvent>
+#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,33 +43,29 @@ 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 ControlListings;
-
-class GuiListings : public QController<ControlListings, GuiView<GuiListingsDialog> > {
-public:
-       friend class GuiListingsDialog;
-
-       GuiListings(Dialog &);
 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
 } // namespace lyx
 
-#endif // QLISTINGS_H
+#endif // GUILISTINGS_H