]> git.lyx.org Git - lyx.git/blob - src/ParagraphList.h
322aa85cb8b4e052f1a446f2e45d73e30d55318b
[lyx.git] / src / ParagraphList.h
1 // -*- C++ -*-
2
3 #ifndef PARAGRAPH_LIST_H
4 #define PARAGRAPH_LIST_H
5
6 #include <iterator>
7
8 class Paragraph;
9
10 ///
11 class ParagraphList {
12 public:
13         ///
14         class iterator {
15         public:
16                 ///
17                 typedef std::bidirectional_iterator_tag iterator_category;
18                 ///
19                 typedef Paragraph * value_type;
20                 ///
21                 typedef ptrdiff_t difference_type;
22                 ///
23                 typedef Paragraph * pointer;
24                 ///
25                 typedef Paragraph & reference;
26                 ///
27                 iterator();
28                 ///
29                 iterator(value_type);
30                 ///
31                 reference operator*();
32                 ///
33                 pointer operator->();
34                 ///
35                 iterator & operator++();
36                 ///
37                 iterator operator++(int);
38                 ///
39                 iterator & operator--();
40                 ///
41                 iterator operator--(int);
42         private:
43                 ///
44                 Paragraph * ptr;
45         };
46         ///
47         ParagraphList();
48         ///
49         void clear();
50         ///
51         iterator begin();
52         ///
53         iterator begin() const;
54         ///
55         iterator end();
56         ///
57         iterator end() const;
58         ///
59         void set(Paragraph *);
60         ///
61         int size() const;
62         ///
63         bool empty() const;
64 private:
65         ///
66         Paragraph * parlist;
67 };
68
69 ///
70 bool operator==(ParagraphList::iterator const & i1,
71                 ParagraphList::iterator const & i2);
72 ///
73 bool operator!=(ParagraphList::iterator const & i1,
74                 ParagraphList::iterator const & i2);
75
76 #endif