Files
Upsilon/escher/include/escher/table_view_data_source.h
Émilie Feral f809d089d6 [escher] Make table view accept only table view cell
Change-Id: I393375d0887e692a85747198d5b42d26d207dc83
2016-10-25 17:55:28 +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/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