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