mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
647ac4a221
- move Previews singleton to LyX - LyX.cpp: set singleton to zero at destruction. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25594 a592a061-630c-0410-9148-cb99ea01b6c8
67 lines
1.5 KiB
C++
67 lines
1.5 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file Previews.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Angus Leeming
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*
|
|
* graphics::Previews is a singleton class that stores the
|
|
* graphics::PreviewLoader for each buffer requiring one.
|
|
*/
|
|
|
|
#ifndef PREVIEWS_H
|
|
#define PREVIEWS_H
|
|
|
|
namespace lyx {
|
|
|
|
class Buffer;
|
|
class LyXRC_PreviewStatus;
|
|
|
|
namespace graphics {
|
|
|
|
class PreviewLoader;
|
|
|
|
class Previews {
|
|
public:
|
|
/// a wrapper for lyxrc.preview
|
|
static LyXRC_PreviewStatus status();
|
|
|
|
/** Returns the PreviewLoader for this buffer.
|
|
* Used by individual insets to update their own preview.
|
|
*/
|
|
PreviewLoader & loader(Buffer const & buffer) const;
|
|
|
|
/// Called from the Buffer d-tor.
|
|
void removeLoader(Buffer const & buffer) const;
|
|
|
|
/** For a particular buffer, initiate the generation of previews
|
|
* for each and every snippet of LaTeX that's of interest with
|
|
* a single forked process.
|
|
*/
|
|
void generateBufferPreviews(Buffer const & buffer) const;
|
|
|
|
private:
|
|
friend class LyX;
|
|
/// noncopyable
|
|
Previews(Previews const &);
|
|
void operator=(Previews const &);
|
|
|
|
/** Make the c-tor, d-tor private so we can control how many objects
|
|
* are instantiated.
|
|
*/
|
|
Previews();
|
|
};
|
|
|
|
} // namespace graphics
|
|
|
|
/// This is a singleton class. Get the instance.
|
|
/// Implemented in LyX.cpp.
|
|
graphics::Previews * thePreviews();
|
|
|
|
} // namespace lyx
|
|
|
|
#endif // PREVIEWS_H
|