]> git.lyx.org Git - lyx.git/blob - src/graphics/Previews.h
de.po: fix doubled accelerator keys
[lyx.git] / src / graphics / Previews.h
1 // -*- C++ -*-
2 /**
3  * \file Previews.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  * graphics::Previews is a singleton class that stores the
12  * graphics::PreviewLoader for each buffer requiring one.
13  */
14
15 #ifndef PREVIEWS_H
16 #define PREVIEWS_H
17
18 namespace lyx {
19
20 class Buffer;
21 class LyXRC_PreviewStatus;
22
23 namespace graphics {
24
25 class PreviewLoader;
26
27 class Previews {
28 public:
29         /// This should be a singleton class only instanciated in LyX.cpp.
30         Previews() {}
31
32         /// a wrapper for lyxrc.preview
33         static LyXRC_PreviewStatus status();
34
35         /** Returns the PreviewLoader for this buffer.
36          *  Used by individual insets to update their own preview.
37          */
38         PreviewLoader & loader(Buffer const & buffer) const;
39
40         /// Called from the Buffer d-tor.
41         void removeLoader(Buffer const & buffer) const;
42
43         /** For a particular buffer, initiate the generation of previews
44          *  for each and every snippet of LaTeX that's of interest with
45          *  a single forked process.
46          */
47         void generateBufferPreviews(Buffer const & buffer) const;
48
49 private:
50         /// noncopyable
51         Previews(Previews const &);
52         void operator=(Previews const &);
53 };
54
55 } // namespace graphics
56
57 /// This is a singleton class. Get the instance.
58 /// Implemented in LyX.cpp.
59 graphics::Previews & thePreviews();
60
61 } // namespace lyx
62
63 #endif // PREVIEWS_H