2002-08-11 15:03:52 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file InsetList.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
2002-08-11 15:03:52 +00:00
|
|
|
|
|
|
|
|
|
#ifndef INSET_LIST_H
|
|
|
|
|
#define INSET_LIST_H
|
|
|
|
|
|
|
|
|
|
#include "support/types.h"
|
|
|
|
|
|
2003-10-09 10:52:12 +00:00
|
|
|
|
#include <vector>
|
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
class InsetOld;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
class BufferView;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
class InsetList {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
struct InsetTable {
|
|
|
|
|
///
|
|
|
|
|
lyx::pos_type pos;
|
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld * inset;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetTable(lyx::pos_type p, InsetOld * i) : pos(p), inset(i) {}
|
2002-08-11 15:03:52 +00:00
|
|
|
|
};
|
|
|
|
|
///
|
|
|
|
|
typedef std::vector<InsetTable> List;
|
|
|
|
|
///
|
2003-05-29 01:13:18 +00:00
|
|
|
|
typedef List::iterator iterator;
|
|
|
|
|
///
|
|
|
|
|
typedef List::const_iterator const_iterator;
|
2003-07-25 21:20:24 +00:00
|
|
|
|
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
|
|
|
|
~InsetList();
|
|
|
|
|
///
|
|
|
|
|
iterator begin();
|
|
|
|
|
///
|
|
|
|
|
iterator end();
|
|
|
|
|
///
|
2003-05-29 01:13:18 +00:00
|
|
|
|
const_iterator begin() const;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2003-05-29 01:13:18 +00:00
|
|
|
|
const_iterator end() const;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2003-11-13 13:43:44 +00:00
|
|
|
|
iterator insetIterator(lyx::pos_type pos);
|
|
|
|
|
///
|
|
|
|
|
const_iterator insetIterator(lyx::pos_type pos) const;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
void insert(InsetOld * inset, lyx::pos_type pos);
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
|
|
|
|
void erase(lyx::pos_type pos);
|
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld * release(lyx::pos_type);
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld * get(lyx::pos_type pos) const;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
|
|
|
|
void increasePosAfterPos(lyx::pos_type pos);
|
|
|
|
|
///
|
|
|
|
|
void decreasePosAfterPos(lyx::pos_type pos);
|
|
|
|
|
///
|
2003-11-13 13:43:44 +00:00
|
|
|
|
void insetsOpenCloseBranch(BufferView * bv);
|
2003-08-17 11:28:23 +00:00
|
|
|
|
|
2002-08-11 15:03:52 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
|
|
|
|
List list;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|