Files
Upsilon/apps/graph/function.h
Émilie Feral e109a23485 [apps/graph] add methods to handle function names and colors.
Change-Id: Ic11f2dd6bd9cb473b436d5e7769e2660c173c733
2016-10-03 14:04:58 +02:00

35 lines
753 B
C++

#ifndef GRAPH_FUNCTION_H
#define GRAPH_FUNCTION_H
#include <poincare.h>
#include <kandinsky.h>
namespace Graph {
class Function {
public:
Function(const char * text = nullptr, KDColor color = KDColorBlack);
~Function(); // Delete expression and layout, if needed
const char * text();
const char * name();
KDColor color() const { return m_color; }
Expression * expression();
ExpressionLayout * layout();
bool isActive();
void setActive(bool active);
void setContent(const char * c);
void setColor(KDColor m_color);
private:
constexpr static int k_bodyLength = 255;
char m_text[k_bodyLength];
const char * m_name;
KDColor m_color;
Expression * m_expression;
ExpressionLayout * m_layout;
bool m_active;
};
}
#endif