4 * Read the file COPYING
6 * \author Angus Leeming
8 * Full author contact details available in file CREDITS
10 * grfx::Previews is a singleton class that stores the grfx::PreviewLoader
11 * for each buffer requiring one.
22 #include <boost/utility.hpp>
23 #include <boost/scoped_ptr.hpp>
31 class Previews : boost::noncopyable {
33 /// a wrapper for lyxrc.preview
34 static bool activated();
36 /// This is a singleton class. Get the instance.
37 static Previews & get();
39 /** Returns the PreviewLoader for this buffer.
40 * Used by individual insets to update their own preview.
41 * We assert that (buffer != 0) but do not pass a Buffer &
42 * so that insets do not need to #include buffer.h
44 PreviewLoader & loader(Buffer const * buffer) const;
46 /** Called from the Buffer d-tor.
47 * If (buffer == 0), does nothing.
49 void removeLoader(Buffer const * buffer) const;
51 /** For a particular buffer, initiate the generation of previews
52 * for each and every snippetof LaTeX that's of interest with
53 * a single forked process.
54 * If (buffer == 0), does nothing.
56 void generateBufferPreviews(Buffer const & buffer) const;
59 /** Make the c-tor, d-tor private so we can control how many objects
66 /// Use the Pimpl idiom to hide the internals.
68 /// The pointer never changes although *pimpl_'s contents may.
69 boost::scoped_ptr<Impl> const pimpl_;