2002-07-05 21:24:15 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2003-08-23 00:17:00 +00:00
|
|
|
* \file PreviewImage.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-07-05 21:24:15 +00:00
|
|
|
*
|
2002-12-01 22:59:25 +00:00
|
|
|
* \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-07-05 21:24:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PREVIEWIMAGE_H
|
|
|
|
#define PREVIEWIMAGE_H
|
|
|
|
|
2007-11-21 23:47:47 +00:00
|
|
|
#include "support/strfwd.h"
|
2002-07-05 21:24:15 +00:00
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
namespace lyx {
|
2006-11-26 21:30:39 +00:00
|
|
|
|
|
|
|
namespace support { class FileName; }
|
|
|
|
|
2007-11-23 22:57:11 +00:00
|
|
|
class Dimension;
|
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
namespace graphics {
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
class PreviewLoader;
|
|
|
|
class Image;
|
|
|
|
|
|
|
|
class PreviewImage {
|
|
|
|
public:
|
|
|
|
/** ascent = height * ascent_frac
|
|
|
|
* descent = height * (1 - ascent_frac)
|
|
|
|
*/
|
|
|
|
PreviewImage(PreviewLoader & parent,
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & latex_snippet,
|
2006-11-26 21:30:39 +00:00
|
|
|
support::FileName const & bitmap_file,
|
2002-07-05 21:24:15 +00:00
|
|
|
double ascent_frac);
|
|
|
|
///
|
|
|
|
~PreviewImage();
|
|
|
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & snippet() const;
|
2002-07-05 21:24:15 +00:00
|
|
|
///
|
2007-11-23 22:57:11 +00:00
|
|
|
Dimension dim() const;
|
2002-07-15 11:08:46 +00:00
|
|
|
|
|
|
|
/** If the image is not yet loaded (WaitingToLoad), then this method
|
|
|
|
* triggers that.
|
|
|
|
*/
|
2003-02-26 11:41:23 +00:00
|
|
|
Image const * image() const;
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// Use the Pimpl idiom to hide the internals.
|
|
|
|
class Impl;
|
|
|
|
/// The pointer never changes although *pimpl_'s contents may.
|
2007-11-21 23:47:47 +00:00
|
|
|
Impl * const pimpl_;
|
2002-07-05 21:24:15 +00:00
|
|
|
};
|
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
} // namespace graphics
|
|
|
|
} // namespace lyx
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
#endif // PREVIEWIMAGE_H
|