]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.h
static_cast-based key/mouse-state. Kill insetKeyPress.
[lyx.git] / src / insets / insettext.h
index 38c15266d8ce5b4f9c091842955e464ed43eaa10..de1e96c9fb73d047c3bee15fa64104c6514799e5 100644 (file)
@@ -1,7 +1,7 @@
 // -*- C++ -*-
 /* This file is part of
  * ======================================================
- * 
+ *
  *           LyX, The Document Processor
  *
  *           Copyright 1998 The LyX Team.
@@ -25,7 +25,7 @@
 #include "paragraph.h"
 #include "lyxcursor.h"
 
-#include <boost/smart_ptr.hpp>
+#include <boost/shared_ptr.hpp>
 
 class Painter;
 class BufferView;
@@ -38,7 +38,7 @@ class Row;
 
 /**
  A text inset is like a TeX box to write full text
- (including styles and other insets) in a given space. 
+ (including styles and other insets) in a given space.
  @author: Jürgen Vigna
  */
 class InsetText : public UpdatableInset {
@@ -107,7 +107,7 @@ public:
        ///
        string const editMessage() const;
        ///
-       void edit(BufferView *, int, int, unsigned int);
+       void edit(BufferView *, int, int, mouse_button::state);
        ///
        void edit(BufferView *, bool front = true);
        ///
@@ -124,13 +124,11 @@ public:
        ///
        bool updateInsetInInset(BufferView *, Inset *);
        ///
-       bool insetButtonRelease(BufferView *, int, int, int);
-       ///
-       void insetButtonPress(BufferView *, int, int, int);
+       bool insetButtonRelease(BufferView *, int, int, mouse_button::state);
        ///
-       void insetMotionNotify(BufferView *, int, int, int);
+       void insetButtonPress(BufferView *, int, int, mouse_button::state);
        ///
-       void insetKeyPress(XKeyEvent *);
+       void insetMotionNotify(BufferView *, int, int, mouse_button::state);
        ///
        UpdatableInset::RESULT localDispatch(BufferView *,
                                             kb_action, string const &);
@@ -150,7 +148,7 @@ public:
        ///
        void getCursorPos(BufferView *, int & x, int & y) const;
        ///
-       unsigned int insetInInsetY();
+       int insetInInsetY() const;
        ///
        void toggleInsetCursor(BufferView *);
        ///
@@ -170,7 +168,7 @@ public:
        ///
        void setFont(BufferView *, LyXFont const &,
                     bool toggleall = false,
-                    bool selectall = false);
+                    bool selectall = false);
        ///
        int getMaxWidth(BufferView *, UpdatableInset const *) const;
        ///
@@ -180,7 +178,7 @@ public:
        ///
        void setParagraphData(Paragraph *, bool same_id = false);
        ///
-       void setText(string const &);
+       void setText(string const &, LyXFont const &);
        ///
        void setAutoBreakRows(bool);
        ///
@@ -240,10 +238,10 @@ public:
        void toggleSelection(BufferView *, bool kill_selection);
        ///
        bool searchForward(BufferView *, string const &,
-                          bool = true, bool = false);
+                          bool = true, bool = false);
        ///
        bool searchBackward(BufferView *, string const &,
-                           bool = true, bool = false);
+                           bool = true, bool = false);
        ///
        bool checkInsertChar(LyXFont &);
        ///
@@ -259,7 +257,9 @@ public:
 protected:
        ///
        void updateLocal(BufferView *, int what, bool mark_dirty) const;
-       ///
+       /// set parameters for an initial lock of this inset
+       void lockInset(BufferView *);
+       /// lock an inset inside this one
        void lockInset(BufferView *, UpdatableInset *);
        ///
        mutable int drawTextXOffset;
@@ -297,11 +297,11 @@ private:
                                        bool activate_inset = true,
                                        bool selecting = false);
        ///
-       UpdatableInset::RESULT moveRightIntern(BufferView *, bool behind,
+       UpdatableInset::RESULT moveRightIntern(BufferView *, bool front,
                                               bool activate_inset = true,
                                               bool selecting = false);
        ///
-       UpdatableInset::RESULT moveLeftIntern(BufferView *, bool behind, 
+       UpdatableInset::RESULT moveLeftIntern(BufferView *, bool front,
                                              bool activate_inset = true,
                                              bool selecting = false);
 
@@ -312,17 +312,21 @@ private:
        ///
        void setCharFont(Buffer const *, int pos, LyXFont const & font);
        ///
-       bool checkAndActivateInset(BufferView * bv, bool behind);
+       bool checkAndActivateInset(BufferView * bv, bool front);
        ///
        bool checkAndActivateInset(BufferView * bv, int x = 0, int y = 0,
-                                  int button = 0);
+                                  mouse_button::state button = mouse_button::none);
        ///
        void removeNewlines();
        ///
        int cx(BufferView *) const;
        ///
+       int cix(BufferView *) const;
+       ///
        int cy(BufferView *) const;
        ///
+       int ciy(BufferView *) const;
+       ///
        lyx::pos_type cpos(BufferView *) const;
        ///
        Paragraph * cpar(BufferView *) const;
@@ -343,8 +347,8 @@ private:
        ///
        void reinitLyXText() const;
        ///
-       void collapseParagraphs(BufferParams const & bparams) const;
-       
+       void collapseParagraphs(BufferView *) const;
+
        /* Private structures and variables */
        ///
        Paragraph * par;
@@ -405,7 +409,7 @@ private:
        };
        ///
        mutable save_state sstate;
-       
+
        ///
        // this is needed globally so we know that we're using it actually and
        // so the LyXText-Cache is not erased until used!