mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
of keeping track of dataHasChanged in the selectable table view Change-Id: Id2626f527f44714e29b9bd66e2c843193e1b57b5
41 lines
1.6 KiB
C++
41 lines
1.6 KiB
C++
#ifndef SHARED_EDITABLE_CELL_TABLE_VIEW_CONTROLLER_H
|
|
#define SHARED_EDITABLE_CELL_TABLE_VIEW_CONTROLLER_H
|
|
|
|
#include <escher.h>
|
|
#include <poincare.h>
|
|
|
|
namespace Shared {
|
|
|
|
class EditableCellTableViewController : public ViewController, public TableViewDataSource, public SelectableTableViewDelegate, public TextFieldDelegate {
|
|
public:
|
|
EditableCellTableViewController(Responder * parentResponder, KDCoordinate topMargin,
|
|
KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin);
|
|
virtual View * view() override;
|
|
|
|
bool textFieldDidReceiveEvent(TextField * textField, Ion::Events::Event event) override;
|
|
bool textFieldDidFinishEditing(TextField * textField, const char * text) override;
|
|
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
|
|
|
|
int numberOfRows() override;
|
|
void willDisplayCellAtLocationWithDisplayMode(TableViewCell * cell, int i, int j, Poincare::Expression::DisplayMode displayMode);
|
|
KDCoordinate rowHeight(int j) override;
|
|
KDCoordinate cumulatedHeightFromIndex(int j) override;
|
|
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
|
|
|
void didBecomeFirstResponder() override;
|
|
void viewWillAppear() override;
|
|
protected:
|
|
SelectableTableView m_selectableTableView;
|
|
private:
|
|
static constexpr KDCoordinate k_cellHeight = 20;
|
|
virtual bool cellAtLocationIsEditable(int columnIndex, int rowIndex) = 0;
|
|
virtual void setDataAtLocation(float floatBody, int columnIndex, int rowIndex) = 0;
|
|
virtual float dataAtLocation(int columnIndex, int rowIndex) = 0;
|
|
virtual int numberOfElements() = 0;
|
|
virtual int maxNumberOfElements() const = 0;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|