]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetExternal.h
Change inset label from ": filename" to "Program Listing: filename" for listings...
[lyx.git] / src / insets / InsetExternal.h
index fa07e0ac08fe4f5389bf9abc1fac75b44219a555..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
@@ -80,7 +77,7 @@ public:
        std::string const & templatename() const { return templatename_; }
 
        /// The external file.
-       EmbeddedFile filename;
+       support::DocFileName filename;
        /// How the inset is to be displayed by LyX.
        external::DisplayType display;
        /// The scale of the displayed graphic (if shown).
@@ -108,14 +105,31 @@ class RenderBase;
 class InsetExternal : public Inset, public boost::signals::trackable
 {
 public:
-       InsetExternal();
+       InsetExternal(Buffer &);
        ///
        ~InsetExternal();
        ///
+       static void string2params(std::string const &, Buffer const &,
+                                 InsetExternalParams &);
+       ///
+       static std::string params2string(InsetExternalParams const &,
+                                              Buffer const &);
+       ///
+       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;
        ///
@@ -124,44 +138,26 @@ public:
        void write(std::ostream &) const;
        ///
        void read(Lexer & lex);
-
-       /// \returns the number of rows (\n's) of generated code.
-       int latex(odocstream &, OutputParams const &) const;
        ///
        int plaintext(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 &);
+       void validate(LaTeXFeatures & features) const;
        ///
        void addPreview(graphics::PreviewLoader &) const;
        ///
        void edit(Cursor & cur, bool front, EntryDirection entry_from);
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
-       /// external file can be embedded
-       void registerEmbeddedFiles(EmbeddedFileList &) const;
-       ///
-       void updateEmbeddedFile(EmbeddedFile const &);
-
-protected:
-       InsetExternal(InsetExternal const &);
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
-private:
-       Inset * clone() const;
-
+       ///
+       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.
         */
@@ -173,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