]> git.lyx.org Git - lyx.git/blob - src/InsetList.h
Continue to improve GtkLengthEntry
[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 class InsetBase;
20 class Buffer;
21
22
23 ///
24 class InsetList {
25 public:
26         ///
27         class InsetTable {
28         public:
29                 ///
30                 InsetTable(lyx::pos_type p, InsetBase * i) : pos(p), inset(i) {}
31                 ///
32                 lyx::pos_type pos;
33                 ///
34                 InsetBase * inset;
35         };
36         ///
37         typedef std::vector<InsetTable> List;
38         ///
39         typedef List::iterator iterator;
40         ///
41         typedef List::const_iterator const_iterator;
42
43         ///
44         ~InsetList();
45         ///
46         iterator begin() { return list_.begin(); }
47         ///
48         iterator end() { return list_.end(); }
49         ///
50         const_iterator begin() const { return list_.begin(); }
51         ///
52         const_iterator end() const { return list_.end(); }
53         ///
54         bool empty() const { return list_.empty(); }
55         ///
56         iterator insetIterator(lyx::pos_type pos);
57         ///
58         const_iterator insetIterator(lyx::pos_type pos) const;
59         ///
60         void insert(InsetBase * inset, lyx::pos_type pos);
61         ///
62         void erase(lyx::pos_type pos);
63         ///
64         InsetBase * release(lyx::pos_type);
65         ///
66         InsetBase * get(lyx::pos_type pos) const;
67         ///
68         void increasePosAfterPos(lyx::pos_type pos);
69         ///
70         void decreasePosAfterPos(lyx::pos_type pos);
71
72 private:
73         ///
74         List list_;
75 };
76
77 #endif