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 &);
34 /// Partial copy constructor.
35 /// Copy the InsetList contents from \p beg to \p end (without end).
36 InsetList(InsetList const &, pos_type beg, pos_type end);
38 void setBuffer(Buffer &);
46 InsetTable(pos_type p, Inset * i) : pos(p), inset(i) {}
53 typedef std::vector<InsetTable> List;
55 typedef List::iterator iterator;
57 typedef List::const_iterator const_iterator;
62 iterator begin() { return list_.begin(); }
64 iterator end() { return list_.end(); }
66 const_iterator begin() const { return list_.begin(); }
68 const_iterator end() const { return list_.end(); }
70 bool empty() const { return list_.empty(); }
72 iterator insetIterator(pos_type pos);
74 const_iterator insetIterator(pos_type pos) const;
76 void insert(Inset * inset, pos_type pos);
78 void erase(pos_type pos);
80 Inset * release(pos_type);
82 Inset * get(pos_type pos) const;
84 void increasePosAfterPos(pos_type pos);
86 void decreasePosAfterPos(pos_type pos);
88 /// search for next occurence of an \c Inset type.
89 /// \return the position of the found inset.
90 /// \retval -1 if no \c Inset is found.
92 InsetCode code, ///< Code of inset to find.
93 pos_type startpos = 0 ///< start position for the search.
96 /// count occurences of of an \c Inset type.
97 /// \return the number of found inset(s).
99 InsetCode code, ///< Code of inset type to count.
100 pos_type startpos = 0 ///< start position for the counting.