]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiImage.h
Disable CheckTeX while buffer is processed
[lyx.git] / src / frontends / qt4 / GuiImage.h
1 // -*- C++ -*-
2 /**
3  * \file GuiImage.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 GUIIMAGE_H
14 #define GUIIMAGE_H
15
16 #include "graphics/GraphicsImage.h"
17
18 #include <QImage>
19 #include <QString>
20
21 namespace lyx {
22 namespace graphics {
23
24 class GuiImage : public Image
25 {
26 public:
27         /// Access to the class is through newImage() and clone.
28         GuiImage();
29         ///
30         GuiImage(GuiImage const &);
31
32         /// Retrieve the rendered image.
33         QImage const & image() const;
34
35 private:
36         /// Create a copy
37         Image * clone() const;
38         /// Get the image width
39         unsigned int width() const;
40         /// Get the image height
41         unsigned int height() const;
42         // FIXME Is the image drawable ?
43         bool isDrawable() const { return true; }
44         /**
45          * Load the image file into memory.
46          */
47         bool load(support::FileName const & filename);
48         bool load();
49         /**
50          * Finishes the process of modifying transformed_, using
51          * \c params to decide on color, grayscale etc.
52          * \returns true if successful.
53          */
54         bool setPixmap(Params const & params);
55
56         /// Clip the image using params.
57         bool clip(Params const & params);
58         /// Rotate the image using params.
59         bool rotate(Params const & params);
60         /// Scale the image using params.
61         bool scale(Params const & params);
62
63         /// The original loaded image.
64         QImage original_;
65
66         /// The transformed image for display.
67         QImage transformed_;
68
69         ///
70         bool is_transformed_;
71         ///
72         QString fname_;
73 };
74
75 } // namespace graphics
76 } // namespace lyx
77
78 #endif // GUIIMAGE_H