#include "Inset.h"
#include "ExternalTransforms.h"
+#include "EmbeddedFiles.h"
-#include "support/filename.h"
-#include "support/translator.h"
+#include "support/FileName.h"
+#include "support/Translator.h"
#include <boost/scoped_ptr.hpp>
#include <boost/signals/trackable.hpp>
InsetExternalParams();
void write(Buffer const &, std::ostream &) const;
- bool read(Buffer const &, LyXLex &);
+ bool read(Buffer const &, Lexer &);
/// The name of the tempfile used for manipulations.
support::FileName const & tempname() const { return tempname_(); }
std::string const & templatename() const { return templatename_; }
/// The external file.
- support::DocFileName filename;
+ EmbeddedFile filename;
/// How the inset is to be displayed by LyX.
external::DisplayType display;
/// The scale of the displayed graphic (if shown).
class RenderBase;
///
-class InsetExternal : public InsetOld, public boost::signals::trackable
+class InsetExternal : public Inset, public boost::signals::trackable
{
public:
InsetExternal();
///
virtual ~InsetExternal();
///
- virtual InsetBase::Code lyxCode() const { return EXTERNAL_CODE; }
+ virtual InsetCode lyxCode() const { return EXTERNAL_CODE; }
///
virtual EDITABLE editable() const { return IS_EDITABLE; }
///
- bool metrics(MetricsInfo &, Dimension &) const;
+ void metrics(MetricsInfo &, Dimension &) const;
///
void draw(PainterInfo & pi, int x, int y) const;
///
virtual void write(Buffer const &, std::ostream &) const;
///
- virtual void read(Buffer const &, LyXLex & lex);
+ 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;
+ OutputParams const &) const;
///
int plaintext(Buffer const &, odocstream &,
- OutputParams const &) const;
+ OutputParams const &) const;
///
int docbook(Buffer const &, odocstream &,
- OutputParams const &) const;
+ OutputParams const &) const;
/// Update needed features for this inset.
virtual void validate(LaTeXFeatures & features) const;
///
void addPreview(graphics::PreviewLoader &) const;
///
- void edit(LCursor & cur, bool left);
+ void edit(Cursor & cur, bool left);
///
- bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+ bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
+ /// external file can be embedded
+ void registerEmbeddedFiles(Buffer const &, EmbeddedFileList &) const;
+ ///
+ void updateEmbeddedFile(Buffer const &, EmbeddedFile const &);
protected:
InsetExternal(InsetExternal const &);
///
- virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+ virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual std::auto_ptr<InsetBase> doClone() const;
+ virtual Inset * clone() const;
/** This method is connected to the graphics loader, so we are
* informed when the image has been loaded.
///
InsetExternalMailer(InsetExternal & inset);
///
- virtual InsetBase & inset() const { return inset_; }
+ virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///