4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
15 #include "insets/InsetCode.h"
17 #include "support/types.h"
33 InsetList(InsetList const &);
35 void setBuffer(Buffer &);
41 InsetTable(pos_type p, Inset * i) : pos(p), inset(i) {}
48 typedef std::vector<InsetTable> List;
50 typedef List::iterator iterator;
52 typedef List::const_iterator const_iterator;
57 iterator begin() { return list_.begin(); }
59 iterator end() { return list_.end(); }
61 const_iterator begin() const { return list_.begin(); }
63 const_iterator end() const { return list_.end(); }
65 bool empty() const { return list_.empty(); }
67 iterator insetIterator(pos_type pos);
69 const_iterator insetIterator(pos_type pos) const;
71 void insert(Inset * inset, pos_type pos);
73 void erase(pos_type pos);
75 Inset * release(pos_type);
77 Inset * get(pos_type pos) const;
79 void increasePosAfterPos(pos_type pos);
81 void decreasePosAfterPos(pos_type pos);
83 /// search for next occurence of an \c Inset type.
84 /// \return the position of the found inset.
85 /// \retval -1 if no \c Inset is found.
87 InsetCode code, ///< Code of inset to find.
88 pos_type startpos = 0 ///< start position for the search.
91 /// count occurences of of an \c Inset type.
92 /// \return the number of found inset(s).
94 InsetCode code, ///< Code of inset type to count.
95 pos_type startpos = 0 ///< start position for the counting.