mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 06:20:28 +00:00
16b928088f
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4638 a592a061-630c-0410-9148-cb99ea01b6c8
66 lines
1.2 KiB
C++
66 lines
1.2 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file PreviewImage.h
|
|
* Copyright 2002 the LyX Team
|
|
* Read the file COPYING
|
|
*
|
|
* \author Angus Leeming <leeming@lyx.org>
|
|
*/
|
|
|
|
#ifndef PREVIEWIMAGE_H
|
|
#define PREVIEWIMAGE_H
|
|
|
|
#ifdef __GNUG__
|
|
#pragma interface
|
|
#endif
|
|
|
|
#include "LString.h"
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
class Inset;
|
|
class BufferView;
|
|
|
|
namespace grfx {
|
|
|
|
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;
|
|
|
|
/** If the image is not yet loaded (WaitingToLoad), then this method
|
|
* triggers that.
|
|
* inset and bv are passed so we can choose to load only
|
|
* those insets that are visible.
|
|
*/
|
|
Image const * image(Inset const & inset, BufferView const & bv) const;
|
|
|
|
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_;
|
|
};
|
|
|
|
} // namespace grfx
|
|
|
|
#endif // PREVIEWIMAGE_H
|