4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
11 * lyx::graphics::Previews is a singleton class that stores the
12 * lyx::graphics::PreviewLoader for each buffer requiring one.
18 #include <boost/noncopyable.hpp>
19 #include <boost/scoped_ptr.hpp>
24 class LyXRC_PreviewStatus
;
30 class Previews
: boost::noncopyable
{
32 /// a wrapper for lyxrc.preview
33 static LyXRC_PreviewStatus
status();
35 /// This is a singleton class. Get the instance.
36 static Previews
& get();
38 /** Returns the PreviewLoader for this buffer.
39 * Used by individual insets to update their own preview.
41 PreviewLoader
& loader(Buffer
const & buffer
) const;
43 /// Called from the Buffer d-tor.
44 void removeLoader(Buffer
const & buffer
) const;
46 /** For a particular buffer, initiate the generation of previews
47 * for each and every snippet of LaTeX that's of interest with
48 * a single forked process.
50 void generateBufferPreviews(Buffer
const & buffer
) const;
53 /** Make the c-tor, d-tor private so we can control how many objects
59 /// Use the Pimpl idiom to hide the internals.
61 /// The pointer never changes although *pimpl_'s contents may.
62 boost::scoped_ptr
<Impl
> const pimpl_
;
65 } // namespace graphics