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