]> git.lyx.org Git - lyx.git/blob - src/graphics/PreviewImage.h
remove noload/don't typeset
[lyx.git] / src / graphics / PreviewImage.h
1 // -*- C++ -*-
2 /**
3  *  \file PreviewImage.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming 
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef PREVIEWIMAGE_H
13 #define PREVIEWIMAGE_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "LString.h"
20 #include <boost/scoped_ptr.hpp>
21
22 class Inset;
23 class BufferView;
24
25 namespace grfx {
26
27 class PreviewLoader;
28 class Image;
29
30 class PreviewImage {
31 public:
32         /** ascent = height * ascent_frac
33          *  descent = height * (1 - ascent_frac)
34          */
35         PreviewImage(PreviewLoader & parent,
36                      string const & latex_snippet,
37                      string const & bitmap_file,
38                      double ascent_frac);
39         ///
40         ~PreviewImage();
41
42         ///
43         string const & snippet() const;
44         ///
45         int ascent() const;
46         ///
47         int descent() const;
48         ///
49         int width() const;
50
51         /** If the image is not yet loaded (WaitingToLoad), then this method
52          *  triggers that.
53          *  inset and bv are passed so we can choose to load only
54          *  those insets that are visible.
55          */
56         Image const * image(Inset const & inset, BufferView const & bv) const;
57
58 private:
59         /// Use the Pimpl idiom to hide the internals.
60         class Impl;
61         /// The pointer never changes although *pimpl_'s contents may.
62         boost::scoped_ptr<Impl> const pimpl_;
63 };
64
65 } // namespace grfx
66
67 #endif // PREVIEWIMAGE_H