// -*- 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
#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;
/**
[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.
///
void insert(MathArray const &);
///
+ void insert2(string const &);
+ ///
void paste(string const & data);
/// return false for empty math insets
bool erase();
/// 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
void selCut();
///
void selDel();
- ///
- void selPaste();
+ /// pastes n-th element of cut buffer
+ void selPaste(size_t n);
///
void selHandle(bool);
///
/// 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"
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