projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reposition the grab/selection handles position.
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
text-controller-impl.h
diff --git
a/dali-toolkit/internal/text/text-controller-impl.h
b/dali-toolkit/internal/text/text-controller-impl.h
index
e60fe37
..
f1c4bc4
100644
(file)
--- a/
dali-toolkit/internal/text/text-controller-impl.h
+++ b/
dali-toolkit/internal/text/text-controller-impl.h
@@
-21,7
+21,6
@@
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/clipboard.h>
#include <dali/devel-api/text-abstraction/font-client.h>
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/clipboard.h>
#include <dali/devel-api/text-abstraction/font-client.h>
-#include <iostream>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/layouts/layout-engine.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/layouts/layout-engine.h>
@@
-105,7
+104,6
@@
struct EventData
INACTIVE,
INTERRUPTED,
SELECTING,
INACTIVE,
INTERRUPTED,
SELECTING,
- SELECTION_CHANGED,
EDITING,
EDITING_WITH_POPUP,
EDITING_WITH_GRAB_HANDLE,
EDITING,
EDITING_WITH_POPUP,
EDITING_WITH_GRAB_HANDLE,
@@
-175,11
+173,14
@@
struct ModifyEvent
struct FontDefaults
{
FontDefaults()
struct FontDefaults
{
FontDefaults()
- : m
DefaultFontFamily(""
),
- m
DefaultFontStyle(""
),
+ : m
FontDescription(
),
+ m
FontStyle(
),
mDefaultPointSize(0.0f),
mFontId(0u)
{
mDefaultPointSize(0.0f),
mFontId(0u)
{
+ // Initially use the default platform font
+ TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+ fontClient.GetDefaultPlatformFontDescription( mFontDescription );
}
FontId GetFontId( TextAbstraction::FontClient& fontClient )
}
FontId GetFontId( TextAbstraction::FontClient& fontClient )
@@
-187,14
+188,14
@@
struct FontDefaults
if( !mFontId )
{
Dali::TextAbstraction::PointSize26Dot6 pointSize = mDefaultPointSize*64;
if( !mFontId )
{
Dali::TextAbstraction::PointSize26Dot6 pointSize = mDefaultPointSize*64;
- mFontId = fontClient.GetFontId( m
DefaultFontFamily, mDefaultFontStyle
, pointSize );
+ mFontId = fontClient.GetFontId( m
FontDescription
, pointSize );
}
return mFontId;
}
}
return mFontId;
}
-
std::string mDefaultFontFamily
;
- std::string m
Default
FontStyle;
+
TextAbstraction::FontDescription mFontDescription
;
+ std::string mFontStyle;
float mDefaultPointSize;
FontId mFontId;
};
float mDefaultPointSize;
FontId mFontId;
};
@@
-218,7
+219,7
@@
struct Controller::Impl
mOperationsPending( NO_OPERATION ),
mMaximumNumberOfCharacters( 50 ),
mRecalculateNaturalSize( true ),
mOperationsPending( NO_OPERATION ),
mMaximumNumberOfCharacters( 50 ),
mRecalculateNaturalSize( true ),
- mUserDefinedFontFamily( false)
+ mUserDefinedFontFamily( false
)
{
mLogicalModel = LogicalModel::New();
mVisualModel = VisualModel::New();
{
mLogicalModel = LogicalModel::New();
mVisualModel = VisualModel::New();
@@
-288,6
+289,14
@@
struct Controller::Impl
return ( mEventData && mEventData->mIsShowingPlaceholderText );
}
return ( mEventData && mEventData->mIsShowingPlaceholderText );
}
+ /**
+ * @brief Helper to check whether active place-holder text is available.
+ */
+ bool IsFocusedPlaceholderAvailable() const
+ {
+ return ( mEventData && !mEventData->mPlaceholderTextActive.empty() );
+ }
+
bool IsShowingRealText() const
{
return ( !IsShowingPlaceholderText() &&
bool IsShowingRealText() const
{
return ( !IsShowingPlaceholderText() &&
@@
-320,14
+329,17
@@
struct Controller::Impl
void ResetImfManager()
{
void ResetImfManager()
{
- // Reset incase we are in a pre-edit state.
- ImfManager imfManager = ImfManager::Get();
- if ( imfManager )
+ if( mEventData )
{
{
- imfManager.Reset(); // Will trigger a commit message
+ // Reset incase we are in a pre-edit state.
+ ImfManager imfManager = ImfManager::Get();
+ if ( imfManager )
+ {
+ imfManager.Reset(); // Will trigger a commit message
+ }
+
+ ClearPreEditFlag();
}
}
-
- ClearPreEditFlag();
}
bool IsClipboardEmpty()
}
bool IsClipboardEmpty()
@@
-377,7
+389,7
@@
struct Controller::Impl
void GetTextFromClipboard( unsigned int itemIndex, std::string& retreivedString );
void GetTextFromClipboard( unsigned int itemIndex, std::string& retreivedString );
- void RepositionSelectionHandles(
CharacterIndex selectionStart, CharacterIndex selectionEnd
);
+ void RepositionSelectionHandles();
void RepositionSelectionHandles( float visualX, float visualY );
void SetPopupButtons();
void RepositionSelectionHandles( float visualX, float visualY );
void SetPopupButtons();
@@
-425,18
+437,23
@@
struct Controller::Impl
/**
* @brief Updates the cursor position.
*
/**
* @brief Updates the cursor position.
*
- *
Retrieves the x,y position of the cursor logical position and sets it into the decorator
.
+ *
Sets the cursor's position into the decorator. It transforms the cursor's position into decorator's coords
.
* It sets the position of the secondary cursor if it's a valid one.
* Sets which cursors are active.
* It sets the position of the secondary cursor if it's a valid one.
* Sets which cursors are active.
+ *
+ * @param[in] cursorInfo Contains the selection handle position in Actor's coords.
+ *
*/
*/
- void UpdateCursorPosition();
+ void UpdateCursorPosition(
const CursorInfo& cursorInfo
);
/**
/**
- * @brief Updates the position of the given selection handle.
+ * @brief Updates the position of the given selection handle.
It transforms the handle's position into decorator's coords.
*
* @param[in] handleType One of the selection handles.
*
* @param[in] handleType One of the selection handles.
+ * @param[in] cursorInfo Contains the selection handle position in Actor's coords.
*/
*/
- void UpdateSelectionHandle( HandleType handleType );
+ void UpdateSelectionHandle( HandleType handleType,
+ const CursorInfo& cursorInfo );
/**
* @biref Clamps the horizontal scrolling to get the control always filled with text.
/**
* @biref Clamps the horizontal scrolling to get the control always filled with text.
@@
-469,7
+486,7
@@
struct Controller::Impl
*
* This method is called after deleting text.
*/
*
* This method is called after deleting text.
*/
- void ScrollTextToMatchCursor();
+ void ScrollTextToMatchCursor(
const CursorInfo& cursorInfo
);
ControlInterface& mControlInterface; ///< Reference to the text controller.
LogicalModelPtr mLogicalModel; ///< Pointer to the logical model.
ControlInterface& mControlInterface; ///< Reference to the text controller.
LogicalModelPtr mLogicalModel; ///< Pointer to the logical model.
@@
-488,7
+505,7
@@
struct Controller::Impl
Length mMaximumNumberOfCharacters; ///< Maximum number of characters that can be inserted.
bool mRecalculateNaturalSize:1; ///< Whether the natural size needs to be recalculated.
Length mMaximumNumberOfCharacters; ///< Maximum number of characters that can be inserted.
bool mRecalculateNaturalSize:1; ///< Whether the natural size needs to be recalculated.
- bool mUserDefinedFontFamily:1; ///< Whether the Font family was
Set by the user instead of being left as sytem default
+ bool mUserDefinedFontFamily:1; ///< Whether the Font family was
set by the user instead of being left as sytem default.
};
} // namespace Text
};
} // namespace Text