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/utility.hpp>
19 #include <boost/scoped_ptr.hpp>
28 class Previews : boost::noncopyable {
30 /// a wrapper for lyxrc.preview
31 static bool activated();
33 /// This is a singleton class. Get the instance.
34 static Previews & get();
36 /** Returns the PreviewLoader for this buffer.
37 * Used by individual insets to update their own preview.
39 PreviewLoader & loader(Buffer const & buffer) const;
41 /// Called from the Buffer d-tor.
42 void removeLoader(Buffer const & buffer) const;
44 /** For a particular buffer, initiate the generation of previews
45 * for each and every snippet of LaTeX that's of interest with
46 * a single forked process.
48 void generateBufferPreviews(Buffer const & buffer) const;
51 /** Make the c-tor, d-tor private so we can control how many objects
57 /// Use the Pimpl idiom to hide the internals.
59 /// The pointer never changes although *pimpl_'s contents may.
60 boost::scoped_ptr<Impl> const pimpl_;
63 } // namespace graphics