mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
29 lines
1.1 KiB
C++
29 lines
1.1 KiB
C++
#ifndef ESCHER_TABLE_VIEW_DATA_SOURCE_H
|
|
#define ESCHER_TABLE_VIEW_DATA_SOURCE_H
|
|
|
|
#include <escher/view.h>
|
|
#include <escher/table_view_cell.h>
|
|
|
|
class TableViewDataSource {
|
|
public:
|
|
virtual int numberOfRows() = 0;
|
|
virtual int numberOfColumns() = 0;
|
|
virtual void willDisplayCellAtLocation(TableViewCell * cell, int i, int j);
|
|
virtual KDCoordinate columnWidth(int i) = 0;
|
|
virtual KDCoordinate rowHeight(int j) = 0;
|
|
/* return the number of pixels to include in offset to display the column i at
|
|
the top */
|
|
virtual KDCoordinate cumulatedWidthFromIndex(int i) = 0;
|
|
virtual KDCoordinate cumulatedHeightFromIndex(int j) = 0;
|
|
/* return the number of columns (starting with first ones) that can be fully
|
|
* displayed in offsetX pixels.
|
|
* Caution: if the offset is exactly the size of n columns, the function
|
|
* returns n-1. */
|
|
virtual int indexFromCumulatedWidth(KDCoordinate offsetX) = 0;
|
|
virtual int indexFromCumulatedHeight(KDCoordinate offsetY) = 0;
|
|
virtual TableViewCell * reusableCell(int index, int type) = 0;
|
|
virtual int reusableCellCount(int type) = 0;
|
|
virtual int typeAtLocation(int i, int j) = 0;
|
|
};
|
|
|
|
#endif |