]> git.lyx.org Git - lyx.git/blob - src/iterators.h
Point fix, earlier forgotten
[lyx.git] / src / iterators.h
1 // -*- C++ -*-
2 /* \file iterators.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author unknown
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef ITERATORS_H
13 #define ITERATORS_H
14
15 #include "ParagraphList.h"
16
17 #include <boost/scoped_ptr.hpp>
18
19 class ParIterator {
20 public:
21         ///
22         ParIterator(ParagraphList::iterator pit, ParagraphList const & pl);
23         ///
24         ~ParIterator();
25         ///
26         ParIterator(ParIterator const &);
27         ///
28         void operator=(ParIterator const &);
29         ///
30         ParIterator & operator++();
31         ///
32         Paragraph & operator*() const;
33         ///
34         ParagraphList::iterator operator->() const;
35         /// This gives us the top-most parent paragraph
36         ParagraphList::iterator outerPar() const;
37         ///
38         ParagraphList::iterator pit() const;
39         ///
40         ParagraphList & plist() const;
41         ///
42         size_t size() const;
43         ///
44         friend
45         bool operator==(ParIterator const & iter1, ParIterator const & iter2);
46 private:
47         struct Pimpl;
48         boost::scoped_ptr<Pimpl> pimpl_;
49 };
50
51 ///
52 bool operator==(ParIterator const & iter1, ParIterator const & iter2);
53
54 ///
55 bool operator!=(ParIterator const & iter1, ParIterator const & iter2);
56
57
58 class ParConstIterator {
59 public:
60         ///
61         ParConstIterator(ParagraphList::iterator pit, ParagraphList const & pl);
62         ///
63         ~ParConstIterator();
64         ///
65         ParConstIterator(ParConstIterator const &);
66         ///
67         ParConstIterator & operator++();
68         ///
69         ParagraphList::const_iterator pit() const;
70         ///
71         Paragraph const & operator*() const;
72         ///
73         ParagraphList::const_iterator operator->() const;
74         ///
75         ParagraphList const & plist() const;
76
77         /// depth of nesting
78         size_t size() const;
79         ///
80         friend
81         bool operator==(ParConstIterator const & iter1,
82                         ParConstIterator const & iter2);
83 private:
84         struct Pimpl;
85         boost::scoped_ptr<Pimpl> pimpl_;
86 };
87
88 bool operator==(ParConstIterator const & iter1,
89                 ParConstIterator const & iter2);
90
91 bool operator!=(ParConstIterator const & iter1,
92                 ParConstIterator const & iter2);
93
94 #endif