#ifndef EXTERNALTRANSFORMS_H
#define EXTERNALTRANSFORMS_H
-#include "lyxlength.h"
+#include "Length.h"
#include "graphics/GraphicsParams.h"
+#include "support/unique_ptr.h"
+
#include <boost/any.hpp>
-#include <boost/function.hpp>
-#include <string>
+#include <functional>
#include <map>
#include <memory>
+#include <string>
-class LyXLex;
namespace lyx {
+
+class Lexer;
+
namespace external {
/*
public:
ClipData() : clip(false) {}
- lyx::graphics::BoundingBox bbox;
+ /// The bounding box
+ graphics::BoundingBox bbox;
+ /// clip image
bool clip;
};
class ResizeData {
public:
- ResizeData() : scale(0), keepAspectRatio(false) {}
+ ResizeData() : scale(), keepAspectRatio(false) {}
bool no_resize() const;
bool usingScale() const;
- float scale;
- LyXLength width;
- LyXLength height;
+ std::string scale;
+ Length width;
+ Length height;
bool keepAspectRatio;
};
BASELINERIGHT
};
- RotationData() : angle_(0), origin_(DEFAULT) {}
+ RotationData() : angle("0"), origin_(DEFAULT) {}
bool no_rotation() const;
- void angle(double a);
- double angle() const { return angle_; }
+ std::string const adjAngle() const;
+ std::string angle;
void origin(OriginType o) { origin_ = o; }
OriginType origin() const { return origin_; }
std::string const originString() const;
private:
- double angle_;
OriginType origin_;
};
*/
class TransformCommand {
public:
- typedef std::auto_ptr<TransformCommand const> ptr_type;
+ typedef unique_ptr<TransformCommand const> ptr_type;
virtual ~TransformCommand() {}
/// The string from the External Template that we seek to replace.
*/
class TransformOption {
public:
- typedef std::auto_ptr<TransformOption const> ptr_type;
+ typedef unique_ptr<TransformOption const> ptr_type;
virtual ~TransformOption() {}
/// The string from the External Template that we seek to replace.
*/
std::string const sanitizeLatexOption(std::string const & input);
std::string const sanitizeDocBookOption(std::string const & input);
-std::string const sanitizeLinuxDocOption(std::string const & input);
enum TransformID {
};
-typedef boost::function<TransformOption::ptr_type(ClipData)>
+typedef std::function<TransformOption::ptr_type(ClipData)>
ClipOptionFactory;
-typedef boost::function<TransformOption::ptr_type(std::string)>
+typedef std::function<TransformOption::ptr_type(std::string)>
ExtraOptionFactory;
-typedef boost::function<TransformOption::ptr_type(ResizeData)>
+typedef std::function<TransformOption::ptr_type(ResizeData)>
ResizeOptionFactory;
-typedef boost::function<TransformOption::ptr_type(RotationData)>
+typedef std::function<TransformOption::ptr_type(RotationData)>
RotationOptionFactory;
-typedef boost::function<TransformCommand::ptr_type(ResizeData)>
+typedef std::function<TransformCommand::ptr_type(ResizeData)>
ResizeCommandFactory;
-typedef boost::function<TransformCommand::ptr_type(RotationData)>
+typedef std::function<TransformCommand::ptr_type(RotationData)>
RotationCommandFactory;
-struct TransformStore
+class TransformStore
{
- TransformStore() {}
+public:
+ TransformStore() : id(Rotate) {}
/** Stores \c factory and a reminder of what \c data this \c factory
* operates on.