#define INSET_EXTERNAL_H
#include "inset.h"
-
-#include "graphics/GraphicsTypes.h"
+#include "ExternalTransforms.h"
#include "support/filename.h"
+#include "support/translator.h"
#include <boost/scoped_ptr.hpp>
#include <boost/signals/trackable.hpp>
std::string tempname_;
};
+/// How is the image to be displayed on the LyX screen?
+enum DisplayType {
+ DefaultDisplay,
+ MonochromeDisplay,
+ GrayscaleDisplay,
+ ColorDisplay,
+ PreviewDisplay,
+ NoDisplay
+};
+
+
+/// The translator between the Display enum and corresponding lyx string.
+Translator<DisplayType, std::string> const & displayTranslator();
+
} // namespace external
} // namespace lyx
/// The external file.
lyx::support::FileName filename;
/// How the inset is to be displayed by LyX.
- lyx::graphics::DisplayType display;
+ lyx::external::DisplayType display;
/// The scale of the displayed graphic (if shown).
unsigned int lyxscale;
+ lyx::external::ClipData clipdata;
+ lyx::external::ExtraData extradata;
+ lyx::external::ResizeData resizedata;
+ lyx::external::RotationData rotationdata;
+
private:
lyx::external::TempName tempname_;
std::string templatename_;
};
-class RenderInset;
+class RenderBase;
///
class InsetExternal : public InsetOld, public boost::signals::trackable
virtual ~InsetExternal();
///
virtual std::auto_ptr<InsetBase> clone() const;
- ///
- virtual dispatch_result localDispatch(FuncRequest const & cmd);
-
///
virtual InsetOld::Code lyxCode() const { return EXTERNAL_CODE; }
///
/// \returns the number of rows (\n's) of generated code.
virtual int latex(Buffer const &, std::ostream &,
- LatexRunParams const &) const;
+ OutputParams const &) const;
///
- virtual int ascii(Buffer const &, std::ostream &, int linelen) const;
+ virtual int plaintext(Buffer const &, std::ostream &,
+ OutputParams const &) const;
///
- virtual int linuxdoc(Buffer const &, std::ostream &) const;
+ virtual int linuxdoc(Buffer const &, std::ostream &,
+ OutputParams const &) const;
///
virtual int docbook(Buffer const &, std::ostream &,
- bool mixcont) const;
+ 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 addPreview(lyx::graphics::PreviewLoader &) const;
+ ///
+ void edit(BufferView * bv, bool);
+protected:
+ ///
+ virtual
+ DispatchResult
+ priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
private:
/** This method is connected to the graphics loader, so we are
* informed when the image has been loaded.
*/
- void statusChanged();
+ void statusChanged() const;
+
+ /** Slot receiving a signal that the external file has changed
+ * and the preview should be regenerated.
+ */
+ void fileChanged() const;
/// The current params
InsetExternalParams params_;
/// The thing that actually draws the image on LyX's screen.
- boost::scoped_ptr<RenderInset> renderer_;
+ boost::scoped_ptr<RenderBase> renderer_;
};