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>
|
|
|
|
|
|
2004-01-26 10:13:15 +00:00
|
|
|
|
class InsetBase;
|
2003-11-21 17:26:11 +00:00
|
|
|
|
class Buffer;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
class InsetList {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
struct InsetTable {
|
|
|
|
|
///
|
|
|
|
|
lyx::pos_type pos;
|
|
|
|
|
///
|
2004-01-26 10:13:15 +00:00
|
|
|
|
InsetBase * inset;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2004-01-26 10:13:15 +00:00
|
|
|
|
InsetTable(lyx::pos_type p, InsetBase * 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();
|
|
|
|
|
///
|
2004-07-25 00:04:42 +00:00
|
|
|
|
iterator begin() { return list_.begin(); }
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2004-07-25 00:04:42 +00:00
|
|
|
|
iterator end() { return list_.end(); }
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2004-07-25 00:04:42 +00:00
|
|
|
|
const_iterator begin() const { return list_.begin(); }
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2004-07-25 00:04:42 +00:00
|
|
|
|
const_iterator end() const { return list_.end(); }
|
2003-11-25 11:17:27 +00:00
|
|
|
|
///
|
2004-07-25 00:04:42 +00:00
|
|
|
|
bool empty() const { return list_.empty(); }
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2004-04-03 08:37:12 +00:00
|
|
|
|
iterator insetIterator(lyx::pos_type pos);
|
2003-11-13 13:43:44 +00:00
|
|
|
|
///
|
|
|
|
|
const_iterator insetIterator(lyx::pos_type pos) const;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2004-01-26 10:13:15 +00:00
|
|
|
|
void insert(InsetBase * inset, lyx::pos_type pos);
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
|
|
|
|
void erase(lyx::pos_type pos);
|
|
|
|
|
///
|
2004-01-26 10:13:15 +00:00
|
|
|
|
InsetBase * release(lyx::pos_type);
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
2004-01-26 10:13:15 +00:00
|
|
|
|
InsetBase * 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-08-17 11:28:23 +00:00
|
|
|
|
|
2002-08-11 15:03:52 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
2004-07-25 00:04:42 +00:00
|
|
|
|
List list_;
|
2002-08-11 15:03:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|