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