]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsImage.h
Fix functions that used functions but did not defined it
[lyx.git] / src / graphics / GraphicsImage.h
1 // -*- C++ -*-
2 /**
3  * \file GraphicsImage.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Baruch Even
8  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS.
11  *
12  * An abstract base class for the images themselves.
13  * Allows the user to retrieve the pixmap, once loaded and to issue commands
14  * to modify it.
15  *
16  * The loading process can be asynchronous, but cropping, rotating and
17  * scaling block execution.
18  */
19
20 #ifndef GRAPHICSIMAGE_H
21 #define GRAPHICSIMAGE_H
22
23 namespace lyx {
24
25 namespace support { class FileName; }
26
27 namespace graphics {
28
29 class Params;
30
31 class Image {
32 public:
33         ///
34         virtual ~Image() {}
35
36         /// Create a copy
37         virtual Image * clone() const = 0;
38
39         /// Get the image width
40         virtual unsigned int width() const = 0;
41
42         /// Get the image height
43         virtual unsigned int height() const = 0;
44
45         /// Is the image drawable ?
46         virtual bool isDrawable() const = 0;
47
48         /** Start loading the image file.
49          *  The caller should expect this process to be asynchronous and
50          *  so should connect to the "finished" signal above.
51          */
52         virtual bool load(support::FileName const & filename) = 0;
53
54         /** Generate the pixmap.
55          *  Uses the params to decide on color, grayscale etc.
56          *  Returns true if the pixmap is created.
57          */
58         virtual bool setPixmap(Params const & params) = 0;
59 };
60
61 /// Only way to create a new Image.
62 /// Implemented in the frontend.
63 Image * newImage();
64
65 } // namespace graphics
66 } // namespace lyx
67
68 #endif // GRAPHICSIMAGE_H