]> git.lyx.org Git - lyx.git/blobdiff - src/pariterator.h
minimal effort implementation of:
[lyx.git] / src / pariterator.h
index 4ce2b05994d379408e9a05e5e8067382607d01ff..4e721d85aabb83da1567c8be8026bf6c7549eb4f 100644 (file)
@@ -13,6 +13,7 @@
 #define PARITERATOR_H
 
 #include "dociterator.h"
+#include "ParagraphList_fwd.h"
 
 #include "support/types.h"
 
 
 class InsetBase;
 class LyXText;
-class ParagraphList;
 
 
 class ParIterator : public std::iterator<std::forward_iterator_tag, Paragraph>,
                    public DocIterator
 {
 public:
+       typedef std::iterator<std::forward_iterator_tag, Paragraph> StdIt;
+
+       typedef StdIt::value_type value_type;
+       typedef StdIt::difference_type difference_type;
+       typedef StdIt::pointer pointer;
+       typedef StdIt::reference reference;
+
+       ///
+       ParIterator() : DocIterator() {}
+
+
        ///
-       ParIterator(InsetBase &, lyx::par_type pit);
+       ParIterator(InsetBase &, lyx::pit_type pit);
        ///
        ParIterator(ParIterator const &);
        ///
        ParIterator(DocIterator const &);
 
-       ///
-       void operator=(ParIterator const &);
+       /// This really should be implemented...
+       //ParIterator & operator=(ParIterator const &);
        ///
        ParIterator & operator++();
        ///
-       ParIterator & operator--();
+       ParIterator operator++(int);
+       /// See comment in pariterator.C
+       //ParIterator & operator--();
        ///
        Paragraph & operator*() const;
        ///
        Paragraph * operator->() const;
        /// This gives us the top-most parent paragraph
-       lyx::par_type outerPar() const;
+       lyx::pit_type outerPar() const;
        ///
-       lyx::par_type pit() const;
+       lyx::pit_type pit() const;
        ///
+       /// return the paragraph this cursor is in
+       pit_type & pit() { return DocIterator::pit(); }
+
        ParagraphList & plist() const;
 };
 
@@ -76,6 +92,8 @@ class ParConstIterator : public std::iterator<std::forward_iterator_tag,
                         public DocIterator
 {
 public:
+       ///
+       ParConstIterator(): DocIterator() {}
        ///
        ParConstIterator(ParConstIterator const &);
        ///