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
|
|
|
*
|
2003-07-21 21:30:57 +00:00
|
|
|
* lyx::graphics::Previews is a singleton class that stores the
|
|
|
|
* lyx::graphics::PreviewLoader for each buffer requiring one.
|
2002-07-05 21:24:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PREVIEWS_H
|
|
|
|
#define PREVIEWS_H
|
|
|
|
|
|
|
|
#include <boost/utility.hpp>
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
class Previews : boost::noncopyable {
|
|
|
|
public:
|
|
|
|
/// 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
|
|
|
|
|
|
|
/// This is a singleton class. Get the instance.
|
|
|
|
static Previews & get();
|
|
|
|
|
|
|
|
/** 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:
|
|
|
|
/** Make the c-tor, d-tor private so we can control how many objects
|
|
|
|
* are instantiated.
|
|
|
|
*/
|
|
|
|
Previews();
|
|
|
|
~Previews();
|
|
|
|
|
|
|
|
/// Use the Pimpl idiom to hide the internals.
|
|
|
|
class Impl;
|
|
|
|
/// The pointer never changes although *pimpl_'s contents may.
|
|
|
|
boost::scoped_ptr<Impl> const pimpl_;
|
|
|
|
};
|
|
|
|
|
2003-07-04 08:23:23 +00:00
|
|
|
} // namespace graphics
|
|
|
|
} // namespace lyx
|
2002-07-05 21:24:15 +00:00
|
|
|
|
|
|
|
#endif // PREVIEWS_H
|