Files
Upsilon/escher/include/escher/table_view_data_source.h
Émilie Feral f6bdf56c15 [escher] TableViewDataSource: implement default cumulatedWidthFromIndex,
cumulatedWidthFromIndex, indexFromCumulatedWidth,
indexFromCumulatedHeight
2018-06-07 16:21:31 +02:00

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/highlight_cell.h>
class TableViewDataSource {
public:
virtual int numberOfRows() = 0;
virtual int numberOfColumns() = 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