mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 15:50:49 +01:00
27 lines
624 B
C++
27 lines
624 B
C++
#ifndef ESCHER_SCROLL_VIEW_DATA_SOURCE_H
|
|
#define ESCHER_SCROLL_VIEW_DATA_SOURCE_H
|
|
|
|
#include <kandinsky.h>
|
|
|
|
class ScrollViewDataSource;
|
|
|
|
class ScrollViewDelegate {
|
|
public:
|
|
virtual void scrollViewDidChangeOffset(ScrollViewDataSource * scrollViewDataSource) = 0;
|
|
};
|
|
|
|
class ScrollViewDataSource {
|
|
public:
|
|
ScrollViewDataSource() : m_delegate(nullptr), m_offset(KDPointZero) {}
|
|
KDPoint offset() const { return m_offset; }
|
|
bool setOffset(KDPoint offset);
|
|
void setScrollViewDelegate(ScrollViewDelegate * delegate) {
|
|
m_delegate = delegate;
|
|
}
|
|
private:
|
|
ScrollViewDelegate * m_delegate;
|
|
KDPoint m_offset;
|
|
};
|
|
|
|
#endif
|