Files
Upsilon/apps/shared/function_app.h
Gabriel Ozouf 56e03aae0c [shared] Remove angleUnitVersion
The angleUnitVersion check is no longer needed, as changing the angle
unit with a trigonometric function set would leave the cursor hanging.

Change-Id: I17d99c05daeacfec953865158cdfe7706635cd32
2020-11-24 09:55:22 +01:00

53 lines
1.6 KiB
C++

#ifndef SHARED_FUNCTION_APP_H
#define SHARED_FUNCTION_APP_H
#include "expression_field_delegate_app.h"
#include "function_graph_controller.h"
#include "function_store.h"
#include "curve_view_cursor.h"
#include "values_controller.h"
#include "shared_app.h"
namespace Shared {
class FunctionApp : public ExpressionFieldDelegateApp {
public:
class Snapshot : public ::SharedApp::Snapshot, public TabViewDataSource {
public:
Snapshot();
CurveViewCursor * cursor() { return &m_cursor; }
uint32_t * rangeVersion() { return &m_rangeVersion; }
virtual FunctionStore * functionStore() = 0;
int * indexFunctionSelectedByCursor() { return &m_indexFunctionSelectedByCursor; }
void reset() override;
void storageDidChangeForRecord(const Ion::Storage::Record record) override;
protected:
CurveViewCursor m_cursor;
private:
int m_indexFunctionSelectedByCursor;
uint32_t m_rangeVersion;
};
static FunctionApp * app() {
return static_cast<FunctionApp *>(Container::activeApp());
}
virtual ~FunctionApp() = default;
Snapshot * snapshot() const {
return static_cast<Snapshot *>(::App::snapshot());
}
virtual FunctionStore * functionStore() { return snapshot()->functionStore(); }
virtual ValuesController * valuesController() = 0;
virtual InputViewController * inputViewController() = 0;
void willBecomeInactive() override;
protected:
FunctionApp(Snapshot * snapshot, ViewController * rootViewController) :
ExpressionFieldDelegateApp(snapshot, rootViewController)
{}
// TextFieldDelegateApp
bool isAcceptableExpression(const Poincare::Expression expression) override;
};
}
#endif