]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiInclude.h
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiInclude.h
index d961650028c9d806dac5f9876cefa1d6ab4c17c7..e5ef7b668907c2d2cf870d01137ca0175939ce30 100644 (file)
@@ -4,81 +4,89 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
+ * \author Alejandro Aguilar Sierra
+ * \author Angus Leeming
  * \author John Levon
  *
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef QINCLUDE_H
-#define QINCLUDE_H
-
-#include "GuiDialogView.h"
+#ifndef GUIINCLUDE_H
+#define GUIINCLUDE_H
 
+#include "GuiDialog.h"
 #include "ui_IncludeUi.h"
 
-#include <QDialog>
+#include "insets/InsetCommandParams.h"
+
 
 namespace lyx {
 namespace frontend {
 
-class GuiInclude;
-
-class GuiIncludeDialog : public QDialog, public Ui::IncludeUi {
+class GuiInclude : public GuiDialog, public Ui::IncludeUi
+{
        Q_OBJECT
-public:
-       GuiIncludeDialog(GuiInclude * form);
 
-       void updateLists();
+public:
+       GuiInclude(GuiView & lv);
 
-       virtual void show();
-       /// validate listings parameters and return an error message, if any
-       docstring validate_listings_params();
-protected Q_SLOTS:
-       virtual void change_adaptor();
-       virtual void editClicked();
-       virtual void browseClicked();
-       virtual void typeChanged(int v);
+private Q_SLOTS:
+       void change_adaptor();
+       /// edit the child document, .lyx file will be opened in lyx
+       /// other formats will be edited by external applications.
+       void edit();
+       /// browse for a file
+       void browse();
+       ///
+       void typeChanged(int v);
        /// 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();
-protected:
-       virtual void closeEvent(QCloseEvent * e);
-private:
-       GuiInclude * form_;
-};
+       void setListingsMsg();
 
+private:
+       ///
+       bool initialiseParams(std::string const & data);
+       ///
+       void paramsToDialog(InsetCommandParams const & params_);
+       /// clean-up on hide.
+       void clearParams() { params_.clear(); }
+       /// clean-up on hide.
+       void dispatchParams();
+       ///
+       bool isBufferDependent() const { return true; }
 
-class ControlInclude;
-
-///
-class GuiInclude : public QController<ControlInclude, GuiView<GuiIncludeDialog> >
-{
-public:
        ///
-       friend class GuiIncludeDialog;
+       enum Type {
+               ///
+               INPUT,
+               ///
+               VERBATIM,
+               ///
+               INCLUDE,
+               ///
+               LISTINGS,
+       };
        ///
-       GuiInclude(Dialog &);
-protected:
-       virtual bool isValid();
-private:
+       void updateLists();
+       /// validate listings parameters and return an error message, if any
+       docstring validate_listings_params();
+       ///
+       bool isValid();
        /// Apply changes
-       virtual void apply();
+       void applyView();
        /// update
-       virtual void update_contents();
-       /// build the dialog
-       virtual void build_dialog();
-
-       /// edit the child document, .lyx file will be opened in lyx
-       /// other formats will be edited by external applications.
-       void edit();
+       void updateContents() {}
+       /// Browse for a file
+       QString browse(QString const &, Type) const;
 
-       /// browse for a file
-       void browse();
+private:
+       ///
+       InsetCommandParams params_;
 };
 
 } // namespace frontend
 } // namespace lyx
 
-#endif // QINCLUDE_H
+#endif // GUIINCLUDE_H