]> git.lyx.org Git - lyx.git/blob - src/iterators.h
"Inter-word Space"
[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         ParagraphList::iterator operator*() const;
33         ///
34         ParagraphList::iterator operator->() const;
35         ///
36         ParagraphList & plist() const;
37         ///
38         size_t size() const;
39         ///
40         friend
41         bool operator==(ParIterator const & iter1, ParIterator const & iter2);
42 private:
43         struct Pimpl;
44         boost::scoped_ptr<Pimpl> pimpl_;
45 };
46
47 ///
48 bool operator==(ParIterator const & iter1, ParIterator const & iter2);
49
50 ///
51 bool operator!=(ParIterator const & iter1, ParIterator const & iter2);
52
53
54 class ParConstIterator {
55 public:
56         ///
57         ParConstIterator(ParagraphList::iterator pit, ParagraphList const & pl);
58         ///
59         ~ParConstIterator();
60         ///
61         ParConstIterator(ParConstIterator const &);
62         ///
63         ParConstIterator & operator++();
64         ///
65         ParagraphList::iterator operator*() const;
66         ///
67         ParagraphList::iterator operator->() const;
68
69         ///
70         size_t size() const;
71         ///
72         friend
73         bool operator==(ParConstIterator const & iter1,
74                         ParConstIterator const & iter2);
75 private:
76         struct Pimpl;
77         boost::scoped_ptr<Pimpl> pimpl_;
78 };
79
80 bool operator==(ParConstIterator const & iter1,
81                 ParConstIterator const & iter2);
82
83 bool operator!=(ParConstIterator const & iter1,
84                 ParConstIterator const & iter2);
85
86 #endif