#ifndef EXTERNALTRANSFORMS_H
#define EXTERNALTRANSFORMS_H
-#include "lyxlength.h"
+#include "Length.h"
#include "graphics/GraphicsParams.h"
#include <map>
#include <memory>
-class LyXLex;
-
namespace lyx {
+
+class Lexer;
+
namespace external {
/*
public:
ClipData() : clip(false) {}
- lyx::graphics::BoundingBox bbox;
+ graphics::BoundingBox bbox;
bool clip;
};
class ResizeData {
public:
- ResizeData() : scale(0), keepAspectRatio(false) {}
+ ResizeData() : scale(), keepAspectRatio(false) {}
bool no_resize() const;
- float scale;
- LyXLength width;
- LyXLength height;
+ bool usingScale() const;
+
+ 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_;
};
+/** \c RotationDataType is a wrapper for RotationData::OriginType
+ * It can be forward-declared and passed as a function argument without
+ * having to expose this header file.
+ */
+class RotationDataType {
+ RotationData::OriginType val_;
+public:
+ RotationDataType(RotationData::OriginType val) : val_(val) {}
+ operator RotationData::OriginType() const { return val_; }
+};
+
+
/*
* Transformers generating commands
*/
*/
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::function1<TransformOption::ptr_type, ClipData>
+typedef boost::function<TransformOption::ptr_type(ClipData)>
ClipOptionFactory;
-typedef boost::function1<TransformOption::ptr_type, std::string>
+typedef boost::function<TransformOption::ptr_type(std::string)>
ExtraOptionFactory;
-typedef boost::function1<TransformOption::ptr_type, ResizeData>
+typedef boost::function<TransformOption::ptr_type(ResizeData)>
ResizeOptionFactory;
-typedef boost::function1<TransformOption::ptr_type, RotationData>
+typedef boost::function<TransformOption::ptr_type(RotationData)>
RotationOptionFactory;
-typedef boost::function1<TransformCommand::ptr_type, ResizeData>
+typedef boost::function<TransformCommand::ptr_type(ResizeData)>
ResizeCommandFactory;
-typedef boost::function1<TransformCommand::ptr_type, RotationData>
+typedef boost::function<TransformCommand::ptr_type(RotationData)>
RotationCommandFactory;
-struct TransformStore
+class TransformStore
{
+public:
TransformStore() {}
/** Stores \c factory and a reminder of what \c data this \c factory