]> git.lyx.org Git - features.git/blobdiff - src/mathed/math_cursor.h
Replace LString.h with support/std_string.h,
[features.git] / src / mathed / math_cursor.h
index 338391bfeee9bc6b9c9052a3e82b8799571378dd..4df0b822d8eec69a7a87ab539c53ad663990070e 100644 (file)
@@ -1,33 +1,26 @@
 // -*- C++ -*-
 /**
- *  File:        math_cursor.h
- *  Purpose:     Declaration of interaction classes for mathed
- *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
- *  Created:     January 1996
- *  Description: MathCursor control all user interaction
+ * \file math_cursor.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *  Dependencies: Xlib, XForms
+ * \author Alejandro Aguilar Sierra
+ * \author André Pönitz
  *
- *  Copyright: 1996, Alejandro Aguilar Sierra
- *
- *   You are free to use and modify this code under the terms of
- *   the GNU General Public Licence version 2 or later.
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef MATH_CURSOR
 #define MATH_CURSOR
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
 #include "math_inset.h"
 #include "math_iterator.h"
-#include "LString.h"
+#include "support/std_string.h"
 
 class InsetFormulaBase;
 class BufferView;
-class MathPainterInfo;
+class PainterInfo;
 class MathUnknownInset;
 
 /**
@@ -35,7 +28,7 @@ class MathUnknownInset;
 [Have a look at math_inset.h first]
 
 The MathCursor is different from the kind of cursor used in the Outer
-World. It contains a stack of MathCursorPos, each of which is made
+World. It contains a stack of CursorPos, each of which is made
 up of a inset pointer, an index and a position offset, marking a path from
 this formula's MathHullInset to the current position.
 
@@ -66,11 +59,13 @@ public:
        ///
        void insert(MathArray const &);
        ///
-       void paste(string const & data);
-       ///
-       void erase();
+       void insert2(string const &);
        ///
-       void backspace();
+       void paste(string const & data);
+       /// return false for empty math insets
+       bool erase();
+       /// return false for empty math insets
+       bool backspace();
        /// called for LFUN_HOME etc
        bool home(bool sel = false);
        /// called for LFUN_END etc
@@ -107,7 +102,7 @@ public:
        /// in pixels from left of screen
        int targetX() const;
        /// current inset
-       MathInset * par() const;
+       MathInset * inset() const;
        /// return the next enclosing grid inset and the cursor's index in it
        MathGridInset * enclosingGrid(idx_type & idx) const;
        /// go up to enclosing grid
@@ -152,8 +147,8 @@ public:
        void selCut();
        ///
        void selDel();
-       ///
-       void selPaste();
+       /// pastes n-th element of cut buffer
+       void selPaste(size_t n);
        ///
        void selHandle(bool);
        ///
@@ -163,7 +158,7 @@ public:
        /// clears or deletes selection depending on lyxrc setting
        void selClearOrDel();
        /// draws light-blue selection background
-       void drawSelection(MathPainterInfo & pi) const;
+       void drawSelection(PainterInfo & pi) const;
        ///
        void handleNest(MathAtom const & at);
        /// remove this as soon as LyXFunc::getStatus is "localized"
@@ -209,19 +204,19 @@ public:
        MathAtom & nextAtom();
 
        /// returns the selection
-       void getSelection(MathCursorPos &, MathCursorPos &) const;
+       void getSelection(CursorPos &, CursorPos &) const;
        /// returns the normalized anchor of the selection
-       MathCursorPos normalAnchor() const;
+       CursorPos normalAnchor() const;
 
        /// reference to the last item of the path, i.e. "The Cursor"
-       MathCursorPos & cursor();
+       CursorPos & cursor();
        /// reference to the last item of the path, i.e. "The Cursor"
-       MathCursorPos const & cursor() const;
+       CursorPos const & cursor() const;
        /// how deep are we nested?
        unsigned depth() const;
 
        /// local dispatcher
-       MathInset::result_type dispatch(FuncRequest const & cmd);
+       dispatch_result dispatch(FuncRequest const & cmd);
        /// describe the situation
        string info() const;
        /// dump selection information for debugging