Files
Upsilon/apps/shared/editable_cell_table_view_controller.h
Émilie Feral 7a54fa0ea0 [apps/shared] Divide tab table controller in 2 classes
Change-Id: I7bd9f7395c000ad69198ab123ffcfe1b661350aa
2017-03-16 15:12:13 +01:00

39 lines
1.5 KiB
C++

#ifndef SHARED_EDITABLE_CELL_TABLE_VIEW_CONTROLLER_H
#define SHARED_EDITABLE_CELL_TABLE_VIEW_CONTROLLER_H
#include <escher.h>
#include <poincare.h>
#include "text_field_delegate.h"
#include "tab_table_controller.h"
#include "regular_table_view_data_source.h"
namespace Shared {
class EditableCellTableViewController : public TabTableController , public RegularTableViewDataSource, public SelectableTableViewDelegate, public TextFieldDelegate {
public:
EditableCellTableViewController(Responder * parentResponder, KDCoordinate topMargin,
KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin);
bool textFieldDidFinishEditing(TextField * textField, const char * text) override;
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
int numberOfRows() override;
void willDisplayCellAtLocationWithDisplayMode(HighlightCell * cell, int i, int j, Poincare::Expression::FloatDisplayMode FloatDisplayMode);
KDCoordinate rowHeight(int j) override;
void didBecomeFirstResponder() override;
void viewWillAppear() override;
private:
TextFieldDelegateApp * textFieldDelegateApp() override;
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