]> git.lyx.org Git - lyx.git/blobdiff - src/insets/updatableinset.h
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / updatableinset.h
index a7ce6032327abe16930f43ac7f78e5f412bbc9fe..16942308152e23ac20a682867977f112d39287c9 100644 (file)
@@ -9,7 +9,7 @@
  * \author Lars Gullik Bjønnes
  * \author Matthias Ettrich
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef UPDATABLEINSET_H
@@ -33,7 +33,7 @@
  *
  * During the lock, all button and keyboard events will be modified
  * and send to the inset through the following inset-features. Note that
- * Inset::insetUnlock will be called from inside UnlockInset. It is meant
+ * InsetOld::insetUnlock will be called from inside UnlockInset. It is meant
  * to contain the code for restoring the menus and things like this.
  *
  * If a inset wishes any redraw and/or update it just has to call
  * Of course the_locking_inset and the insets in the current paragraph/buffer
  *  are checked first, so no performance problem should occur.
  */
-class UpdatableInset : public Inset {
+class UpdatableInset : public InsetOld {
 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.
-       virtual bool checkInsertChar(LyXFont &);
+       virtual bool checkInsertChar(LyXFont &) { return true; }
        ///
        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(PainterInfo & pi, int x, int y) const;
        ///
-       virtual void draw(BufferView *, LyXFont const &,
-                         int baseline, float & x) const;
+       virtual bool insertInset(BufferView *, InsetOld *) { return false; }
        ///
-       virtual bool insertInset(BufferView *, Inset *) { return false; }
+       virtual UpdatableInset * getLockingInset() const
+               { return const_cast<UpdatableInset *>(this); }
        ///
-       virtual UpdatableInset * getLockingInset() const {
-               return const_cast<UpdatableInset *>(this);
-       }
-       ///
-       virtual UpdatableInset * getFirstLockingInsetOfType(Inset::Code c)
+       virtual UpdatableInset * getFirstLockingInsetOfType(InsetOld::Code c)
                { return (c == lyxCode()) ? this : 0; }
        ///
        virtual int insetInInsetY() const { return 0; }
        ///
-       virtual bool updateInsetInInset(BufferView *, Inset *)
-               { return false; }
-       ///
        virtual bool lockInsetInInset(BufferView *, UpdatableInset *)
                { return false; }
        ///
@@ -99,26 +86,12 @@ public:
                { return false; }
        ///  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 {
-               // We need this method to not clobber the real method in Inset
-               return Inset::scroll(recursive);
-       }
+       // We need this method to not clobber the real method in Inset
+       int scroll(bool recursive = true) const
+               { return InsetOld::scroll(recursive); }
        ///
        virtual bool showInsetDialog(BufferView *) const { return false; }
        ///
-       virtual void nodraw(bool b) const {
-               block_drawing_ = b;
-       }
-       ///
-       virtual bool nodraw() const {
-               return block_drawing_;
-       }
-       ///
        // needed for spellchecking text
        ///
        virtual bool allowSpellcheck() const { return false; }
@@ -132,7 +105,7 @@ public:
 
        /// find the next change in the inset
        virtual bool nextChange(BufferView * bv, lyx::pos_type & length);
+
        ///
        // needed for search/replace functionality
        ///
@@ -143,30 +116,10 @@ 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_;
 };
 
-inline
-bool UpdatableInset::checkInsertChar(LyXFont &)
-{
-       return true;
-}
-
 #endif