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