// EXTERNAL INCLUDES
#include <dali/public-api/common/intrusive-ptr.h>
+#include <dali/public-api/events/key-event.h>
#include <dali/public-api/math/vector3.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/object/ref-object.h>
*/
enum OperationsMask
{
- NO_OPERATION = 0x0,
- CONVERT_TO_UTF32 = 0x1,
- GET_SCRIPTS = 0x2,
- VALIDATE_FONTS = 0x4,
- GET_LINE_BREAKS = 0x8,
- GET_WORD_BREAKS = 0x10,
- SHAPE_TEXT = 0x20,
- GET_GLYPH_METRICS = 0x40,
- LAYOUT = 0x80,
- REORDER = 0x100,
- ALIGNMENT = 0x200,
- RENDER = 0x400,
- ALL_OPERATIONS = 0xFFF
+ NO_OPERATION = 0x0000,
+ CONVERT_TO_UTF32 = 0x0001,
+ GET_SCRIPTS = 0x0002,
+ VALIDATE_FONTS = 0x0004,
+ GET_LINE_BREAKS = 0x0008,
+ GET_WORD_BREAKS = 0x0010,
+ SHAPE_TEXT = 0x0020,
+ GET_GLYPH_METRICS = 0x0040,
+ LAYOUT = 0x0080,
+ UPDATE_ACTUAL_SIZE = 0x0100,
+ UPDATE_POSITIONS = 0x0200,
+ UPDATE_LINES = 0x0400,
+ REORDER = 0x0800,
+ ALIGNMENT = 0x1000,
+ RENDER = 0x2000,
+ ALL_OPERATIONS = 0xFFFF
};
public:
*
* @return A string of UTF-8 characters.
*/
- void GetText( std::string& text );
+ void GetText( std::string& text ) const;
+
+ /**
+ * @brief Replaces any placeholder text previously set.
+ *
+ * @param[in] text A string of UTF-8 characters.
+ */
+ void SetPlaceholderText( const std::string& text );
+
+ /**
+ * @brief Retrieve any placeholder text previously set.
+ *
+ * @return A string of UTF-8 characters.
+ */
+ void GetPlaceholderText( std::string& text ) const;
+
+ /**
+ * @brief Set the default font family.
+ *
+ * @param[in] defaultFontFamily The default font family.
+ */
+ void SetDefaultFontFamily( const std::string& defaultFontFamily );
+
+ /**
+ * @brief Retrieve the default font family.
+ *
+ * @return The default font family.
+ */
+ const std::string& GetDefaultFontFamily() const;
+
+ /**
+ * @brief Set the default font style.
+ *
+ * @param[in] defaultFontStyle The default font style.
+ */
+ void SetDefaultFontStyle( const std::string& defaultFontStyle );
+
+ /**
+ * @brief Retrieve the default font style.
+ *
+ * @return The default font style.
+ */
+ const std::string& GetDefaultFontStyle() const;
+
+ /**
+ * @brief Set the default point size.
+ *
+ * @param[in] defaultFontStyle The default point size.
+ */
+ void SetDefaultPointSize( float pointSize );
+
+ /**
+ * @brief Retrieve the default point size.
+ *
+ * @return The default point size.
+ */
+ float GetDefaultPointSize() const;
/**
* @brief Called to enable text input.
bool Relayout( const Vector2& size );
/**
+ * @brief Lays-out the text.
*
+ * GetNaturalSize(), GetHeightForWidth() and Relayout() calls this method.
+ *
+ * @param[in] size A the size of a bounding box to layout text within.
+ * @param[in] operations The layout operations which need to be done.
+ * @param[out] layoutSize The size of the laid-out text.
*/
- bool DoRelayout( const Vector2& size, OperationsMask operations );
+ bool DoRelayout( const Vector2& size,
+ OperationsMask operations,
+ Size& layoutSize );
/**
* @copydoc Control::GetNaturalSize()
void KeyboardFocusLostEvent();
/**
+ * @brief Caller by editable UI controls when key events are received.
+ *
+ * @param[in] event The key event.
+ */
+ bool KeyEvent( const Dali::KeyEvent& event );
+
+ /**
* @brief Caller by editable UI controls when a tap gesture occurs.
* @param[in] tapCount The number of taps.
* @param[in] x The x position relative to the top-left of the parent control.
struct Impl;
Impl* mImpl;
+ // Avoid allocating this when the user does not specify a font
+ struct FontDefaults;
+
// Avoid allocating this for non-editable controls
struct TextInput;
};