X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fiterators.h;h=a68f7ff12d565886c7c732b4332edd0d79a214b0;hb=67f9c9fdae42211aa3ff8d0c6f62485bd721d8eb;hp=7dc35fea57358d33847df15d91631e538da9ea9a;hpb=7ea6f6e8833c0fac0aab13dd45436ebbf2916cb8;p=lyx.git diff --git a/src/iterators.h b/src/iterators.h index 7dc35fea57..a68f7ff12d 100644 --- a/src/iterators.h +++ b/src/iterators.h @@ -13,18 +13,36 @@ #define ITERATORS_H #include "ParagraphList_fwd.h" +#include "InsetList.h" + #include "support/types.h" -#include +#include + +#include class LyXText; class InsetBase; class Cursor; class Buffer; -class BufferView; class PosIterator; +class ParPosition { +public: + /// + ParPosition(ParagraphList::iterator p, ParagraphList const & pl); + /// + ParagraphList::iterator pit; + /// + ParagraphList const * plist; + /// + boost::optional it; + /// + boost::optional index; +}; + + class ParIterator : public std::iterator< std::forward_iterator_tag, ParagraphList::value_type> { @@ -59,17 +77,14 @@ public: int index() const; /// size_t size() const; - /// - friend - bool operator==(ParIterator const & iter1, ParIterator const & iter2); - /// - void lockPath(BufferView *) const; - /// - PosIterator asPosIterator(lyx::pos_type) const; + typedef std::vector PosHolder; + PosHolder const & positions() const + { + return positions_; + } private: - struct Pimpl; - boost::scoped_ptr pimpl_; + PosHolder positions_; }; /// @@ -102,14 +117,13 @@ public: /// depth of nesting size_t size() const; - /// - friend - bool operator==(ParConstIterator const & iter1, - ParConstIterator const & iter2); - + typedef std::vector PosHolder; + PosHolder const & positions() const + { + return positions_; + } private: - struct Pimpl; - boost::scoped_ptr pimpl_; + PosHolder positions_; }; bool operator==(ParConstIterator const & iter1,