#ifndef PREVIEWLOADER_H
#define PREVIEWLOADER_H
-#include <boost/signal.hpp>
-#include "support/docstring.h"
-
#include "ColorCode.h"
+#include "support/signals.h"
+
+#include <QObject>
+
+#include <memory>
namespace lyx {
class PreviewImage;
-class PreviewLoader {
+class PreviewLoader : public QObject {
+ Q_OBJECT
public:
/** We need buffer because we require the preamble to the
* LaTeX file.
*/
PreviewLoader(Buffer const & buffer);
- ///
- ~PreviewLoader();
/** Is there an image already associated with this snippet of LaTeX?
* If so, returns a pointer to it, else returns 0.
/// Remove this snippet of LaTeX from the PreviewLoader.
void remove(std::string const & latex_snippet) const;
- /// Record math macro definitions added to the loader
- void addMacroDef(docstring const & latex_snippet) const;
- /// Has a math macro definition already been added to the loader?
- bool hasMacroDef(docstring const & latex_snippet) const;
-
/** We have accumulated several latex snippets with status "InQueue".
* Initiate their transformation into bitmap images.
*/
* has been created and is ready for loading through
* lyx::graphics::PreviewImage::image().
*/
- typedef boost::signal<void(PreviewImage const &)> sig_type;
- typedef sig_type::slot_type slot_type;
+ typedef signal<void(PreviewImage const &)> sig;
+ typedef sig::slot_type slot;
///
- boost::signals::connection connect(slot_type const &) const;
+ connection connect(slot const &) const;
/** When PreviewImage has finished loading the image file into memory,
* it tells the PreviewLoader to tell the outside world
double displayPixelRatio() const ;
+public Q_SLOTS:
+ ///
+ void refreshPreviews();
+
private:
/// noncopyable
PreviewLoader(PreviewLoader const &);
/// Use the Pimpl idiom to hide the internals.
class Impl;
/// The pointer never changes although *pimpl_'s contents may.
- Impl * const pimpl_;
+ std::shared_ptr<Impl> const pimpl_;
};
} // namespace graphics