2002-07-05 21:24:15 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \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
|
|
|
*
|
2002-09-05 14:10:50 +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
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
class InsetOld;
|
2002-07-15 11:08:46 +00:00
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
namespace lyx {
|
|
|
|
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,
|
|
|
|
string const & latex_snippet,
|
|
|
|
string const & bitmap_file,
|
|
|
|
double ascent_frac);
|
|
|
|
///
|
|
|
|
~PreviewImage();
|
|
|
|
|
|
|
|
///
|
|
|
|
string const & snippet() const;
|
|
|
|
///
|
|
|
|
int ascent() const;
|
|
|
|
///
|
|
|
|
int descent() const;
|
|
|
|
///
|
|
|
|
int width() 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.
|
|
|
|
boost::scoped_ptr<Impl> const pimpl_;
|
|
|
|
};
|
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
} // namespace graphics
|
|
|
|
} // namespace lyx
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
#endif // PREVIEWIMAGE_H
|