]> git.lyx.org Git - lyx.git/blob - src/InsetList.h
aarrrgghh
[lyx.git] / src / InsetList.h
1 // -*- C++ -*-
2
3 #ifndef INSET_LIST_H
4 #define INSET_LIST_H
5
6 #include "support/types.h"
7
8
9 class Inset;
10 class BufferView;
11
12
13 ///
14 class InsetList {
15 public:
16         ///
17         struct InsetTable {
18                 ///
19                 lyx::pos_type pos;
20                 ///
21                 Inset * inset;
22                 ///
23                 InsetTable(lyx::pos_type p, Inset * i) : pos(p), inset(i) {}
24         };
25         ///
26         typedef std::vector<InsetTable> List;
27
28         ///
29         class iterator {
30         public:
31                 ///
32                 iterator() {}
33                 //
34                 iterator(List::iterator const & iter);
35                 ///
36                 iterator & operator++();
37                 ///
38                 iterator operator++(int);
39                 ///
40                 lyx::pos_type getPos() const;
41                 ///
42                 Inset * getInset() const;
43                 ///
44                 void setInset(Inset * inset);
45                 ///
46                 friend bool operator==(iterator const &, iterator const &);
47         private:
48                 ///
49                 List::iterator it;
50         };
51         ///
52         ~InsetList();
53         ///
54         iterator begin();
55         ///
56         iterator end();
57         ///
58         iterator begin() const;
59         ///
60         iterator end() const;
61         ///
62         iterator insetIterator(lyx::pos_type pos);
63         ///
64         void insert(Inset * inset, lyx::pos_type pos);
65         ///
66         void erase(lyx::pos_type pos);
67         ///
68         Inset * release(lyx::pos_type);
69         ///
70         Inset * get(lyx::pos_type pos) const;
71         ///
72         void increasePosAfterPos(lyx::pos_type pos);
73         ///
74         void decreasePosAfterPos(lyx::pos_type pos);
75         ///
76         void deleteInsetsLyXText(BufferView * bv);
77         ///
78         void resizeInsetsLyXText(BufferView * bv);
79 private:
80         ///
81         List list;
82 };
83
84 ///
85 bool operator==(InsetList::iterator const & i1,
86                 InsetList::iterator const & i2);
87 ///
88 bool operator!=(InsetList::iterator const & i1,
89                 InsetList::iterator const & i2);
90
91 #endif