]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QLImage.h
fix math fonts with LyX/Mac
[lyx.git] / src / frontends / qt2 / QLImage.h
1 // -*- C++ -*-
2 /**
3  * \file QLImage.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef QLIMAGE_H
14 #define QLIMAGE_H
15
16
17 #include "graphics/GraphicsImage.h"
18
19 #include <qimage.h>
20
21 namespace lyx {
22 namespace graphics {
23
24 class QLImage : public Image {
25 public:
26         /// Access to this class is through this static method.
27         static ImagePtr newImage();
28
29         /// Return the list of loadable formats.
30         static FormatList loadableFormats();
31
32         ~QLImage();
33         QImage const & qimage() const { return transformed_; }
34
35 private:
36         /// Create a copy
37         virtual Image * clone_impl() const;
38         /// Get the image width
39         virtual unsigned int getWidth_impl() const;
40         /// Get the image height
41         virtual unsigned int getHeight_impl() const;
42         // FIXME Is the image drawable ?
43         virtual bool isDrawable_impl() const { return true; }
44         /**
45          * Load the image file into memory.
46          * The process is asynchronous, so this method starts the loading.
47          * When finished, the Image::finishedLoading signal is emitted.
48          */
49         virtual void load_impl(std::string const & filename);
50         /**
51          * Finishes the process of modifying transformed_, using
52          * \c params to decide on color, grayscale etc.
53          * \returns true if successful.
54          */
55         virtual bool setPixmap_impl(Params const & params);
56         /// Clip the image using params.
57         virtual void clip_impl(Params const & params);
58         /// Rotate the image using params.
59         virtual void rotate_impl(Params const & params);
60         /// Scale the image using params.
61         virtual void scale_impl(Params const & params);
62
63         /// Access to the class is through newImage() and clone.
64         QLImage();
65         ///
66         QLImage(QLImage const &);
67
68         /// The original loaded image.
69         QImage original_;
70
71         /// The transformed image for display.
72         QImage transformed_;
73 };
74
75 } // namespace graphics
76 } // namespace lyx
77
78 #endif // QLIMAGE_H