#define DALI_INPUT_METHOD_CONTEXT_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
COMMIT, ///< Commit recieved
DELETE_SURROUNDING, ///< Event to delete a range of characters from the string
GET_SURROUNDING, ///< Event to query string and cursor position
- PRIVATE_COMMAND ///< Private command sent from the input panel
+ PRIVATE_COMMAND, ///< Private command sent from the input panel
+ SELECTION_SET ///< input method needs to set the selection
};
/**
enum class InputPanelLanguage
{
AUTOMATIC, ///< IME Language automatically set depending on the system display
- ALPHABET ///< Latin alphabet at all times
+ ALPHABET ///< Latin alphabet(default). It can be changed according to OSD(On Screen Display) language.
+ };
+
+ /**
+ * @brief Enumeration for defining the types of Ecore_IMF Input Panel align.
+ */
+ enum class InputPanelAlign
+ {
+ TOP_LEFT, ///< The top-left corner
+ TOP_CENTER, ///< The top-center position
+ TOP_RIGHT, ///< The top-right corner
+ MIDDLE_LEFT, ///< The middle-left position
+ MIDDLE_CENTER, ///< The middle-center position
+ MIDDLE_RIGHT, ///< The middle-right position
+ BOTTOM_LEFT, ///< The bottom-left corner
+ BOTTOM_CENTER, ///< The bottom-center position
+ BOTTOM_RIGHT ///< The bottom-right corner
};
/**
: predictiveString(),
eventName(VOID),
cursorOffset(0),
- numberOfChars(0){};
+ numberOfChars(0),
+ startIndex(0),
+ endIndex(0){};
/**
* @brief Constructor
: predictiveString(aPredictiveString),
eventName(aEventName),
cursorOffset(aCursorOffset),
- numberOfChars(aNumberOfChars)
+ numberOfChars(aNumberOfChars),
+ startIndex(0),
+ endIndex(0)
+ {
+ }
+
+ /**
+ * @brief Constructor
+ *
+ * @param[in] aEventName The name of the event from the InputMethodContext.
+ * @param[in] aStartIndex The start index of selection.
+ * @param[in] aEndIndex The end index of selection.
+ */
+ EventData(EventType aEventName, int aStartIndex, int aEndIndex)
+ : predictiveString(),
+ eventName(aEventName),
+ cursorOffset(0),
+ numberOfChars(0),
+ startIndex(aStartIndex),
+ endIndex(aEndIndex)
{
}
EventType eventName; ///< The name of the event from the InputMethodContext.
int cursorOffset; ///< Start position from the current cursor position to start deleting characters.
int numberOfChars; ///< number of characters to delete from the cursorOffset.
+ int startIndex; ///< The start index of selection.
+ int endIndex; ///< The end index of selection.
};
/**
void SetInputPanelPosition(unsigned int x, unsigned int y);
/**
+ * @brief Sets the alignment and its x, y coordinates of the input panel.
+ *
+ * Regardless of the rotation degree, the x, y values of the top-left corner on the screen are based on 0, 0.
+ * When the IME size is changed, its size will change according to the set alignment.
+ *
+ * @param[in] x The x coordinate of the InputPanelAlign value.
+ * @param[in] y The y coordinate of the InputPanelAlign value.
+ * @param[in] align one of the InputPanelAlign values specifying the desired alignment.
+ * @return true on success, false otherwise.
+ * @remarks This API can be used to set the alignment of a floating IME.
+ */
+ bool SetInputPanelPositionAlign(int x, int y, InputPanelAlign align);
+
+ /**
* @brief Gets the preedit attributes data.
*
* @param[out] attrs The preedit attributes data.