]> git.lyx.org Git - lyx.git/blobdiff - src/insets/updatableinset.h
Enable the external inset to handle unknown templates gracefully.
[lyx.git] / src / insets / updatableinset.h
index 192ced8ed83b69f7c27d9e95caa629a8ce83cb4a..77046dc1df0568f1a5024c7296555d6f5441de31 100644 (file)
@@ -49,7 +49,7 @@ public:
        ///
        UpdatableInset();
        ///
-       UpdatableInset(UpdatableInset const & in, bool same_id = false);
+       UpdatableInset(UpdatableInset const & in);
 
        /// check if the font of the char we want inserting is correct
        /// and modify it if it is not.
@@ -57,25 +57,16 @@ public:
        ///
        virtual EDITABLE editable() const;
 
-       ///
-       virtual void toggleInsetCursor(BufferView *);
-       ///
-       virtual void showInsetCursor(BufferView *, bool show = true);
-       ///
-       virtual void hideInsetCursor(BufferView *);
        ///
        virtual void fitInsetCursor(BufferView *) const;
-       ///
+       /// FIXME
        virtual void getCursorPos(BufferView *, int &, int &) const {}
+       /// Get the absolute document x,y of the cursor
+       virtual void getCursor(BufferView &, int &, int &) const = 0;
        ///
        virtual void insetUnlock(BufferView *);
        ///
-       virtual void edit(BufferView *, int x, int y, mouse_button::state button);
-       ///
-       virtual void edit(BufferView *, bool front = true);
-       ///
-       virtual void draw(BufferView *, LyXFont const &,
-                         int baseline, float & x, bool cleared) const;
+       virtual void draw(PainterInfo & pi, int x, int y) const;
        ///
        virtual bool insertInset(BufferView *, Inset *) { return false; }
        ///
@@ -100,8 +91,6 @@ public:
        ///  An updatable inset could handle lyx editing commands
        virtual RESULT localDispatch(FuncRequest const & cmd);
        ///
-       bool isCursorVisible() const { return cursor_visible_; }
-       ///
        virtual int getMaxWidth(BufferView * bv, UpdatableInset const *) const;
        ///
        int scroll(bool recursive = true) const {
@@ -132,7 +121,7 @@ public:
 
        /// find the next change in the inset
        virtual bool nextChange(BufferView * bv, lyx::pos_type & length);
+
        ///
        // needed for search/replace functionality
        ///
@@ -143,22 +132,12 @@ public:
                                    bool = true, bool = false);
 
 protected:
-       ///
-       void toggleCursorVisible() const {
-               cursor_visible_ = !cursor_visible_;
-       }
-       ///
-       void setCursorVisible(bool b) const {
-               cursor_visible_ = b;
-       }
        /// scrolls to absolute position in bufferview-workwidth * sx units
        void scroll(BufferView *, float sx) const;
        /// scrolls offset pixels
        void scroll(BufferView *, int offset) const;
 
 private:
-       ///
-       mutable bool cursor_visible_;
        ///
        mutable bool block_drawing_;
 };