From 38cfe6c35e5b8e9aa0d80b60d43453841842dbaa Mon Sep 17 00:00:00 2001 From: Shrouq Sabah Date: Tue, 7 Sep 2021 17:56:35 +0300 Subject: [PATCH] Revert "Used View instead of Text Editor and Text Field to make one common API." This reverts commit eafddc9a6aeeb16189d046c4b247f2c6c203f0ee. --- .../src/public/BaseComponents/TextUtils.cs | 78 ++++++++++++++-------- 1 file changed, 49 insertions(+), 29 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs b/src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs index 7c35685..72b9973 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs @@ -1789,20 +1789,27 @@ namespace Tizen.NUI.BaseComponents /// /// Copy the previously selected text into the clipboard and return the copied value. /// - /// The textEditor/textField control from which the text is copied. + /// The textEditor control from which the text is copied. /// The copied text. + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) /// 9 - public static string CopyToClipboard(View textView) + public static string CopyToClipboard(TextEditor textEditor) { - string copiedText =""; - Type textViewType = textView.GetType(); - - if(textViewType.Equals(typeof(TextEditor))){ - copiedText = Interop.TextEditor.CopyText(textView.SwigCPtr); - }else if(textViewType.Equals(typeof(TextField))){ - copiedText = Interop.TextField.CopyText(textView.SwigCPtr); - } + string copiedText = Interop.TextEditor.CopyText(textEditor.SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return copiedText; + } + /// + /// Copy the previously selected text into the clipboard and return the copied value. + /// + /// The textField control from which the text is copied. + /// The copied text. + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + /// 9 + public static string CopyToClipboard(TextField textField) + { + string copiedText = Interop.TextField.CopyText(textField.SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return copiedText; } @@ -1810,20 +1817,27 @@ namespace Tizen.NUI.BaseComponents /// /// Cut the previously selected text from the text control and into the clipboard and return the cut value. /// - /// The textEditor/textField control from which the text is cut. + /// The textEditor control from which the text is cut. /// The cut text. + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) /// 9 - public static string CutToClipboard(View textView) + public static string CutToClipboard(TextEditor textEditor) { - string cutText = ""; - Type textViewType = textView.GetType(); - - if(textViewType.Equals(typeof(TextEditor))){ - cutText = Interop.TextEditor.CutText(textView.SwigCPtr); - }else if(textViewType.Equals(typeof(TextField))){ - cutText = Interop.TextField.CutText(textView.SwigCPtr); - } + string cutText = Interop.TextEditor.CutText(textEditor.SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return cutText; + } + /// + /// Cut the previously selected text from the text control and into the clipboard and return the cut value. + /// + /// The textField control from which the text is cut. + /// The cut text. + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + /// 9 + public static string CutToClipboard(TextField textField) + { + string cutText = Interop.TextField.CutText(textField.SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return cutText; } @@ -1831,18 +1845,24 @@ namespace Tizen.NUI.BaseComponents /// /// Paste the most recently copied/cut text from the clipboard and into the text control. /// - /// The textEditor/textField control into which the text is pasted. + /// The textEditor control into which the text is pasted. + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) /// 9 - public static void PasteTo(View textView) + public static void PasteTo(TextEditor textEditor) { - Type textViewType = textView.GetType(); - - if(textViewType.Equals(typeof(TextEditor))){ - Interop.TextEditor.PasteText(textView.SwigCPtr); - }else if(textViewType.Equals(typeof(TextField))){ - Interop.TextField.PasteText(textView.SwigCPtr); - } + Interop.TextEditor.PasteText(textEditor.SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// + /// Paste the most recently copied/cut text from the clipboard and into the text control. + /// + /// The textField control into which the text is pasted. + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + /// 9 + public static void PasteTo(TextField textField) + { + Interop.TextField.PasteText(textField.SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } -- 2.7.4