]> git.lyx.org Git - lyx.git/blob - src/InsetList.h
Fix copy&paste bug.
[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 class InsetList {
27 public:
28         ///
29         class InsetTable {
30         public:
31                 ///
32                 InsetTable(pos_type p, Inset * i) : pos(p), inset(i) {}
33                 ///
34                 pos_type pos;
35                 ///
36                 Inset * inset;
37         };
38         ///
39         typedef std::vector<InsetTable> List;
40         ///
41         typedef List::iterator iterator;
42         ///
43         typedef List::const_iterator const_iterator;
44
45         ///
46         ~InsetList();
47         ///
48         iterator begin() { return list_.begin(); }
49         ///
50         iterator end() { return list_.end(); }
51         ///
52         const_iterator begin() const { return list_.begin(); }
53         ///
54         const_iterator end() const { return list_.end(); }
55         ///
56         bool empty() const { return list_.empty(); }
57         ///
58         iterator insetIterator(pos_type pos);
59         ///
60         const_iterator insetIterator(pos_type pos) const;
61         ///
62         void insert(Inset * inset, pos_type pos);
63         ///
64         void erase(pos_type pos);
65         ///
66         Inset * release(pos_type);
67         ///
68         Inset * get(pos_type pos) const;
69         ///
70         void increasePosAfterPos(pos_type pos);
71         ///
72         void decreasePosAfterPos(pos_type pos);
73
74         /// replicate ourselves.
75         /// Warning: this should be used with care, only
76         /// Paragraph::Pimpl should use it actually.
77         void clone();
78
79 private:
80         ///
81         List list_;
82 };
83
84
85 } // namespace lyx
86
87 #endif