]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlInclude.h
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlInclude.h
index 317644b7a1a60669626d16fdd72c620fe117e962..41c23cd7733923d31aa2323ec02150c8787004d5 100644 (file)
@@ -1,29 +1,29 @@
 // -*- C++ -*-
 /**
  * \file ControlInclude.h
- * Copyright 2001 the LyX Team
- * See the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
  * \author Alejandro Aguilar Sierra
- * \author John Levon, moz@compsoc.man.ac.uk
- * \author Angus Leeming, a.leeming@.ac.uk
+ * \author John Levon
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef CONTROLINCLUDE_H
 #define CONTROLINCLUDE_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
-#include "ControlInset.h"
-#include "insets/insetinclude.h" // InsetIncludeParams
+#include "Dialog.h"
+#include "insets/insetcommandparams.h"
+
+namespace lyx {
+namespace frontend {
 
 /** A controller for the Include file dialog.
  */
-class ControlInclude
-       : public ControlInset<InsetInclude, InsetInclude::Params>
-{
+class ControlInclude : public Dialog::Controller {
 public:
        ///
        enum Type {
@@ -35,21 +35,36 @@ public:
                INCLUDE
        };
        ///
-       ControlInclude(LyXView &, Dialogs &);
+       ControlInclude(Dialog &);
+
+       ///
+       virtual bool initialiseParams(std::string const & data);
+       /// clean-up on hide.
+       virtual void clearParams();
+       /// clean-up on hide.
+       virtual void dispatchParams();
+       ///
+       virtual bool isBufferDependent() const { return true; }
+
+       ///
+       InsetCommandParams const & params() const { return params_; }
+       ///
+       void setParams(InsetCommandParams const &);
 
        /// Browse for a file
-       string const Browse(string const &, Type);
+       std::string const browse(std::string const &, Type) const;
+
+       /// load a file
+       void load(std::string const & file);
 
+       /// test if file exist
+       bool fileExists(std::string const & file);
 private:
-       /// Dispatch the changed parameters to the kernel.
-       virtual void applyParamsToInset();
-       /// Should be used but currently isn't
-       virtual void applyParamsNoInset() {}
-       /// get the parameters from the string passed to createInset.
-       virtual InsetInclude::Params const getParams(string const &)
-               { return InsetInclude::Params(); }
-       /// get the parameters from the inset passed to showInset.
-       virtual InsetInclude::Params const getParams(InsetInclude const & inset)
-               { return inset.params(); }
+       ///
+       InsetCommandParams params_;
 };
+
+} // namespace frontend
+} // namespace lyx
+
 #endif // CONTROLINCLUDE_H