]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcollapsable.h
The markDirty() and fitCursor() changes
[lyx.git] / src / insets / insetcollapsable.h
index 9f1abf4ec2327385e9235500d875ca306d36efa1..7243844297e2464b09bf906b0e751962c19b2b96 100644 (file)
@@ -1,27 +1,27 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file insetcollapsable.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Alejandro Aguilar Sierra
+ * \author Jürgen Vigna
+ * \author Lars Gullik Bjønnes
  *
- *           Copyright 2000-2001 The LyX Team.
- *
- *======================================================
+ * Full author contact details are available in file CREDITS
  */
 
-
 #ifndef INSETCOLLAPSABLE_H
 #define INSETCOLLAPSABLE_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
 #include "inset.h"
 #include "insettext.h"
 #include "lyxfont.h"
 #include "LColor.h"
 
+#include <boost/weak_ptr.hpp>
+
 class Painter;
 class LyXText;
 class Paragraph;
@@ -56,7 +56,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, const LyXFont &, int , float &, bool) const;
+       void draw(BufferView *, const LyXFont &, int , float &) const;
        ///
        void update(BufferView *, LyXFont const &, bool =false);
        ///
@@ -74,8 +74,6 @@ public:
        ///
        bool isTextInset() const { return true; }
        ///
-       bool doClearArea() const;
-       ///
        void insetUnlock(BufferView *);
        ///
        bool needFullRow() const { return isOpen(); }
@@ -89,13 +87,7 @@ public:
        ///
        int insetInInsetY() const;
        ///
-       bool insetButtonRelease(BufferView *, int, int, mouse_button::state);
-       ///
-       void insetButtonPress(BufferView *, int, int, mouse_button::state);
-       ///
-       void insetMotionNotify(BufferView *, int, int, mouse_button::state);
-       ///
-       UpdatableInset::RESULT localDispatch(BufferView *, FuncRequest const &);
+       RESULT localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const *, std::ostream &,
                  bool fragile, bool free_spc) const;
@@ -158,8 +150,6 @@ public:
                UpdatableInset::scroll(bv, offset);
        }
        ///
-       Paragraph * getParFromID(int id) const;
-       ///
        Inset * getInsetFromID(int id) const;
        ///
        Paragraph * firstParagraph() const;
@@ -174,7 +164,7 @@ public:
        ///
        void close(BufferView *) const;
        ///
-       bool allowSpellcheck() { return inset.allowSpellcheck(); }
+       bool allowSpellcheck() const { return inset.allowSpellcheck(); }
        ///
        WordLangTuple const
        selectNextWordToSpellcheck(BufferView *, float &) const;
@@ -186,6 +176,11 @@ public:
        void toggleSelection(BufferView * bv, bool kill_selection) {
                inset.toggleSelection(bv, kill_selection);
        }
+       void markErased();
+       bool nextChange(BufferView * bv, lyx::pos_type & length);
+
        ///
        bool searchForward(BufferView * bv, string const & str,
                           bool = true, bool = false);
@@ -196,6 +191,11 @@ public:
        void addPreview(grfx::PreviewLoader &) const;
 
 protected:
+       ///
+       virtual void cache(BufferView *) const;
+       ///
+       virtual BufferView * view() const;
+
        ///
        int ascent_collapsed() const;
        ///
@@ -229,6 +229,13 @@ protected:
        mutable UpdateCodes need_update;
 
 private:
+       ///
+       void lfunMousePress(FuncRequest const &);
+       ///
+       bool lfunMouseRelease(FuncRequest const &);
+       ///
+       void lfunMouseMotion(FuncRequest const &);
+
        ///
        mutable string label;
 #if 0
@@ -241,6 +248,8 @@ private:
        bool in_update;
        ///
        mutable bool first_after_edit;
+       ///
+       mutable boost::weak_ptr<BufferView> view_;
 };
 
 #endif