Merge "DALi Version 2.2.27" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / text-abstraction / segmentation.h
old mode 100755 (executable)
new mode 100644 (file)
index a56fa89..42df64f
@@ -1,8 +1,8 @@
-#ifndef __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H__
-#define __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H__
+#ifndef DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H
+#define DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 namespace Dali
 {
-
 namespace TextAbstraction
 {
-
 namespace Internal DALI_INTERNAL
 {
-
 class Segmentation;
 
-} // Internal
+} // namespace DALI_INTERNAL
 
-} // TextAbstraction
+} // namespace TextAbstraction
 
 namespace TextAbstraction
 {
-
 /**
  *   Segmentation API
  *
  */
 class DALI_ADAPTOR_API Segmentation : public BaseHandle
 {
-
 public:
-
   /**
    * @brief Create an uninitialized TextAbstraction handle.
    *
@@ -70,7 +64,7 @@ public:
    *
    * @param[in] implementation A pointer to the internal segmentation object.
    */
-  explicit DALI_INTERNAL Segmentation( Internal::Segmentation* implementation );
+  explicit DALI_INTERNAL Segmentation(Internal::Segmentation* implementation);
 
   /**
    * @brief Retrieve a handle to the Segmentation instance.
@@ -99,9 +93,9 @@ public:
    * @param[in] numberOfCharacters The number of characters.
    * @param[out] breakInfo The line break info.
    */
-  void GetLineBreakPositions( const Character* const text,
-                              Length numberOfCharacters,
-                              LineBreakInfo* breakInfo );
+  void GetLineBreakPositions(const Character* const text,
+                             Length                 numberOfCharacters,
+                             LineBreakInfo*         breakInfo);
 
   /**
    * @brief Retrieves the word break info.
@@ -122,13 +116,60 @@ public:
    * @param[in] numberOfCharacters The number of characters.
    * @param[out] breakInfo The word break info.
    */
-  void GetWordBreakPositions( const Character* const text,
-                              Length numberOfCharacters,
-                              WordBreakInfo* breakInfo );
+  void GetWordBreakPositions(const Character* const text,
+                             Length                 numberOfCharacters,
+                             WordBreakInfo*         breakInfo);
+
+  /**
+   * @brief Retrieves the line break info from utf8.
+   *
+   * @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 UTF8.
+   * @param[in] numberOfCharacters The number of characters.
+   * @param[out] breakInfo The line break info.
+   */
+  void GetLineBreakPositionsUtf8(const uint8_t* const text,
+                                 Length               numberOfCharacters,
+                                 LineBreakInfo*       breakInfo);
+
+  /**
+   * @brief Retrieves the word break info from utf8.
+   *
+   * @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 UTF8.
+   * @param[in] numberOfCharacters The number of characters.
+   * @param[out] breakInfo The word break info.
+   */
+  void GetWordBreakPositionsUtf8(const uint8_t* const text,
+                                 Length               numberOfCharacters,
+                                 WordBreakInfo*       breakInfo);
 };
 
 } // namespace TextAbstraction
 
 } // namespace Dali
 
-#endif // __DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H__
+#endif // DALI_PLATFORM_TEXT_ABSTRACTION_SEGMENTATION_H