3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
15 #include "DocIterator.h"
17 #include "support/types.h"
28 class ParIterator : public DocIterator
32 ParIterator(Buffer * buf) : DocIterator(buf) {}
34 ParIterator(ParIterator const & pi) :
35 DocIterator(DocIterator(pi)) {}
37 explicit ParIterator(DocIterator const & dit) :
40 /// This really should be implemented...
41 //ParIterator & operator=(ParIterator const &);
43 ParIterator & operator++();
45 ParIterator operator++(int);
46 /// See comment in ParIterator.cpp
47 //ParIterator & operator--();
49 Paragraph & operator*() const;
51 Paragraph * operator->() const;
52 /// This gives us the top-most parent paragraph
53 pit_type outerPar() const;
57 /// return the paragraph this cursor is in
58 pit_type & pit() { return DocIterator::pit(); }
60 ParagraphList & plist() const;
64 ParIterator par_iterator_begin(Inset & inset);
66 ParIterator par_iterator_end(Inset & inset);
70 //bool operator==(ParIterator const & it1, ParIterator const & it2);
72 // FIXME: Unfortunately operator!=(ParIterator &, ParIterator &) is
73 // implemented with operator!=(DocIterator &, DocIterator &) that gives
74 // false if the positions are different, even if the pars are the same.
75 // So ultimately it's a bug in operator!=(ParIterator &, ParIterator &)
76 // I'd say (nevertheless, I would be reluctant to change it, because I
77 // fear that some part of the code could rely on this "bug". --Alfredo
78 //bool operator!=(ParIterator const & it1, ParIterator const & it2);
81 class ParConstIterator : public DocIterator
85 ParConstIterator(Buffer const * buf)
86 : DocIterator(const_cast<Buffer *>(buf)) {}
88 ParConstIterator(ParConstIterator const & pi)
89 : DocIterator(DocIterator(pi)) {}
91 explicit ParConstIterator(DocIterator const & dit)
94 void push_back(Inset const &);
96 ParConstIterator & operator++();
98 ParConstIterator & operator--();
100 Paragraph const & operator*() const;
102 Paragraph const * operator->() const;
104 ParagraphList const & plist() const;
107 //bool operator==(ParConstIterator const & it1, ParConstIterator const & it2);
109 //bool operator!=(ParConstIterator const & it1, ParConstIterator const & it2);