]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetPreview.h
As observed on users list it's hard to guess where to setup external editor.
[lyx.git] / src / insets / InsetPreview.h
index b398c89b8f1a52c4b8dbb1d11ed45b34c1987075..f0808d7246733fdc54352eb7b25ce6f51d3af46e 100644 (file)
@@ -16,7 +16,8 @@
 
 #include "Dimension.h"
 
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
+
 
 namespace lyx {
 
@@ -28,7 +29,7 @@ namespace graphics {
 
 /// An inset with an instant preview
 class InsetPreview : public InsetText {
-       
+
 public:
        ///
        InsetPreview(Buffer *);
@@ -36,21 +37,25 @@ public:
        ~InsetPreview();
        ///
        InsetPreview(InsetPreview const & other);
+       ///
+       InsetPreview & operator=(InsetPreview const & other);
 
        /// \name Methods inherited from Inset class
        //@{
        Inset * clone() const { return new InsetPreview(*this); }
 
        bool neverIndent() const { return true; }
-       
+
+       bool inheritFont() const { return false; }
+
        InsetCode lyxCode() const { return PREVIEW_CODE; }
-       
-       docstring name() const { return from_ascii("Preview"); }
-       
+
+       docstring layoutName() const { return from_ascii("Preview"); }
+
        bool descendable(BufferView const & /*bv*/) const { return true; }
 
-       docstring contextMenu(BufferView const &, int, int) const
-               { return from_ascii("context-preview"); }
+       std::string contextMenuName() const
+               { return "context-preview"; }
 
        void metrics(MetricsInfo & mi, Dimension & dim) const;
 
@@ -66,8 +71,10 @@ public:
        void write(std::ostream & os) const;
 
        void edit(Cursor & cur, bool front, EntryDirection entry_from);
+
+       bool canPaintChange(BufferView const &) const { return true; };
        //@}
-       
+
 protected:
        /// Retrieves the preview state. Returns true if preview
        /// is enabled and the preview image is availabled.
@@ -78,13 +85,8 @@ protected:
        void preparePreview(DocIterator const & pos) const;
 
        ///
-       boost::scoped_ptr<RenderPreview> preview_;
-       ///
-       mutable bool use_preview_;
+       unique_ptr<RenderPreview> preview_;
 
-private:
-       ///
-       mutable Dimension dim_;
 };