aboutsummaryrefslogtreecommitdiff
path: root/dw/oofawarewidget.hh
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-09-12 23:32:32 +0200
committerSebastian Geerken <devnull@localhost>2014-09-12 23:32:32 +0200
commitf543038f3b597c34f67a4ca63efc2bbe59a78b05 (patch)
treebeb923c5231cb67cb7e9d57348e7dc0bd212757b /dw/oofawarewidget.hh
parent5c0abff7a414c2bd3501b4ac1721b4fad7b8bd47 (diff)
OOFAwareWidgetIterator.
Diffstat (limited to 'dw/oofawarewidget.hh')
-rw-r--r--dw/oofawarewidget.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/dw/oofawarewidget.hh b/dw/oofawarewidget.hh
index 32de4868..50332487 100644
--- a/dw/oofawarewidget.hh
+++ b/dw/oofawarewidget.hh
@@ -52,6 +52,35 @@ protected:
enum { PARENT_REF_OOFM_BITS = 2,
PARENT_REF_OOFM_MASK = (1 << PARENT_REF_OOFM_BITS) - 1 };
+ class OOFAwareWidgetIterator: public core::Iterator
+ {
+ private:
+ enum { NUM_SECTIONS = NUM_OOFM + 1 };
+ int sectionIndex; // 0 means in flow, otherwise OOFM index + 1
+ int index;
+
+ int numParts (int sectionIndex);
+ void getPart (int sectionIndex, int index, core::Content *content);
+
+ protected:
+ virtual int numContentsInFlow () = 0;
+ virtual void getContentInFlow (int index, core::Content *content) = 0;
+
+ void highlightOOF (int start, int end, core::HighlightLayer layer);
+ void unhighlightOOF (int direction, core::HighlightLayer layer);
+ void getAllocationOOF (int start, int end, core::Allocation *allocation);
+
+ public:
+ OOFAwareWidgetIterator (OOFAwareWidget *widget, core::Content::Type mask,
+ bool atEnd);
+
+ int compareTo(lout::object::Comparable *other);
+
+ bool next ();
+ bool prev ();
+ void print ();
+ };
+
inline bool isParentRefOOF (int parentRef)
{ return parentRef != -1 && (parentRef & PARENT_REF_OOFM_MASK); }