[NUI] Change TextPageUtil to Tizen.NUI.Utility namespace. (#1843)
authorJoogabYun <40262755+JoogabYun@users.noreply.github.com>
Tue, 21 Jul 2020 03:37:32 +0000 (12:37 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 8 Feb 2021 05:30:08 +0000 (14:30 +0900)
src/Tizen.NUI/src/public/Utility/TextPageUtil.cs [moved from test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageUtil.cs with 85% similarity]
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageSample.cs

@@ -1,15 +1,36 @@
-using System.Collections.Generic;
+/*
+ * Copyright (c) 2020 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
 using System;
+using System.Collections.Generic;
+using System.ComponentModel;
 using System.IO;
 
 
 using Tizen.NUI;
 using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.NUI.Wearable;
 
-namespace Tizen.NUI.Samples
+namespace Tizen.NUI.Utility
 {
+
+  /// <summary>
+  /// This is a class for stroing the text of a page.
+  /// </summary>
+  [EditorBrowsable(EditorBrowsableState.Never)]
   class PageData
   {
     public string previousTag  {get; set;}
@@ -18,6 +39,10 @@ namespace Tizen.NUI.Samples
     public int endOffset {get; set;}
   }
 
+  /// <summary>
+  /// This is a class that stores information when parsing markup text.
+  /// </summary>
+  [EditorBrowsable(EditorBrowsableState.Never)]
   class TagData
   {
     public string tagName {get; set;}
@@ -25,6 +50,10 @@ namespace Tizen.NUI.Samples
     public bool isEndTag {get; set;}
   }
 
+  /// <summary>
+  /// This is utility class for paging very long text.
+  /// </summary>
+  [EditorBrowsable(EditorBrowsableState.Never)]
   public class TextPageUtil
   {
     private static char LESS_THAN      = '<';
@@ -50,7 +79,11 @@ namespace Tizen.NUI.Samples
     private List<char> characterList;
     private string pageString;
 
-
+    /// <summary>
+    /// When text is inputed, the text is paging in the TextLabe size unit.
+    /// <returns>The total number of pages.</returns>
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
     public int SetText(TextLabel label, string str)
     {
       if(str == null) return 0;
@@ -125,6 +158,11 @@ namespace Tizen.NUI.Samples
       return totalPageCnt;
     }
 
+    /// <summary>
+    /// Input the page number returns the text of the page.
+    /// <returns>The text of the page.</returns>
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
     public string GetText(int pageNum)
     {
       if( pageNum > totalPageCnt || pageNum < 1 ) {
index d3399c4..f2f5096 100755 (executable)
@@ -1,7 +1,6 @@
 using Tizen.NUI;
 using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.NUI.Wearable;
+using Tizen.NUI.Utility;
 
 using System;
 using System.IO;
@@ -33,20 +32,11 @@ namespace Tizen.NUI.Samples
         {
             Window window = NUIApplication.GetDefaultWindow();
 
-            TextLabelStyle attr = new TextLabelStyle
-            {
-
-                BackgroundColor = Color.Yellow,
-                TextColor = Color.Blue,
-            };
-
-
-            label = new TextLabel(attr);
+            label = new TextLabel();
             label.Size = new Size(300, 700);
             label.PointSize = 11.0f;
             label.MultiLine = true;
 
-
             TextPageUtil util = new TextPageUtil();
             int pageCount = util.SetText( label, LoadTerms() );
             Tizen.Log.Error("NUI", $"pageCount: {pageCount}\n");