2002-07-05 21:24:15 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2003-07-21 21:30:57 +00:00
|
|
|
* \file Previews.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-07-05 21:24:15 +00:00
|
|
|
*
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author Angus Leeming
|
2002-09-05 11:31:30 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-07-05 21:24:15 +00:00
|
|
|
*
|
2007-11-21 23:31:12 +00:00
|
|
|
* graphics::Previews is a singleton class that stores the
|
|
|
|
* graphics::PreviewLoader for each buffer requiring one.
|
2002-07-05 21:24:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PREVIEWS_H
|
|
|
|
#define PREVIEWS_H
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2002-07-05 21:24:15 +00:00
|
|
|
class Buffer;
|
2004-04-19 13:31:17 +00:00
|
|
|
class LyXRC_PreviewStatus;
|
2002-07-05 21:24:15 +00:00
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
namespace graphics {
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
class PreviewLoader;
|
|
|
|
|
2007-11-21 23:31:12 +00:00
|
|
|
class Previews {
|
2002-07-05 21:24:15 +00:00
|
|
|
public:
|
2008-07-14 11:40:29 +00:00
|
|
|
/// This should be a singleton class only instanciated in LyX.cpp.
|
|
|
|
Previews() {}
|
|
|
|
|
2002-07-05 21:24:15 +00:00
|
|
|
/// a wrapper for lyxrc.preview
|
2004-04-19 13:31:17 +00:00
|
|
|
static LyXRC_PreviewStatus status();
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
/** Returns the PreviewLoader for this buffer.
|
|
|
|
* Used by individual insets to update their own preview.
|
|
|
|
*/
|
2003-08-28 07:41:31 +00:00
|
|
|
PreviewLoader & loader(Buffer const & buffer) const;
|
2002-07-05 21:24:15 +00:00
|
|
|
|
2003-09-04 00:29:22 +00:00
|
|
|
/// Called from the Buffer d-tor.
|
2003-08-28 07:41:31 +00:00
|
|
|
void removeLoader(Buffer const & buffer) const;
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
/** For a particular buffer, initiate the generation of previews
|
2003-09-04 00:29:22 +00:00
|
|
|
* for each and every snippet of LaTeX that's of interest with
|
2002-07-05 21:24:15 +00:00
|
|
|
* a single forked process.
|
|
|
|
*/
|
2002-07-17 16:56:42 +00:00
|
|
|
void generateBufferPreviews(Buffer const & buffer) const;
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
private:
|
2007-11-21 23:31:12 +00:00
|
|
|
/// noncopyable
|
|
|
|
Previews(Previews const &);
|
|
|
|
void operator=(Previews const &);
|
2002-07-05 21:24:15 +00:00
|
|
|
};
|
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
} // namespace graphics
|
2008-07-14 07:16:00 +00:00
|
|
|
|
|
|
|
/// This is a singleton class. Get the instance.
|
|
|
|
/// Implemented in LyX.cpp.
|
2008-07-14 08:35:00 +00:00
|
|
|
graphics::Previews & thePreviews();
|
2008-07-14 07:16:00 +00:00
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
} // namespace lyx
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
#endif // PREVIEWS_H
|