namespace TextAbstraction
{
-
Segmentation::Segmentation()
-:mPlugin(NULL)
+: mPlugin( NULL )
{
}
return segmentationHandle;
}
-} // namespace Segmentation
+void Segmentation::GetLineBreakPositions( const Dali::TextAbstraction::Character* const text,
+ Dali::TextAbstraction::Length numberOfCharacters,
+ Dali::TextAbstraction::LineBreakInfo* breakInfo )
+{
+}
+
+void Segmentation::GetWordBreakPositions( const Dali::TextAbstraction::Character* const text,
+ Dali::TextAbstraction::Length numberOfCharacters,
+ Dali::TextAbstraction::WordBreakInfo* breakInfo )
+{
+}
+
+} // namespace TextAbstraction
+
} // namespace Internal
+
} // namespace Dali
*/
static Dali::TextAbstraction::Segmentation Get();
+ /**
+ * @copydoc Dali::Segmentation::GetLineBreakPositions()
+ */
+ void GetLineBreakPositions( const Dali::TextAbstraction::Character* const text,
+ Dali::TextAbstraction::Length numberOfCharacters,
+ Dali::TextAbstraction::LineBreakInfo* breakInfo );
+
+
+ /**
+ * @copydoc Dali::Segmentation::GetWordBreakPositions()
+ */
+ void GetWordBreakPositions( const Dali::TextAbstraction::Character* const text,
+ Dali::TextAbstraction::Length numberOfCharacters,
+ Dali::TextAbstraction::WordBreakInfo* breakInfo );
+
private:
// Undefined copy constructor.
Segmentation::Segmentation()
{
}
+
Segmentation::~Segmentation()
{
}
-Segmentation::Segmentation(Dali::Internal::TextAbstraction::Segmentation *impl)
- : BaseHandle(impl)
+
+Segmentation::Segmentation( Dali::Internal::TextAbstraction::Segmentation* implementation )
+: BaseHandle( implementation )
{
}
return Dali::Internal::TextAbstraction::Segmentation::Get();
}
+void Segmentation::GetLineBreakPositions( const Character* const text,
+ Length numberOfCharacters,
+ LineBreakInfo* breakInfo )
+{
+ GetImplementation( *this ).GetLineBreakPositions( text,
+ numberOfCharacters,
+ breakInfo );
+}
+
+void Segmentation::GetWordBreakPositions( const Character* const text,
+ Length numberOfCharacters,
+ WordBreakInfo* breakInfo )
+{
+ GetImplementation( *this ).GetWordBreakPositions( text,
+ numberOfCharacters,
+ breakInfo );
+}
+
} // namespace TextAbstraction
} // namespace Dali
* limitations under the License.
*
*/
+
+// INTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/text-abstraction.h>
+
+// EXTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
namespace Dali
namespace TextAbstraction
{
-
/**
* Segmentation API
*
public:
- /**
- * @brief Create an uninitialized TextAbstraction handle.
- *
- */
- Segmentation();
-
- /**
- * @brief Destructor
- *
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- */
- ~Segmentation();
-
- /**
- * @brief This constructor is used by Segmentation::Get().
- *
- * @param[in] segmentation A pointer to the internal segmentation object.
- */
- explicit DALI_INTERNAL Segmentation( Dali::Internal::TextAbstraction::Segmentation* segmentation);
-
- /**
- * @brief Retrieve a handle to the Segmentation instance.
- *
- * @return A handle to the Segmentation
- */
- static Segmentation Get();
-
+ /**
+ * @brief Create an uninitialized TextAbstraction handle.
+ *
+ */
+ Segmentation();
+
+ /**
+ * @brief Destructor
+ *
+ * This is non-virtual since derived Handle types must not contain data or virtual methods.
+ */
+ ~Segmentation();
+
+ /**
+ * @brief This constructor is used by Segmentation::Get().
+ *
+ * @param[in] implementation A pointer to the internal segmentation object.
+ */
+ explicit DALI_INTERNAL Segmentation( Dali::Internal::TextAbstraction::Segmentation* implementation );
+
+ /**
+ * @brief Retrieve a handle to the Segmentation instance.
+ *
+ * @return A handle to the Segmentation
+ */
+ static Segmentation Get();
+
+ /**
+ * @brief Retrieves the line break info.
+ *
+ * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
+ *
+ * Possible values for LineBreakInfo are:
+ *
+ * - 0 is a LINE_MUST_BREAK. Text must be broken into a new line.
+ * - 1 is a LINE_ALLOW_BREAK. Is possible to break the text into a new line.
+ * - 2 is a LINE_NO_BREAK. Text can't be broken into a new line.
+ *
+ @verbatim
+ i.e. Hello big\nworld produces:
+ 2222212220 22220
+ @endverbatim
+ *
+ * @param[in] text Pointer to the first character of the text coded in UTF32.
+ * @param[in] numberOfCharacters The number of characters.
+ * @param[out] breakInfo The line break info.
+ */
+ void GetLineBreakPositions( const Character* const text,
+ Length numberOfCharacters,
+ LineBreakInfo* breakInfo );
+
+ /**
+ * @brief Retrieves the word break info.
+ *
+ * @pre @p breakInfo must have enough space allocated for @p numberOfCharacters.
+ *
+ * Possible values for WordBreakInfo are:
+ *
+ * - 0 is a WORD_BREAK. Text can be broken into a new word.
+ * - 1 is a WORD_NO_BREAK. Text can't be broken into a new word.
+ *
+ @verbatim
+ i.e. Hello big\nworld produces:
+ 1111001100 11110
+ @endverbatim
+ *
+ * @param[in] text Pointer to the first character of the text coded in UTF32.
+ * @param[in] numberOfCharacters The number of characters.
+ * @param[out] breakInfo The word break info.
+ */
+ void GetWordBreakPositions( const Character* const text,
+ Length numberOfCharacters,
+ WordBreakInfo* breakInfo );
};
} // namespace TextAbstraction
typedef uint32_t CharacterIndex; ///< An index into an array of characters
typedef uint32_t Length; ///< The length of an array
typedef uint32_t BidiInfoIndex; ///< Index to the bidirectional info for a paragraph.
+typedef char LineBreakInfo; ///< Line break info (must break, allow break, no break).
+typedef char WordBreakInfo; ///< Word break info (break, no break).
+
+/**
+ * @brief Enumerates the possible line break info values.
+ */
+enum
+{
+ LINE_MUST_BREAK = 0u, ///< Text must be broken into a new line.
+ LINE_ALLOW_BREAK = 1u, ///< Is possible to break the text into a new line.
+ LINE_NO_BREAK = 2u ///< Text can't be broken into a new line.
+};
+
+/**
+ * @brief Enumerates the possible word break info values.
+ */
+enum
+{
+ WORD_BREAK = 0u, ///< Text can be broken into a new word.
+ WORD_NO_BREAK = 1u, ///< Text can't be broken into a new word.
+};
} // namespace TextAbstraction