]> git.lyx.org Git - lyx.git/blob - src/InsetList.h
Changed a '1.4.4' to '1.4.5'
[lyx.git] / src / InsetList.h
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.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_LIST_H
13 #define INSET_LIST_H
14
15 #include "support/types.h"
16
17 #include <vector>
18
19
20 namespace lyx {
21
22 class Inset;
23 class Buffer;
24
25
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;
38         };
39         ///
40         typedef std::vector<InsetTable> List;
41         ///
42         typedef List::iterator iterator;
43         ///
44         typedef List::const_iterator const_iterator;
45
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);
74
75 private:
76         ///
77         List list_;
78 };
79
80
81 } // namespace lyx
82
83 #endif