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 "ParagraphList_fwd.h"
16 #include "InsetList.h"
18 #include "support/types.h"
20 #include <boost/optional.hpp>
34 ParPosition(ParagraphList::iterator p, ParagraphList const & pl);
36 ParagraphList::iterator pit;
38 ParagraphList const * plist;
40 boost::optional<InsetList::iterator> it;
42 boost::optional<int> index;
46 class ParIterator : public std::iterator<
47 std::forward_iterator_tag,
48 ParagraphList::value_type> {
51 ParIterator(ParagraphList::iterator pit, ParagraphList const & pl);
55 ParIterator(ParIterator const &);
57 ParIterator(PosIterator const &);
59 void operator=(ParIterator const &);
61 ParIterator & operator++();
63 Paragraph & operator*() const;
65 ParagraphList::iterator operator->() const;
66 /// This gives us the top-most parent paragraph
67 ParagraphList::iterator outerPar() const;
69 ParagraphList::iterator pit() const;
71 ParagraphList & plist() const;
72 /// returns 'innermost' LyXText
73 LyXText * text(Buffer &) const;
74 /// returns innermost inset
75 InsetBase * inset() const;
76 /// returns index of cell in innermost inset
81 typedef std::vector<ParPosition> PosHolder;
82 PosHolder const & positions() const
91 bool operator==(ParIterator const & iter1, ParIterator const & iter2);
94 bool operator!=(ParIterator const & iter1, ParIterator const & iter2);
97 class ParConstIterator : public std::iterator<
98 std::forward_iterator_tag,
99 ParagraphList::value_type> {
102 ParConstIterator(ParagraphList::iterator pit, ParagraphList const & pl);
106 ParConstIterator(ParConstIterator const &);
108 ParConstIterator & operator++();
110 ParagraphList::const_iterator pit() const;
112 Paragraph const & operator*() const;
114 ParagraphList::const_iterator operator->() const;
116 ParagraphList const & plist() const;
120 typedef std::vector<ParPosition> PosHolder;
121 PosHolder const & positions() const
126 PosHolder positions_;
129 bool operator==(ParConstIterator const & iter1,
130 ParConstIterator const & iter2);
132 bool operator!=(ParConstIterator const & iter1,
133 ParConstIterator const & iter2);