]> git.lyx.org Git - features.git/blob - src/ParagraphList.h
f60337eff4f1b58040303fea17cad0f152733bd2
[features.git] / src / ParagraphList.h
1 // -*- C++ -*-
2
3 #ifndef PARAGRAPH_LIST_H
4 #define PARAGRAPH_LIST_H
5
6 #include <iterator>
7 #include <utility>
8
9 class Paragraph;
10
11 ///
12 class ParagraphList {
13 public:
14         ///
15         class iterator {
16         public:
17                 ///
18                 typedef std::bidirectional_iterator_tag iterator_category;
19                 ///
20                 typedef Paragraph * value_type;
21                 ///
22                 typedef ptrdiff_t difference_type;
23                 ///
24                 typedef Paragraph * pointer;
25                 ///
26                 typedef Paragraph & reference;
27                 ///
28                 iterator();
29                 ///
30                 iterator(value_type);
31                 ///
32                 reference operator*();
33                 ///
34                 pointer operator->();
35                 ///
36                 iterator & operator++();
37                 ///
38                 iterator operator++(int);
39                 ///
40                 iterator & operator--();
41                 ///
42                 iterator operator--(int);
43         private:
44                 ///
45                 Paragraph * ptr;
46         };
47         ///
48         ParagraphList();
49         ///
50         iterator insert(iterator it, Paragraph * par);
51         ///
52         void clear();
53         ///
54         void erase(iterator it);
55         ///
56         iterator begin();
57         ///
58         iterator begin() const;
59         ///
60         iterator end();
61         ///
62         iterator end() const;
63         ///
64         void set(Paragraph *);
65         ///
66         void push_back(Paragraph *);
67         ///
68         Paragraph const & front() const;
69         ///
70         Paragraph & front();
71         ///
72         Paragraph const & back() const;
73         ///
74         Paragraph & back();
75         ///
76         int size() const;
77         ///
78         bool empty() const;
79 private:
80         ///
81         Paragraph * parlist;
82 };
83
84
85
86 typedef std::pair<ParagraphList::iterator, int> PitPosPair;
87
88
89
90 ///
91 bool operator==(ParagraphList::iterator const & i1,
92                 ParagraphList::iterator const & i2);
93 ///
94 bool operator!=(ParagraphList::iterator const & i1,
95                 ParagraphList::iterator const & i2);
96
97
98 #endif