]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsImage.h
de.po: fix doubled accelerator keys
[lyx.git] / src / graphics / GraphicsImage.h
index 6b25f6505250005080f77f37f240a57aac3e9f14..f316572d967b9bb19c6df5aac61e755fab16c6c4 100644 (file)
 #ifndef GRAPHICSIMAGE_H
 #define GRAPHICSIMAGE_H
 
+#include "Dimension.h"
+
 #include <boost/function.hpp>
 #include <boost/signal.hpp>
 
 #include <vector>
-#include <utility>
 
 namespace lyx {
 
@@ -45,11 +46,6 @@ public:
         */
        static boost::function<Image *()> newImage;
 
-       ///
-       typedef std::vector<std::string> FormatList;
-       /// Return the list of loadable formats.
-       static boost::function<FormatList()> loadableFormats;
-
        ///
        virtual ~Image() {}
 
@@ -57,10 +53,10 @@ public:
        virtual Image * clone() const = 0;
 
        /// Get the image width
-       virtual unsigned int getWidth() const = 0;
+       virtual unsigned int width() const = 0;
 
        /// Get the image height
-       virtual unsigned int getHeight() const = 0;
+       virtual unsigned int height() const = 0;
 
        /// Is the image drawable ?
        virtual bool isDrawable() const = 0;
@@ -76,7 +72,7 @@ public:
         *  The caller should expect this process to be asynchronous and
         *  so should connect to the "finished" signal above.
         */
-       virtual void load(support::FileName const & filename) = 0;
+       virtual bool load(support::FileName const & filename) = 0;
 
        /** Generate the pixmap.
         *  Uses the params to decide on color, grayscale etc.
@@ -84,15 +80,6 @@ public:
         */
        virtual bool setPixmap(Params const & params) = 0;
 
-       /// Clip the image using params.
-       virtual void clip(Params const & params) = 0;
-
-       /// Rotate the image using params.
-       virtual void rotate(Params const & params) = 0;
-
-       /// Scale the image using params.
-       virtual void scale(Params const & params) = 0;
-
 protected:
        /// Must define default c-tor explicitly as we define a copy c-tor.
        Image() {}
@@ -100,11 +87,10 @@ protected:
        Image(Image const &) {}
 
        /** Uses the params to ascertain the dimensions of the scaled image.
-        *  Returned as make_pair(width, height).
-        *  If something goes wrong, returns make_pair(getWidth(), getHeight())
+        *  Returned as Dimension(width, height, 0 descend).
+        *  If something goes wrong, returns make_pair(getWidth(), getHeight(), 0)
         */
-       std::pair<unsigned int, unsigned int>
-       getScaledDimensions(Params const & params) const;
+       Dimension scaledDimension(Params const & params) const;
 };