]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLImage.h
Remove quite a few compiler warnings:
[lyx.git] / src / frontends / qt4 / 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 //Added by qt3to4:
21 #include <QPixmap>
22
23 namespace lyx {
24 namespace graphics {
25
26 class QLImage : public Image {
27 public:
28         /// Access to this class is through this static method.
29         static ImagePtr newImage();
30
31         /// Return the list of loadable formats.
32         static FormatList loadableFormats();
33
34         /// Retrieve the buffered pixmap.
35         QPixmap const & qpixmap() const { return transformed_pixmap_; }
36
37         /// Retrieve the buffered pixmap.
38         QImage const & qimage() const { return transformed_; }
39
40 private:
41         /// Create a copy
42         virtual Image * clone_impl() const;
43         /// Get the image width
44         virtual unsigned int getWidth_impl() const;
45         /// Get the image height
46         virtual unsigned int getHeight_impl() const;
47         // FIXME Is the image drawable ?
48         virtual bool isDrawable_impl() const { return true; }
49         /**
50          * Load the image file into memory.
51          * The process is asynchronous, so this method starts the loading.
52          * When finished, the Image::finishedLoading signal is emitted.
53          */
54         virtual void load_impl(std::string const & filename);
55         /**
56          * Finishes the process of modifying transformed_, using
57          * \c params to decide on color, grayscale etc.
58          * \returns true if successful.
59          */
60         virtual bool setPixmap_impl(Params const & params);
61         /// Clip the image using params.
62         virtual void clip_impl(Params const & params);
63         /// Rotate the image using params.
64         virtual void rotate_impl(Params const & params);
65         /// Scale the image using params.
66         virtual void scale_impl(Params const & params);
67
68         /// Access to the class is through newImage() and clone.
69         QLImage();
70         ///
71         QLImage(QLImage const &);
72
73         /// The original loaded image.
74         QImage original_;
75
76         /// The transformed image for display.
77         QImage transformed_;
78         /// Buffer the pixmap itself
79         QPixmap transformed_pixmap_;
80 };
81
82 } // namespace graphics
83 } // namespace lyx
84
85 #endif // QLIMAGE_H