#ifndef LAYOUT_REFERENCE_H #define LAYOUT_REFERENCE_H #include "tree_reference.h" #include "layout_node.h" class LayoutCursor; template class LayoutReference : public TreeReference { friend class LayoutCursor; public: using TreeReference::TreeReference; /* Allow every LayoutReference to be transformed into a * LayoutReference, i.e. Layout */ operator LayoutReference() const { return LayoutReference(this->node()); } static TreeNode * failedAllocationNode(); LayoutCursor cursor() const; LayoutReference childAtIndex(int i) { TreeReference treeRefChild = TreeReference::treeChildAtIndex(i); return LayoutReference(treeRefChild.node()); } void replaceChildAtIndex(int oldChildIndex, LayoutReference newChild) { TreeReference::replaceChildAtIndex(oldChildIndex, newChild); } int layoutOrigin() { return this->node()->layoutOrigin(); } int absoluteOrigin() { return this->node()->absoluteOrigin(); } }; typedef LayoutReference LayoutRef; #endif