LyX 1.5.0 is released
[lyx.git] / src / InsetList.h
blob13beeb0b9cc6218c94561d90257c7a980149ffc9
1 // -*- C++ -*-
2 /**
3 * \file InsetList.h
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.
12 #ifndef INSET_LIST_H
13 #define INSET_LIST_H
15 #include "support/types.h"
17 #include <vector>
20 namespace lyx {
22 class Inset;
23 class Buffer;
26 ///
27 class InsetList {
28 public:
29 ///
30 class InsetTable {
31 public:
32 ///
33 InsetTable(pos_type p, Inset * i) : pos(p), inset(i) {}
34 ///
35 pos_type pos;
36 ///
37 Inset * inset;
39 ///
40 typedef std::vector<InsetTable> List;
41 ///
42 typedef List::iterator iterator;
43 ///
44 typedef List::const_iterator const_iterator;
46 ///
47 ~InsetList();
48 ///
49 iterator begin() { return list_.begin(); }
50 ///
51 iterator end() { return list_.end(); }
52 ///
53 const_iterator begin() const { return list_.begin(); }
54 ///
55 const_iterator end() const { return list_.end(); }
56 ///
57 bool empty() const { return list_.empty(); }
58 ///
59 iterator insetIterator(pos_type pos);
60 ///
61 const_iterator insetIterator(pos_type pos) const;
62 ///
63 void insert(Inset * inset, pos_type pos);
64 ///
65 void erase(pos_type pos);
66 ///
67 Inset * release(pos_type);
68 ///
69 Inset * get(pos_type pos) const;
70 ///
71 void increasePosAfterPos(pos_type pos);
72 ///
73 void decreasePosAfterPos(pos_type pos);
75 private:
76 ///
77 List list_;
81 } // namespace lyx
83 #endif