]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInclude.h
* InsetCollapsable:
[lyx.git] / src / insets / InsetInclude.h
index 8a45ef22ef7aa86502457720fc7b83ccd7197260..3be610147d655b49df8dbe56fc73aecf3da0c43e 100644 (file)
@@ -5,6 +5,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Lars Gullik Bjønnes
+ * \author Richard Heck (conversion to InsetCommand)
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -13,7 +14,7 @@
 #define INSET_INCLUDE_H
 
 #include "BiblioInfo.h"
-#include "Inset.h"
+#include "InsetCommand.h"
 #include "InsetCommandParams.h"
 #include "RenderButton.h"
 #include "MailInset.h"
@@ -33,11 +34,10 @@ class RenderMonitoredPreview;
 
 
 /// for including tex/lyx files
-class InsetInclude : public Inset {
+class InsetInclude : public InsetCommand {
 public:
        ///
        InsetInclude(InsetCommandParams const &);
-       ~InsetInclude();
 
        /// Override these InsetButton methods if Previewing
        void metrics(MetricsInfo & mi, Dimension & dim) const;
@@ -45,10 +45,6 @@ public:
        void draw(PainterInfo & pi, int x, int y) const;
        ///
        virtual DisplayType display() const;
-
-       /// get the parameters
-       InsetCommandParams const & params() const;
-
        ///
        InsetCode lyxCode() const { return INCLUDE_CODE; }
        /** Fills \c list
@@ -78,14 +74,10 @@ public:
         *  \param buffer the Buffer containing this inset.
         */
        std::vector<support::FileName> const &
-       getBibfilesCache(Buffer const & buffer) const;
+               getBibfilesCache(Buffer const & buffer) const;
        ///
        EDITABLE editable() const { return IS_EDITABLE; }
        ///
-       void write(Buffer const &, std::ostream &) const;
-       ///
-       void read(Buffer const &, Lexer &);
-       ///
        int latex(Buffer const &, odocstream &,
                  OutputParams const &) const;
        ///
@@ -101,11 +93,15 @@ public:
        ///
        void addToToc(TocList &, Buffer const &, ParConstIterator const &) const;
        ///
-       bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
-       ///
        void updateLabels(Buffer const & buffer, ParIterator const &);
        /// child document can be embedded
        void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const;
+       ///
+       static CommandInfo const * findInfo(std::string const &);
+       ///
+       static std::string defaultCommand() { return "include"; };
+       ///
+       static bool isCompatibleCommand(std::string const & s);
 protected:
        InsetInclude(InsetInclude const &);
        ///
@@ -118,19 +114,10 @@ private:
         */
        void fileChanged() const;
 
-       friend class InsetIncludeMailer;
-
        /// set the parameters
        void set(InsetCommandParams const & params, Buffer const &);
        /// get the text displayed on the button
        docstring const getScreenLabel(Buffer const &) const;
-       ///
-       void write(std::ostream &) const;
-       ///
-       void read(Lexer &);
-
-       /// the parameters
-       InsetCommandParams params_;
        /// holds the entity name that defines the file location (SGML)
        docstring const include_label;
 
@@ -144,27 +131,6 @@ private:
 };
 
 
-class InsetIncludeMailer : public MailInset {
-public:
-       ///
-       InsetIncludeMailer(InsetInclude & inset);
-       ///
-       virtual Inset & inset() const { return inset_; }
-       ///
-       virtual std::string const & name() const { return name_; }
-       ///
-       virtual std::string const inset2string(Buffer const &) const;
-       ///
-       static void string2params(std::string const &, InsetCommandParams &);
-       ///
-       static std::string const params2string(InsetCommandParams const &);
-private:
-       ///
-       static std::string const name_;
-       ///
-       InsetInclude & inset_;
-};
-
 /// return loaded Buffer or zero if the file loading did not proceed.
 Buffer * loadIfNeeded(Buffer const & parent, InsetCommandParams const & params);