#ifndef SHARED_POINCARE_HELPERS_H #define SHARED_POINCARE_HELPERS_H #include namespace Shared { namespace PoincareHelpers { inline Poincare::ExpressionLayout * CreateLayout(const Poincare::Expression * e) { return e->createLayout(Poincare::Preferences::sharedPreferences()->displayMode(), Poincare::Preferences::sharedPreferences()->numberOfSignificantDigits()); } template inline int ConvertFloatToText(T d, char * buffer, int bufferSize, int numberOfSignificantDigits) { return Poincare::PrintFloat::convertFloatToText(d, buffer, bufferSize, numberOfSignificantDigits, Poincare::Preferences::sharedPreferences()->displayMode()); } inline int WriteTextInBuffer(const Poincare::Expression * e, char * buffer, int bufferSize, int numberOfSignificantDigits = Poincare::PrintFloat::k_numberOfStoredSignificantDigits) { return e->writeTextInBuffer(buffer, bufferSize, Poincare::Preferences::sharedPreferences()->displayMode(), numberOfSignificantDigits); } template inline Poincare::Expression * Approximate(const Poincare::Expression * e, Poincare::Context & context) { return e->approximate(context, Poincare::Preferences::sharedPreferences()->angleUnit(), Poincare::Preferences::sharedPreferences()->complexFormat()); } template inline T ApproximateToScalar(const Poincare::Expression * e, Poincare::Context & context) { return e->approximateToScalar(context, Poincare::Preferences::sharedPreferences()->angleUnit()); } template inline T ApproximateToScalar(const char * text, Poincare::Context & context) { return Poincare::Expression::approximateToScalar(text, context, Poincare::Preferences::sharedPreferences()->angleUnit()); } inline Poincare::Expression * ParseAndSimplify(const char * text, Poincare::Context & context) { return Poincare::Expression::ParseAndSimplify(text, context, Poincare::Preferences::sharedPreferences()->angleUnit()); } inline void Simplify(Poincare::Expression ** expressionAddress, Poincare::Context & context) { return Poincare::Expression::Simplify(expressionAddress, context, Poincare::Preferences::sharedPreferences()->angleUnit()); } } } #endif