]> git.lyx.org Git - features.git/blob - src/ParagraphList.h
add ParagraphList::erase, make mergeParagraph take a Buffer* arg, adjust other funcs...
[features.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         void erase(iterator it);
52         ///
53         iterator begin();
54         ///
55         iterator begin() const;
56         ///
57         iterator end();
58         ///
59         iterator end() const;
60         ///
61         void set(Paragraph *);
62         ///
63         void push_back(Paragraph *);
64         ///
65         Paragraph const * back() const;
66         ///
67         Paragraph * back();
68         ///
69         int size() const;
70         ///
71         bool empty() const;
72 private:
73         ///
74         Paragraph * parlist;
75 };
76
77 ///
78 bool operator==(ParagraphList::iterator const & i1,
79                 ParagraphList::iterator const & i2);
80 ///
81 bool operator!=(ParagraphList::iterator const & i1,
82                 ParagraphList::iterator const & i2);
83
84 #endif