Files
Upsilon/apps/shared/toolbox_helpers.h
Léa Saviot 13ae1d2545 [apps/escher/toolbox] handleEventWithText for all responders.
This makes the code in the various toolbox more generic. The arguments
of the text to insert are each replaced by a Ion::Charset::Empty.
These Empty chars are used to create layouts in ExpressionLayoutFields,
and to compute the position of the cursor in other fields, before being
removed.

Change-Id: Ie81c1e394b06fef2ab801ccff919d6550f70ec30
2018-04-23 17:18:48 +02:00

25 lines
737 B
C++

#ifndef SHARED_TOOLBOX_HELPERS_H
#define SHARED_TOOLBOX_HELPERS_H
#include <escher/i18n.h>
namespace Shared {
namespace ToolboxHelpers {
int CursorIndexInCommandText(const char * text);
/* Returns the index of the cursor position in a command, which is the smallest
* index between :
* - After the first open parenthesis
* - The end of the text */
void TextToInsertForCommandMessage(I18n::Message message, char * buffer, int bufferSize, bool replaceArgsWithEmptyChar = false);
void TextToInsertForCommandText(const char * command, char * buffer, int bufferSize, bool replaceArgsWithEmptyChar = false);
/* Removes the arguments from a command:
* - Removes text between parentheses or brackets, except commas */
}
}
#endif