2003-02-20 17:39:48 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
2003-02-20 17:50:06 +00:00
|
|
|
|
* \file updatableinset.h
|
2003-02-20 17:39:48 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Matthias Ettrich
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-02-20 17:39:48 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef UPDATABLEINSET_H
|
|
|
|
|
#define UPDATABLEINSET_H
|
|
|
|
|
|
2003-11-10 09:06:48 +00:00
|
|
|
|
// Updatable Insets. These insets can receive directly user interaction.
|
2003-02-20 17:39:48 +00:00
|
|
|
|
// Note that all pure methods from Inset class are pure here too.
|
|
|
|
|
// [Alejandro 080596]
|
|
|
|
|
|
|
|
|
|
#include "inset.h"
|
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
class UpdatableInset : public InsetOld {
|
2003-02-20 17:39:48 +00:00
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
virtual EDITABLE editable() const;
|
2004-01-15 17:34:44 +00:00
|
|
|
|
/// identification as text inset in a cursor slice
|
2004-01-15 11:58:35 +00:00
|
|
|
|
UpdatableInset * asUpdatableInset() { return this; }
|
2003-02-20 17:39:48 +00:00
|
|
|
|
|
2003-11-13 08:50:26 +00:00
|
|
|
|
/// return the cursor pos, relative to the inset pos
|
2004-01-08 18:30:14 +00:00
|
|
|
|
virtual void getCursorPos(int, int &, int &) const {}
|
2003-11-13 08:50:26 +00:00
|
|
|
|
/// return the cursor dim
|
2003-11-21 14:59:24 +00:00
|
|
|
|
virtual void getCursorDim(int &, int &) const;
|
2003-07-31 10:48:50 +00:00
|
|
|
|
// We need this method to not clobber the real method in Inset
|
|
|
|
|
int scroll(bool recursive = true) const
|
|
|
|
|
{ return InsetOld::scroll(recursive); }
|
2003-02-20 17:39:48 +00:00
|
|
|
|
///
|
|
|
|
|
virtual bool showInsetDialog(BufferView *) const { return false; }
|
|
|
|
|
|
|
|
|
|
protected:
|
2003-10-17 18:01:15 +00:00
|
|
|
|
/// An updatable inset could handle lyx editing commands
|
|
|
|
|
virtual
|
2003-10-29 10:47:21 +00:00
|
|
|
|
DispatchResult
|
2004-01-20 14:25:24 +00:00
|
|
|
|
priv_dispatch(LCursor & cur, FuncRequest const & cmd);
|
2003-02-20 17:39:48 +00:00
|
|
|
|
/// scrolls to absolute position in bufferview-workwidth * sx units
|
2004-01-15 17:34:44 +00:00
|
|
|
|
void scroll(BufferView &, float sx) const;
|
2003-02-20 17:39:48 +00:00
|
|
|
|
/// scrolls offset pixels
|
2004-01-15 17:34:44 +00:00
|
|
|
|
void scroll(BufferView &, int offset) const;
|
2003-02-20 17:39:48 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|