2002-02-27 09:59:52 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2003-08-23 00:17:00 +00:00
|
|
|
* \file GraphicsImage.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-02-27 09:59:52 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* \author Baruch Even
|
|
|
|
* \author Angus Leeming
|
2002-09-05 11:31:30 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-02-27 09:59:52 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* An abstract base class for the images themselves.
|
|
|
|
* Allows the user to retrieve the pixmap, once loaded and to issue commands
|
|
|
|
* to modify it.
|
2002-02-27 09:59:52 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* The loading process can be asynchronous, but cropping, rotating and
|
|
|
|
* scaling block execution.
|
2002-02-27 09:59:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GRAPHICSIMAGE_H
|
|
|
|
#define GRAPHICSIMAGE_H
|
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
namespace lyx {
|
2006-11-26 21:30:39 +00:00
|
|
|
|
|
|
|
namespace support { class FileName; }
|
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
namespace graphics {
|
2002-02-27 09:59:52 +00:00
|
|
|
|
2002-06-28 11:22:56 +00:00
|
|
|
class Params;
|
2002-02-27 09:59:52 +00:00
|
|
|
|
2002-06-28 11:22:56 +00:00
|
|
|
class Image {
|
2002-02-27 09:59:52 +00:00
|
|
|
public:
|
|
|
|
///
|
2002-06-28 11:22:56 +00:00
|
|
|
virtual ~Image() {}
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
/// Create a copy
|
2007-11-21 22:54:10 +00:00
|
|
|
virtual Image * clone() const = 0;
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
/// Get the image width
|
2007-11-23 22:15:17 +00:00
|
|
|
virtual unsigned int width() const = 0;
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
/// Get the image height
|
2007-11-23 22:15:17 +00:00
|
|
|
virtual unsigned int height() const = 0;
|
2002-02-27 09:59:52 +00:00
|
|
|
|
2003-09-16 15:34:39 +00:00
|
|
|
/// Is the image drawable ?
|
2007-11-21 22:54:10 +00:00
|
|
|
virtual bool isDrawable() const = 0;
|
2002-07-17 16:56:42 +00:00
|
|
|
|
2002-06-28 11:22:56 +00:00
|
|
|
/** Start loading the image file.
|
|
|
|
* The caller should expect this process to be asynchronous and
|
|
|
|
* so should connect to the "finished" signal above.
|
|
|
|
*/
|
2008-06-06 11:52:02 +00:00
|
|
|
virtual bool load(support::FileName const & filename) = 0;
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
/** Generate the pixmap.
|
|
|
|
* Uses the params to decide on color, grayscale etc.
|
|
|
|
* Returns true if the pixmap is created.
|
|
|
|
*/
|
2007-11-21 22:54:10 +00:00
|
|
|
virtual bool setPixmap(Params const & params) = 0;
|
2002-02-27 09:59:52 +00:00
|
|
|
};
|
|
|
|
|
2008-09-19 12:01:01 +00:00
|
|
|
/// Only way to create a new Image.
|
|
|
|
/// Implemented in the frontend.
|
|
|
|
Image * newImage();
|
2003-09-16 15:34:39 +00:00
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
} // namespace graphics
|
|
|
|
} // namespace lyx
|
2002-02-27 09:59:52 +00:00
|
|
|
|
|
|
|
#endif // GRAPHICSIMAGE_H
|