Files
Upsilon/apps/shared/float_parameter_controller.h
Émilie Feral 2e16365100 [escher] Reorganize all cells'name and factorize their layouts
Change-Id: I69900ee98ff6a6868f96d70a0e335a589ef16c3f
2017-02-20 10:54:02 +01:00

33 lines
1.1 KiB
C++

#ifndef SHARED_FLOAT_PARAMETER_CONTROLLER_H
#define SHARED_FLOAT_PARAMETER_CONTROLLER_H
#include <escher.h>
#include "text_field_delegate.h"
namespace Shared {
/* This controller edits float parameter of any model (given through
* parameterAtIndex and setParameterAtIndex). */
class FloatParameterController : public ViewController, public SimpleListViewDataSource, public SelectableTableViewDelegate, public TextFieldDelegate {
public:
FloatParameterController(Responder * parentResponder);
View * view() override;
void didBecomeFirstResponder() override;
KDCoordinate cellHeight() override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
bool textFieldDidFinishEditing(TextField * textField, const char * text) override;
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
protected:
int activeCell();
SelectableTableView m_selectableTableView;
private:
TextFieldDelegateApp * textFieldDelegateApp() override;
virtual float parameterAtIndex(int index) = 0;
virtual void setParameterAtIndex(int parameterIndex, float f) = 0;
};
}
#endif