]> git.lyx.org Git - lyx.git/blobdiff - src/insets/ExternalTransforms.h
Center longtable explicitly (#10690)
[lyx.git] / src / insets / ExternalTransforms.h
index 5f9a85294bb00d053f6dd7ba96d36d210a599ced..cd3e5e226a0e1354d66de3709597ad2f86ed43c6 100644 (file)
 #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 {
 
 /*
@@ -35,7 +39,9 @@ class ClipData {
 public:
        ClipData() : clip(false) {}
 
-       lyx::graphics::BoundingBox bbox;
+       /// The bounding box
+       graphics::BoundingBox bbox;
+       /// clip image
        bool clip;
 };
 
@@ -56,14 +62,14 @@ private:
 
 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;
 };
 
@@ -84,11 +90,11 @@ public:
                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_; }
@@ -97,7 +103,6 @@ public:
        std::string const originString() const;
 
 private:
-       double angle_;
        OriginType origin_;
 };
 
@@ -119,7 +124,7 @@ public:
  */
 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.
@@ -198,7 +203,7 @@ private:
  */
 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.
@@ -303,7 +308,6 @@ private:
  */
 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 {
@@ -314,23 +318,24 @@ 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.