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:
|
|
|
|
|
/// check if the font of the char we want inserting is correct
|
|
|
|
|
/// and modify it if it is not.
|
2003-07-31 10:48:50 +00:00
|
|
|
|
virtual bool checkInsertChar(LyXFont &) { return true; }
|
2003-02-20 17:39:48 +00:00
|
|
|
|
///
|
|
|
|
|
virtual EDITABLE editable() const;
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
virtual void fitInsetCursor(BufferView *) const;
|
2003-05-03 18:05:53 +00:00
|
|
|
|
/// FIXME
|
2003-02-20 17:39:48 +00:00
|
|
|
|
virtual void getCursorPos(BufferView *, int &, int &) const {}
|
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
virtual bool insertInset(BufferView *, InsetOld *) { return false; }
|
2003-02-20 17:39:48 +00:00
|
|
|
|
///
|
|
|
|
|
virtual int insetInInsetY() const { return 0; }
|
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; }
|
|
|
|
|
///
|
|
|
|
|
virtual void toggleSelection(BufferView *, bool /*kill_selection*/) {}
|
|
|
|
|
|
|
|
|
|
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
|
2003-10-17 18:01:15 +00:00
|
|
|
|
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
|
2003-02-20 17:39:48 +00:00
|
|
|
|
/// scrolls to absolute position in bufferview-workwidth * sx units
|
|
|
|
|
void scroll(BufferView *, float sx) const;
|
|
|
|
|
/// scrolls offset pixels
|
|
|
|
|
void scroll(BufferView *, int offset) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|