]> git.lyx.org Git - lyx.git/blob - src/ParagraphList.h
f64b88cd79a79303ec60e857be88cac724f4fa67
[lyx.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         ParagraphList(ParagraphList const &);
51         ///
52         ParagraphList & operator=(ParagraphList const &);
53         ///
54         iterator insert(iterator it, Paragraph * par);
55         ///
56         void insert(iterator pos, iterator beg, iterator end);
57         ///
58         void assign(iterator beg, iterator end);
59         ///
60         void clear();
61         ///
62         void erase(iterator it);
63         ///
64         iterator begin();
65         ///
66         iterator begin() const;
67         ///
68         iterator end();
69         ///
70         iterator end() const;
71         ///
72         void set(Paragraph *);
73         ///
74         void push_back(Paragraph *);
75         ///
76         Paragraph const & front() const;
77         ///
78         Paragraph & front();
79         ///
80         Paragraph const & back() const;
81         ///
82         Paragraph & back();
83         ///
84         int size() const;
85         ///
86         bool empty() const;
87 private:
88         ///
89         Paragraph * parlist;
90 };
91
92
93
94 typedef std::pair<ParagraphList::iterator, int> PitPosPair;
95
96
97
98 ///
99 bool operator==(ParagraphList::iterator const & i1,
100                 ParagraphList::iterator const & i2);
101 ///
102 bool operator!=(ParagraphList::iterator const & i1,
103                 ParagraphList::iterator const & i2);
104
105
106 #endif