Files
Upsilon/escher/include/escher/table_view_data_source.h
2019-09-09 20:05:14 +02:00

30 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/highlight_cell.h>
class TableViewDataSource {
public:
virtual int numberOfRows() const = 0;
virtual int numberOfColumns() const = 0;
virtual void willDisplayCellAtLocation(HighlightCell * 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);
virtual KDCoordinate cumulatedHeightFromIndex(int j);
/* 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);
virtual int indexFromCumulatedHeight(KDCoordinate offsetY);
virtual HighlightCell * reusableCell(int index, int type) = 0;
virtual int reusableCellCount(int type) = 0;
virtual int typeAtLocation(int i, int j) = 0;
};
#endif