namespace Text
{
+//Forward declarations
+struct CursorInfo;
+
struct Event
{
// Used to queue input events until DoRelayout()
Param p3;
};
-struct CursorInfo
-{
- CursorInfo()
- : primaryPosition(),
- secondaryPosition(),
- lineOffset( 0.f ),
- lineHeight( 0.f ),
- primaryCursorHeight( 0.f ),
- secondaryCursorHeight( 0.f ),
- isSecondaryCursor( false )
- {}
-
- ~CursorInfo()
- {}
-
- Vector2 primaryPosition; ///< The primary cursor's position.
- Vector2 secondaryPosition; ///< The secondary cursor's position.
- float lineOffset; ///< The vertical offset where the line containing the cursor starts.
- float lineHeight; ///< The height of the line where the cursor is placed.
- float primaryCursorHeight; ///< The primary cursor's height.
- float secondaryCursorHeight; ///< The secondary cursor's height.
- bool isSecondaryCursor; ///< Whether the secondary cursor is valid.
-};
-
struct EventData
{
enum State
InputStyle mInputStyle; ///< The style to be set to the new inputed text.
- /**
- * 0,0 means that the top-left corner of the layout matches the top-left corner of the UI control.
- * Typically this will have a negative value with scrolling occurs.
- */
- Vector2 mScrollPosition; ///< The text is offset by this position when scrolling.
-
State mState; ///< Selection mode, edit mode etc.
CharacterIndex mPrimaryCursorPosition; ///< Index into logical model for primary cursor.
mLayoutEngine(),
mModifyEvents(),
mTextColor( Color::BLACK ),
- mAlignmentOffset(),
mTextUpdateInfo(),
mOperationsPending( NO_OPERATION ),
mMaximumNumberOfCharacters( 50u ),
mRecalculateNaturalSize( true ),
- mMarkupProcessorEnabled( false )
+ mMarkupProcessorEnabled( false ),
+ mClipboardHideEnabled( true ),
+ mAutoScrollEnabled( false ),
+ mAutoScrollDirectionRTL( false )
{
mLogicalModel = LogicalModel::New();
mVisualModel = VisualModel::New();
void OnSelectAllEvent();
+ /**
+ * @brief Retrieves the selected text. It removes the text if the @p deleteAfterRetrieval parameter is @e true.
+ *
+ * @param[out] selectedText The selected text encoded in utf8.
+ * @param[in] deleteAfterRetrieval Whether the text should be deleted after retrieval.
+ */
void RetrieveSelection( std::string& selectedText, bool deleteAfterRetrieval );
void ShowClipboard();
void HideClipboard();
+ void SetClipboardHideEnable(bool enable);
+
bool CopyStringToClipboard( std::string& source );
void SendSelectionToClipboard( bool deleteAfterSending );
void SetPopupButtons();
void ChangeState( EventData::State newState );
- LineIndex GetClosestLine( float y ) const;
-
- void FindSelectionIndices( float visualX, float visualY, CharacterIndex& startIndex, CharacterIndex& endIndex );
-
- /**
- * @brief Retrieves the cursor's logical position for a given touch point x,y
- *
- * @param[in] visualX The touch point x.
- * @param[in] visualY The touch point y.
- *
- * @return The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character.
- */
- CharacterIndex GetClosestCursorIndex( float visualX,
- float visualY );
/**
* @brief Calculates the cursor's position for a given character index in the logical order.
LayoutEngine mLayoutEngine; ///< The layout engine.
Vector<ModifyEvent> mModifyEvents; ///< Temporary stores the text set until the next relayout.
Vector4 mTextColor; ///< The regular text color
- Vector2 mAlignmentOffset; ///< Vertical and horizontal offset of the whole text inside the control due to alignment.
+ /**
+ * 0,0 means that the top-left corner of the layout matches the top-left corner of the UI control.
+ * Typically this will have a negative value with scrolling occurs.
+ */
+ Vector2 mScrollPosition; ///< The text is offset by this position when scrolling.
TextUpdateInfo mTextUpdateInfo; ///< Info of the characters updated.
OperationsMask mOperationsPending; ///< Operations pending to be done to layout the text.
Length mMaximumNumberOfCharacters; ///< Maximum number of characters that can be inserted.
bool mRecalculateNaturalSize:1; ///< Whether the natural size needs to be recalculated.
bool mMarkupProcessorEnabled:1; ///< Whether the mark-up procesor is enabled.
+ bool mClipboardHideEnabled:1; ///< Whether the ClipboardHide function work or not
+ bool mAutoScrollEnabled:1; ///< Whether auto text scrolling is enabled.
+ CharacterDirection mAutoScrollDirectionRTL:1; ///< Direction of auto scrolling, true if rtl
+
};
} // namespace Text