Files
Upsilon/layout_cursor_reference.h
Léa Saviot 0af06b5f3a Add Layouts
2018-06-25 13:37:28 +02:00

36 lines
1.1 KiB
C++

#ifndef LAYOUT_CURSOR_REFERENCE_H
#define LAYOUT_CURSOR_REFERENCE_H
#include "layout_node.h"
#include "layout_reference.h"
class LayoutCursor;
template <typename T>
class LayoutCursorReference : public LayoutReference<T> {
public:
//using LayoutReference<T>::LayoutReference;
LayoutCursorReference(LayoutReference<T> * r) :
LayoutReference<T>(r->node())
{
}
LayoutCursorReference(const LayoutCursorReference & r) :
LayoutReference<T>(r.node())
{
}
// Tree navigation
/* We cannot have LayoutCursor cursorLeftOf(LayoutCursor cursor) because of
* circular header dependency */
virtual void moveCursorLeft(LayoutCursor * cursor, bool * shouldRecomputeLayout) {}
virtual void moveCursorRight(LayoutCursor * cursor, bool * shouldRecomputeLayout) {}
virtual void moveCursorUp(LayoutCursor * cursor, bool * shouldRecomputeLayout, bool equivalentPositionVisited = false) {}
virtual void moveCursorDown(LayoutCursor * cursor, bool * shouldRecomputeLayout, bool equivalentPositionVisited = false) {}
};
typedef LayoutCursorReference<LayoutNode> LayoutPointer;
#endif