]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetExternal.h
Fix bug http://bugzilla.lyx.org/show_bug.cgi?id=4910 by creating InsetText::addToToc().
[lyx.git] / src / insets / InsetExternal.h
index 993354d328427248b97d81773612bcdeded8f7dc..22a9318a47b1e12a606df811d2ae09235af891f1 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "Inset.h"
 #include "ExternalTransforms.h"
-#include "EmbeddedFiles.h"
 
 #include "support/FileName.h"
 #include "support/Translator.h"
@@ -22,8 +21,6 @@
 #include <boost/scoped_ptr.hpp>
 #include <boost/signals/trackable.hpp>
 
-#include "MailInset.h"
-
 
 /** No two InsetExternalParams variables can have the same temporary file.
  *  This class has copy-semantics but the copy constructor
@@ -108,61 +105,59 @@ class RenderBase;
 class InsetExternal : public Inset, public boost::signals::trackable
 {
 public:
-       InsetExternal();
+       InsetExternal(Buffer &);
+       ///
+       ~InsetExternal();
        ///
-       virtual ~InsetExternal();
+       static void string2params(std::string const &, Buffer const &,
+                                 InsetExternalParams &);
        ///
-       virtual InsetCode lyxCode() const { return EXTERNAL_CODE; }
+       static std::string params2string(InsetExternalParams const &,
+                                              Buffer const &);
        ///
-       virtual EDITABLE editable() const { return IS_EDITABLE; }
+       InsetExternalParams const & params() const;
+       ///
+       void setParams(InsetExternalParams const &);
+       /// \returns the number of rows (\n's) of generated code.
+       int latex(odocstream &, OutputParams const &) const;
+       ///
+       docstring contextMenu(BufferView const & bv, int x, int y) const;
 
+private:
+       ///
+       InsetExternal(InsetExternal const &);
+       ///
+       InsetCode lyxCode() const { return EXTERNAL_CODE; }
+       ///
+       EDITABLE editable() const { return IS_EDITABLE; }
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       virtual void write(Buffer const &, std::ostream &) const;
+       void write(std::ostream &) const;
        ///
-       virtual void read(Buffer const &, Lexer & lex);
-
-       /// \returns the number of rows (\n's) of generated code.
-       int latex(Buffer const &, odocstream &,
-                 OutputParams const &) const;
+       void read(Lexer & lex);
        ///
-       int plaintext(Buffer const &, odocstream &,
-                     OutputParams const &) const;
+       int plaintext(odocstream &, OutputParams const &) const;
        ///
-       int docbook(Buffer const &, odocstream &,
-                   OutputParams const &) const;
-
+       int docbook(odocstream &, OutputParams const &) const;
        /// Update needed features for this inset.
-       virtual void validate(LaTeXFeatures & features) const;
-
-       ///
-       InsetExternalParams const & params() const;
-       ///
-       void setParams(InsetExternalParams const &, Buffer const &);
+       void validate(LaTeXFeatures & features) const;
        ///
        void addPreview(graphics::PreviewLoader &) const;
        ///
-       void edit(Cursor & cur, bool left);
+       void edit(Cursor & cur, bool front, EntryDirection entry_from);
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
-       /// external file can be embedded
-       void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const;
-
-protected:
-       InsetExternal(InsetExternal const &);
        ///
-       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
-private:
-       virtual Inset * clone() const;
-
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
+       ///
+       Inset * clone() const { return new InsetExternal(*this); }
        /** This method is connected to the graphics loader, so we are
         *  informed when the image has been loaded.
         */
        void statusChanged() const;
-
        /** Slot receiving a signal that the external file has changed
         *  and the preview should be regenerated.
         */
@@ -174,30 +169,6 @@ private:
        boost::scoped_ptr<RenderBase> renderer_;
 };
 
-
-class InsetExternalMailer : public MailInset {
-public:
-       ///
-       InsetExternalMailer(InsetExternal & 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 &, Buffer const &,
-                                 InsetExternalParams &);
-       ///
-       static std::string const params2string(InsetExternalParams const &,
-                                              Buffer const &);
-private:
-       ///
-       static std::string const name_;
-       ///
-       InsetExternal & inset_;
-};
-
 } // namespace lyx
 
-#endif
+#endif // INSET_EXTERNAL_H