From f1eb4e0a3863c919c1174fe5662542082a8e4f51 Mon Sep 17 00:00:00 2001
From: JoogabYun <40262755+JoogabYun@users.noreply.github.com>
Date: Tue, 21 Jul 2020 12:37:32 +0900
Subject: [PATCH] [NUI] Change TextPageUtil to Tizen.NUI.Utility namespace.
(#1843)
---
.../Tizen.NUI/src/public/Utility}/TextPageUtil.cs | 48 +++++++++++++++++++---
.../Tizen.NUI.Samples/Samples/TextPageSample.cs | 14 +------
2 files changed, 45 insertions(+), 17 deletions(-)
rename {test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples => src/Tizen.NUI/src/public/Utility}/TextPageUtil.cs (85%)
diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageUtil.cs b/src/Tizen.NUI/src/public/Utility/TextPageUtil.cs
similarity index 85%
rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageUtil.cs
rename to src/Tizen.NUI/src/public/Utility/TextPageUtil.cs
index 6e110ff..c188f7a 100755
--- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageUtil.cs
+++ b/src/Tizen.NUI/src/public/Utility/TextPageUtil.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
{
+
+ ///
+ /// This is a class for stroing the text of a page.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
class PageData
{
public string previousTag {get; set;}
@@ -18,6 +39,10 @@ namespace Tizen.NUI.Samples
public int endOffset {get; set;}
}
+ ///
+ /// This is a class that stores information when parsing markup text.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
class TagData
{
public string tagName {get; set;}
@@ -25,6 +50,10 @@ namespace Tizen.NUI.Samples
public bool isEndTag {get; set;}
}
+ ///
+ /// This is utility class for paging very long text.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
public class TextPageUtil
{
private static char LESS_THAN = '<';
@@ -50,7 +79,11 @@ namespace Tizen.NUI.Samples
private List characterList;
private string pageString;
-
+ ///
+ /// When text is inputed, the text is paging in the TextLabe size unit.
+ /// The total number of pages.
+ ///
+ [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;
}
+ ///
+ /// Input the page number returns the text of the page.
+ /// The text of the page.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string GetText(int pageNum)
{
if( pageNum > totalPageCnt || pageNum < 1 ) {
diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageSample.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageSample.cs
index d3399c4..f2f5096 100755
--- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageSample.cs
+++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TextPageSample.cs
@@ -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");
--
2.7.4