X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Ftext-input%2Ftext-input-impl.h;h=a4102054324e4aacda3b680fb1ce9d468362e9f4;hb=1123d866f9342b8950fe63715f6eaa1be9a2c18f;hp=b9f32338b1d11d7bc559303bec5a376795bd3a04;hpb=bb52eae847ee00d2caf94bc5e94111c7663b91ea;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/base/dali-toolkit/internal/controls/text-input/text-input-impl.h b/base/dali-toolkit/internal/controls/text-input/text-input-impl.h index b9f3233..a410205 100644 --- a/base/dali-toolkit/internal/controls/text-input/text-input-impl.h +++ b/base/dali-toolkit/internal/controls/text-input/text-input-impl.h @@ -26,7 +26,6 @@ #include #include -#include #include namespace Dali @@ -866,12 +865,11 @@ public: // Public to allow internal testing. std::size_t InsertAt( const Text& newText, const std::size_t insertionPosition, const std::size_t numberOfCharactersToReplace ); /** - * Creates a cursor from the supplied image - * @param[in] cursorImage the image to be used for the cursor. - * @param[in] border the nine patch border corresponding to the supplied image. - * @return the image actor to be used as the cursor. - */ - ImageActor CreateCursor( Image cursorImage, const Vector4& border ); + * Creates a cursor. + * @param[in] color the cursor color. + * @return the image actor to be used as the cursor. + */ + ImageActor CreateCursor( const Vector4 &color ); /** * Moves cursor to the right @@ -882,9 +880,8 @@ public: // Public to allow internal testing. /** * Draw a cursor / caret at position where new text should appear - * @param[in] nthChar the position along the text string in which new text should appear. */ - void DrawCursor(const std::size_t nthChar = 0); + void DrawCursor(); /** * Sets cursor visibility @@ -1019,15 +1016,6 @@ public: // Public to allow internal testing. void SetSelectionHandlePosition(SelectionHandleId handleId); /** - * Gets the visual position of a logical position. - * @note This is preferred over directly accessing the Map, as it resolves visual - * positions outside of the character map range. - * @param[in] logicalPosition The logical position - * @return Visual position is returned. - */ - std::size_t GetVisualPosition(std::size_t logicalPosition) const; - - /** * Gets a table of the visual text positions which has a flag * for each Character. The flag is either true (character selected) * or false (character deselected) @@ -1060,21 +1048,11 @@ public: // Public to allow internal testing. void AddPopupOptions(); /** - * Adds a popup option. - * @note Creates popup frame if not already created. - * @param[in] name The unique name for this option. - * @param[in] caption The caption (label) for this option - * @param[in] icon the image icon to be displayed for this option - * @param[in] finalOption Flag to indicate that this is the final option. - * (set to true on the last option you add) - */ - void AddPopupOption(const std::string& name, const std::string& caption, const Image icon, bool finalOption = false); - - /** * Sets popup position * @param[in] position The actual position for this popup. + * @param[in] alternativePosition Alternative popup position if no space in upper area. */ - void SetPopupPosition(const Vector3& position); + void SetPopupPosition(const Vector3& position, const Vector2& alternativePosition ); /** * Hides the popup @@ -1096,8 +1074,10 @@ public: // Public to allow internal testing. /** * Setup the selection popup and clipboard if relevant so the correct options are shown when ShowPopup is called. + * @param[in] showCutButton Flag to show or hide cut button, in some cases like whitespace we do not want to cut just select. + * default is true. */ - void SetUpPopUpSelection(); + void SetUpPopupSelection( bool showCutButton = true ); /** * Return the logical index containing the character position closest to the source. @@ -1164,6 +1144,15 @@ public: // Public to allow internal testing. std::size_t GetRowStartFromCharacterPosition(std::size_t logicalPosition) const; /** + * Retrieves the first character of a group of characters with the same direction. + * + * @param[in] logicalPosition Index to a character. + * + * @return Index to the character. + */ + std::size_t GetFirstCharacterWithSameDirection( std::size_t logicalPosition ) const; + + /** * Retrieve the dimensions of this row of text that the character resides on. * @param[in] characterPosition the position in the 'string' of characters. * @return The size of the rectangle representing this row @@ -1230,8 +1219,9 @@ public: // Public to allow internal testing. /** * Hide highlight shown between selection handles. + * @param[in] hidePopup flag to hide the popup too, default is to hide popup. */ - void RemoveHighlight(); + void RemoveHighlight( bool hidePopup = true ); /** * Highlights text that has been selected @@ -1344,6 +1334,18 @@ public: // Public to allow internal testing. */ void GetTextLayoutInfo(); + /** + * Set the offset for positioning Popup from the TextInput + * @param[in] offset in the order, left, top, right, bottom + */ + void SetOffsetFromText( const Vector4& offset ); + + /** + * Get the offset of the Popup from the TextInput + * @return Vector4 with the offset in the order, left, top, right, bottom + */ + const Vector4& GetOffsetFromText() const; + // Properties /** @@ -1452,7 +1454,7 @@ private: ///< the text size after layout and the scroll offset. MarkupProcessor::StyledTextArray mCurrentCopySelecton; ///< Array to store copied text. - TextInputPopup mPopUpPanel; ///< Panel to house cut and paste, select all buttons. + TextInputPopup mPopupPanel; ///< Panel to house cut and paste, select all buttons. Timer mScrollTimer; Vector2 mScrollDisplacement; @@ -1463,10 +1465,11 @@ private: Vector4 mSelectionHandleFlipMargin; Vector4 mBoundingRectangleWorldCoordinates; - Clipboard mClipboard; ///< Handle to clipboard + Clipboard mClipboard; ///< Handle to clipboard // Styling - Vector4 mMaterialColor; // Color of the highlight + Vector4 mMaterialColor; // Color of the highlight + Vector4 mPopupOffsetFromText; // Offset of Popup from the TextInput. bool mOverrideAutomaticAlignment:1; ///< Whether to override the alignment automatically set by the text content (e.g. european LTR or arabic RTL) bool mCursorRTLEnabled:1; ///< Enable state of Alternate RTL Cursor (need to keep track of this as it's not always enabled)