diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index 05edec98fa0..1f71c11b340 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -55,7 +55,7 @@ jobs: -- print --format=json --include-hidden \ -o Artifacts/api.json Artifacts/bin/public/ - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 if: ${{ always() }} with: name: reports @@ -72,7 +72,7 @@ jobs: dotnet-version: 3.1.x - name: Download Artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: reports path: Artifacts @@ -120,7 +120,7 @@ jobs: base-file: Artifacts/base-api.json output: Artifacts/api-comp.json - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: reports path: Artifacts/api-comp.json diff --git a/.github/workflows/deploy-documents-for-tizen-docs.yml b/.github/workflows/deploy-documents-for-tizen-docs.yml index ff84dce4f77..67fe65a9cba 100644 --- a/.github/workflows/deploy-documents-for-tizen-docs.yml +++ b/.github/workflows/deploy-documents-for-tizen-docs.yml @@ -6,7 +6,6 @@ on: workflow_dispatch: env: - DOCFX_FILE: docfx_tizen_docs.json DEPLOY_BRANCH: tizen-docs-pages CACHE_NAME: docfx-tizen-docs-pages-site @@ -15,7 +14,7 @@ jobs: build: runs-on: ubuntu-20.04 container: - image: tizendotnet/tizenfx-build-worker:2.4 + image: tizendotnet/tizenfx-build-worker:2.5 options: --ulimit nofile=10240:10240 steps: @@ -37,7 +36,6 @@ jobs: - name: Build Documents if: steps.cache-site.outputs.cache-hit != 'true' run: | - cp docfx_config/docfx.json docfx.json ./build.sh restore ./build.sh build @@ -46,7 +44,7 @@ jobs: cp .gitattributes _site/ tar cfz site.tar.gz _site/ - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: documents path: site.tar.gz @@ -56,7 +54,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: documents diff --git a/.github/workflows/deploy-documents.yml b/.github/workflows/deploy-documents.yml index ad7604338eb..017f9e0f6d2 100644 --- a/.github/workflows/deploy-documents.yml +++ b/.github/workflows/deploy-documents.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-20.04 container: - image: tizendotnet/tizenfx-build-worker:2.4 + image: tizendotnet/tizenfx-build-worker:2.5 options: --ulimit nofile=10240:10240 steps: @@ -31,14 +31,13 @@ jobs: - name: Build Documents if: steps.cache-site.outputs.cache-hit != 'true' run: | - cp docfx_config/docfx.json docfx.json ./build.sh restore ./build.sh build ./build.sh index - name: Archive Artifacts run: | tar cfz site.tar.gz _site/ - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: documents path: site.tar.gz @@ -48,7 +47,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: documents diff --git a/README.md b/README.md index f834a32c41d..6f5b6f32479 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,9 @@ TizenFX API, which allows you to access platform-specific features not covered b | Branch | API Level | Target Framework | API Reference | Platform | myget.org | nuget.org | |--------|:---------:|------------------|---------------|-------------------|-----------|------------| -|master | 12 | net6.0-tizen9.0 | [Link](https://samsung.github.io/TizenFX/master/) | Tizen vNext | [![api12_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API12.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | | -|API11 | 11 | net6.0-tizen8.0 | [Link](https://samsung.github.io/TizenFX/API11/) | Tizen 8.0 | [![api11_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API11.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | ![api11_nuget](https://img.shields.io/nuget/v/Tizen.NET.API11.svg) +|master | 13 | | [Link](https://samsung.github.io/TizenFX/master/) | Tizen vNext | [![api12_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API12.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | | +|API12 | 12 | net6.0-tizen9.0 | [Link](https://samsung.github.io/TizenFX/API12/) | Tizen 9.0 | [![api12_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API12.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api12_nuget](https://img.shields.io/nuget/v/Tizen.NET.API12.svg)](https://www.nuget.org/packages/Tizen.NET/) | +|API11 | 11 | net6.0-tizen8.0 | [Link](https://samsung.github.io/TizenFX/API11/) | Tizen 8.0 | [![api11_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API11.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api11_nuget](https://img.shields.io/nuget/v/Tizen.NET.API11.svg)](https://www.nuget.org/packages/Tizen.NET/) | |API10 | 10 | tizen10.0 | [Link](https://samsung.github.io/TizenFX/API10/) | Tizen 7.0 | [![api10_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API10.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api10_nuget](https://img.shields.io/nuget/v/Tizen.NET.API10.svg)](https://www.nuget.org/packages/Tizen.NET/) | |API9 | 9 | tizen90 | [Link](https://samsung.github.io/TizenFX/API9/) | Tizen 6.5 | [![api9_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API9.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api9_nuget](https://img.shields.io/nuget/v/Tizen.NET.API9.svg)](https://www.nuget.org/packages/Tizen.NET/) | |API8 | 8 | tizen80 | [Link](https://samsung.github.io/TizenFX/API8/) | Tizen 6.0 | [![api8_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API8.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api8_nuget](https://img.shields.io/nuget/v/Tizen.NET.API8.svg)](https://www.nuget.org/packages/Tizen.NET/) | @@ -20,7 +21,7 @@ TizenFX API, which allows you to access platform-specific features not covered b |API4 | 4 | tizen40 | [Link](https://samsung.github.io/TizenFX/API4/) | Tizen 4.0 | [![api4_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API4.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api4_nuget](https://img.shields.io/nuget/v/Tizen.NET.API4.svg)](https://www.nuget.org/packages/Tizen.NET/) | ### master -The __master__ branch is the main development branch for the Tizen .NET __API Level 12__. +The __master__ branch is the main development branch for the Tizen .NET __API Level 13__. The following NuGet packages will be published to [Tizen MyGet Gallery](https://tizen.myget.org/gallery/dotnet) and [Github Packages Registry](https://github.com/orgs/Samsung/packages?tab=packages&q=Tizen.NET) every day if there are any changes. (Nightly Build) @@ -28,13 +29,13 @@ The following NuGet packages will be published to [Tizen MyGet Gallery](https:// > - GitHub Packages Feed : ```https://nuget.pkg.github.com/Samsung/index.json``` > - GitHub Packages only supports authentication using a personal access token (classic). For more information, see [Working with the NuGet registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry) and [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) -* Tizen.NET 12.0.0.##### -* Tizen.NET.API12 12.0.0.##### -* Tizen.NET.Internals 12.0.0.##### +* Tizen.NET 13.0.0.##### +* Tizen.NET.API13 13.0.0.##### +* Tizen.NET.Internals 13.0.0.##### And, This branch is pushed to the [tizen branch](https://git.tizen.org/cgit/platform/core/csapi/tizenfx/?h=tizen) in the tizen gerrit and submitted for the next Tizen platform. -### API4 ~ API11 branches +### API4 ~ API12 branches The __API#__ branches are the release branch for Tizen .NET __API Level #__. These release branches were __FROZEN__. No new public APIs can be added to these branches, only bug fixes and internal APIs can be added. @@ -56,6 +57,7 @@ For more information, please see [Using Tizen.NET.Sdk as SDK-style](https://deve ### Minimum required versions of Tizen.NET.Sdk and Visual Studio | API Level | Target Framework | Tizen.NET.Sdk | Visual Studio | |:---------:|------------------|---------------|-------------------| +| API13 | net6.0-tizen9.0 | [Tizen .NET Workloads](https://github.com/samsung/Tizen.NET) | 2022 | | API12 | net6.0-tizen9.0 | [Tizen .NET Workloads](https://github.com/samsung/Tizen.NET) | 2022 | | API11 | net6.0-tizen8.0 | [Tizen .NET Workloads](https://github.com/samsung/Tizen.NET) | 2022 | | API10 | tizen10.0 | 1.1.9 | 2019 | @@ -95,4 +97,5 @@ You can download the latest binaries with TizenFX from the link below : | Tizen 6.5 | http://download.tizen.org/snapshots/TIZEN/Tizen-6.5/Tizen-6.5-Unified/latest/ | | Tizen 7.0 | http://download.tizen.org/snapshots/TIZEN/Tizen-7.0/Tizen-7.0-Unified/latest/ | | Tizen 8.0 | http://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Unified/latest/ | -| Tizen 9.0 | http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest | +| Tizen 9.0 | http://download.tizen.org/snapshots/TIZEN/Tizen-9.0/Tizen-9.0-Unified/latest/ | +| Tizen 10.0 | http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest | diff --git a/packaging/csapi-tizenfx.spec b/packaging/csapi-tizenfx.spec index e17a246e84c..187764d8bf3 100644 --- a/packaging/csapi-tizenfx.spec +++ b/packaging/csapi-tizenfx.spec @@ -1,7 +1,7 @@ # Auto-generated from csapi-tizenfx.spec.in by makespec.sh %define TIZEN_NET_API_VERSION 12 -%define TIZEN_NET_RPM_VERSION 12.0.0.999+nui22332 +%define TIZEN_NET_RPM_VERSION 12.0.0.999+nui22351 %define TIZEN_NET_NUGET_VERSION 12.0.0.99999 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework diff --git a/packaging/version.txt b/packaging/version.txt index d89dc7054e8..f9b9c0bac20 100755 --- a/packaging/version.txt +++ b/packaging/version.txt @@ -6,4 +6,4 @@ RPM_VERSION=12.0.0.999 NUGET_VERSION=12.0.0.99999 # RPM Version Suffix -RPM_VERSION_SUFFIX=nui22332 +RPM_VERSION_SUFFIX=nui22351 diff --git a/src/Tizen.AIAvatar/Tizen.AIAvatar.csproj b/src/Tizen.AIAvatar/Tizen.AIAvatar.csproj index 68314141a71..63f5918ca9d 100644 --- a/src/Tizen.AIAvatar/Tizen.AIAvatar.csproj +++ b/src/Tizen.AIAvatar/Tizen.AIAvatar.csproj @@ -7,7 +7,6 @@ - @@ -16,7 +15,6 @@ - diff --git a/src/Tizen.AIAvatar/src/AIServices/BaseAIService.cs b/src/Tizen.AIAvatar/src/AIServices/BaseAIService.cs new file mode 100644 index 00000000000..c9a18196cf9 --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/BaseAIService.cs @@ -0,0 +1,82 @@ +/* + * Copyright(c) 2024 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.ComponentModel; + +namespace Tizen.AIAvatar +{ + /// + /// Abstract base class for AI services, providing common functionalities. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public abstract class BaseAIService : IAIService, IDisposable + { + /// + /// Gets the name of the AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public abstract string ServiceName { get; } + + /// + /// Gets the capabilities of the AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public abstract ServiceCapabilities Capabilities { get; } + + /// + /// Gets the service client manager responsible for managing client operations. + /// + protected ServiceClientManager ClientManager { get; } + + /// + /// Gets the configuration settings for the AI service. + /// + protected AIServiceConfiguration Configuration { get; } + + /// + /// Initializes a new instance of the class with the specified configuration. + /// + /// The configuration settings for the AI service. + protected BaseAIService(AIServiceConfiguration config) + { + Configuration = config; + ClientManager = new ServiceClientManager(config); + } + + /// + /// Releases all resources used by the AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Releases all resources used by the AI service. + /// + protected virtual void Dispose(bool disposing) + { + if (disposing && ClientManager != null) + { + ClientManager.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/Tizen.AIAvatar/src/AIServices/Core/AIServiceData.cs b/src/Tizen.AIAvatar/src/AIServices/Core/AIServiceData.cs new file mode 100644 index 00000000000..c75e9d49026 --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/Core/AIServiceData.cs @@ -0,0 +1,185 @@ +/* + * Copyright(c) 2024 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; + + +namespace Tizen.AIAvatar +{ + /// + /// Provides data for LLM response events. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class llmResponseEventArgs : EventArgs + { + /// + /// Gets or sets the task ID associated with the LLM response. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int TaskID { get; set; } + + /// + /// Gets or sets the response text from the LLM. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Text { get; set; } + + /// + /// Gets or sets the error message, if any, from the LLM response. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Error { get; set; } + } + + /// + /// Provides data for TTS streaming events. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class ttsStreamingEventArgs : EventArgs + { + /// + /// Gets or sets the audio data of the current chunk. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public byte[] AudioData { get; set; } + + /// + /// Gets or sets the sample rate of the audio data. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int SampleRate { get; set; } + + /// + /// Gets or sets the text being converted to speech. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Text { get; set; } + + /// + /// Gets or sets the voice used for the TTS conversion. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Voice { get; set; } + + /// + /// Gets or sets the size of the current audio data chunk in bytes. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int AudioBytes { get; set; } + + /// + /// Gets or sets the total number of bytes for the audio data. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int TotalBytes { get; set; } + + /// + /// Gets or sets the number of bytes processed so far. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int ProcessedBytes { get; set; } + + /// + /// Gets or sets the progress percentage of the TTS processing. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public double ProgressPercentage { get; set; } + + /// + /// Gets or sets the error message, if any, during the TTS process. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Error { get; set; } + } + + /// + /// Provides data for STT streaming events. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class sttStreamingEventArgs : EventArgs + { + /// + /// Gets or sets a value indicating whether the text is interim. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Interim { get; set; } + + /// + /// Gets or sets the transcribed text from the STT process. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Text { get; set; } + + /// + /// Gets or sets the error message, if any, during the STT process. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Error { get; set; } + } + + /// + /// Represents service endpoints for AI services. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class ServiceEndpoints + { + /// + /// Gets or sets the endpoint for the LLM service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string LLMEndpoint { get; set; } + + /// + /// Gets or sets the endpoint for the Text-to-Speech service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string TextToSpeechEndpoint { get; set; } + + /// + /// Gets or sets the endpoint for the Speech-to-Text service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string SpeechToTextEndpoint { get; set; } + } + + /// + /// Represents the configuration for an AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public abstract class AIServiceConfiguration + { + /// + /// Gets or sets the API key for the AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string ApiKey { get; set; } + + /// + /// Gets or sets the service endpoints. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public ServiceEndpoints Endpoints { get; set; } + + /// + /// Gets or sets additional settings for the AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Dictionary AdditionalSettings { get; set; } = new(); + } +} diff --git a/src/Tizen.AIAvatar/src/Multimedia/Audio/AudioOptions.cs b/src/Tizen.AIAvatar/src/AIServices/Core/IAIService.cs similarity index 50% rename from src/Tizen.AIAvatar/src/Multimedia/Audio/AudioOptions.cs rename to src/Tizen.AIAvatar/src/AIServices/Core/IAIService.cs index 2ac9305159e..d82f4aac12a 100644 --- a/src/Tizen.AIAvatar/src/Multimedia/Audio/AudioOptions.cs +++ b/src/Tizen.AIAvatar/src/AIServices/Core/IAIService.cs @@ -15,51 +15,65 @@ * */ +using System; using System.ComponentModel; -using Tizen.Multimedia; namespace Tizen.AIAvatar { /// - /// Provides the ability to audio + /// Defines the capabilities that an AI service can support. /// + [Flags] [EditorBrowsable(EditorBrowsableState.Never)] - internal class AudioOptions + public enum ServiceCapabilities { - private int sampleRate; - private AudioChannel channel; - private AudioSampleType sampleType; + /// + /// No capabilities. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + None = 0, + + /// + /// Capability for Text-to-Speech service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + TextToSpeech = 1, + + /// + /// Capability for Speech-to-Text service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + SpeechToText = 2, /// - /// Initializes a new instance of the AudioOptions class with the specified sample rate, channel, and sampleType. + /// Capability for Large Language Model service. /// - /// the audio sample rate (8000 ~ 192000Hz) - /// the audio channel type. - /// the audio sample type. [EditorBrowsable(EditorBrowsableState.Never)] - public AudioOptions(int sampleRate, AudioChannel channel, AudioSampleType sampleType) - { - this.sampleRate = sampleRate; - this.channel = channel; - this.sampleType = sampleType; - } + LargeLanguageModel = 4, /// - /// The audio sample rate (8000 ~ 192000Hz) + /// Capability for Vision-related service. /// [EditorBrowsable(EditorBrowsableState.Never)] - public int SampleRate { get => sampleRate; set => sampleRate = value; } + Vision = 8 + } + /// + /// Represents a generic AI service interface. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public interface IAIService + { /// - /// The audio channel type + /// Gets the name of the AI service. /// [EditorBrowsable(EditorBrowsableState.Never)] - public AudioChannel Channel { get => channel; set => channel = value; } + string ServiceName { get; } /// - /// The audio sample type + /// Gets the capabilities of the AI service. /// [EditorBrowsable(EditorBrowsableState.Never)] - public AudioSampleType SampleType { get => sampleType; set => sampleType = value; } + ServiceCapabilities Capabilities { get; } } } diff --git a/src/Tizen.AIAvatar/src/AIServices/Core/IAIServiceFeatures.cs b/src/Tizen.AIAvatar/src/AIServices/Core/IAIServiceFeatures.cs new file mode 100644 index 00000000000..6df878534ce --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/Core/IAIServiceFeatures.cs @@ -0,0 +1,128 @@ +/* + * Copyright(c) 2024 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 System.Threading.Tasks; + + +namespace Tizen.AIAvatar +{ + /// + /// Interface for a Text-to-Speech service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public interface ITextToSpeechService + { + /// + /// Occurs when the Text-to-Speech service starts processing. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + event EventHandler OnTtsStart; + + /// + /// Occurs when the Text-to-Speech service is receiving data. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + event EventHandler OnTtsReceiving; + + /// + /// Occurs when the Text-to-Speech service finishes processing. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + event EventHandler OnTtsFinish; + + /// + /// Converts the given text to speech asynchronously and returns the audio data. + /// + /// The text to be converted to speech. + /// Optional parameter to specify the voice type. + /// Optional parameters for customizing speech output. + /// A task representing the asynchronous operation, with a byte array of the generated audio data. + [EditorBrowsable(EditorBrowsableState.Never)] + Task TextToSpeechAsync( + string text, + string voice = null, + Dictionary options = null); + + /// + /// Streams the given text as speech asynchronously. + /// + /// The text to be converted to speech. + /// Optional parameter to specify the voice type. + /// Optional parameters for customizing speech output. + /// A task representing the asynchronous operation. + [EditorBrowsable(EditorBrowsableState.Never)] + Task TextToSpeechStreamAsync( + string text, + string voice = null, + Dictionary options = null); + } + + /// + /// Interface for a Speech-to-Text service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public interface ISpeechToTextService + { + /// + /// Converts the given audio data to text asynchronously. + /// + /// The audio data to be converted to text. + /// Optional parameters for customizing the transcription. + /// A task representing the asynchronous operation, with the resulting transcribed text. + [EditorBrowsable(EditorBrowsableState.Never)] + Task SpeechToTextAsync( + byte[] audioData, + Dictionary options = null); + + /// + /// Streams the given audio data to text asynchronously. + /// + /// The audio stream to be converted to text. + /// Optional parameters for customizing the transcription. + /// A task representing the asynchronous operation. + [EditorBrowsable(EditorBrowsableState.Never)] + Task StreamSpeechToTextAsync( + Stream audioStream, + Dictionary options = null); + } + + /// + /// Interface for a Large Language Model (LLM) service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public interface ILLMService + { + /// + /// Occurs when a response is generated by the LLM service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + event EventHandler ResponseHandler; + + /// + /// Generates a response to the given message asynchronously. + /// + /// The input message to be processed by the LLM. + /// Optional parameters for customizing the LLM output. + /// A task representing the asynchronous operation. + [EditorBrowsable(EditorBrowsableState.Never)] + Task GenerateTextAsync(string message, Dictionary options = null); + } +} diff --git a/src/Tizen.AIAvatar/src/AIServices/Core/Prompt.cs b/src/Tizen.AIAvatar/src/AIServices/Core/Prompt.cs new file mode 100644 index 00000000000..a3707d4ce5d --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/Core/Prompt.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; + +namespace Tizen.AIAvatar +{ + internal class Message + { + public string role { get; set; } + public string content { get; set; } + } + + internal class Prompt + { + public string model { get; set; } + public List messages { get; set; } + public double temperature { get; set; } + public int seed { get; set; } + } +} diff --git a/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/IRestClient.cs b/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/IRestClient.cs new file mode 100644 index 00000000000..f79415ccc6e --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/IRestClient.cs @@ -0,0 +1,78 @@ +/* + * Copyright(c) 2024 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.ComponentModel; +using System.Net; +using System.Threading.Tasks; + +namespace Tizen.AIAvatar +{ + + /// + /// Represents the response from a REST API call, containing information such as status, content, and potential error messages. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class RestResponse + { + /// + /// Indicates whether the request was successful. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool IsSuccessful { get; set; } + + /// + /// The HTTP status code returned by the server, providing information about the response status. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public HttpStatusCode StatusCode { get; set; } + + /// + /// The content of the response as a string, typically containing the body of the HTTP response. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Content { get; set; } + + /// + /// The raw bytes of the response, which can be useful for handling non-text data or binary responses. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public byte[] RawBytes { get; set; } + + /// + /// The error message if the request failed, providing details about what went wrong. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string ErrorMessage { get; set; } + } + + /// + /// Interface for making REST API calls, providing functionality to execute HTTP requests and receive responses. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public interface IRestClient : IDisposable + { + /// + /// Executes a REST request asynchronously and returns the response from the server. + /// + /// The REST request to execute, containing information such as endpoint, headers, and parameters. + /// A task representing the asynchronous operation, which returns the REST response containing status, content, and any errors. + /// Thrown when the request parameter is null. + [EditorBrowsable(EditorBrowsableState.Never)] + Task ExecuteAsync(RestRequest request); + } +} \ No newline at end of file diff --git a/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/RestClient.cs b/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/RestClient.cs new file mode 100644 index 00000000000..d7cf0560636 --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/RestClient.cs @@ -0,0 +1,97 @@ +/* + * Copyright(c) 2024 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.ComponentModel; +using System.Net.Http; +using System.Threading.Tasks; + + +namespace Tizen.AIAvatar +{ + /// + /// A class that provides methods to execute REST requests and handle responses. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class RestClient : IRestClient + { + private readonly HttpClient _httpClient; + + /// + /// Initializes a new instance of the RestClient class with the specified HttpClient. + /// + /// The HttpClient instance to use for sending HTTP requests. + [EditorBrowsable(EditorBrowsableState.Never)] + public RestClient(HttpClient httpClient) + { + _httpClient = httpClient; + } + + /// + /// Executes a REST request asynchronously and returns the response. + /// + /// The RestRequest object containing details of the request. + /// A RestResponse object representing the result of the request. + /// Thrown when an error occurs during the request execution. + [EditorBrowsable(EditorBrowsableState.Never)] + public async Task ExecuteAsync(RestRequest request) + { + using var httpRequest = request?.CreateRequestMessage(_httpClient.BaseAddress); + + try + { + using var httpResponse = await _httpClient.SendAsync(httpRequest); + var response = new RestResponse + { + StatusCode = httpResponse.StatusCode, + IsSuccessful = httpResponse.IsSuccessStatusCode + }; + + if (httpResponse.Content != null) + { + response.RawBytes = await httpResponse.Content.ReadAsByteArrayAsync(); + response.Content = await httpResponse.Content.ReadAsStringAsync(); + } + + if (!httpResponse.IsSuccessStatusCode) + + { + response.ErrorMessage = $"HTTP {(int)httpResponse.StatusCode} - {httpResponse.ReasonPhrase}"; + } + + return response; + } + catch (Exception ex) + { + return new RestResponse + { + IsSuccessful = false, + ErrorMessage = ex.Message + }; + } + } + + /// + /// Disposes of the resources used by the RestClient. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Dispose() + { + _httpClient?.Dispose(); + } + } +} diff --git a/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/RestRequest.cs b/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/RestRequest.cs new file mode 100644 index 00000000000..4d6ca754319 --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/RestRequest.cs @@ -0,0 +1,219 @@ +/* + * Copyright(c) 2024 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.Text.Json; +using System.Text; +using System; +using System.Net.Http; +using System.Collections.Generic; +using System.Text.Json.Serialization; +using System.ComponentModel; + +namespace Tizen.AIAvatar +{ + /// + /// An enumeration representing various HTTP methods. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum Method + { + /// + /// Represents the HTTP GET method. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Get, + + /// + /// Represents the HTTP POST method. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Post, + + /// + /// Represents the HTTP PUT method. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Put, + + /// + /// Represents the HTTP DELETE method. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Delete, + + /// + /// Represents the HTTP PATCH method. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Patch + } + + /// + /// Represents a RESTful API request. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class RestRequest + { + /// + /// Initializes a new instance of the RestRequest class with the specified HTTP method. + /// + /// The HTTP method to use for the request. + [EditorBrowsable(EditorBrowsableState.Never)] + public RestRequest(Method method) + { + Resource = string.Empty; + Method = method; + _headers = new Dictionary(); + } + + /// + /// Initializes a new instance of the RestRequest class with the specified resource and HTTP method. + /// + /// The resource URI for the request. + /// The HTTP method to use for the request. + [EditorBrowsable(EditorBrowsableState.Never)] + public RestRequest(string resource, Method method) + { + Resource = resource; + Method = method; + _headers = new Dictionary(); + } + + /// + /// Adds a header to the request. + /// + /// The name of the header. + /// The value of the header. + /// The current instance of RestRequest. + [EditorBrowsable(EditorBrowsableState.Never)] + public RestRequest AddHeader(string name, string value) + { + _headers[name] = value; + return this; + } + + /// + /// Adds a JSON body to the request. + /// + /// The object to serialize as JSON and include in the request body. + /// The current instance of RestRequest. + [EditorBrowsable(EditorBrowsableState.Never)] + public RestRequest AddJsonBody(object body) + { + _body = body; + _jsonStringBody = null; // Clear json string if object body is set + if (!_headers.ContainsKey("Content-Type")) + { + _headers["Content-Type"] = "application/json"; + } + return this; + } + + /// + /// Adds a JSON string body to the request. + /// + /// The JSON string to include in the request body. + /// The current instance of RestRequest. + [EditorBrowsable(EditorBrowsableState.Never)] + public RestRequest AddJsonStringBody(string jsonString) + { + _jsonStringBody = jsonString; + _body = null; // Clear object body if json string is set + if (!_headers.ContainsKey("Content-Type")) + { + _headers["Content-Type"] = "application/json"; + } + return this; + } + + /// + /// The resource URI for the request. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Resource { get; } + + /// + /// The HTTP method to use for the request. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Method Method { get; } + + /// + /// Creates an HttpRequestMessage based on the current RestRequest instance. + /// + /// The base address to use when constructing the request URI. + /// A new HttpRequestMessage representing the current RestRequest. + internal HttpRequestMessage CreateRequestMessage(Uri baseAddress) + { + // If Resource is empty, use only the baseAddress + var requestUri = string.IsNullOrEmpty(Resource) ? baseAddress : new Uri(baseAddress, Resource); + + var request = new HttpRequestMessage(GetHttpMethod(), requestUri); + + foreach (var header in _headers) + { + request.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + + if (_jsonStringBody != null) + { + request.Content = new StringContent(_jsonStringBody, Encoding.UTF8, "application/json"); + } + else if (_body != null) + { + var jsonBody = JsonSerializer.Serialize(_body, new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }); + request.Content = new StringContent(jsonBody, Encoding.UTF8, "application/json"); + } + + return request; + } + + /// + /// Gets the appropriate HttpMethod for the specified Method enumeration value. + /// + /// The corresponding HttpMethod. + private HttpMethod GetHttpMethod() + { + return Method switch + { + Method.Get => HttpMethod.Get, + Method.Post => HttpMethod.Post, + Method.Put => HttpMethod.Put, + Method.Delete => HttpMethod.Delete, + Method.Patch => HttpMethod.Patch, + _ => throw new ArgumentException($"Unsupported HTTP method: {Method}") + }; + } + + + + /// + /// A dictionary containing the headers for the request. + /// + private readonly Dictionary _headers; + + /// + /// The object to serialize as JSON and include in the request body. + /// + private object _body; + + /// + /// The JSON string to include in the request body. + /// + private string _jsonStringBody; + } +} \ No newline at end of file diff --git a/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/ServiceClientManager.cs b/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/ServiceClientManager.cs new file mode 100644 index 00000000000..1aaf70e79fa --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/Core/RestClient/ServiceClientManager.cs @@ -0,0 +1,77 @@ +/* + * Copyright(c) 2024 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.Net.Http; + +namespace Tizen.AIAvatar +{ + /// + /// Manages REST clients for different endpoints based on the AI service configuration. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class ServiceClientManager : IDisposable + { + private readonly Dictionary _clients = new(); + private readonly AIServiceConfiguration _config; + + /// + /// Initializes a new instance of the class. + /// + /// The AI service configuration. + [EditorBrowsable(EditorBrowsableState.Never)] + public ServiceClientManager(AIServiceConfiguration config) + { + _config = config; + } + + /// + /// Retrieves or creates a REST client for the specified endpoint. + /// + /// The base URI of the endpoint. + /// The REST client for the specified endpoint. + [EditorBrowsable(EditorBrowsableState.Never)] + public IRestClient GetClient(string endpoint) + { + if (!_clients.ContainsKey(endpoint)) + { + var client = new RestClient(new HttpClient + { + BaseAddress = new Uri(endpoint) + }); + _clients[endpoint] = client; + } + return _clients[endpoint]; + } + + /// + /// Releases all resources used by the . + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Dispose() + { + foreach (var client in _clients.Values) + { + client?.Dispose(); + } + _clients.Clear(); + } + } +} \ No newline at end of file diff --git a/src/Tizen.AIAvatar/src/AIServices/OpenAIService.cs b/src/Tizen.AIAvatar/src/AIServices/OpenAIService.cs new file mode 100644 index 00000000000..f6b231f9698 --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/OpenAIService.cs @@ -0,0 +1,280 @@ +/* + * Copyright(c) 2024 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.Text.Json; +using System.Threading.Tasks; + +namespace Tizen.AIAvatar +{ + /// + /// Configuration class for OpenAI services. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class OpenAIConfiguration : AIServiceConfiguration + { + /// + /// Initializes a new instance of the class with default endpoint settings. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public OpenAIConfiguration() + { + Endpoints = new ServiceEndpoints + { + LLMEndpoint = "https://api.openai.com/v1/chat/", + TextToSpeechEndpoint = "https://api.openai.com/v1/audio/" + }; + } + + /// + /// Gets or sets the default model to use for LLM services. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Model { get; set; } = "gpt-3.5-turbo"; + + /// + /// Gets or sets the OpenAI organization ID for accessing specific organizational resources. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Organization { get; set; } + } + + /// + /// OpenAI Service implementation that provides Text-to-Speech and LLM services. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class OpenAIService : BaseAIService, ITextToSpeechService, ILLMService + { + private readonly OpenAIConfiguration config; + + /// + /// Occurs when a response is generated by the LLM service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler ResponseHandler; + + /// + /// Occurs when the Text-to-Speech service starts processing. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler OnTtsStart; + + /// + /// Occurs when the Text-to-Speech service is receiving data. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler OnTtsReceiving; + + /// + /// Occurs when the Text-to-Speech service finishes processing. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler OnTtsFinish; + + /// + /// Gets the name of the AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override string ServiceName => "OpenAI"; + + /// + /// Gets the capabilities supported by this AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override ServiceCapabilities Capabilities => + ServiceCapabilities.TextToSpeech | ServiceCapabilities.LargeLanguageModel; + + /// + /// Initializes a new instance of the class with the specified configuration. + /// + /// The configuration for the OpenAI Service. + [EditorBrowsable(EditorBrowsableState.Never)] + public OpenAIService(OpenAIConfiguration config) : base(config) + { + this.config = config; + } + + /// + /// Generates a response from the LLM service asynchronously. + /// + /// The input message to be processed by the LLM. + /// Optional parameters for customizing the LLM output. + /// A task representing the asynchronous operation. + [EditorBrowsable(EditorBrowsableState.Never)] + public async Task GenerateTextAsync(string message, Dictionary options = null) + { + var client = ClientManager.GetClient(config.Endpoints.LLMEndpoint); + var messages = new List + { + new { role = "user", content = message } + }; + + var request = new RestRequest("completions", Method.Post) + .AddHeader("Authorization", $"Bearer {config.ApiKey}") + .AddJsonBody(new + { + model = config.Model, + messages = messages, + temperature = options?.GetValueOrDefault("temperature", 0.7), + max_tokens = options?.GetValueOrDefault("max_tokens", 1000) + }); + + var response = await client.ExecuteAsync(request).ConfigureAwait(false); + + if (!response.IsSuccessful) + { + ResponseHandler?.Invoke(this, new llmResponseEventArgs { Error = response.ErrorMessage }); + return; + } + + var jsonResponse = JsonSerializer.Deserialize(response.Content); + string content = jsonResponse + .GetProperty("choices")[0] + .GetProperty("message") + .GetProperty("content") + .GetString(); + + ResponseHandler?.Invoke(this, new llmResponseEventArgs { Text = content }); + } + + /// + /// Converts the given text to speech asynchronously and returns the audio data. + /// + /// The text to be converted to speech. + /// Optional parameter to specify the voice type. + /// Optional parameters for customizing speech output. + /// A task representing the asynchronous operation, with a byte array of the generated audio data. + [EditorBrowsable(EditorBrowsableState.Never)] + public async Task TextToSpeechAsync( + string text, + string voice = null, + Dictionary options = null) + { + var client = ClientManager.GetClient(config.Endpoints.TextToSpeechEndpoint); + + var request = new RestRequest("speech", Method.Post) + .AddHeader("Authorization", $"Bearer {config.ApiKey}") + .AddJsonBody(new + { + model = "tts-1", + input = text, + voice = voice ?? "alloy", + response_format = "mp3" + }); + + var response = await client.ExecuteAsync(request); + if (!response.IsSuccessful) + throw new Exception($"OpenAI TTS Error: {response.ErrorMessage}"); + + return response.RawBytes; + } + + /// + /// Streams the given text as speech asynchronously. + /// + /// The text to be converted to speech. + /// Optional parameter to specify the voice type. + /// Optional parameters for customizing speech output. + /// A task representing the asynchronous operation. + [EditorBrowsable(EditorBrowsableState.Never)] + public async Task TextToSpeechStreamAsync(string text, string voice = null, Dictionary options = null) + { + const int SAMPLE_RATE = 24000; + const int FRAME_DURATION_MS = 160; + const int TAIL_DURATION_MS = 15; + const int BYTES_PER_SAMPLE = 2; + const int CHUNK_SIZE = (SAMPLE_RATE * FRAME_DURATION_MS * BYTES_PER_SAMPLE) / 1000; + const int TAIL_CHUNK_SIZE = (SAMPLE_RATE * TAIL_DURATION_MS * BYTES_PER_SAMPLE) / 1000; + + var client = ClientManager.GetClient(config.Endpoints.TextToSpeechEndpoint); + var request = new RestRequest("speech", Method.Post) + .AddHeader("Authorization", $"Bearer {config.ApiKey}") + .AddJsonBody(new + { + model = "tts-1", + input = text, + voice = voice ?? "alloy", + response_format = "pcm" + }); + + try + { + OnTtsStart?.Invoke(this, new ttsStreamingEventArgs + { + Text = text, + Voice = voice ?? "alloy", + SampleRate = SAMPLE_RATE, + TotalBytes = 0, + AudioData = Array.Empty() + }); + + var response = await client.ExecuteAsync(request).ConfigureAwait(false); + if (!response.IsSuccessful) + { + throw new Exception($"OpenAI TTS Error: {response.ErrorMessage}"); + } + + var audioData = response.RawBytes; + var totalBytes = audioData.Length; + var bytesProcessed = 0; + + // Process the audio data in 160ms chunks + while (bytesProcessed < totalBytes) + { + var remainingBytes = totalBytes - bytesProcessed; + var currentChunkSize = Math.Min(CHUNK_SIZE + TAIL_CHUNK_SIZE, remainingBytes); + var chunk = new byte[currentChunkSize]; + Array.Copy(audioData, bytesProcessed, chunk, 0, currentChunkSize); + bytesProcessed += Math.Min(CHUNK_SIZE, remainingBytes); + + OnTtsReceiving?.Invoke(this, new ttsStreamingEventArgs + { + Text = text, + Voice = voice ?? "alloy", + TotalBytes = totalBytes, + ProcessedBytes = bytesProcessed, + ProgressPercentage = (double)bytesProcessed / totalBytes * 100, + AudioData = chunk + }); + } + + OnTtsFinish?.Invoke(this, new ttsStreamingEventArgs + { + Text = text, + Voice = voice ?? "alloy", + TotalBytes = totalBytes, + ProcessedBytes = totalBytes, + ProgressPercentage = 100, + AudioData = Array.Empty() + }); + } + catch (Exception ex) + { + OnTtsFinish?.Invoke(this, new ttsStreamingEventArgs + { + Text = text, + Voice = voice ?? "alloy", + Error = ex.Message, + AudioData = Array.Empty() + }); + throw; + } + } + } +} diff --git a/src/Tizen.AIAvatar/src/AIServices/SamsungAIService.cs b/src/Tizen.AIAvatar/src/AIServices/SamsungAIService.cs new file mode 100644 index 00000000000..e032d61ebaa --- /dev/null +++ b/src/Tizen.AIAvatar/src/AIServices/SamsungAIService.cs @@ -0,0 +1,444 @@ +/* + * Copyright(c) 2024 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 System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using Tizen.Uix.Tts; + + +namespace Tizen.AIAvatar +{ + /// + /// Configuration class for Samsung AI services. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class SamsungAIConfiguration : AIServiceConfiguration + { + /// + /// Initializes a new instance of the class with default endpoint settings. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public SamsungAIConfiguration() + { + Endpoints = new ServiceEndpoints + { + LLMEndpoint = "https://playground-api.sec.samsung.net/api/v1/chat/completions", + TextToSpeechEndpoint = "OnDevice" + }; + } + + /// + /// Gets or sets the default model to use for LLM services. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Model { get; set; } = "chat-65b-32k-1.1.2"; + + /// + /// Gets or sets the small model version for LLM services. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string SmallModel { get; set; } = "Gauss.L-1B-0.1.1"; + } + + /// + /// Samsung AI Service implementation that provides Text-to-Speech and LLM services. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class SamsungAIService : BaseAIService, ITextToSpeechService, ILLMService + { + private readonly SamsungAIConfiguration config; + private readonly TtsClient ttsHandle; + private TaskCompletionSource ttsCompletionSource; + + // Audio-related constants + private const float audioLengthFactor = 0.16f; + private const float audioTailLengthFactor = 0.015f; + private const float audioBufferMultiflier = 2f; + + + private int audioLength; + private int desiredBufferLength; + private int audioTailLength; + private byte[] recordedBuffer; + private byte[] audioMainBuffer; + private List audioSyncBuffer; + private float desiredBufferDuration = audioLengthFactor + audioTailLengthFactor; + + /// + /// Occurs when a response is generated by the LLM service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler ResponseHandler; + + /// + /// Occurs when the Text-to-Speech service starts processing. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler OnTtsStart; + + /// + /// Occurs when the Text-to-Speech service is receiving data. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler OnTtsReceiving; + + /// + /// Occurs when the Text-to-Speech service finishes processing. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler OnTtsFinish; + + /// + /// Gets the name of the AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override string ServiceName => "SamsungResearch"; + + /// + /// Gets the capabilities supported by this AI service. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override ServiceCapabilities Capabilities => + ServiceCapabilities.TextToSpeech | ServiceCapabilities.LargeLanguageModel; + + /// + /// Initializes a new instance of the class with the specified configuration. + /// + /// The configuration for the Samsung AI Service. + [EditorBrowsable(EditorBrowsableState.Never)] + public SamsungAIService(SamsungAIConfiguration config) : base(config) + { + this.config = config; + + try + { + ttsHandle = new TtsClient(); + ttsHandle.SynthesizedPcm += TtsSynthesizedPCM; + ttsHandle.PlayingMode = PlayingMode.ByClient; + + ttsHandle.Prepare(); + + GetSupportedVoices(); + } + catch (Exception e) + { + throw new Exception($"[ERROR] Failed to prepare TTS {e.Message}"); + } + } + + /// + /// Generates a response from the LLM service asynchronously. + /// + /// The input message to be processed by the LLM. + /// Optional parameters for customizing the LLM output. + /// A task representing the asynchronous operation. + [EditorBrowsable(EditorBrowsableState.Never)] + public async Task GenerateTextAsync(string message, Dictionary options = null) + { + var client = ClientManager.GetClient(config.Endpoints.LLMEndpoint); + + var request = new RestRequest(Method.Post) + .AddHeader("Authorization", $"Bearer {config.ApiKey}"); + + int taskID = (int)(options?.GetValueOrDefault("TaskID", 0) ?? 0); + + if (options != null && options.TryGetValue("promptFilePath", out var jsonFilePathObj) && jsonFilePathObj is string jsonFilePath) + { + // Read JSON file content + if (File.Exists(jsonFilePath)) + { + try + { + var jsonContent = await File.ReadAllTextAsync(jsonFilePath).ConfigureAwait(false); + Prompt prompt = JsonSerializer.Deserialize(jsonContent); + var msg = prompt.messages.Last(); + msg.content = String.Format(msg.content, message); + + request.AddJsonBody(prompt); + } + catch (Exception ex) + { + ResponseHandler?.Invoke(this, new llmResponseEventArgs { TaskID = taskID, Error = ex.Message }); + return; + } + } + else + { + ResponseHandler?.Invoke(this, new llmResponseEventArgs { TaskID = taskID, Error = $"File not found: {jsonFilePath}" }); + return; + } + } + else + { + + var messages = new List + { + new { role = "user", content = message } + }; + // Add the default body if no JSON file is provided + request.AddJsonBody(new + { + model = config.Model, + messages = messages, + temperature = options?.GetValueOrDefault("temperature", 0.5) ?? 0.5, + seed = options?.GetValueOrDefault("seed", 0) + }); + } + + var response = await client.ExecuteAsync(request).ConfigureAwait(false); + if (!response.IsSuccessful) + { + ResponseHandler?.Invoke(this, new llmResponseEventArgs { TaskID = taskID, Error = response.ErrorMessage }); + return; + } + + var jsonResponse = JsonSerializer.Deserialize(response.Content); + string content = jsonResponse.GetProperty("response").GetProperty("content").GetString(); + + ResponseHandler?.Invoke(this, new llmResponseEventArgs { TaskID = taskID, Text = content }); + } + + /// + /// Converts the given text to speech asynchronously and returns the audio data. + /// + /// The text to be converted to speech. + /// Optional parameter to specify the voice type. + /// Optional parameters for customizing speech output. + /// A task representing the asynchronous operation, with a byte array of the generated audio data. + [EditorBrowsable(EditorBrowsableState.Never)] + public async Task TextToSpeechAsync(string text, string voice = null, Dictionary options = null) + { + audioSyncBuffer = new List(); + + await TextToSpeechStreamAsync(text,voice, options).ConfigureAwait(false); + + return audioSyncBuffer.ToArray(); + } + + /// + /// Streams the given text as speech asynchronously. + /// + /// The text to be converted to speech. + /// The voice type to be used for the speech. + /// Optional parameters for customizing speech output. + /// A task representing the asynchronous operation. + [EditorBrowsable(EditorBrowsableState.Never)] + public async Task TextToSpeechStreamAsync(string text, string voice, Dictionary options) + { + ttsCompletionSource = new TaskCompletionSource(); + recordedBuffer = Array.Empty(); + + //Option 처리 + SpeedRange speedRange = ttsHandle.GetSpeedRange(); + int speed = speedRange.Normal; + int voiceType = (int)VoiceType.Auto; + + if (options != null) + { + if (options.ContainsKey("speechRate")) + { + float speechRate = (float)(options["speechRate"]) / 2.0f; + speed = (int)(speedRange.Min + (speedRange.Max - speedRange.Min) * speechRate); + } + + if (options.ContainsKey("voiceType")) + { + voiceType = (int)options["voiceType"]; + } + } + ///////// + try + { + ttsHandle.AddText(text, voice, voiceType, speed); + + ttsHandle.Play(); + + await ttsCompletionSource.Task.ConfigureAwait(false); + } + catch (Exception ex) + { + OnTtsFinish?.Invoke(this, new ttsStreamingEventArgs + { + Text = text, + Voice = voice, + Error = ex.Message, + AudioData = Array.Empty() + }); + } + } + + /// + /// Releases all resources used by the AI service. + /// + protected override void Dispose(bool disposing) + { + if (disposing) + { + ttsHandle?.Dispose(); + } + base.Dispose(disposing); + } + + /// + /// Handles the PCM data synthesized by the TTS service. + /// + /// The sender of the event. + /// The event arguments containing PCM data and other information. + private void TtsSynthesizedPCM(object sender, SynthesizedPcmEventArgs e) + { + try + { + switch (e.EventType) + { + case SynthesizedPcmEvent.Start: + recordedBuffer = Array.Empty(); + + audioLength = (int)(audioLengthFactor * e.SampleRate * audioBufferMultiflier); + audioTailLength = (int)(audioTailLengthFactor * e.SampleRate * audioBufferMultiflier); + desiredBufferLength = (int)(desiredBufferDuration * e.SampleRate * audioBufferMultiflier); + + audioMainBuffer = new byte[desiredBufferLength]; + + OnTtsStart?.Invoke(this, new ttsStreamingEventArgs + { + SampleRate = e.SampleRate, + AudioBytes = audioLength, + TotalBytes = 0, + AudioData = Array.Empty() + }); + + Log.Info("Tizen.AIAvatar", $"TTS Start: UtteranceId={e.UtteranceId}, SampleRate={e.SampleRate}"); + + break; + + case SynthesizedPcmEvent.Continue: + + audioSyncBuffer?.AddRange(e.Data); + recordedBuffer = recordedBuffer.Concat(e.Data).ToArray(); + + if (recordedBuffer.Length >= desiredBufferLength) + { + Buffer.BlockCopy(recordedBuffer, 0, audioMainBuffer, 0, desiredBufferLength); + OnTtsReceiving?.Invoke(this, new ttsStreamingEventArgs + { + AudioData = audioMainBuffer, + ProcessedBytes = audioMainBuffer.Length + }); + + + int slicedBufferLength = recordedBuffer.Length - audioLength; + byte[] slicedBuffer = new byte[slicedBufferLength]; + Buffer.BlockCopy(recordedBuffer, audioLength, slicedBuffer, 0, slicedBufferLength); + + recordedBuffer = slicedBuffer; + } + + break; + + case SynthesizedPcmEvent.Finish: + Log.Info("Tizen.AIAvatar", $"TTS Finish: UtteranceId={e.UtteranceId}"); + + // Send any remaining audio data + if (recordedBuffer.Length > 0) + { + int minBufferSize = Math.Min(desiredBufferLength, recordedBuffer.Length); + + Array.Clear(audioMainBuffer, 0, desiredBufferLength); + Buffer.BlockCopy(recordedBuffer, 0, audioMainBuffer, 0, minBufferSize); + OnTtsReceiving?.Invoke(this, new ttsStreamingEventArgs + { + AudioData = audioMainBuffer, + ProcessedBytes = minBufferSize, + ProgressPercentage = 100 + }); + } + + OnTtsFinish?.Invoke(this, new ttsStreamingEventArgs + { + AudioData = Array.Empty(), + TotalBytes = recordedBuffer.Length, + ProgressPercentage = 100 + }); + + ttsCompletionSource?.SetResult(true); + break; + + case SynthesizedPcmEvent.Fail: + var error = "TTS synthesis failed"; + + OnTtsFinish?.Invoke(this, new ttsStreamingEventArgs + { + Error = error, + AudioData = Array.Empty() + }); + + ttsCompletionSource?.SetException(new Exception(error)); + + break; + + } + } + catch (Exception ex) + { + Log.Error("Tizen.AIAvatar", $"Error in TtsSynthesizedPCM: {ex.Message}"); + OnTtsFinish?.Invoke(this, new ttsStreamingEventArgs + { + Error = ex.Message, + AudioData = Array.Empty() + }); + ttsCompletionSource?.SetException(ex); + } + } + + /// + /// Retrieves the list of supported voices from the TTS client. + /// + /// A list of supported voice information. + private List GetSupportedVoices() + { + var voiceInfoList = new List(); + + if (ttsHandle == null) + { + Log.Error("Tizen.AIAvatar", $"ttsHandle is null"); + return voiceInfoList; + } + + var supportedVoices = ttsHandle.GetSupportedVoices(); + foreach (var supportedVoice in supportedVoices) + { + Log.Info("Tizen.AIAvatar", $"{supportedVoice.Language} & {supportedVoice.VoiceType} is supported"); + voiceInfoList.Add(new VoiceInfo() { Language = supportedVoice.Language, Type = (VoiceType)supportedVoice.VoiceType }); + } + return voiceInfoList; + } + + /// + /// Invokes the response handler event with the given event arguments. + /// + /// The response event arguments. + private void OnResponseHandler(llmResponseEventArgs e) + { + ResponseHandler?.Invoke(this, e); + } + } +} diff --git a/src/Tizen.AIAvatar/src/Animations/EyeBlinker.cs b/src/Tizen.AIAvatar/src/Animations/EyeBlinker.cs deleted file mode 100644 index 14319028d91..00000000000 --- a/src/Tizen.AIAvatar/src/Animations/EyeBlinker.cs +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright(c) 2024 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 Tizen.NUI; - -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar -{ - internal class EyeBlinker : IBlendShapeModule, IDisposable - { - private AvatarMotionState currentMotionState = AvatarMotionState.Unavailable; - - private readonly Object motionChangedLock = new Object(); - private event EventHandler motionChanged; - - private const int blinkIntervalMinimum = 800; - private const int blinkIntervalMaximum = 3000; - private Animation eyeAnimation; - - private Timer blinkTimer; - - private bool isPlaying = false; - private const int blinkDuration = 200; - - public AvatarMotionState CurrentMotionState - { - get - { - return currentMotionState; - } - set - { - if (currentMotionState == value) - { - return; - } - var preState = currentMotionState; - currentMotionState = value; - if (motionChanged != null) - { - motionChanged?.Invoke(this, new AvatarMotionChangedEventArgs(preState, currentMotionState)); - } - } - } - - public event EventHandler MotionStateChanged - { - add - { - lock (motionChangedLock) - { - motionChanged += value; - } - - } - - remove - { - lock (motionChangedLock) - { - if (motionChanged == null) - { - Log.Error(LogTag, "Remove StateChanged Failed : motionChanged is null"); - return; - } - motionChanged -= value; - } - } - } - - public EyeBlinker() - { - - } - - public void Dispose() - { - DestroyAnimation(); - } - - public void Init(Animation eyeAnimation) - { - this.eyeAnimation = eyeAnimation; - } - - public void Play() - { - //data - StartEyeBlink(); - } - - public void Stop() - { - StopEyeBlink(); - } - - public void Pause() - { - eyeAnimation?.Pause(); - } - - public void Destroy() - { - DestroyAnimation(); - } - - private void StartEyeBlink() - { - DestroyBlinkTimer(); - - blinkTimer = new Timer(blinkDuration); - if (blinkTimer != null) - { - blinkTimer.Tick += OnBlinkTimer; - blinkTimer?.Start(); - isPlaying = true; - } - } - - private void PauseEyeBlink() - { - blinkTimer?.Stop(); - isPlaying = false; - } - - private void StopEyeBlink() - { - blinkTimer?.Stop(); - isPlaying = false; - } - - private void DestroyAnimation() - { - DestroyBlinkTimer(); - if (eyeAnimation != null) - { - eyeAnimation.Stop(); - eyeAnimation.Dispose(); - eyeAnimation = null; - } - isPlaying = false; - } - - private bool OnBlinkTimer(object source, Timer.TickEventArgs e) - { - if (eyeAnimation == null) - { - Log.Error(LogTag, "eye animation is not ready"); - return false; - } - eyeAnimation?.Play(); - - var random = new Random(); - var fortimerinterval = (uint)random.Next(blinkIntervalMinimum, blinkIntervalMaximum); - blinkTimer.Interval = fortimerinterval; - return true; - } - - private void DestroyBlinkTimer() - { - if (blinkTimer != null) - { - blinkTimer.Tick -= OnBlinkTimer; - blinkTimer.Stop(); - blinkTimer.Dispose(); - blinkTimer = null; - } - } - } -} diff --git a/src/Tizen.AIAvatar/src/Animations/IBlendShapeModule.cs b/src/Tizen.AIAvatar/src/Animations/IBlendShapeModule.cs deleted file mode 100644 index 7f9daf667c4..00000000000 --- a/src/Tizen.AIAvatar/src/Animations/IBlendShapeModule.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright(c) 2024 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 Tizen.NUI; - -namespace Tizen.AIAvatar -{ - internal interface IBlendShapeModule - { - public void Init(Animation animation); - - public void Play(); - - public void Stop(); - - public void Pause(); - - public void Destroy(); - } - -} diff --git a/src/Tizen.AIAvatar/src/Animations/MotionPlayer.cs b/src/Tizen.AIAvatar/src/Animations/MotionPlayer.cs deleted file mode 100644 index a590ba9deae..00000000000 --- a/src/Tizen.AIAvatar/src/Animations/MotionPlayer.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright(c) 2024 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 Tizen.NUI; -using Tizen.NUI.Scene3D; -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar -{ - internal class MotionPlayer - { - private Animation motionAnimation; - private EyeBlinker eyeBlinker; - - internal Animation MotionAnimation { get => motionAnimation; private set => motionAnimation = value; } - - internal MotionPlayer() - { - eyeBlinker = new EyeBlinker(); - - - } - - internal void PlayAnimation(Animation motionAnimation, int duration = 3000, bool isLooping = false, int loopCount = 1) - { - ResetAnimations(); - if (motionAnimation != null) - { - MotionAnimation = motionAnimation; - MotionAnimation?.Play(); - } - else - { - Tizen.Log.Error(LogTag, "motionAnimation is null"); - } - } - - internal void PauseMotionAnimation() - { - MotionAnimation?.Pause(); - } - - internal void StopMotionAnimation() - { - MotionAnimation?.Stop(); - } - - internal void SetBlinkAnimation(Animation blinkerAnimation) - { - eyeBlinker?.Init(blinkerAnimation); - } - - internal void StartEyeBlink() - { - eyeBlinker?.Play(); - } - - internal void PauseEyeBlink() - { - eyeBlinker?.Pause(); - } - - - internal void StopEyeBlink() - { - eyeBlinker?.Stop(); - } - - internal void DestroyAnimations() - { - eyeBlinker?.Destroy(); - } - - private void ResetAnimations() - { - if (MotionAnimation != null) - { - MotionAnimation.Stop(); - MotionAnimation.Dispose(); - MotionAnimation = null; - } - } - - } -} diff --git a/src/Tizen.AIAvatar/src/Common/Avatar.cs b/src/Tizen.AIAvatar/src/Common/Avatar.cs deleted file mode 100644 index 8ff4306ebe3..00000000000 --- a/src/Tizen.AIAvatar/src/Common/Avatar.cs +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright(c) 2024 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.ComponentModel; -using Tizen.NUI.Scene3D; -using Tizen.NUI; - -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar -{ - /// - /// The Avatar class displays 3D avatars and provides easy access to their animations. - /// This class is a sub-class of the Model class which allows us to easily control the Avatar's animations. - /// Avatar also supports AR Emoji for humanoid-based 3D models. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class Avatar : Model - { - private AvatarProperties avatarProperties = new DefaultAvatarProperties(); - - private MotionPlayer motionPlayer; - - /// - /// The AvatarProperties property gets or sets the AvatarProperties object containing various information about the Avatar. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public AvatarProperties Properties - { - get => avatarProperties; - set - { - avatarProperties = value; - } - } - - /// - /// Create an initialized AvatarModel. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public Avatar() : base() - { - InitAvatar(); - } - - /// - /// Create an initialized AREmojiDefaultAvatar. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public Avatar(AvatarInfo avatarInfo) : base(avatarInfo.ResourcePath) - { - InitAvatar(); - } - - /// - /// Create an initialized Avatar. - /// - /// avatar file url.(e.g. glTF). - /// The url to derectory containing resources: binary, image etc. - /// - /// If resourceDirectoryUrl is empty, the parent directory url of avatarUrl is used for resource url. - /// - /// http://tizen.org/privilege/mediastorage for local files in media storage. - /// http://tizen.org/privilege/externalstorage for local files in external storage. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public Avatar(string avatarUrl, string resourceDirectoryUrl = "") : base(avatarUrl, resourceDirectoryUrl) - { - InitAvatar(); - } - - /// - /// Copy constructor. - /// - /// Source object to copy. - [EditorBrowsable(EditorBrowsableState.Never)] - public Avatar(Avatar avatar) : base(avatar) - { - InitAvatar(); - } - - #region Manage Animating - - /// - /// Plays the specified avatar animation with an optional duration and loop count. - /// - /// The AnimationInfo object containing information about the desired avatar animation. - /// The duration of the animation in milliseconds (default is 3000). - /// A boolean indicating whether the animation should be looped or not. - /// The number of times to repeat the animation if it's set to loop. - [EditorBrowsable(EditorBrowsableState.Never)] - public void PlayAnimation(AnimationInfo animationInfo, int duration = 3000, bool isLooping = false, int loopCount = 1) - { - if (animationInfo == null) - { - Tizen.Log.Error(LogTag, "animationInfo is null"); - return; - } - if (animationInfo.MotionData == null) - { - Tizen.Log.Error(LogTag, "animationInfo.MotionData is null"); - return; - } - motionAnimation = GenerateMotionDataAnimation(animationInfo.MotionData); - if (motionAnimation != null) - { - motionAnimation.Duration = duration; - motionAnimation.Looping = isLooping; - motionAnimation.LoopCount = loopCount; - motionAnimation.BlendPoint = 0.2f; - motionPlayer.PlayAnimation(motionAnimation); - } - else - { - Tizen.Log.Error(LogTag, "motionAnimation is null"); - } - } - - Animation motionAnimation; - - /// - /// Plays the specified avatar animation with MotionData and an optional duration and loop count. - /// - /// The MotionData object containing information about the desired avatar animation. - /// The duration of the animation in milliseconds (default is 3000). - /// A boolean indicating whether the animation should be looped or not. - /// The number of times to repeat the animation if it's set to loop. - [EditorBrowsable(EditorBrowsableState.Never)] - public void PlayAnimation(MotionData motionData, int duration = 3000, bool isLooping = false, int loopCount = 1) - { - - if (motionData == null) - { - Tizen.Log.Error(LogTag, "motionData is null"); - return; - } - var motionAnimation = GenerateMotionDataAnimation(motionData); - if (motionAnimation != null) - { - motionAnimation.Duration = duration; - motionAnimation.Looping = isLooping; - motionAnimation.LoopCount = loopCount; - motionAnimation.BlendPoint = 0.2f; - motionPlayer.PlayAnimation(motionAnimation); - } - else - { - Tizen.Log.Error(LogTag, "motionAnimation is null"); - } - } - - /// - /// Plays the specified avatar animation based on its index within the available animations and an optional duration and loop count. - /// - /// The zero-based index of the desired avatar animation within the list of available animations. - /// The duration of the animation in milliseconds (default is 3000). - /// A boolean indicating whether the animation should be looped or not. - /// The number of times to repeat the animation if it's set to loop. - [EditorBrowsable(EditorBrowsableState.Never)] - public void PlayAnimation(int index, int duration = 3000, bool isLooping = false, int loopCount = 1) - { - //TODO by index - //var motionAnimation = GenerateMotionDataAnimation(animationInfoList[index].MotionData); - /*motionAnimation.Duration = duration; - motionAnimation.Looping = isLooping; - motionAnimation.LoopCount = loopCount; - motionAnimation.BlendPoint = 0.2f; - - motionPlayer.PlayAnimation(motionAnimation);*/ - } - - /// - /// Pauses the currently playing avatar animation. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void PauseMotionAnimation() - { - motionPlayer.PauseMotionAnimation(); - } - - /// - /// Stops the currently playing avatar animation. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void StopMotionAnimation() - { - motionPlayer?.StopMotionAnimation(); - } - - /// - /// Starts the eye blink animation for the current avatar. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void StartEyeBlink() - { - motionPlayer?.StartEyeBlink(); - } - - /// - /// Pauses the eye blink animation for the current avatar. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void PauseEyeBlink() - { - motionPlayer?.PauseEyeBlink(); - } - - /// - /// Stops the eye blink animation for the current avatar. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void StopEyeBlink() - { - motionPlayer?.StopEyeBlink(); - } - #endregion - - private void InitAvatar() - { - motionPlayer = new MotionPlayer(); - var eyeMotionData = CreateEyeBlinkMotionData(200); - if (eyeMotionData == null) - { - Tizen.Log.Info(LogTag, "Failed Loading eyeAnimation"); - } - - ResourcesLoaded += (s, e) => - { - var eyeAnimation = GenerateMotionDataAnimation(eyeMotionData); - if (eyeAnimation != null) - { - motionPlayer.SetBlinkAnimation(eyeAnimation); - } - }; - } - - private MotionData CreateEyeBlinkMotionData(int ms) - { - var keyFrames = new KeyFrames(); - keyFrames.Add(0.1f, 0.0f); - keyFrames.Add(0.5f, 1.0f); - keyFrames.Add(0.9f, 0.0f); - - var headBlendShapeEyeLeft = new AvatarBlendShapeIndex(avatarProperties.NodeMapper, NodeType.HeadGeo, avatarProperties.BlendShapeMapper, BlendShapeType.EyeBlinkLeft); - var headBlendShapeEyeRight = new AvatarBlendShapeIndex(avatarProperties.NodeMapper, NodeType.HeadGeo, avatarProperties.BlendShapeMapper, BlendShapeType.EyeBlinkRight); - var eyelashBlendShapeEyeLeft = new AvatarBlendShapeIndex(avatarProperties.NodeMapper, NodeType.EyelashGeo, avatarProperties.BlendShapeMapper, BlendShapeType.EyeBlinkLeft); - var eyelashBlendShapeEyeRight = new AvatarBlendShapeIndex(avatarProperties.NodeMapper, NodeType.EyelashGeo, avatarProperties.BlendShapeMapper, BlendShapeType.EyeBlinkRight); - - var motionData = new MotionData(ms); - motionData.Add(headBlendShapeEyeLeft, new MotionValue(keyFrames)); - motionData.Add(headBlendShapeEyeRight, new MotionValue(keyFrames)); - motionData.Add(eyelashBlendShapeEyeLeft, new MotionValue(keyFrames)); - motionData.Add(eyelashBlendShapeEyeRight, new MotionValue(keyFrames)); - - return motionData; - } - } -} diff --git a/src/Tizen.AIAvatar/src/Emotion/EmotionAnalyzer.cs b/src/Tizen.AIAvatar/src/Emotion/EmotionAnalyzer.cs deleted file mode 100644 index ec74d751e85..00000000000 --- a/src/Tizen.AIAvatar/src/Emotion/EmotionAnalyzer.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright(c) 2024 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 Newtonsoft.Json; -using System.Net.Http; -using System; -using System.Threading.Tasks; - -namespace Tizen.AIAvatar -{ - internal class EmotionAnalyzer - { - private LipSyncController avatarTTS; - private IRestClient restClient; - private const string playgroundURL = "https://playground-api.sec.samsung.net"; - - internal EmotionAnalyzer() - { - } - - internal void InitAvatarLLM(LipSyncController avatarTTS) - { - this.avatarTTS = avatarTTS; - // Setup RestClinet - var restClientFactory = new RestClientFactory(); - restClient = restClientFactory.CreateClient(playgroundURL); - } - - internal async Task StartTTSWithLLMAsync(string text, string token) - { - var bearerToken = token; - var jsonData = "{\"messages\": [{\"role\": \"user\", \"content\": \"" + text + "\"}]}"; - - try - { - var postResponse = await restClient.SendRequestAsync(HttpMethod.Post, "/api/v1/chat/completions", bearerToken, jsonData); - var responseData = JsonConvert.DeserializeObject(postResponse); - string content = responseData["response"]["content"]; - Log.Info("Tizen.AIAvatar", content); - - //TTS 호출 - var voiceInfo = new VoiceInfo() - { - Language = "en_US", - Type = VoiceType.Female, - }; - - avatarTTS.PlayTTSAsync(content, voiceInfo, (o, e) => - { - - }); - - } - catch (Exception ex) - { - Log.Error("Tizen.AIAvatar", "에러 발생: " + ex.Message); - } - } - } -} diff --git a/src/Tizen.AIAvatar/src/Emotion/EmotionController.cs b/src/Tizen.AIAvatar/src/Emotion/EmotionController.cs deleted file mode 100644 index fd0bd421915..00000000000 --- a/src/Tizen.AIAvatar/src/Emotion/EmotionController.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright(c) 2024 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.ComponentModel; - -namespace Tizen.AIAvatar -{ - /// - /// Manages facial expression control for avatars based on input text sentiment analysis results. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class EmotionController - { - /// - /// Initializes a new instance of the class without an avatar reference. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public EmotionController() - { - - } - - /// - /// Initializes the EmotionController by setting up the necessary components for managing facial expressions in the avatar. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void Initialize() - { - - } - /// - /// This method analyzes emotion the given text. - /// - /// The text to analyze - [EditorBrowsable(EditorBrowsableState.Never)] - public void AnalizeEmotion(string text) - { - - } - - /// - /// This method starts playing the emotion facial. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void PlayEmotionFacial() - { - - } - - /// - /// This method pauses the emotion facial. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void PauseEmotionFacial() - { - - } - - /// - /// This method stops the emotion facial. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void StopEmotionFacial() - { - - } - } -} diff --git a/src/Tizen.AIAvatar/src/Internal/AIAvatar.cs b/src/Tizen.AIAvatar/src/Internal/AIAvatar.cs deleted file mode 100644 index 847866ac90d..00000000000 --- a/src/Tizen.AIAvatar/src/Internal/AIAvatar.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright(c) 2024 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 Tizen.Multimedia; - -namespace Tizen.AIAvatar -{ - internal static class AIAvatar - { - internal const string LogTag = "Tizen.AIAvatar"; - internal static readonly string ApplicationResourcePath = "/usr/apps/org.tizen.default-avatar-resource/shared/res/"; - internal static readonly string EmojiAvatarResourcePath = "/models/EmojiAvatar/"; - internal static readonly string DefaultModelResourcePath = "/models/DefaultAvatar/"; - internal static readonly string DefaultMotionResourcePath = "/animation/motion/"; - - internal static readonly string VisemeInfo = $"{ApplicationResourcePath}/viseme/emoji_viseme_info.json"; - internal static readonly string DefaultModel = "DefaultAvatar.gltf"; - - internal static readonly string AREmojiDefaultAvatarPath = $"{ApplicationResourcePath}{DefaultModelResourcePath}{DefaultModel}"; - - internal static readonly string DefaultLowModelResourcePath = "/models/DefaultAvatar_Low/"; - internal static readonly string ExternalModel = "model_external.gltf"; - internal static readonly string AREmojiDefaultLowAvatarPath = $"{ApplicationResourcePath}{DefaultLowModelResourcePath}{ExternalModel}"; - - internal static AudioOptions DefaultAudioOptions = new AudioOptions(24000, AudioChannel.Mono, AudioSampleType.S16Le); - internal static AudioOptions CurrentAudioOptions = DefaultAudioOptions; - } -} diff --git a/src/Tizen.AIAvatar/src/Internal/Utils.cs b/src/Tizen.AIAvatar/src/Internal/Utils.cs deleted file mode 100644 index e845a02f812..00000000000 --- a/src/Tizen.AIAvatar/src/Internal/Utils.cs +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright(c) 2024 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.IO; -using Tizen.Security; -using Newtonsoft.Json; -using System.Collections.Generic; -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar -{ - internal class Utils - { - internal static void ConvertAudioToFloat(in byte[] audioBytes, out float[] audioFloat) - { - audioFloat = new float[audioBytes.Length / 2]; - - for (int i = 0, j = 0; i < audioBytes.Length; i += 2, j++) - { - short sample = BitConverter.ToInt16(audioBytes, i); - audioFloat[j] = sample / 32768.0f; - } - } - - internal static byte[] ReadAllBytes(string path) - { - try - { - var bytes = File.ReadAllBytes(path); - return bytes; - } - catch (Exception) - { - return null; - } - } - - internal static void SaveFile(string path, string filename, byte[] array) - { - try - { - var file = new FileStream($"{path}/{filename}", FileMode.Create); - file.Write(array, 0, array.Length); - file.Close(); - } - catch (Exception) - { - return; - } - } - - internal static void CheckPrivilege(string privilege) - { - var result = PrivacyPrivilegeManager.CheckPermission(privilege); - - switch (result) - { - case CheckResult.Allow: - Log.Info(LogTag, $"Privilege \"{privilege}\" : allowed."); - break; - case CheckResult.Deny: - Log.Info(LogTag, $"Privilege \"{privilege}\" : denied."); - /// Privilege can't be used - break; - case CheckResult.Ask: - /// Request permission to user - PrivacyPrivilegeManager.RequestPermission(privilege); - break; - } - } - - internal static T ConvertJson(string jsonString) - { - return JsonConvert.DeserializeObject(jsonString); - } - - internal int FindMaxValue(List list, Converter projection) - { - if (list.Count == 0) - { - throw new InvalidOperationException("Empty list"); - } - int maxValue = int.MinValue; - foreach (T item in list) - { - int value = projection(item); - if (value > maxValue) - { - maxValue = value; - } - } - return maxValue; - } - } -} - -internal class SystemUtils -{ - internal static string GetFileName(string path) - { - return System.IO.Path.GetFileName(path); - } - internal static string GetFileNameWithoutExtension(string path) - { - return System.IO.Path.GetFileNameWithoutExtension(path); - } -} diff --git a/src/Tizen.AIAvatar/src/Lipsync/AsyncLipSyncer.cs b/src/Tizen.AIAvatar/src/Lipsync/AsyncLipSyncer.cs deleted file mode 100644 index 952c47c4980..00000000000 --- a/src/Tizen.AIAvatar/src/Lipsync/AsyncLipSyncer.cs +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright(c) 2024 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 Tizen.NUI; - -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar -{ - [EditorBrowsable(EditorBrowsableState.Never)] - internal class AsyncLipSyncer - { - private readonly uint AsyncPlayTime = 160; - private Queue lipAnimations; - private Queue lipAudios; - private Timer asyncVowelTimer; - - private bool isAsyncInit = false; - private bool isFinishAsyncLip = false; - - [EditorBrowsable(EditorBrowsableState.Never)] - internal AsyncLipSyncer() - { - - } - - internal int SampleRate { get; set; } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal bool IsAsyncInit { get=>isAsyncInit; set=>isAsyncInit = value; } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal void SetFinishAsyncLip(bool finished) - { - isFinishAsyncLip = finished; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - protected new void OnLipAnimationFinished(object sender, EventArgs e) - { - if (!isAsyncInit) - { - //TODO : State is Stop - } - else - { - Tizen.Log.Error(LogTag, "OnLipAnimationFinished---------------c"); - //Async State - if (isFinishAsyncLip && lipAnimations.Count == 0) - { - Tizen.Log.Error(LogTag, "Finish vowel lip sync"); - - - //Audio Player is Stop, AudioPlayer.Stop(); - //TODO : State is Stop - DestroyVowelTimer(); - isAsyncInit = false; - } - } - } - - internal void InitAsyncLipsync() - { - if (lipAnimations == null) - { - lipAnimations = new Queue(); - } - else - { - lipAnimations.Clear(); - } - - if (lipAudios == null) - { - lipAudios = new Queue(); - } - else - { - lipAudios.Clear(); - } - } - - private void EnqueueVowels(byte[] buffer, bool deleteLast = false) - { - /* - var vowels = PredictVowels(buffer); - if (vowels != null) - { - vowelPools.Enqueue(vowels); - if (deleteLast) - { - var vowelList = new List(vowels); - vowelList.RemoveAt(vowelList.Count - 1); - vowels = vowelList.ToArray(); - } - }*/ - } - - internal Animation CreateAsyncLipAnimation(byte[] buffer, int sampleRate) - { - EnqueueVowels(buffer, false); - return null; - //return CreateLipAnimationByVowelsQueue(sampleRate); - } - - internal void EnqueueAnimation(byte[] recordBuffer, int sampleRate, int audioLength) - { - var createdAni = CreateAsyncLipAnimation(recordBuffer, sampleRate); - if (createdAni != null) - { - lipAnimations.Enqueue(createdAni); - } - - //Use Audio Full File - ///var createdAni = avatarLipSyncer.CreateLipAnimation(recordBuffer, sampleRate); - //lipAnimations.Enqueue(createdAni); - - var currentAudioBuffer = new byte[audioLength]; - Buffer.BlockCopy(recordBuffer, 0, currentAudioBuffer, 0, audioLength); - - lipAudios.Enqueue(currentAudioBuffer); - } - - internal bool PlayAsyncLip(int sampleRate, bool isFinishAsyncLip) - { - try - { - if (lipAudios.Count <= 0 && lipAnimations.Count <= 0) - { - Tizen.Log.Info(LogTag, "Return lipaudio 0"); - if (isFinishAsyncLip) - { - Tizen.Log.Info(LogTag, "Finish Async lipsync"); - return false; - } - return true; - } - Tizen.Log.Info(LogTag, "Async timer tick lipAudios : " + lipAudios.Count); - Tizen.Log.Info(LogTag, "Async timer tick lipAnimations : " + lipAnimations.Count); - - var lipAnimation = lipAnimations.Dequeue(); - lipAnimation.Finished += OnLipAnimationFinished; - - //ResetLipAnimation(lipAnimation); - //PlayLipAnimation(); - var audioBuffer = lipAudios.Dequeue(); - - //Audio Playe rAsync Play - //AudioPlayer.PlayAsync(audioBuffer, sampleRate); - return true; - - } - catch (Exception ex) - { - Log.Error(LogTag, $"---Log Tick : {ex.StackTrace}"); - - return false; - } - } - - internal void StartAsyncLipPlayTimer() - { - if (asyncVowelTimer == null) - { - Tizen.Log.Info(LogTag, "Start Async"); - asyncVowelTimer = new Timer(AsyncPlayTime); - asyncVowelTimer.Tick += OnAsyncVowelTick; - asyncVowelTimer.Start(); - } - return; - } - - private void DestroyVowelTimer() - { - if (asyncVowelTimer != null) - { - - asyncVowelTimer.Tick -= OnAsyncVowelTick; - asyncVowelTimer.Stop(); - asyncVowelTimer.Dispose(); - asyncVowelTimer = null; - } - } - - private bool OnAsyncVowelTick(object source, Tizen.NUI.Timer.TickEventArgs e) - { - return PlayAsyncLip(SampleRate, isFinishAsyncLip); - } - } -} diff --git a/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Audio2Vowels.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Audio2Vowels.cs new file mode 100644 index 00000000000..c1cddee7027 --- /dev/null +++ b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Audio2Vowels.cs @@ -0,0 +1,108 @@ +/* + * Copyright(c) 2024 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.Collections.Generic; +using System.ComponentModel; + + +namespace Tizen.AIAvatar +{ + /// + /// The Audio2Vowels class is responsible for predicting vowels from audio data using a pre-trained TensorFlow model. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class Audio2Vowels + { + /// + /// The sample rate of the audio data. + /// + private int sampleRate; + + /// + /// The pre-trained TensorFlow model used for vowel prediction. + /// + private TFVowel6 model; + + /// + /// A dictionary containing vowel classifiers indexed by their respective sample rates. + /// + private Dictionary classifiers; + + /// + /// Initializes a new instance of the Audio2Vowels class with the specified TensorFlow model file path. + /// + /// The path to the pre-trained TensorFlow model file. + [EditorBrowsable(EditorBrowsableState.Never)] + public Audio2Vowels(string tensorflowFilePath) + { + classifiers = new Dictionary(); + model = new TFVowel6(new int[4] { 12, 1, 1, 1 }, new int[4] { 7, 1, 1, 1 }, tensorflowFilePath); + } + + /// + /// Predicts the vowels present in the given audio data. + /// + /// The audio data to analyze. + /// An array of predicted vowels. + [EditorBrowsable(EditorBrowsableState.Never)] + public string[] PredictVowels(byte[] audioData) + { + VowelClassifier classifier = GetVowelClassifier(sampleRate); + return classifier.Inference(audioData, model); + } + + /// + /// Sets the sample rate of the audio data. + /// + /// The sample rate to set. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetSampleRate(int rate) + { + sampleRate = rate; + } + + /// + /// Gets the current sample rate of the audio data. + /// + /// The current sample rate. + [EditorBrowsable(EditorBrowsableState.Never)] + public int GetSampleRate() + { + return sampleRate; + } + + /// + /// Retrieves the vowel classifier corresponding to the specified sample rate. + /// If no classifier exists for the given sample rate, a new one is created. + /// + /// The sample rate for which to retrieve the classifier. + /// A VowelClassifier object. + private VowelClassifier GetVowelClassifier(int rate) + { + if (classifiers.ContainsKey(rate)) + { + return classifiers[rate]; + } + else + { + VowelClassifier classifier = new VowelClassifier(rate); + classifiers[rate] = classifier; + return classifier; + } + } + } +} diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/ISingleShotModel.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/ISingleShotModel.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/ISingleShotModel.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/ISingleShotModel.cs diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/CustomMfccExtractor.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/CustomMfccExtractor.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/CustomMfccExtractor.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/CustomMfccExtractor.cs diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/DCT.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/DCT.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/DCT.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/DCT.cs diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/FFT.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/FFT.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/FFT.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/FFT.cs diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/FilterBank.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/FilterBank.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/FilterBank.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/FilterBank.cs diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/IMFccExtractor.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/IMFccExtractor.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/IMFccExtractor.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/IMFccExtractor.cs diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/PreEmphasis.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/PreEmphasis.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/PreEmphasis.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/PreEmphasis.cs diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/Window.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/Window.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Audio2Vowel/inMFCC/Algorithm/Window.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/MFCC/Algorithm/Window.cs diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/SoftmaxLinqExtension.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/SoftmaxLinqExtension.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/SoftmaxLinqExtension.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/SoftmaxLinqExtension.cs diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/TFVowel6.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/TFVowel6.cs similarity index 96% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/TFVowel6.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/TFVowel6.cs index fcafa674366..7d152b0a45b 100644 --- a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/TFVowel6.cs +++ b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/TFVowel6.cs @@ -29,10 +29,8 @@ internal class TFVowel6 : ISingleShotModel private TensorsInfo outputInfo; private TensorsData inputData; private TensorsData outputData; - - private readonly string modelPath = ApplicationResourcePath + "audio2vowel_7.tflite"; - - internal TFVowel6(int[] inputDimension, int[] outputDimension) + + internal TFVowel6(int[] inputDimension, int[] outputDimension, string modelPath) { try { diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/VowelClassifier.cs b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/VowelClassifier.cs similarity index 86% rename from src/Tizen.AIAvatar/src/Lipsync/VowelConverter/VowelClassifier.cs rename to src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/VowelClassifier.cs index 958b6f19647..c9771bb478d 100644 --- a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/VowelClassifier.cs +++ b/src/Tizen.AIAvatar/src/Lipsync/Audio2Vowels/Core/VowelClassifier.cs @@ -43,13 +43,13 @@ internal VowelClassifier(int sampleRate, float frameDuration = 0.025f, float hop mfccExtractor = new CustomMfccExtractor(sampleRate, frameDuration, hopDuration, featureCount); } - public float GetStepTime() + internal float GetStepTime() { return stepTime; } - public string[] Inference(byte[] audio, ISingleShotModel model) + internal string[] Inference(byte[] audio, ISingleShotModel model) { int length = PreprocessInput(audio, out float[] features, out List audioEnergy); var outputData = InferenceModel(features, length, model); @@ -58,9 +58,9 @@ public string[] Inference(byte[] audio, ISingleShotModel model) return result.ToArray(); } - public int PreprocessInput(byte[] audioByte, out float[] flattenedArray, out List audioEnergy) + internal int PreprocessInput(byte[] audioByte, out float[] flattenedArray, out List audioEnergy) { - Utils.ConvertAudioToFloat(audioByte, out var audio); + ConvertAudioToFloat(audioByte, out var audio); var mfccFeatures = mfccExtractor.ComputeFrom(audio, sampleRate); @@ -78,7 +78,7 @@ public int PreprocessInput(byte[] audioByte, out float[] flattenedArray, out Lis return featureLength; } - public List InferenceModel(float[] input, int length, ISingleShotModel model) + internal List InferenceModel(float[] input, int length, ISingleShotModel model) { byte[] inputBuffer = new byte[4 * 12 * 1 * 1]; byte[] outputBuffer; @@ -108,6 +108,17 @@ public List InferenceModel(float[] input, int length, ISingleShotModel return fullOutput; } + private void ConvertAudioToFloat(in byte[] audioBytes, out float[] audioFloat) + { + audioFloat = new float[audioBytes.Length / 2]; + + for (int i = 0, j = 0; i < audioBytes.Length; i += 2, j++) + { + short sample = BitConverter.ToInt16(audioBytes, i); + audioFloat[j] = sample / 32768.0f; + } + } + private List ProcessOutput(List outputData, List audioEnergy) { var result = new List(); diff --git a/src/Tizen.AIAvatar/src/Lipsync/LipSyncController.cs b/src/Tizen.AIAvatar/src/Lipsync/LipSyncController.cs deleted file mode 100644 index 45349f86cb0..00000000000 --- a/src/Tizen.AIAvatar/src/Lipsync/LipSyncController.cs +++ /dev/null @@ -1,668 +0,0 @@ -/* - * Copyright(c) 2024 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.Collections.Generic; -using System.ComponentModel; -using System; -using Tizen.Uix.Tts; - -using static Tizen.AIAvatar.AIAvatar; -using Tizen.Multimedia; -using Tizen.NUI.Scene3D; -using Tizen.NUI; - -namespace Tizen.AIAvatar -{ - /// - /// A controller class used to manage lip sync functionality for avatars. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class LipSyncController : IDisposable - { - private TTSController ttsController; - private AudioRecorder audioRecorder; - private LipSyncer lipSyncer; - - private Avatar avatar; - - private event EventHandler ttsReadyFinished; - private readonly Object ttsReadyFinishedLock = new Object(); - - /// - /// Initializes a new instance of the class. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public LipSyncController(Avatar avatar) - { - this.avatar = avatar; - - audioRecorder = new AudioRecorder(); - lipSyncer = new LipSyncer(); - - lipSyncer.CreatedKeyFrameAnimation += OnCreatedKeyFrameAnimation; - } - - private Animation CreateLipAnimation(AnimationKeyFrame animationKeyFrames, bool isMic = false) - { - var animationTime = (int)(animationKeyFrames.AnimationTime * 1000f); - var lipAnimation = new Animation(animationTime); - - var motionData = new MotionData(animationTime); - for (var i = 0; i < animationKeyFrames.NodeNames.Length; i++) - { - var nodeName = animationKeyFrames.NodeNames[i]; - for (var j = 0; j < animationKeyFrames.BlendShapeCounts[i]; j++) - { - var blendShapeIndex = new BlendShapeIndex(new PropertyKey(nodeName), new PropertyKey(j)); - var keyFrameList = animationKeyFrames.GetKeyFrames(nodeName, j); - if (keyFrameList.Count == 0) - { - continue; - } - - var keyFrames = new KeyFrames(); - CreateKeyTimeFrames(ref keyFrames, keyFrameList, isMic); - - motionData.Add(blendShapeIndex, new MotionValue(keyFrames)); - lipAnimation = avatar.GenerateMotionDataAnimation(motionData); - } - } - return lipAnimation; - } - - private KeyFrames CreateKeyTimeFrames(ref KeyFrames keyFrames, List keyFrameList, bool isMic = false) - { - foreach (var key in keyFrameList) - { - keyFrames.Add(key.time, key.value); - } - if (!isMic) keyFrames.Add(1.0f, 0.0f); - - return keyFrames; - } - - private Animation OnCreatedKeyFrameAnimation(AnimationKeyFrame animationKeyFrame, bool isMic) - { - if (animationKeyFrame == null) - { - Tizen.Log.Error(LogTag, "animtionKeyFrame is null"); - } - var lipAnimation = CreateLipAnimation(animationKeyFrame, isMic); - return lipAnimation; - } - - /// - /// Occurs when text-to-speech synthesis has finished and the audio data is ready to play. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler TTSReadyFinished - { - add - { - lock (ttsReadyFinishedLock) - { - ttsReadyFinished += value; - } - - } - - remove - { - lock (ttsReadyFinishedLock) - { - if (ttsReadyFinished == null) - { - Log.Error(LogTag, "ttsReadyFinished is null"); - return; - } - ttsReadyFinished -= value; - } - } - } - - /// - /// Gets the current Text-To-Speech client associated with the Lip Sync Controller. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public TtsClient CurrentTTSClient => ttsController?.TtsHandle; - - /// - /// Initializes the Text-To-Speech system for use with the Lip Sync Controller. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void InitializeTTS() - { - if (ttsController == null) - { - try - { - ttsController = new TTSController(); - //TODO : LipSync Event Connect - ttsController.PreparedSyncText += OnPreparedSyncText; - ttsController.StoppedTTS += OnStoppedTTS; - ttsController.UpdatedBuffer += OnUpdatedBuffer; - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - } - } - } - - private void OnUpdatedBuffer(object sender, TTSControllerEventArgs e) - { - throw new NotImplementedException(); - if (lipSyncer != null) - { - Log.Error(LogTag, "OnTTSBufferChanged"); - /* - lipSyncer.EnqueueAnimation(recordBuffer, sampleRate, audioLength); - if (!isAsyncLipStarting) - { - lipSyncer.StartAsyncLipPlayTimer(); - isAsyncLipStarting = true; - }*/ - } - else - { - Log.Error(LogTag, "avatarLipSyncer is null"); - } - } - - private void OnStoppedTTS(object sender, TTSControllerEventArgs e) - { - lipSyncer.Stop(); - } - - private void OnPreparedSyncText(object sender, TTSControllerEventArgs e) - { - var data = e.AudioData; - var sampleRate = e.SampleRate; - - // Play Lipsync Animation by Audio - lipSyncer.PlayAudio(data, sampleRate); - } - - /// - /// Deinitializes the Text-To-Speech system for use with the Lip Sync Controller. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void DeInitializeTTS() - { - if (ttsController != null) - { - try - { - ttsController.DeinitTts(); - ttsController = null; - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - } - } - } - - /// - /// Returns a list of supported voices for the Text-To-Speech system. - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public List GetSupportedVoices() - { - return ttsController.GetSupportedVoices(); - } - - /// - /// Plays the given audio with LipSync and returns whether it was successful or not. - /// If the lip syncer is null, logs an error and returns false. - /// The lipSyncer plays the audio using the provided byte array and sample rate. - /// - /// The audio data to be played in a byte array format. - /// The sampling rate of the audio data, default value is 24000 Hz. - public bool PlayLipSync(byte[] audio, int sampleRate = 24000) - { - if (lipSyncer == null) - { - Log.Error(LogTag, "lipSyncer is null"); - return false; - } - lipSyncer.PlayAudio(audio, sampleRate); - - return true; - } - - /// - /// Plays the given audio with LipSync and returns whether it was successful or not. - /// If the lip syncer is null, logs an error and returns false. - /// The lipSyncer plays the audio using the provided byte array and sample rate. - /// - /// The audio data to be played in a byte array format. - /// The sampling rate of the audio data, default value is 16000 Hz. - public bool PlayLipSync(string path, int sampleRate = 24000) - { - var audio = Utils.ReadAllBytes(path); - if (audio == null) - { - Log.Error(LogTag, "audio data is null"); - return false; - } - lipSyncer.PlayAudio(audio, sampleRate); - - return true; - } - - /// - /// Prepares the Text-To-Speech engine to synthesize speech from the provided text and voice info. - /// - /// The text to convert into speech. - /// The voice info to use for converting the text into speech. - /// An optional callback that will be invoked when the TTS process is complete. - /// True if preparation was successful, otherwise False. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool PrepareTTS(string text, VoiceInfo voiceInfo, EventHandler ttsReadyFinishedCallback = null) - { - if (ttsController == null || ttsController.TtsHandle == null) - { - Log.Error(LogTag, "tts is null"); - return false; - } - - - if (!ttsController.IsSupportedVoice(voiceInfo)) - { - Log.Info(LogTag, $"{voiceInfo.Language} & {voiceInfo.Type} is not supported"); - return false; - } - - Log.Info(LogTag, "Current TTS State :" + ttsController.TtsHandle.CurrentState); - if (ttsController.TtsHandle.CurrentState != Tizen.Uix.Tts.State.Ready) - { - Log.Info(LogTag, "TTS is not ready"); - return false; - } - - try - { - ttsController.AddText(text, voiceInfo); - ttsController.Prepare(ttsReadyFinishedCallback); - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - return false; - } - return true; - } - - /// - /// Prepares the Text-To-Speech engine to synthesize speech from the provided text and language code. - /// - /// The text to convert into speech. - /// The two-letter ISO 639-1 language code to use for converting the text into speech (default is Korean - ko_KR). - /// An optional callback that will be invoked when the TTS process is complete. - /// True if preparation was successful, otherwise False. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool PrepareTTS(string text, string lang = "ko_KR", EventHandler ttsReadyFinishedCallback = null) - { - if (ttsController == null || ttsController.TtsHandle == null) - { - Log.Error(LogTag, "tts is null"); - return false; - } - - if (!ttsController.IsSupportedVoice(lang)) - { - Log.Error(LogTag, $"{lang} is not supported"); - return false; - } - - Log.Info(LogTag, "Current TTS State :" + ttsController.TtsHandle.CurrentState); - if (ttsController.TtsHandle.CurrentState != Tizen.Uix.Tts.State.Ready) - { - Log.Error(LogTag, "TTS is not ready"); - return false; - } - try - { - ttsController.AddText(text, lang); - ttsController.Prepare(ttsReadyFinishedCallback); - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - return false; - } - return true; - } - - /// - /// Plays the previously prepared Text-To-Speech audio data. - /// - /// True if playback started successfully, otherwise False. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool PlayPreparedTTS() - { - if (ttsController == null || ttsController.TtsHandle == null) - { - Log.Error(LogTag, "tts is null"); - return false; - } - - return ttsController.PlayPreparedText(); - } - - /// - /// Converts the given text into speech using the specified voice info and plays the resulting audio immediately. - /// - /// The text to convert into speech. - /// The voice info to use for converting the text into speech. - /// True if playback started successfully, otherwise False. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool PlayTTS(string text, VoiceInfo voiceInfo) - { - if (ttsController == null || ttsController.TtsHandle == null) - { - Log.Error(LogTag, "tts is null"); - return false; - } - - if (!ttsController.IsSupportedVoice(voiceInfo)) - { - Log.Info(LogTag, $"{voiceInfo.Language} & {voiceInfo.Type} is not supported"); - return false; - } - - Log.Info(LogTag, "Current TTS State :" + ttsController.TtsHandle.CurrentState); - if (ttsController.TtsHandle.CurrentState != Tizen.Uix.Tts.State.Ready) - { - Log.Info(LogTag, "TTS is not ready"); - return false; - } - - try - { - ttsController.AddText(text, voiceInfo); - ttsController.Play(); - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - return false; - } - return true; - } - - /// - /// Converts the given text into speech using the specified language code and plays the resulting audio immediately. - /// - /// The text to convert into speech. - /// The two-letter ISO 639-1 language code to use for converting the text into speech (default is Korean - ko_KR). - /// True if playback started successfully, otherwise False. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool PlayTTS(string text, string lang = "ko_KR") - { - if (ttsController == null || ttsController.TtsHandle == null) - { - Log.Error(LogTag, "tts is null"); - return false; - } - - if (!ttsController.IsSupportedVoice(lang)) - { - Log.Error(LogTag, $"{lang} is not supported"); - return false; - } - - Log.Info(LogTag, "Current TTS State :" + ttsController.TtsHandle.CurrentState); - if (ttsController.TtsHandle.CurrentState != Tizen.Uix.Tts.State.Ready) - { - Log.Error(LogTag, "TTS is not ready"); - return false; - } - try - { - ttsController.AddText(text, lang); - ttsController.Play(); - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - return false; - } - return true; - } - - /// - /// Asynchronously converts the given text into speech using the specified voice info and plays the resulting audio once it's ready. - /// - /// The text to convert into speech. - /// The voice info to use for converting the text into speech. - /// An optional callback that will be invoked when the TTS process is complete. - /// True if asynchronous conversion was initiated successfully, otherwise False. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool PlayTTSAsync(string text, VoiceInfo voiceInfo, EventHandler ttsReadyFinishedCallback = null) - { - if (ttsController == null || ttsController.TtsHandle == null) - { - Log.Error(LogTag, "tts is null"); - return false; - } - - if (!ttsController.IsSupportedVoice(voiceInfo)) - { - Log.Info(LogTag, $"{voiceInfo.Language} & {voiceInfo.Type} is not supported"); - return false; - } - - Log.Info(LogTag, "Current TTS State :" + ttsController.TtsHandle.CurrentState); - if (ttsController.TtsHandle.CurrentState != Tizen.Uix.Tts.State.Ready) - { - Log.Info(LogTag, "TTS is not ready"); - return false; - } - - try - { - ttsController.AddText(text, voiceInfo); - ttsController.PlayAsync(ttsReadyFinishedCallback); - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - return false; - } - return true; - } - - /// - /// Asynchronously converts the given text into speech using the specified language code and plays the resulting audio once it's ready. - /// - /// The text to convert into speech. - /// The two-letter ISO 639-1 language code to use for converting the text into speech (default is Korean - ko_KR). - /// An optional callback that will be invoked when the TTS process is complete. - /// True if asynchronous conversion was initiated successfully, otherwise False. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool PlayTTS(string text, string lang = "ko_KR", EventHandler ttsReadyFinishedCallback = null) - { - if (ttsController == null || ttsController.TtsHandle == null) - { - Log.Error(LogTag, "tts is null"); - return false; - } - - if (!ttsController.IsSupportedVoice(lang)) - { - Log.Error(LogTag, $"{lang} is not supported"); - return false; - } - - Log.Info(LogTag, "Current TTS State :" + ttsController.TtsHandle.CurrentState); - if (ttsController.TtsHandle.CurrentState != Tizen.Uix.Tts.State.Ready) - { - Log.Error(LogTag, "TTS is not ready"); - return false; - } - try - { - ttsController.AddText(text, lang); - ttsController.PlayAsync(ttsReadyFinishedCallback); - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - return false; - } - return true; - } - - /// - /// Pauses the currently playing Text-To-Speech audio. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void PauseTTS() - { - if (ttsController == null || ttsController.TtsHandle == null) - { - Log.Error(LogTag, "tts is null"); - return; - } - - try - { - Log.Info(LogTag, "Current TTS State :" + ttsController.TtsHandle.CurrentState); - ttsController?.Pause(); - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - } - } - - /// - /// Stops the currently playing Text-To-Speech audio. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void StopTTS() - { - if (ttsController == null || ttsController.TtsHandle == null) - { - Log.Error(LogTag, "tts is null"); - return; - } - - try - { - Log.Info(LogTag, "Current TTS State :" + ttsController.TtsHandle.CurrentState); - ttsController?.Stop(); - } - catch (Exception e) - { - Log.Error(LogTag, $"error :{e.Message}"); - Log.Error(LogTag, $"{e.StackTrace}"); - } - } - - public void InitializeMic() - { - if (audioRecorder == null) - { - Tizen.Log.Error(LogTag, "audio record is null"); - return; - } - audioRecorder.InitializeMic(lipSyncer, 160); - } - - public void DeinitializeMic() - { - if (audioRecorder == null) - { - Tizen.Log.Error(LogTag, "audio record is null"); - return; - } - audioRecorder.StartRecording(); - } - - public void StartMic() - { - if (audioRecorder == null) - { - Tizen.Log.Error(LogTag, "audio record is null"); - return; - } - audioRecorder.StartRecording(); - } - - public void StopMic() - { - if (audioRecorder == null) - { - Tizen.Log.Error(LogTag, "audio record is null"); - return; - } - audioRecorder.StopRecording(); - } - - public void PauseMic() - { - if (audioRecorder == null) - { - Tizen.Log.Error(LogTag, "audio record is null"); - return; - } - audioRecorder.PauseRecording(); - } - - public void ResumeMic() - { - if(audioRecorder == null) - { - Tizen.Log.Error(LogTag, "audio record is null"); - return; - } - audioRecorder.ResumeRecording(); - } - - /// - /// Releases unmanaged resources used by this instance. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public void Dispose() - { - if (ttsController != null) - { - ttsController.Dispose(); - ttsController = null; - } - - if (audioRecorder != null) - { - audioRecorder.Dispose(); - audioRecorder = null; - } - } - } -} diff --git a/src/Tizen.AIAvatar/src/Lipsync/LipSyncer.cs b/src/Tizen.AIAvatar/src/Lipsync/LipSyncer.cs deleted file mode 100644 index 8a5fc8fb47e..00000000000 --- a/src/Tizen.AIAvatar/src/Lipsync/LipSyncer.cs +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright(c) 2024 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 Tizen.NUI; -using Tizen.NUI.Scene3D; -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar -{ - internal class LipSyncer - { - private Animation lipAnimation = null; - - private VowelConverter vowelConverter; - private AudioPlayer audioPlayer; - private event Func TheEvent; - - internal Func CreatedKeyFrameAnimation; - - //Mic - private Queue vowelPools = new Queue(); - private string prevVowel = "sil"; - - internal LipSyncer() - { - vowelConverter = new VowelConverter(); - audioPlayer = new AudioPlayer(); - } - - internal AudioPlayer AudioPlayer { get { return audioPlayer; } } - - public void SetLipAnimation(Animation lipAnimation) - { - this.lipAnimation = lipAnimation; - } - - public void PlayAudio(byte[] audio, int sampleRate) - { - if (audio != null) - { - PlayLipSync(audio, sampleRate); - } - } - - public void Stop() - { - StopLipSync(); - } - - public void Pause() - { - PauseLipSync(); - } - - public void Destroy() - { - DestroyLipAnimation(); - } - - //TODO : lipAnimation 자체를 Animator안에서 생성하고 관리될 수 있게 수정. - protected void ResetLipAnimation(Animation lipAnimation) - { - DestroyLipAnimation(); - this.lipAnimation = lipAnimation; - if (this.lipAnimation != null) - { - this.lipAnimation.Finished += OnLipAnimationFinished; - } - } - - protected void PlayLipAnimation() - { - if (lipAnimation == null) - { - Log.Error(LogTag, "Current Lip Animation is null"); - } - lipAnimation?.Play(); - } - - protected void OnLipAnimationFinished(object sender, EventArgs e) - { - } - - private void PlayLipSync(byte[] audio) - { - if (audio == null) - { - Tizen.Log.Error(LogTag, "audi data is null"); - return; - } - DestroyLipAnimation(); - - var lipKeyframes = CreateKeyFrame(audio, CurrentAudioOptions.SampleRate); - if (lipKeyframes != null) - { - var lipAnimation = CreatedKeyFrameAnimation?.Invoke(lipKeyframes, false); - - if (lipAnimation != null) - { - ResetLipAnimation(lipAnimation); - PlayLipAnimation(); - audioPlayer.Play(audio); - } - else - { - Tizen.Log.Error(LogTag, "lipAnimation is null"); - } - } - else - { - Tizen.Log.Error(LogTag, "lipKeyframes is null"); - } - } - - private void PlayLipSync(byte[] audio, int sampleRate) - { - DestroyLipAnimation(); - var lipKeyFrames = CreateKeyFrame(audio, sampleRate); - var lipAnimation = CreatedKeyFrameAnimation?.Invoke(lipKeyFrames, false); - if (lipAnimation != null) - { - ResetLipAnimation(lipAnimation); - PlayLipAnimation(); - } - audioPlayer.Play(audio, sampleRate); - } - - private void PlayLipSync(string path) - { - var bytes = Utils.ReadAllBytes(path); - if (bytes != null) - { - PlayLipSync(bytes); - } - else - { - Log.Error(LogTag, "Failed to load audio file"); - } - } - - private void PauseLipSync() - { - PauseLipAnimation(); - audioPlayer.Pause(); - } - - private void StopLipSync() - { - if (lipAnimation != null) - { - DestroyLipAnimation(); - - var lipAnimation = ResetLipAnimation(); - if (lipAnimation != null) - { - ResetLipAnimation(lipAnimation); - PlayLipAnimation(); - } - else - { - Log.Error(LogTag, "Current Lip Animation is null"); - } - } - else - { - Log.Error(LogTag, "Current Lip Animation is null"); - } - audioPlayer.Stop(); - } - - private void PauseLipAnimation() - { - if (lipAnimation != null) - { - lipAnimation?.Pause(); - } - else - { - Log.Error(LogTag, "Current Lip Animation is null"); - } - } - - private void DestroyLipAnimation() - { - if (lipAnimation != null) - { - lipAnimation.Stop(); - lipAnimation.Dispose(); - lipAnimation = null; - } - } - - private void EnqueueVowels(byte[] buffer, bool deleteLast = false) - { - var vowels = PredictVowels(buffer); - if (vowels != null) - { - vowelPools.Enqueue(vowels); - if (deleteLast) - { - var vowelList = new List(vowels); - vowelList.RemoveAt(vowelList.Count - 1); - vowels = vowelList.ToArray(); - } - } - } - - private Animation CreateLipAnimationByVowelsQueue(int sampleRate = 0) - { - if (sampleRate == 0) - { - sampleRate = CurrentAudioOptions.SampleRate; - } - if (vowelPools.Count > 0) - { - AttachPreviousVowel(vowelPools.Dequeue(), out var newVowels); - Log.Info(LogTag, $"vowelRecognition: {String.Join(", ", newVowels)}"); - - var lipKeyFrames = vowelConverter?.CreateKeyFrames(newVowels, sampleRate, true); - var lipAnimation = CreatedKeyFrameAnimation?.Invoke(lipKeyFrames, true); - - return lipAnimation; - } - return null; - } - - private Animation ResetLipAnimation() - { - vowelPools.Clear(); - var newVowels = new string[1]; - newVowels[0] = prevVowel = "sil"; - vowelPools.Enqueue(newVowels); - return CreateLipAnimationByVowelsQueue(); - } - - private string[] PredictVowels(byte[] audioData) - { - string[] vowels = vowelConverter?.PredictVowels(audioData); - return vowels; - } - - private void AttachPreviousVowel(in string[] vowels, out string[] newVowels) - { - newVowels = new string[vowels.Length + 1]; - newVowels[0] = prevVowel; - Array.Copy(vowels, 0, newVowels, 1, vowels.Length); - prevVowel = vowels[vowels.Length - 1]; - } - - private AnimationKeyFrame CreateKeyFrame(byte[] audio, int sampleRate) - { - var keyFrames = vowelConverter?.CreateKeyFrames(audio, sampleRate); - if (keyFrames == null) - { - Log.Error(LogTag, $"Failed to initialize KeyFrames"); - } - - return keyFrames; - } - - - internal void OnRecordBufferChanged(byte[] recordBuffer, int sampleRate) - { - EnqueueVowels(recordBuffer); - } - - internal void OnRecodingTick() - { - var lipAnimation = CreateLipAnimationByVowelsQueue(); - if (lipAnimation != null) - { - ResetLipAnimation(lipAnimation); - PlayLipAnimation(); - } - else - { - Log.Error(LogTag, "Current Lip Animation is null"); - } - } - } -} diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/AnimationConverter.cs b/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/AnimationConverter.cs deleted file mode 100644 index 2e2c6a4c06b..00000000000 --- a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/AnimationConverter.cs +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright(c) 2024 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 Newtonsoft.Json; - -using System; -using System.Collections.Generic; -using System.IO; - -namespace Tizen.AIAvatar -{ - internal enum Viseme - { - sil, AE, Ah, B_M_P, Ch_J, EE, Er, IH, Oh, W_OO, S_Z, F_V, TH, - T_L_D_N, K_G_H_NG, R - }; - - internal class AnimationConverter - { - private Dictionary VowelToViseme - = new Dictionary { - { "A", "Ah" }, - { "E", "AE" }, - { "I", "EE" }, - { "O", "R" }, - { "ER", "R" }, - { "U", "W_OO" }, - { "HM", "B_M_P" }, - { "sil", "sil" } - }; - - private AnimationKeyFrame _animationKeyFrame; - private BlendShapeInfo _visemBlendShapeInfo; - private Dictionary _visemeMap; - - private bool _isInitialized; - - public AnimationConverter() { } - - public void InitializeVisemeInfo(string info_path) - { - try - { - StreamReader v = new StreamReader(info_path); - var jsonString = v.ReadToEnd(); - - _visemBlendShapeInfo = JsonConvert.DeserializeObject(jsonString); - _visemeMap = _visemBlendShapeInfo.GetVisemeMap(); - - var nodeNames = _visemBlendShapeInfo.GetNodeNames(); - var blendShapeCounts = _visemBlendShapeInfo.GetBlendShapeCounts(); - var blendShapeKeyFormat = _visemBlendShapeInfo.blendShape.keyFormat; - - _animationKeyFrame = new AnimationKeyFrame(nodeNames, - blendShapeCounts, - blendShapeKeyFormat); - _isInitialized = true; - v.Dispose(); - } - catch (Exception) - { - throw new FailedPersonalizeException(info_path); - } - } - - public AnimationKeyFrame ConvertVowelsToAnimation(string[] vowels, - float stepDuration) - { - if (!_isInitialized) throw new NotInitializedException(); - - _animationKeyFrame.ClearAnimation(); - ConvertVowelsToVisemes(vowels, out var visemes); - ConvertVisemesToAnimationKeyFrame(visemes, stepDuration); - - return _animationKeyFrame; - } - - public AnimationKeyFrame ConvertVowelsToAnimationMic(string[] vowels, - float stepDuration) - { - if (!_isInitialized) throw new NotInitializedException(); - - _animationKeyFrame.ClearAnimation(); - ConvertVowelsToVisemes(vowels, out var visemes); - ConvertVisemesToAnimationKeyFrameMic(visemes, stepDuration); - - return _animationKeyFrame; - } - - private void ConvertVowelsToVisemes(in string[] vowels, - out string[] visemes) - { - visemes = new string[vowels.Length]; - - for (var i = 0; i < vowels.Length; i++) - { - if (!VowelToViseme.TryGetValue(vowels[i], out visemes[i])) - { - throw new InvalidVowelTypeException(vowels[i]); - } - } - } - - private void ConvertVisemesToAnimationKeyFrame(in string[] visemes, - float stepDuration) - { - float animationTime = visemes.Length * stepDuration; - _animationKeyFrame.SetAnimationTime(animationTime); - - for (int i = 0; i < visemes.Length; i++) - { - float timeStamp = GetTimeStamp(i, stepDuration) / animationTime; - - foreach (var info in _visemeMap[visemes[i]]) - { - _animationKeyFrame.AddKeyFrame(info.nodeName, - info.blendIndex, - timeStamp, - info.blendValue); - } - } - } - - private void ConvertVisemesToAnimationKeyFrameMic(in string[] visemes, - float stepDuration) - { - float animationTime = (visemes.Length - 1) * stepDuration; - _animationKeyFrame.SetAnimationTime(animationTime); - - for (int i = 0; i < visemes.Length; i++) - { - float timeStamp = GetTimeStamp(i, stepDuration) / animationTime; - - foreach (var info in _visemeMap[visemes[i]]) - { - _animationKeyFrame.AddKeyFrame(info.nodeName, - info.blendIndex, - timeStamp, - info.blendValue); - } - } - } - - private float GetTimeStamp(int idx, float stepDuration) - { - if (idx > 0) - return (idx * stepDuration) - (stepDuration / 2.0f); - else - return 0; - } - } -} \ No newline at end of file diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/DTO/AnimationKeyFrame.cs b/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/DTO/AnimationKeyFrame.cs deleted file mode 100644 index 04f2a6ea832..00000000000 --- a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/DTO/AnimationKeyFrame.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright(c) 2024 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.Collections.Generic; - -namespace Tizen.AIAvatar -{ - internal class KeyFrame - { - public KeyFrame(float t, float v) - { - time = t; - value = v; - } - public float time; - public float value; - } - - internal class AnimationKeyFrame - { - private Dictionary[]> _animationKeyFrames; - - public string[] NodeNames { get; private set; } - public int[] BlendShapeCounts { get; private set; } - public string BlendShapeKeyFormat { get; private set; } - public float AnimationTime { get; private set; } - - public AnimationKeyFrame(string[] nodeNames, - int[] blendShapeCounts, - string blendShapeKeyFormat) - { - _animationKeyFrames = new Dictionary[]>(); - NodeNames = nodeNames; - BlendShapeCounts = blendShapeCounts; - BlendShapeKeyFormat = blendShapeKeyFormat; - - InitializeAnimation(nodeNames, blendShapeCounts); - } - - public void SetAnimationTime(float animationTime) - { - AnimationTime = animationTime; - } - - public List GetKeyFrames(string nodeName, int blendIndex) - { - return _animationKeyFrames[nodeName][blendIndex]; - } - - public void AddKeyFrame(string nodeName, int blendIndex, float time, float value) - { - _animationKeyFrames[nodeName][blendIndex].Add(new KeyFrame(time, value)); - } - - public void AddKeyFrame(string nodeName, int blendIndex, KeyFrame value) - { - _animationKeyFrames[nodeName][blendIndex].Add(value); - } - - public void InitializeAnimation(string[] nodeNames, int[] blendShapeCounts) - { - ClearAnimation(); - - for (int i = 0; i < nodeNames.Length; i++) - { - var nodeName = nodeNames[i]; - var blendShapeCount = blendShapeCounts[i]; - - _animationKeyFrames.Add(nodeName, new List[blendShapeCount]); - - for (int j = 0; j < blendShapeCount; j++) - { - _animationKeyFrames[nodeName][j] = new List(); - } - } - } - - public void ClearAnimation() - { - foreach (KeyValuePair[]> kvp in _animationKeyFrames) - { - foreach (List kf in kvp.Value) - { - kf.Clear(); - } - } - } - } -} diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/DTO/BlendShapeInfo.cs b/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/DTO/BlendShapeInfo.cs deleted file mode 100644 index 8fb8163b146..00000000000 --- a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/DTO/BlendShapeInfo.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright(c) 2024 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.Collections.Generic; - -namespace Tizen.AIAvatar -{ - internal class BlendShapeInfo - { - public BlendShapeModelInfo blendShape; - public BlendShapeVisemeInfo[] visemes; - - public BlendShapeInfo() { } - - public string[] GetNodeNames() - { - return blendShape.nodeNames; - } - - public int[] GetBlendShapeCounts() - { - return blendShape.blendShapeCount; - } - - public Dictionary GetVisemeMap() - { - Dictionary visemeMap - = new Dictionary(); - - foreach (var visemeInfo in this.visemes) - { - visemeMap.Add(visemeInfo.name, visemeInfo.values); - } - - return visemeMap; - } - } - - internal class BlendShapeModelInfo - { - public string keyFormat; - public string[] nodeNames; - public int[] blendShapeCount; - - public BlendShapeModelInfo(string keyFormat, string[] nodeNames, int[] blendShapeCount) - { - this.keyFormat = keyFormat; - this.nodeNames = nodeNames; - this.blendShapeCount = blendShapeCount; - } - } - - internal class BlendShapeVisemeInfo - { - public string name; - public BlendShapeValue[] values; - } - - internal class BlendShapeValue - { - public string nodeName; - public int blendIndex; - public float blendValue; - } -} diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/Exception.cs b/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/Exception.cs deleted file mode 100644 index da7b089053b..00000000000 --- a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/Vowel2Animation/Exception.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright(c) 2024 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; - -namespace Tizen.AIAvatar -{ - internal class InvalidVowelTypeException : Exception - { - public InvalidVowelTypeException() { } - - public InvalidVowelTypeException(string name) - : base($"Not supported vowel type, {name}") { } - } - - internal class FailedPersonalizeException : Exception - { - public FailedPersonalizeException() { } - - public FailedPersonalizeException(string name) - : base($"Failed to personalize, file_path : {name}") { } - } - - internal class NotInitializedException : Exception - { - public NotInitializedException() - : base($"Animation Converter should be initialized with viseme_info") { } - } -} diff --git a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/VowelConverter.cs b/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/VowelConverter.cs deleted file mode 100644 index 0b65da25465..00000000000 --- a/src/Tizen.AIAvatar/src/Lipsync/VowelConverter/VowelConverter.cs +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright(c) 2024 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.Collections.Generic; - -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar -{ - internal class VowelConverter - { - private TFVowel6 vowelClassfierModel = null; - private VowelClassifier vowelClassifier = null; - private Dictionary vowelClassifiers; - private AnimationConverter animationConverter = new AnimationConverter(); - - internal VowelConverter() - { - vowelClassifiers = new Dictionary(); - vowelClassifier = GetVowelClassifier(CurrentAudioOptions.SampleRate); - vowelClassfierModel = new TFVowel6(new int[4] { 12, 1, 1, 1 }, new int[4] { 7, 1, 1, 1 }); - animationConverter.InitializeVisemeInfo(VisemeInfo); - } - - internal AnimationKeyFrame CreateKeyFrames(string[] vowels, int sampleRate, bool isMic = false) - { - vowelClassifier = GetVowelClassifier(sampleRate); - - if (isMic) - { - return animationConverter.ConvertVowelsToAnimationMic(vowels, vowelClassifier.GetStepTime()); - } - else - { - return animationConverter.ConvertVowelsToAnimation(vowels, vowelClassifier.GetStepTime()); - } - } - - internal AnimationKeyFrame CreateKeyFrames(byte[] audioData, int sampleRate, bool isMic = false) - { - vowelClassifier = GetVowelClassifier(sampleRate); - - if (vowelClassifier == null) - { - Log.Error(LogTag, "Failed to play Buffer"); - return null; - } - var vowels = PredictVowels(audioData); - Log.Info(LogTag, $"vowelRecognition: {string.Join(", ", vowels)}"); - - if (isMic) return animationConverter.ConvertVowelsToAnimationMic(vowels, vowelClassifier.GetStepTime()); - else return animationConverter.ConvertVowelsToAnimation(vowels, vowelClassifier.GetStepTime()); - } - - internal string[] PredictVowels(byte[] audioData) - { - var vowels = vowelClassifier.Inference(audioData, vowelClassfierModel); - return vowels; - } - - internal VowelClassifier GetVowelClassifier(int sampleRate) - { - if (vowelClassifiers.ContainsKey(sampleRate)) - { - return vowelClassifiers[sampleRate]; - } - else - { - vowelClassifiers[sampleRate] = new VowelClassifier(sampleRate); - return vowelClassifiers[sampleRate]; - } - } - } -} diff --git a/src/Tizen.AIAvatar/src/Multimedia/Audio/AudioPlayer.cs b/src/Tizen.AIAvatar/src/Multimedia/Audio/AudioPlayer.cs index bd04ec08502..8b13be57562 100644 --- a/src/Tizen.AIAvatar/src/Multimedia/Audio/AudioPlayer.cs +++ b/src/Tizen.AIAvatar/src/Multimedia/Audio/AudioPlayer.cs @@ -15,124 +15,460 @@ * */ -using Tizen.Multimedia; -using System.IO; + using System; +using System.IO; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.Multimedia; using static Tizen.AIAvatar.AIAvatar; +using System.ComponentModel; namespace Tizen.AIAvatar { - internal class AudioPlayer : IDisposable + /// + /// Represents an audio player capable of streaming and playing audio with support for audio ducking. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class AudioPlayer : IDisposable { - private AudioPlayback audioPlayback; + + private int accLength = 0; + private int streamIndex = 0; + + private bool isStreaming = false; + private MemoryStream audioStream; + private MemoryStream baseAudioStream; + private List streamList; + + private AudioDucking audioDucking; + private AudioPlayback audioPlayback; + private AudioStreamPolicy audioStreamPolicy; - internal AudioPlayer() + private Timer bufferChecker; + + private AudioPlayerState currentAudioPlayerState = AudioPlayerState.Unavailable; + internal event EventHandler AudioPlayerStateChanged; + + + /// + /// Initializes a new instance of the class. + /// + /// Optional audio options for playback configuration. + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioPlayer(AudioOptions audioOptions = null) { + + if (audioOptions == null) + CurrentAudioOptions = DefaultAudioOptions; + else + CurrentAudioOptions = audioOptions; + + + baseAudioStream = new MemoryStream(); + streamList = new List(); + + audioStreamPolicy = new AudioStreamPolicy(CurrentAudioOptions.StreamType); + InitAudio(CurrentAudioOptions.SampleRate); + + bufferChecker = new Timer(100); + bufferChecker.Tick += OnBufferChecker; + + audioDucking = new AudioDucking(CurrentAudioOptions.DuckingTargetStreamType); + audioDucking.DuckingStateChanged += (sender, arg) => + { + if (arg.IsDucked) + { + CurrentAudioPlayerState = AudioPlayerState.Playing; + } + }; + + AudioPlayerStateChanged += OnStateChanged; + } + + /// + /// Adds a new audio buffer to the stream list. + /// + /// The audio buffer to add. + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddStream(byte[] buffer) + { + streamList.Add(new MemoryStream(buffer)); } - internal void PlayAsync(byte[] buffer, int sampleRate = 0) + /// + /// Determines if the audio player is prepared with a valid stream. + /// + /// True if a valid stream is available; otherwise, false. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool IsPrepare() { - if (audioPlayback == null) + return streamList.Count > 0; + } + + /// + /// Prepare the audio from the stream asynchronously. + /// + /// Optional sample rate for the audio playback. + [EditorBrowsable(EditorBrowsableState.Never)] + public void PrepareStreamAudio(int sampleRate = 0) + { + InitializeStream(); + + if (audioPlayback == null || audioPlayback.SampleRate != sampleRate) { - Play(buffer, sampleRate); + InitAudio(sampleRate); } - else + + + try + { + audioDucking.Activate(AIAvatar.CurrentAudioOptions.DuckingDuration, AIAvatar.CurrentAudioOptions.DuckingRatio); + } + catch (Exception e) { - audioPlayback.Write(buffer); + Log.Error(LogTag, $"Failed to PlayAsync AudioPlayback. {e.Message}"); + CurrentAudioPlayerState = AudioPlayerState.Playing; } } - internal void Play(byte[] audioBytes, int sampleRate = 0) + /// + /// Plays the provided audio buffer. + /// + /// The audio buffer to play. + /// Optional sample rate for the audio playback. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Play(byte[] audioBytes, int sampleRate = 0) { + isStreaming = false; + if (audioBytes == null) { + Log.Error(LogTag, $"Play AudioPlayBack null."); return; } + if (audioPlayback.SampleRate != sampleRate) + { + InitAudio(sampleRate); + } + + InitializeStream(); + streamList.Add(new MemoryStream(audioBytes)); + try { + audioDucking.Activate(CurrentAudioOptions.DuckingDuration, CurrentAudioOptions.DuckingRatio); + } + catch (Exception e) + { + Log.Error(LogTag, $"Failed to Play AudioPlayback. {e.Message}"); + CurrentAudioPlayerState = AudioPlayerState.Playing; + } + } + + /// + /// Pauses the current audio playback. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Pause() + { + CurrentAudioPlayerState = AudioPlayerState.Paused; + + } + + /// + /// Stops the current audio playback. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Stop() + { + CurrentAudioPlayerState = AudioPlayerState.Stopped; + } + + /// + /// Destroys the audio player and clears all resources. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Destroy() + { + DestroyAudioPlayback(); + streamList.Clear(); + streamList = null; + } + + /// + /// Releases all resources used by the AudioPlayer. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Releases all resources used by the AudioPlayer. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (bufferChecker != null) + { + bufferChecker.Stop(); + bufferChecker.Dispose(); + bufferChecker = null; + } + + if (audioDucking != null) + { + audioDucking.DuckingStateChanged -= (sender, arg) => + { + if (arg.IsDucked) + { + CurrentAudioPlayerState = AudioPlayerState.Playing; + } + }; + audioDucking.Dispose(); + audioDucking = null; + } + if (audioPlayback != null) { - Destroy(); + Stop(); + audioPlayback.BufferAvailable -= OnBufferAvailable; + audioPlayback.Dispose(); + audioPlayback = null; } - if (sampleRate == 0) + + if (audioStreamPolicy != null) { - sampleRate = CurrentAudioOptions.SampleRate; + audioStreamPolicy.Dispose(); + audioStreamPolicy = null; + } + + if (baseAudioStream != null) + { + baseAudioStream.Dispose(); + baseAudioStream = null; + } + + if (streamList != null) + { + foreach (var stream in streamList) + { + stream.Dispose(); + } + streamList.Clear(); + streamList = null; } - audioPlayback = new AudioPlayback(sampleRate, CurrentAudioOptions.Channel, CurrentAudioOptions.SampleType); } - catch (Exception e) + } + + /// + /// Gets or sets the current state of the audio player. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioPlayerState CurrentAudioPlayerState + { + get => currentAudioPlayerState; + protected set { - Log.Error(LogTag, $"Failed to create AudioPlayback. {e.Message}"); + if (currentAudioPlayerState == value) return; + + var preState = currentAudioPlayerState; + currentAudioPlayerState = value; + + AudioPlayerStateChanged?.Invoke(this, new AudioPlayerChangedEventArgs(preState, currentAudioPlayerState)); } + } - if (audioPlayback != null) + + private bool OnBufferChecker(object source, Timer.TickEventArgs e) + { + if (isStreaming && streamList.Count == 0) + { + return true; + } + + if (audioStream != null && audioStream.Position == audioStream.Length) { - audioPlayback.Prepare(); - audioPlayback.BufferAvailable += (sender, args) => + if (streamIndex >= streamList.Count) { - if (audioStream.Position == audioStream.Length) + CurrentAudioPlayerState = AudioPlayerState.Finished; + Log.Debug(LogTag, $"Complete Play Audio Buffer."); + return false; + } + } + + return true; + } + + private void OnStateChanged(object sender, AudioPlayerChangedEventArgs state) + { + + switch (state.Current) + { + case AudioPlayerState.Playing: + try { - return; + bufferChecker?.Start(); + audioPlayback?.Prepare(); + Log.Debug(LogTag, "Audio is playing."); } + catch (NullReferenceException e) + { + Log.Error(LogTag, $"NullReferenceException in Playing state: {e.Message}"); + } + catch (Exception e) + { + Log.Info(LogTag, $"PlayinnState: {e.Message}"); + } + + break; + case AudioPlayerState.Paused: try { - var buffer = new byte[args.Length]; - audioStream.Read(buffer, 0, args.Length); - audioPlayback.Write(buffer); + bufferChecker?.Stop(); + audioPlayback?.Pause(); + audioPlayback?.Unprepare(); + + if (audioDucking.IsDucked) + audioDucking?.Deactivate(); + + Log.Debug(LogTag, "Audio is paused."); + } + catch (NullReferenceException e) + { + Log.Error(LogTag, $"NullReferenceException in Paused state: {e.Message}"); } catch (Exception e) { - Log.Error(LogTag, $"Failed to write. {e.Message}"); + Log.Info(LogTag, $"PlayinnState: {e.Message}"); } - }; + break; - audioStream = new MemoryStream(audioBytes); + case AudioPlayerState.Stopped: + case AudioPlayerState.Finished: + + try + { + bufferChecker?.Stop(); + audioPlayback?.Pause(); + audioPlayback?.Unprepare(); + + if (audioDucking.IsDucked) + audioDucking?.Deactivate(); + + streamIndex = 0; + audioStream = baseAudioStream; + + Log.Debug(LogTag, "Audio is stopped."); + } + catch (NullReferenceException e) + { + Log.Error(LogTag, $"NullReferenceException in Stopped/Finished state: {e.Message}"); + } + catch (Exception e) + { + Log.Info(LogTag, $"PlayinnState: {e.Message}"); + } + + break; } + } - internal void Pause() + private void OnBufferAvailable(object sender, AudioPlaybackBufferAvailableEventArgs args) { - if (audioPlayback != null) + if (audioStream.Position == audioStream.Length) { - audioPlayback.Pause(); + + if (streamIndex < streamList.Count) + { + audioStream = streamList[streamIndex]; + accLength = (int)audioStream.Length; + + streamIndex++; + } + else + { + return; + } } - else + + try + { + if (args.Length > 1024) + { + accLength -= args.Length; + int length = args.Length; + if (accLength < 0) + { + length += accLength; + } + + var buffer = new byte[length]; + audioStream.Read(buffer, 0, length); + audioPlayback.Write(buffer); + } + } + catch (Exception e) { - Log.Error(LogTag, $"audioPlayBack is null"); + Log.Error(LogTag, $"Failed to write. {e.Message}"); } } - internal void Stop() + private void InitializeStream() + { + isStreaming = true; + streamIndex = 0; + streamList.Clear(); + } + + private void InitAudio(int sampleRate) { if (audioPlayback != null) { - audioPlayback.Pause(); - Destroy(); + DestroyAudioPlayback(); } - else + if (sampleRate == 0) { - Log.Error(LogTag, $"audioPlayBack is null"); + sampleRate = CurrentAudioOptions.SampleRate; } - } - public void Dispose() - { - Destroy(); + try + { + audioPlayback = new AudioPlayback(sampleRate, CurrentAudioOptions.Channel, CurrentAudioOptions.SampleType); + audioPlayback.ApplyStreamPolicy(audioStreamPolicy); + audioPlayback.BufferAvailable += OnBufferAvailable; + + audioStream = baseAudioStream; + } + catch (Exception e) + { + Log.Error(LogTag, $"Failed to create AudioPlayback. {e.Message}"); + } - audioStream?.Flush(); - audioStream?.Dispose(); - audioStream = null; } - private void Destroy() + private void DestroyAudioPlayback() { - audioPlayback?.Unprepare(); - audioPlayback?.Dispose(); + if (audioPlayback != null) + { + Stop(); + audioPlayback.BufferAvailable -= OnBufferAvailable; + audioPlayback.Dispose(); + } + audioPlayback = null; } + + } } diff --git a/src/Tizen.AIAvatar/src/Multimedia/Audio/AudioRecorder.cs b/src/Tizen.AIAvatar/src/Multimedia/Audio/AudioRecorder.cs deleted file mode 100644 index 406ce6d09de..00000000000 --- a/src/Tizen.AIAvatar/src/Multimedia/Audio/AudioRecorder.cs +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright(c) 2023 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.Linq; -using Tizen.Multimedia; -using Tizen.NUI; -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar -{ - internal class AudioRecorder : IDisposable - { - private const string privilegeForRecording = "http://tizen.org/privilege/recorder"; - - private AsyncAudioCapture asyncAudioCapture; - - private byte[] recordedBuffer; - private float desiredBufferDuration = 0.16f; - private int desiredBufferLength; - - private Timer audioRecordingTimer; - - private Action audioRecdingAction; - private Action bufferAction; - - private static AudioRecorder instance; - - internal static AudioRecorder Instance - { - get - { - if (instance == null) - { - instance = new AudioRecorder(); - } - return instance; - } - } - - internal event EventHandler BufferChanged; - - internal AudioRecorder() - { - Utils.CheckPrivilege(privilegeForRecording); - desiredBufferLength = (int)(CurrentAudioOptions.SampleRate * desiredBufferDuration * 2); - } - - internal void InitializeMic(LipSyncer lipSyncer, uint recordingTime = 160) - { - audioRecordingTimer = new Timer(recordingTime); - if (lipSyncer != null) - { - Tizen.Log.Error(LogTag, "LipSyncer of animator is null"); - return; - } - this.audioRecdingAction = lipSyncer.OnRecodingTick; - this.bufferAction = lipSyncer.OnRecordBufferChanged; - - BufferChanged += OnRecordBufferChanged; - audioRecordingTimer.Tick += AudioRecordingTimerTick; - } - - - internal void DeinitializeMic() - { - StopRecording(); - BufferChanged -= OnRecordBufferChanged; - - if (audioRecordingTimer != null) - { - audioRecordingTimer.Stop(); - audioRecordingTimer.Tick -= AudioRecordingTimerTick; - - audioRecordingTimer.Dispose(); - audioRecordingTimer = null; - } - audioRecdingAction = null; - } - - internal void StartRecording() - { - audioRecordingTimer?.Start(); - asyncAudioCapture = new AsyncAudioCapture(CurrentAudioOptions.SampleRate, CurrentAudioOptions.Channel, CurrentAudioOptions.SampleType); - - recordedBuffer = new byte[0]; - asyncAudioCapture.DataAvailable += (s, e) => - { - recordedBuffer = recordedBuffer.Concat(e.Data).ToArray(); - if (recordedBuffer.Length >= desiredBufferLength) - { - var recordedBuffer = this.recordedBuffer; - this.recordedBuffer = Array.Empty(); - - BufferChanged?.Invoke(this, new RecordBufferChangedEventArgs(recordedBuffer, CurrentAudioOptions.SampleRate)); - } - }; - asyncAudioCapture.Prepare(); - Log.Info(LogTag, "Start Recording - Preapre AsyncAudioCapture"); - } - - internal void StopRecording() - { - audioRecordingTimer?.Stop(); - asyncAudioCapture.Dispose(); - } - - internal void PauseRecording() - { - asyncAudioCapture.Pause(); - } - - internal void ResumeRecording() - { - asyncAudioCapture.Resume(); - } - - private void OnRecordBufferChanged(object sender, RecordBufferChangedEventArgs e) - { - bufferAction?.Invoke(e.RecordedBuffer, CurrentAudioOptions.SampleRate); - } - - private bool AudioRecordingTimerTick(object source, Timer.TickEventArgs e) - { - Log.Info(LogTag, "TickTimer"); - audioRecdingAction?.Invoke(); - return true; - } - - public void Dispose() - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Tizen.AIAvatar/src/Multimedia/Audio/Core/AudioOptions.cs b/src/Tizen.AIAvatar/src/Multimedia/Audio/Core/AudioOptions.cs new file mode 100644 index 00000000000..63b792db137 --- /dev/null +++ b/src/Tizen.AIAvatar/src/Multimedia/Audio/Core/AudioOptions.cs @@ -0,0 +1,123 @@ +/* + * Copyright(c) 2023 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.ComponentModel; +using Tizen.Multimedia; + +namespace Tizen.AIAvatar +{ + /// + /// Provides the ability to audio + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public class AudioOptions + { + private int sampleRate; + private AudioChannel channel; + private AudioSampleType sampleType; + private AudioStreamType streamType; + + private double duckingRatio; + private uint duckingDuration; + private AudioStreamType duckingTargetStreamType; + + + /// + /// Initializes a new instance of the AudioOptions class with the specified sample rate, channel, sampleType and streamType. + /// + /// the audio sample rate (8000 ~ 192000Hz) + /// the audio channel type. + /// the audio sample type. + /// the audio Stream type. + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioOptions(int sampleRate, AudioChannel channel, AudioSampleType sampleType, AudioStreamType streamType) + { + this.sampleRate = sampleRate; + this.channel = channel; + this.sampleType = sampleType; + this.streamType = streamType; + + DuckingOptions(AudioStreamType.Media, 500, 0.2); + } + + /// + /// Initialize the DuckingOption values of the AudioOptions class using the specified target StreamType, Duration, and Ratio. + /// + /// the audio Ducking target Stream type. + /// the ducking duration. + /// the ducking target volume ratio. + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public void DuckingOptions(AudioStreamType duckingTargetStreamType, uint duckingDuration, double duckingRatio) + { + this.duckingTargetStreamType = duckingTargetStreamType; + this.duckingDuration = duckingDuration; + this.duckingRatio = duckingRatio; + } + + /// + /// The audio sample rate (8000 ~ 192000Hz) + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public int SampleRate { get => sampleRate; set => sampleRate = value; } + + /// + /// The audio channel type + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioChannel Channel { get => channel; set => channel = value; } + + /// + /// The audio sample type + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioSampleType SampleType { get => sampleType; set => sampleType = value; } + + /// + /// The audio stream type + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioStreamType StreamType { get => streamType; set => streamType = value; } + + /// + /// The audio ducking duration. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public uint DuckingDuration { get => duckingDuration; set => duckingDuration = value; } + + /// + /// The audio ducking ratio. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public double DuckingRatio { get => duckingRatio; set => duckingRatio = value; } + + /// + /// The audio ducking target stream type. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioStreamType DuckingTargetStreamType { get => duckingTargetStreamType; } + } +} diff --git a/src/Tizen.AIAvatar/src/Multimedia/Audio/Core/AudioPlayerChangedEventArgs.cs b/src/Tizen.AIAvatar/src/Multimedia/Audio/Core/AudioPlayerChangedEventArgs.cs new file mode 100644 index 00000000000..145f6cf1a73 --- /dev/null +++ b/src/Tizen.AIAvatar/src/Multimedia/Audio/Core/AudioPlayerChangedEventArgs.cs @@ -0,0 +1,63 @@ +/* + * Copyright(c) 2024 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.ComponentModel; + +namespace Tizen.AIAvatar +{ + /// + /// This class provides arguments for handling Audio State change events. + /// The previous state of the audio. + /// The current state of the audio. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class AudioPlayerChangedEventArgs : EventArgs + { + /// + /// Initializes a new instance of the AudioChangedEventArgs class with the specified previous and current states. + /// + /// The previous state of the audio. + /// The current state of the audio. + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioPlayerChangedEventArgs(AudioPlayerState previous, AudioPlayerState current) + { + Previous = previous; + Current = current; + } + + /// + /// The previous state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioPlayerState Previous + { + get; + internal set; + } + + /// + /// The current state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public AudioPlayerState Current + { + get; + internal set; + } + } +} diff --git a/src/Tizen.AIAvatar/src/Animations/AvatarMotionState.cs b/src/Tizen.AIAvatar/src/Multimedia/Audio/Core/AudioPlayerState.cs similarity index 88% rename from src/Tizen.AIAvatar/src/Animations/AvatarMotionState.cs rename to src/Tizen.AIAvatar/src/Multimedia/Audio/Core/AudioPlayerState.cs index aa62b0d4940..b4e37f779e1 100644 --- a/src/Tizen.AIAvatar/src/Animations/AvatarMotionState.cs +++ b/src/Tizen.AIAvatar/src/Multimedia/Audio/Core/AudioPlayerState.cs @@ -23,10 +23,10 @@ namespace Tizen.AIAvatar /// Enumeration for the states. /// [EditorBrowsable(EditorBrowsableState.Never)] - public enum AvatarMotionState + public enum AudioPlayerState { /// - /// Created state. + /// Fail state. /// [EditorBrowsable(EditorBrowsableState.Never)] Failed = -1, @@ -55,6 +55,12 @@ public enum AvatarMotionState [EditorBrowsable(EditorBrowsableState.Never)] Stopped = 5, + /// + /// Finished state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Finished = 6, + /// /// Unavailable state. /// diff --git a/src/Tizen.AIAvatar/src/Multimedia/TTS/TTSController.cs b/src/Tizen.AIAvatar/src/Multimedia/TTS/TTSController.cs deleted file mode 100644 index f6cea3c405f..00000000000 --- a/src/Tizen.AIAvatar/src/Multimedia/TTS/TTSController.cs +++ /dev/null @@ -1,532 +0,0 @@ -/* - * Copyright(c) 2024 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.Linq; -using Tizen.Uix.Tts; - -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar -{ - internal class TTSControllerEventArgs : EventArgs - { - public TTSControllerEventArgs() - { - } - - public TTSControllerEventArgs(byte[] audioData, int sampleRate) - { - //AudioData = audioData; - AudioData = new byte[audioData.Length]; - Buffer.BlockCopy(audioData, 0, AudioData, 0, audioData.Length); - SampleRate = sampleRate; - } - - public byte[] AudioData - { - get; - internal set; - } - - public int SampleRate - { - get; - internal set; - } - } - - internal class TTSController : IDisposable - { - private List textList; - private TtsClient ttsHandle; - private VoiceInfo voiceInfo; - private List byteList; - - private byte[] recordedBuffer; - private byte[] audioTailBuffer; - - private int sampleRate; - private float desiredBufferDuration = 0.175f; - private float audioTailLengthFactor = 0.015f; - private float audioBufferMultiflier = 2f; - - private int desiredBufferLength; - private int audioTailLength; - - private bool isPrepared = false; - private bool isAsync = false; - - private Action bufferChangedAction; - - private int audioLength; - private bool isAsyncLipStarting; - - internal event EventHandler PlayReadyCallback; - - internal event EventHandler PreparedSyncText; - internal event EventHandler StoppedTTS; - - - internal event EventHandler UpdatedBuffer; - - internal TTSController() - { - InitTts(); - } - - ~TTSController() - { - DeinitTts(); - } - - internal TtsClient TtsHandle - { - get { return ttsHandle; } - } - - internal VoiceInfo VoiceInfo - { - get { return voiceInfo; } - set - { - voiceInfo = value; - } - } - - internal List GetSupportedVoices() - { - var voiceInfoList = new List(); - - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return voiceInfoList; - } - - var supportedVoices = ttsHandle.GetSupportedVoices(); - foreach (var supportedVoice in supportedVoices) - { - Log.Info(LogTag, $"{supportedVoice.Language} & {supportedVoice.VoiceType} is supported"); - voiceInfoList.Add(new VoiceInfo() { Language = supportedVoice.Language, Type = (VoiceType)supportedVoice.VoiceType }); - } - return voiceInfoList; - } - - internal bool IsSupportedVoice(string lang) - { - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return false; - } - var supportedVoices = ttsHandle.GetSupportedVoices(); - - foreach (var supportedVoice in supportedVoices) - { - if (supportedVoice.Language.Equals(lang)) - { - Log.Info(LogTag, $"{lang} is supported"); - return true; - } - } - return false; - } - - internal bool IsSupportedVoice(VoiceInfo voiceInfo) - { - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return false; - } - var supportedVoices = ttsHandle.GetSupportedVoices(); - foreach (var supportedVoice in supportedVoices) - { - if (supportedVoice.Language.Equals(voiceInfo.Language) && ((VoiceType)supportedVoice.VoiceType == voiceInfo.Type)) - { - Log.Info(LogTag, $"{voiceInfo.Language} & {voiceInfo.Type} is supported"); - return true; - } - } - return false; - } - - - internal void AddText(string txt, VoiceInfo voiceInfo) - { - if (voiceInfo.Language == null) - { - Log.Error(LogTag, "VoiceInfo's value is null"); - } - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return; - } - var temp = new UtteranceText(); - temp.Text = txt; - temp.UttID = ttsHandle.AddText(txt, voiceInfo.Language, (int)voiceInfo.Type, 0); - try - { - textList.Add(temp); - } - catch (Exception e) - { - Log.Error(LogTag, $"Error AddText" + e.Message); - } - } - - internal void AddText(string txt, string lang) - { - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return; - } - var temp = new UtteranceText(); - temp.Text = txt; - temp.UttID = ttsHandle.AddText(txt, lang, (int)voiceInfo.Type, 0); - try - { - textList.Add(temp); - } - catch (Exception e) - { - Log.Error(LogTag, $"Error AddText" + e.Message); - } - } - - internal void Prepare(EventHandler playReadyCallback) - { - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return; - } - Log.Info(LogTag, "Prepare TTS"); - isPrepared = true; - isAsync = false; - PlayReadyCallback = playReadyCallback; - Play(true); - } - - - internal bool PlayPreparedText() - { - if (byteList != null && byteList.Count != 0) - { - Log.Info(LogTag, "PlayPreparedText TTS"); - - PreparedSyncText?.Invoke(this, new TTSControllerEventArgs(byteList.ToArray(), sampleRate)); - return true; - } - return false; - } - - internal void Play(bool isPrepared = false) - { - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return; - } - - this.isPrepared = isPrepared; - isAsync = false; - ttsHandle.Play(); - } - - internal void PlayAsync(EventHandler playReadyCallback) - { - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return; - } - - isPrepared = false; - isAsync = true; - PlayReadyCallback = playReadyCallback; - ttsHandle.Play(); - } - - public void Pause() - { - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return; - } - ttsHandle.Pause(); - } - - internal void Stop() - { - if (ttsHandle == null) - { - Log.Error(LogTag, $"ttsHandle is null"); - return; - } - ttsHandle.Stop(); - StoppedTTS?.Invoke(this, new TTSControllerEventArgs()); - } - - internal void DeinitTts() - { - try - { - if (ttsHandle != null) - { - ttsHandle.Unprepare(); - - // Unregister Callbacks - ttsHandle.DefaultVoiceChanged -= TtsDefaultVoiceChangedCallback; - ttsHandle.EngineChanged -= TtsEngineChangedCallback; - ttsHandle.ErrorOccurred -= TtsErrorOccuredCallback; - ttsHandle.StateChanged -= TtsStateChangedCallback; - ttsHandle.UtteranceCompleted -= TtsUtteranceCompletedCallback; - ttsHandle.UtteranceStarted -= TtsUtteranceStartedCallback; - - ttsHandle.Dispose(); - ttsHandle = null; - } - - if (textList != null) - { - textList.Clear(); - textList = null; - } - - if (byteList != null) - { - byteList.Clear(); - byteList = null; - } - } - catch (Exception e) - { - Log.Error(LogTag, "[ERROR] Fail to unprepare Tts"); - Log.Error(LogTag, e.Message); - } - } - - private void InitTts() - { - try - { - ttsHandle = new TtsClient(); - - // Register Callbacks - ttsHandle.DefaultVoiceChanged += TtsDefaultVoiceChangedCallback; - ttsHandle.EngineChanged += TtsEngineChangedCallback; - ttsHandle.ErrorOccurred += TtsErrorOccuredCallback; - ttsHandle.StateChanged += TtsStateChangedCallback; - ttsHandle.UtteranceCompleted += TtsUtteranceCompletedCallback; - ttsHandle.UtteranceStarted += TtsUtteranceStartedCallback; - - ttsHandle.SynthesizedPcm += TtsSyntheiszedPCM; - ttsHandle.PlayingMode = PlayingMode.ByClient; - - ttsHandle.Prepare(); - - voiceInfo = new VoiceInfo - { - Language = ttsHandle.DefaultVoice.Language, - Type = (VoiceType)ttsHandle.DefaultVoice.VoiceType - }; - - textList = new List(); - Log.Info(LogTag, voiceInfo.Language + ", " + voiceInfo.Type.ToString()); - - } - catch (Exception e) - { - Log.Error(LogTag, "[ERROR] Fail to prepare Tts"); - Log.Error(LogTag, e.Message); - } - } - - private void TtsSyntheiszedPCM(object sender, SynthesizedPcmEventArgs e) - { - var dataSize = e.Data.Length; - var audio = new byte[dataSize]; - sampleRate = e.SampleRate; - - //Marshal.Copy(e.Data, audio, 0, dataSize); - switch (e.EventType) //START - { - case SynthesizedPcmEvent.Start://start - Tizen.Log.Info(LogTag, "------------------Start : " + e.UtteranceId); - Tizen.Log.Info(LogTag, "Output audio Size : " + dataSize); - Tizen.Log.Info(LogTag, "SampleRate" + e.SampleRate); - if (byteList == null) - { - byteList = new List(); - } - if (recordedBuffer == null) - { - recordedBuffer = new byte[0]; - } - byteList.Clear(); - - if (isAsync) - { - recordedBuffer = Array.Empty(); - - desiredBufferLength = (int)(e.SampleRate * desiredBufferDuration * audioBufferMultiflier); - audioTailLength = (int)(sampleRate * audioTailLengthFactor * audioBufferMultiflier); - audioTailBuffer = new byte[audioTailLength]; - PlayReadyCallback?.Invoke(null, EventArgs.Empty); - //InitAsyncBuffer(); - } - break; - case SynthesizedPcmEvent.Continue://continue - if (isAsync) - { - recordedBuffer = recordedBuffer.Concat(e.Data).ToArray(); - //PlayAsync - if (recordedBuffer.Length >= desiredBufferLength) - { - Tizen.Log.Error(LogTag, "Current recordbuffer length :" + recordedBuffer.Length); - //UpdateBuffer(recordedBuffer, sampleRate); - - Buffer.BlockCopy(recordedBuffer, recordedBuffer.Length - audioTailLength, audioTailBuffer, 0, audioTailLength); - - recordedBuffer = Array.Empty(); - recordedBuffer = recordedBuffer.Concat(audioTailBuffer).ToArray(); - Array.Clear(audioTailBuffer, 0, audioTailLength); - } - } - else - { - byteList.AddRange(e.Data); - } - break; - case SynthesizedPcmEvent.Finish://finish - Tizen.Log.Info(LogTag, "------------------Finish : " + e.UtteranceId); - if (!isAsync) - { - if (!isPrepared) - { - //Play voice immediately - PlayPreparedText(); - } - else - { - //Notify finished state - Log.Info(LogTag, "Notify finished state"); - PlayReadyCallback?.Invoke(null, EventArgs.Empty); - } - } - else - {//async - //FinishedSynthesizedPcm?.Invoke(null, EventArgs.Empty); - //lipSyncer.SetFinishAsyncLip(true); - } - break; - case SynthesizedPcmEvent.Fail: //fail - break; - - } - } - - private void TtsUtteranceStartedCallback(object sender, UtteranceEventArgs e) - { - Log.Debug(LogTag, "Utterance start now (" + e.UtteranceId + ")"); - } - - private void TtsUtteranceCompletedCallback(object sender, UtteranceEventArgs e) - { - Log.Debug(LogTag, "Utterance complete (" + e.UtteranceId + ")"); - - foreach (UtteranceText item in textList) - { - if (item.UttID == e.UtteranceId) - { - textList.Remove(item); - Log.Debug(LogTag, "TextList Count (" + textList.Count.ToString() + ")"); - break; - } - } - } - - private void TtsStateChangedCallback(object sender, StateChangedEventArgs e) - { - Log.Debug(LogTag, "Current state is changed from (" + e.Previous + ") to (" + e.Current + ")"); - } - - private void TtsErrorOccuredCallback(object sender, ErrorOccurredEventArgs e) - { - Log.Error(LogTag, "Error is occured (" + e.ErrorMessage + ")"); - } - - private void TtsEngineChangedCallback(object sender, EngineChangedEventArgs e) - { - Log.Debug(LogTag, "Prefered engine is changed (" + e.EngineId + ") (" + e.VoiceType.Language + ")"); - } - - private void TtsDefaultVoiceChangedCallback(object sender, DefaultVoiceChangedEventArgs e) - { - Log.Debug(LogTag, "Default voice is changed from (" + e.Previous + ") to (" + e.Current + ")"); - } - - private void InitAsyncBuffer() - { - /* - InitedAsyncBuffer?.Invoke(null, EventArgs.Empty); - if (!lipSyncer.IsAsyncInit) - { - audioLength = (int)(sampleRate * 0.16f * 2f); - - lipSyncer.InitAsyncLipsync(); - lipSyncer.IsAsyncInit = true; - - lipSyncer.SetFinishAsyncLip(false); - isAsyncLipStarting = false; - }*/ - } - - private void UpdateBuffer(byte[] recordBuffer, int sampleRate) - { - UpdatedBuffer?.Invoke(this, new TTSControllerEventArgs(recordBuffer, sampleRate)); - /* - if (lipSyncer != null) - { - Log.Error(LogTag, "OnTTSBufferChanged"); - lipSyncer.EnqueueAnimation(recordBuffer, sampleRate, audioLength); - if (!isAsyncLipStarting) - { - lipSyncer.StartAsyncLipPlayTimer(); - isAsyncLipStarting = true; - } - } - else - { - Log.Error(LogTag, "avatarLipSyncer is null"); - }*/ - } - - public void Dispose() - { - ttsHandle.Stop(); - ttsHandle.Dispose(); - ttsHandle = null; - } - } -} diff --git a/src/Tizen.AIAvatar/src/Multimedia/TTS/UtteranceText.cs b/src/Tizen.AIAvatar/src/Multimedia/TTS/UtteranceText.cs deleted file mode 100644 index 2e69e1f97d6..00000000000 --- a/src/Tizen.AIAvatar/src/Multimedia/TTS/UtteranceText.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright(c) 2024 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; - -namespace Tizen.AIAvatar -{ - internal struct UtteranceText : IEquatable - { - private string text; - private int uttID; - - public string Text { get => text; set => text = value; } - public int UttID { get => uttID; set => uttID = value; } - - public override bool Equals(object obj) => obj is VoiceInfo other && this.Equals(other); - - public bool Equals(UtteranceText other) => Text == other.Text && UttID == other.UttID; - - public static bool operator ==(UtteranceText lhsUtternaceText, UtteranceText rhsUtternaceText) => lhsUtternaceText.Equals(rhsUtternaceText); - - public static bool operator !=(UtteranceText lhsUtternaceText, UtteranceText rhsVoiceInfo) => !lhsUtternaceText.Equals(rhsVoiceInfo); - - public override int GetHashCode() => (Text, UttID).GetHashCode(); - } -} diff --git a/src/Tizen.AIAvatar/src/RestClient/IRestClient.cs b/src/Tizen.AIAvatar/src/RestClient/IRestClient.cs deleted file mode 100644 index 9a593b135b6..00000000000 --- a/src/Tizen.AIAvatar/src/RestClient/IRestClient.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright(c) 2024 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.Net.Http; -using System.Threading.Tasks; - -namespace Tizen.AIAvatar -{ - - internal interface IRestClient - { - Task SendRequestAsync(HttpMethod method, string endpoint, string bearerToken = null, string jsonData = null); - } -} diff --git a/src/Tizen.AIAvatar/src/RestClient/RestClient.cs b/src/Tizen.AIAvatar/src/RestClient/RestClient.cs deleted file mode 100644 index 0ee81ebb73b..00000000000 --- a/src/Tizen.AIAvatar/src/RestClient/RestClient.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright(c) 2024 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.Net.Http.Headers; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using System.ComponentModel; - -namespace Tizen.AIAvatar -{ - internal class RestClient : IRestClient, IDisposable - { - private readonly HttpClient client; - - internal RestClient(HttpClient httpClient) - { - client = httpClient; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public async Task SendRequestAsync(HttpMethod method, string endpoint, string bearerToken = null, string jsonData = null) - { - AddBearerToken(bearerToken); - - HttpRequestMessage request = new HttpRequestMessage(method, endpoint); - - if (jsonData != null) - { - request.Content = new StringContent(jsonData, Encoding.UTF8, "application/json"); - } - - HttpResponseMessage response = await client.SendAsync(request); - request?.Dispose(); - return await HandleResponse(response); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void Dispose() - { - client.Dispose(); - } - - private void AddBearerToken(string bearerToken) - { - if (!string.IsNullOrEmpty(bearerToken)) - { - client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken); - } - } - - private async Task HandleResponse(HttpResponseMessage response) - { - if (response.IsSuccessStatusCode) - { - return await response.Content.ReadAsStringAsync(); - } - else - { - throw new HttpRequestException($"HTTP request failed with status code {response.StatusCode}"); - } - } - } -} diff --git a/src/Tizen.AIAvatar/src/Tracking/TrackingOptions.cs b/src/Tizen.AIAvatar/src/Tracking/TrackingOptions.cs deleted file mode 100644 index a908e718b73..00000000000 --- a/src/Tizen.AIAvatar/src/Tracking/TrackingOptions.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright(c) 2024 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. - * - */ - -namespace Tizen.AIAvatar -{ - internal class TrackingOptions - { - } -} diff --git a/src/Tizen.AIAvatar/src/Tracking/TrackingController.cs b/src/Tizen.AIAvatar/src/Utility/AIAvatar.cs similarity index 65% rename from src/Tizen.AIAvatar/src/Tracking/TrackingController.cs rename to src/Tizen.AIAvatar/src/Utility/AIAvatar.cs index 4ca0fbf9b03..79079cad032 100644 --- a/src/Tizen.AIAvatar/src/Tracking/TrackingController.cs +++ b/src/Tizen.AIAvatar/src/Utility/AIAvatar.cs @@ -15,26 +15,15 @@ * */ +using Tizen.Multimedia; + namespace Tizen.AIAvatar { - internal class TrackingController + internal static class AIAvatar { - internal TrackingController() - { - } - - internal void Initialize(TrackingOptions options) - { - } - - internal void StartMotionTracking() - { - - } - - internal void StopMotionTracking() - { + internal const string LogTag = "Tizen.AIAvatar"; - } + internal static AudioOptions DefaultAudioOptions = new AudioOptions(24000, AudioChannel.Mono, AudioSampleType.S16Le, AudioStreamType.System); + internal static AudioOptions CurrentAudioOptions = DefaultAudioOptions; } } diff --git a/src/Tizen.AIAvatar/test/Test.cs b/src/Tizen.AIAvatar/test/Test.cs index e8f0e11a86d..5d9c2cc9984 100644 --- a/src/Tizen.AIAvatar/test/Test.cs +++ b/src/Tizen.AIAvatar/test/Test.cs @@ -21,19 +21,7 @@ internal class Test { public void CreateTest() { - var avatar1 = new Avatar(); - - var avatarInfo = new AvatarInfo("avatarName", "resourcePath"); - var avatar2 = new Avatar(avatarInfo); - - var avatar3 = new Avatar("resourcePath"); - - var avatar4 = new Avatar(avatar1); - - avatar1.Dispose(); - avatar2.Dispose(); - avatar3.Dispose(); - avatar4.Dispose(); + } } } diff --git a/src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs b/src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs index 85f7fb66c12..a7adbf724f6 100755 --- a/src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs +++ b/src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs @@ -54,6 +54,15 @@ internal struct DateTime [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_with_recurrence_week_flag")] internal static extern int CreateAlarmRecurWeek(SafeAppControlHandle appControl, ref DateTime date, int week, out int alarmId); + [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_service_with_recurrence_seconds")] + internal static extern int CreateAlarmRecurForService(SafeAppControlHandle appControl, ref DateTime date, int period, out int alarmId); + + [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_service_once_after_delay")] + internal static extern int CreateAlarmOnceAfterDelayForService(SafeAppControlHandle appControl, int delay, out int alarmId); + + [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_service_once_at_date")] + internal static extern int CreateAlarmOnceAtDateForService(SafeAppControlHandle appControl, ref DateTime date, out int alarmId); + [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_scheduled_recurrence_week_flag")] internal static extern int GetAlarmWeekFlag(int alarmId, out int weekFlag); diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs b/src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs index 5110a58e63b..a5e5428ca5d 100755 --- a/src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs +++ b/src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs @@ -61,14 +61,17 @@ public int AlarmId /// http://tizen.org/privilege/alarm.get /// /// The setter for WeekFlag property is available since API Level 6. - /// Weekflag can be a combination of the days of the week, for example Tuesday | Friday. - /// If the period is already set, it will be removed and the week repetition flag will be set. - /// If the week repetition flag is already set, it will be overwritten. If not, it will be set. + /// Weekflag can represent a combination of days of the week, such as Tuesday | Friday. + /// If the period is already set, it will be removed and the week repetition flag will be set instead. + /// If the week repetition flag is already set, it will be overwritten. Otherwise, it will be set. /// If the Weekflag argument is 0 and the flag is already set, - /// the flag will be cleared and the alarm will be changed to set once. - /// If the Weekflag argument is 0, and the flag is not set or the period is set, - /// the alarm won't be changed. + /// the flag will be cleared and the alarm will be changed to a single occurrence. + /// If the Weekflag argument is 0 and no flag is set or if the period is set, + /// the alarm will remain unchanged. /// + /// Thrown in case of an invalid parmaeter. + /// Thrown in case of a permission denied due to insufficient privileges. + /// Thrown in case of any internal error. /// 3 public AlarmWeekFlag WeekFlag { @@ -103,6 +106,9 @@ public AlarmWeekFlag WeekFlag /// /// The SchduleDate property setter is available since API Level 6. /// + /// Thrown in case of an invalid parmaeter. + /// Thrown in case of a permission denied due to insufficient privileges. + /// Thrown in case of any internal error. /// 3 public DateTime ScheduledDate { @@ -141,19 +147,22 @@ public DateTime ScheduledDate } /// - /// Gets the period of time between the recurrent alarms. + /// Gets or sets the period of time between the recurrent alarms. /// /// http://tizen.org/privilege/alarm.set /// http://tizen.org/privilege/alarm.get /// /// The Period property setter is available since API Level 6. /// If the week recurrence flag was set before, it will be removed and the period will be set - /// If the period was set before, it will be overwritten.If it was not, it will be set. + /// If the period was set before, it will be overwritten. If it was not, it will be set. /// If the @a period argument is 0 and the period was previously set, /// the period attribute will be cleared and the alarm will be changed to one-time. /// If the @a period argument is 0 and the period was not set, - /// or the week recurrence flag was set, the alarm will be unchanged. + /// or the week recurrence flag was set, the alarm will remain unchanged. /// + /// Thrown in case of an invalid parmaeter. + /// Thrown in case of a permission denied due to insufficient privileges. + /// Thrown in case of any internal error. /// 3 public int Period { diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs b/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs index 0aaf4279051..007949e2f98 100755 --- a/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs +++ b/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs @@ -18,6 +18,7 @@ namespace Tizen.Applications { using System; using System.Collections.Generic; + using System.ComponentModel; using System.Runtime.InteropServices; using Tizen.Applications.Notifications; @@ -102,7 +103,7 @@ public enum AlarmStandardPeriod } /// - /// Mobile devices typically give constant access to information from various sources. Some of this information is best delivered through alarms. + /// Devices typically give constant access to information from various sources. Some of this information is best delivered through alarms. /// The most obvious case is a calendar scheduling application, which lets you know when a meeting is about to start. Alarms are certainly better than actively waiting in a loop. /// They are also better than putting an interface to sleep because they do not block your main UI thread. /// Use of alarms helps build smooth user experiences and implements unattended data synchronization tasks. @@ -149,7 +150,7 @@ internal static DateTime ConvertIntPtrToDateTime(Interop.Alarm.DateTime time) /// Sets an alarm to be triggered after a specific time. /// The alarm will first go off delay seconds later and then will go off every certain amount of time defined using period seconds. /// - /// The amount of time before the first execution (in seconds). + /// The amount of time before the first execution (in seconds). Although this is inexact, the alarm will not fire before this time /// The amount of time between subsequent alarms (in seconds). This value does not guarantee the accuracy. /// The actual interval is calculated by the OS. The minimum value is 600sec. /// The destination AppControl is used to perform a specific task when the alarm is triggered. @@ -185,6 +186,7 @@ public static Alarm CreateAlarm(int delay, int period, AppControl appControl) /// The amount of time before the execution (in seconds). /// The destination AppControl to perform a specific task when the alarm is triggered. /// An alarm instance is created with the set param values. + /// This operation is permitted with the UI application appcontrol only. /// Thrown in case of an invalid parameter. /// Thrown in case of a permission denied. /// Thrown in case of any internal error. @@ -330,7 +332,7 @@ public static Alarm CreateAlarm(DateTime dateTime, Notification notification) /// Sets a notification alarm to be triggered after a specific time. /// The alarm will first go off delay seconds later and then will go off every certain amount of time defined using period seconds. /// - /// The amount of time before the first execution (in seconds). + /// The amount of time before the first execution (in seconds). Although this is inexact, the alarm will not fire before this time /// The amount of time between subsequent alarms (in seconds). This value does not guarantee the accuracy. /// The notification to be posted when the alarm is triggered. /// An alarm instance is created with the set param values. @@ -438,6 +440,119 @@ public static Alarm CreateAlarm(int delay, AlarmStandardPeriod standardPeriod, N return CreateAlarm(delay, (int)standardPeriod, notification); } + /// + /// Sets an alarm to be triggered after a specific time. + /// The alarm will go off delay seconds later. + /// + /// The amount of time before the execution (in seconds). + /// The destination AppControl to perform a specific task when the alarm is triggered. + /// An alarm instance is created with the set param values. + /// + /// This operation only allows service application which has Background Category to set an exact alarm. + /// + /// Thrown in case of an invalid parameter. + /// Thrown in case of a permission denied. + /// Thrown in case of any internal error. + /// http://tizen.org/privilege/alarm.set + /// http://tizen.org/privilege/appmanager.launch + /// 12 + [EditorBrowsable(EditorBrowsableState.Never)] + public static Alarm CreateAlarmForServiceApp(int delay, AppControl appControl) + { + if (appControl == null) + { + throw AlarmErrorFactory.GetException(AlarmError.InvalidParameter, "AppControl should be not null"); + } + + Alarm alarm = null; + int alarmId; + AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmOnceAfterDelayForService(appControl.SafeAppControlHandle, delay, out alarmId); + alarm = new Alarm(alarmId); + if (ret != AlarmError.None) + { + throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); + } + + return alarm; + } + + /// + /// Sets an alarm to be triggered at a specific time. + /// The date describes the time of the first occurrence. + /// + /// The first active alarm time. + /// The destination AppControl to perform specific work when the alarm is triggered. + /// An alarm instance is created with the set param values. + /// + /// This operation only allows service application which has Background Category to set an exact alarm. + /// + /// Thrown in case of an invalid parameter. + /// Thrown in case of a permission denied. + /// Thrown in case of any internal error. + /// http://tizen.org/privilege/alarm.set + /// http://tizen.org/privilege/appmanager.launch + /// 12 + [EditorBrowsable(EditorBrowsableState.Never)] + public static Alarm CreateAlarmForServiceApp(DateTime value, AppControl appControl) + { + if (appControl == null) + { + throw AlarmErrorFactory.GetException(AlarmError.InvalidParameter, "AppControl should be not null"); + } + + Alarm alarm = null; + int alarmId; + Interop.Alarm.DateTime time = ConvertDateTimeToStruct(value); + AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmOnceAtDateForService(appControl.SafeAppControlHandle, ref time, out alarmId); + alarm = new Alarm(alarmId); + if (ret != AlarmError.None) + { + throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); + } + + return alarm; + } + + /// + /// Sets an alarm to be triggered at a specific time. + /// The alarm will first go off at a specific time and then will go off every certain amount of time defined using period seconds. + /// + /// The first active alarm time. + /// The amount of time between subsequent alarms (in seconds). + /// The destination AppControl is used to perform a specific task when the alarm is triggered. + /// An alarm instance is created with the set param values. + /// + /// This operation only allows service application which has Background Category to set an exact alarm. + /// This API can have a significant impact on power usage when the device is in idle state, so apps that use it may greatly increase battery consumption. + /// Therefore, caution should be taken when using this API. + /// + /// Thrown in case of an invalid parameter. + /// Thrown in case of a permission denied. + /// Thrown in case of any internal error. + /// http://tizen.org/privilege/alarm.set + /// http://tizen.org/privilege/appmanager.launch + /// 12 + [EditorBrowsable(EditorBrowsableState.Never)] + public static Alarm CreateAlarmForServiceApp(DateTime value, int period, AppControl appControl) + { + if (appControl == null) + { + throw AlarmErrorFactory.GetException(AlarmError.InvalidParameter, "AppControl should be not null"); + } + + Alarm alarm = null; + int alarmId; + Interop.Alarm.DateTime time = ConvertDateTimeToStruct(value); + AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmRecurForService(appControl.SafeAppControlHandle, ref time, period, out alarmId); + alarm = new Alarm(alarmId); + if (ret != AlarmError.None) + { + throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); + } + + return alarm; + } + /// /// Cancels all scheduled alarms that are registered by the application that calls this API. /// diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs b/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs index c7a4f1acabc..6378e4b5ba8 100644 --- a/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs +++ b/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs @@ -22,6 +22,7 @@ namespace Tizen.Applications /// The class containing common properties of the Badge. /// /// 3 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class Badge { private int count = 0; @@ -34,6 +35,7 @@ public class Badge /// Count value /// True if it should be displayed /// Thrown when failed because of invalid argument + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Badge(string appId, int count = 1, bool visible = true) { if (IsNegativeNumber(count)) @@ -50,6 +52,7 @@ public Badge(string appId, int count = 1, bool visible = true) /// /// 3 /// Thrown when set negative number + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int Count { get @@ -71,12 +74,14 @@ public int Count /// Property for the application ID of the badge. /// /// 3 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string AppId { get; set; } /// /// Property for display visibility. True if the badge display visible, otherwise false.. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool Visible{ get; set; } private bool IsNegativeNumber(int number) diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs index 093f40f65f8..7a2e4f11f5e 100755 --- a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs +++ b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs @@ -22,6 +22,7 @@ namespace Tizen.Applications /// The class for badge operation. /// /// 3 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static class BadgeControl { private static event EventHandler s_changed; @@ -37,6 +38,7 @@ public static class BadgeControl /// Thrown in case of failed conditions. /// Thrown when an application does not have the privilege to access. /// Thrown when Badge is not supported. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static event EventHandler Changed { add @@ -88,6 +90,7 @@ public static event EventHandler Changed /// Thrown when an application does not have the privilege to access. /// Thrown in case of failed conditions. /// Thrown when Badge is not supported. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static Badge Find(string appId) { uint count; @@ -119,6 +122,7 @@ public static Badge Find(string appId) /// Thrown when an application does not have the privilege to access. /// Thrown in case of failed conditions. /// Thrown when Badge is not supported. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void Remove(string appId) { BadgeError err = Interop.Badge.Remove(appId); @@ -139,6 +143,7 @@ public static void Remove(string appId) /// Thrown when an application does not have the privilege to access. /// Thrown in case of failed conditions. /// Thrown when Badge is not supported. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void Remove(Badge badge) { if (badge == null) @@ -160,6 +165,7 @@ public static void Remove(Badge badge) /// Thrown when an application does not have the privilege to access. /// Thrown in case of failed conditions. /// Thrown when Badge is not supported. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void Add(Badge badge) { if (badge == null) @@ -195,6 +201,7 @@ public static void Add(Badge badge) /// Thrown when an application does not have the privilege to access. /// Thrown in case of failed conditions. /// Thrown when Badge is not supported. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void Update(Badge badge) { if (badge == null) @@ -225,6 +232,7 @@ public static void Update(Badge badge) /// Thrown when an application does not have the privilege to access. /// Thrown in case of failed conditions. /// Thrown when Badge is not supported. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static IEnumerable GetBadges() { IList list = new List(); diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs index c0b8d0ff1da..c20c0add80a 100755 --- a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs +++ b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs @@ -22,6 +22,7 @@ namespace Tizen.Applications /// The class for event arguments of the badge event. /// /// 3 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class BadgeEventArgs : EventArgs { internal BadgeEventArgs() @@ -32,6 +33,7 @@ internal BadgeEventArgs() /// Enumeration for the badge action. /// /// 3 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public enum Action : int { /// @@ -54,12 +56,14 @@ public enum Action : int /// The property for the badge object. /// /// 3 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Badge Badge { get; internal set; } /// /// The property for the action value. /// /// 3 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Action Reason { get; internal set; } } } diff --git a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Parcel.cs b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Parcel.cs index 9923019a73a..ce0aada91db 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Parcel.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Parcel.cs @@ -156,10 +156,10 @@ public class Parcel : IDisposable private ParcelHeader _header; /// - /// Constructor for this class. + /// Constructs a new instance of the Parcel class. /// - /// If it's false, the parcel object does not have the header. - /// Thrown when an internal IO error occurs. + /// Determines whether the created parcel object includes a header or not. + /// Thrown when an internal I/O error occurs during the construction process. /// 11 public Parcel(bool withHeader) { @@ -188,10 +188,10 @@ public Parcel() : this(true) } /// - /// Constructor with port object. + /// Creates a new parcel object from a specified port object. /// - /// Port object. - /// Thrown when an internal IO error occurs. + /// The port object to create a parcel from. + /// An internal IO error occurred while creating the parcel. /// 5 public Parcel(Port port) { @@ -203,10 +203,10 @@ public Parcel(Port port) } /// - /// Constructor with the raw bytes. + /// Constructs a new Parcel object from the specified raw bytes. /// - /// The raw bytes. - /// Thrown when an internal IO error occurs. + /// An array of bytes that represents the content of the parcel. + /// Thrown if an invalid argument is passed in or an internal I/O error occurs. /// 9 public Parcel(byte[] bytes) { @@ -218,10 +218,10 @@ public Parcel(byte[] bytes) } /// - /// Gets the raw bytes of the parcel. + /// Converts the current parcel into its raw bytes representation. /// - /// The raw bytes of the parcel. - /// Thrown when an internal IO error occurs. + /// An array of bytes containing the contents of the parcel. + /// Thrown if an internal I/O error occurs during conversion. /// 9 public byte[] ToBytes() { @@ -234,9 +234,9 @@ public byte[] ToBytes() } /// - /// Sends parcel data through the port. + /// Sends parcel data through the specified port. /// - /// The RPC port object for writing data. + /// The RPC port object for writing data. /// Thrown when an internal IO error occurs. /// 5 public void Send(Port p) @@ -249,9 +249,9 @@ public void Send(Port p) } /// - /// Writes a byte value into parcel object. + /// Writes a single byte value into the parcel object. /// - /// byte data. + /// The byte value to be written into the parcel object. /// 5 public void WriteByte(byte b) { @@ -261,7 +261,7 @@ public void WriteByte(byte b) /// /// Writes a short value into parcel object. /// - /// short data. + /// The short data to write. /// 5 public void WriteShort(short b) { @@ -269,9 +269,23 @@ public void WriteShort(short b) } /// - /// Writes an int value into parcel object. - /// - /// int data. + /// Writes an integer value into the parcel object. + /// + /// The integer value to write. + /// + /// Here's an example showing how to write an integer value into a parcel object: + /// + /// + /// // Create a new parcel object + /// Parcel parcel = new Parcel(); + /// + /// // Write an integer value into the parcel object + /// parcel.WriteInt(42); + /// + /// // Do something else with the parcel object... + /// ... + /// + /// /// 5 public void WriteInt(int b) { @@ -279,9 +293,9 @@ public void WriteInt(int b) } /// - /// Writes a long value into parcel object. + /// Writes a long value into the parcel object. /// - /// long data. + /// The long data to write. /// 5 public void WriteLong(long b) { @@ -289,9 +303,9 @@ public void WriteLong(long b) } /// - /// Writes a float value into parcel object. + /// Writes a float value into the parcel object. /// - /// float data. + /// The float data to write into the parcel object. /// 5 public void WriteFloat(float b) { @@ -299,9 +313,9 @@ public void WriteFloat(float b) } /// - /// Writes a double value into parcel object. + /// Writes a double value into the parcel object. /// - /// double data. + /// The double data to write. /// 5 public void WriteDouble(double b) { @@ -309,9 +323,9 @@ public void WriteDouble(double b) } /// - /// Writes a string value into parcel object. + /// Writes a string value into the parcel object. /// - /// string data. + /// The string data to be written into the parcel object. /// 5 public void WriteString(string b) { @@ -319,9 +333,9 @@ public void WriteString(string b) } /// - /// Writes a bool value into parcel object. + /// Writes a boolean value into the parcel object. /// - /// bool data. + /// The boolean value to write. /// 5 public void WriteBool(bool b) { @@ -329,9 +343,9 @@ public void WriteBool(bool b) } /// - /// Writes a Bundle data into parcel object. + /// Writes a Bundle data into the parcel object. /// - /// Bundle data. + /// The Bundle object to write. /// 5 public void WriteBundle(Bundle b) { @@ -344,9 +358,9 @@ public void WriteBundle(Bundle b) } /// - /// Writes a count of an array into parcel object. + /// Writes a count of an array into the parcel object. /// - /// Array count. + /// The number of elements in the array. /// 5 public void WriteArrayCount(int cnt) { @@ -354,9 +368,9 @@ public void WriteArrayCount(int cnt) } /// - /// Reads a byte value from parcel object. + /// Reads a byte value from the parcel object. /// - /// byte data. + /// The byte value. /// 5 public byte ReadByte() { @@ -365,9 +379,9 @@ public byte ReadByte() } /// - /// Reads a short value from parcel object. + /// Reads a short value from the parcel object. /// - /// short data. + /// The short data. /// 5 public short ReadShort() { @@ -376,9 +390,9 @@ public short ReadShort() } /// - /// Reads an int value from parcel object. + /// Reads an integer value from the parcel object. /// - /// int data. + /// The integer data. /// 5 public int ReadInt() { @@ -387,9 +401,9 @@ public int ReadInt() } /// - /// Reads a long value from parcel object. + /// Reads a long value from the parcel object. /// - /// long data. + /// The long data. /// 5 public long ReadLong() { @@ -398,9 +412,9 @@ public long ReadLong() } /// - /// Reads a float value from parcel object. + /// Reads a float value from the parcel object. /// - /// float data. + /// The float data. /// 5 public float ReadFloat() { @@ -409,9 +423,9 @@ public float ReadFloat() } /// - /// Reads a double value from parcel object. + /// Reads a double value from the parcel object. /// - /// double data. + /// The double data. /// 5 public double ReadDouble() { @@ -420,9 +434,9 @@ public double ReadDouble() } /// - /// Reads a string value from parcel object. + /// Reads a string value from the parcel object. /// - /// string data. + /// The string data. /// 5 public string ReadString() { @@ -431,9 +445,9 @@ public string ReadString() } /// - /// Reads a bool value from parcel object. + /// Reads a boolean value from the parcel object. /// - /// bool data. + /// The boolean data. /// 5 public bool ReadBool() { @@ -442,9 +456,9 @@ public bool ReadBool() } /// - /// Reads a Bundle value from parcel object. + /// Reads a Bundle value from the parcel object. /// - /// Bundle data. + /// The Bundle data. /// 5 public Bundle ReadBundle() { @@ -460,9 +474,9 @@ public Bundle ReadBundle() } /// - /// Reads a count of an array from parcel object. + /// Reads a count of an array from a parcel object. /// - /// Array count. + /// The number of elements in the array. /// 5 public int ReadArrayCount() { @@ -471,9 +485,9 @@ public int ReadArrayCount() } /// - /// Writes bytes into parcel object. + /// Writes bytes into the parcel object. /// - /// Array of bytes. + /// An array of bytes containing the data to be written. /// 5 public void Write(byte[] bytes) { @@ -486,10 +500,10 @@ public void Write(byte[] bytes) } /// - /// Reads bytes from parcel object. + /// Reads bytes from the parcel object. /// - /// Bytes to read. - /// Array of bytes. + /// The number of bytes to read. + /// An array of bytes that were read from the parcel. /// 5 public byte[] Read(int size) { diff --git a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Port.cs b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Port.cs index f8261902ae5..5518b86fae5 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Port.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/Port.cs @@ -21,7 +21,7 @@ namespace Tizen.Applications.RPCPort { /// - /// The class that proxy and stub can use to communicate with each other. + /// A class used by proxies and stubs to communicate with each other. /// /// 5 public class Port diff --git a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/ProxyBase.cs b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/ProxyBase.cs index 3206c52f240..038dbdd1c3b 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/ProxyBase.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/ProxyBase.cs @@ -19,7 +19,7 @@ namespace Tizen.Applications.RPCPort { /// - /// Abstract class for creating a proxy class for RPC. + /// Base class for creating a proxy class for remote procedure calls. /// /// 5 public abstract class ProxyBase : IDisposable @@ -45,9 +45,9 @@ public abstract class ProxyBase : IDisposable protected Port CallbackPort { get; private set; } /// - /// Constructor for this class. + /// Creates a new instance of the ProxyBase class. /// - /// Thrown when internal IO error occurs. + /// Thrown when an internal I/O error occurs during initialization. /// 5 public ProxyBase() { @@ -64,13 +64,17 @@ public ProxyBase() } /// - /// Connects to port. + /// Establishes a connection to the specified application through the named remote procedure call (RPC) port. /// - /// The target stub app ID. - /// The name of the RPC port. - /// Thrown when not available app ID is used. - /// Thrown when an internal IO error occurs. - /// Thrown when the permission is denied. + /// + /// By calling this method, you can establish a connection between two applications using the specified RPC port. It requires the target application ID and the name of the desired RPC port. + /// If the connection cannot be established due to invalid arguments or insufficient privileges, appropriate exceptions are thrown accordingly. + /// + /// The ID of the target application to connect to. + /// The name of the RPC port to use for the connection. + /// Thrown if the specified application ID does not exist. + /// Thrown in case of an internal input/output error during the connection process. + /// Thrown when the required privileges are missing or access is otherwise restricted. /// http://tizen.org/privilege/datasharing /// http://tizen.org/privilege/appmanager.launch /// 5 @@ -89,13 +93,13 @@ protected void Connect(string appid, string port) } /// - /// Connects to port synchronously. + /// Establishes a connection to the specified application synchronously through the named remote procedure call (RPC) port. /// - /// The target stub app ID. - /// The name of the RPC port. - /// Thrown when not available app ID is used. - /// Thrown when an internal IO error occurs. - /// Thrown when the permission is denied. + /// The ID of the target application to connect to. + /// The name of the RPC port to use for the connection. + /// Thrown if the specified application ID does not exist. + /// Thrown in case of an internal input/output error during the connection process. + /// Thrown when the required privileges are missing or access is otherwise restricted. /// http://tizen.org/privilege/datasharing /// http://tizen.org/privilege/appmanager.launch /// 8 @@ -114,11 +118,17 @@ protected void ConnectSync(string appid, string port) } /// - /// Gets a port. + /// Retrieves a port based on its type. /// - /// The type of port. - /// Port object. - /// Thrown when an internal IO error occurs. + /// The specific type of port to retrieve. + /// An object representing the requested port. + /// Thrown if an internal I/O error occurs while retrieving the port. + /// + /// To get a main port: + /// + /// Port mainPort = GetPort(Port.Type.Main); + /// + /// /// 5 protected Port GetPort(Port.Type t) { @@ -137,8 +147,8 @@ protected Port GetPort(Port.Type t) /// /// Abstract method for receiving connected event. /// - /// The target stub app ID. - /// The name of the RPC port. + /// The target stub application ID. + /// The name of the Remote Procedure Call (RPC) port. /// Port object for reading and writing. /// 5 protected abstract void OnConnectedEvent(string endPoint, string portName, Port port); @@ -146,24 +156,24 @@ protected Port GetPort(Port.Type t) /// /// Abstract method for receiving disconnected event. /// - /// The target stub app ID. - /// The name of the port. + /// The target stub application ID.. + /// The name of the Remote Procedure Call (RPC) port. /// 5 protected abstract void OnDisconnectedEvent(string endPoint, string portName); /// /// Abstract method called when the proxy receives data from stub. /// - /// The target stub app ID. - /// The name of the RPC port. + /// The target stub application ID.. + /// The name of the Remote Procedure Call (RPC) port. /// 5 protected abstract void OnReceivedEvent(string endPoint, string portName); /// /// Abstract method for receiving rejected event. /// - /// The target stub app ID. - /// The name of the RPC port. + /// The target stub application ID.. + /// The name of the Remote Procedure Call (RPC) port. /// 5 protected abstract void OnRejectedEvent(string endPoint, string portName); diff --git a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/StubBase.cs b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/StubBase.cs index 8e9c13a80ca..43272dee33e 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/StubBase.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications.RPCPort/StubBase.cs @@ -19,8 +19,13 @@ namespace Tizen.Applications.RPCPort { /// - /// Abstract class for creating a stub class for RPC. + /// Base class for creating stubs in RPC. /// + /// + /// This class provides a base implementation for creating stubs that are used in Remote Procedure Call (RPC). By extending this class, you can easily implement your own stubs for specific interfaces. + /// The StubBase class handles common functionality such as managing the connection state and handling incoming requests from clients. It also provides methods for sending responses back to the client after processing the request. + /// To create a stub for a specific interface, you need to extend the StubBase class and override its virtual methods according to the requirements of the interface. + /// /// 5 public abstract class StubBase : IDisposable { @@ -36,10 +41,18 @@ public abstract class StubBase : IDisposable public string PortName { get; } /// - /// Constructor for this class. + /// Constructs a new instance of the StubBase class. /// /// The name of the port that wants to listen. /// Thrown when an internal IO error occurs. + /// + /// Here's an example showing how to construct a new instance of the StubBase class: + /// + /// + /// // Create a new instance of the StubBase class + /// var stubBase = new StubBase("MyPort"); + /// + /// /// 5 public StubBase(string portName) { @@ -55,9 +68,13 @@ public StubBase(string portName) } /// - /// Listens to the requests for connections. + /// Starts listening to incoming connection requests on the specified port. /// - /// Thrown when an internal IO error occurs. + /// + /// This method enables your application to listen for incoming connection requests from other applications. + /// It is typically called after setting up the necessary network infrastructure such as creating a server socket and specifying a listening port. + /// + /// Thrown when an internal IO error occurs during the listening process. /// 5 protected void Listen() { @@ -87,9 +104,9 @@ protected void AddPrivilege(string privilege) } /// - /// Sets a trusted proxy to the stub. + /// Sets whether the stub allows only trusted proxies or not. /// - /// Whether stub allows only trusted proxy or not. + /// Indicates if the stub allows only trusted proxies or not. /// 5 protected void SetTrusted(bool trusted) { @@ -97,13 +114,13 @@ protected void SetTrusted(bool trusted) } /// - /// Gets s port. + /// Retrieves a port based on its type and the connected instance. /// - /// The type of port. - /// The ID of the instance, which is connected. - /// Port object. - /// Thrown when invalid instance is used. - /// Thrown when an internal IO error occurs. + /// The type of port to retrieve. + /// The ID of the instance that the port is connected to. + /// The requested port. + /// Thrown if an invalid instance ID is passed. + /// Thrown in case of an internal I/O error. /// 5 protected Port GetPort(Port.Type t, string instance) { @@ -123,7 +140,7 @@ protected Port GetPort(Port.Type t, string instance) /// /// Abstract method for receiving connected event. /// - /// The target proxy app ID. + /// The target proxy applicstion ID. /// The information about the request. /// 5 protected abstract void OnConnectedEvent(string sender, string instance); @@ -131,7 +148,7 @@ protected Port GetPort(Port.Type t, string instance) /// /// Abstract method for receiving disconnected event. /// - /// The target proxy app ID. + /// The target proxy applicstion ID. /// The information about the request. /// 5 protected abstract void OnDisconnectedEvent(string sender, string instance); @@ -139,7 +156,7 @@ protected Port GetPort(Port.Type t, string instance) /// /// Abstract method called when the stub receives data from proxy. /// - /// The target proxy app ID. + /// The target proxy applicstion ID. /// The information about the request. /// Port object for reading and writing. /// true to continue receiving data, otherwise false to disconnect from the port. diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs index 6f341d899f8..043fa7edf2c 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs @@ -102,7 +102,7 @@ public AppControl(bool enableAppStartedResultEvent) /// /// Initializes the instance of the AppControl class with the SafeAppControlHandle. /// - /// + /// A reference to the SafeAppControlHandle object. /// 3 public AppControl(SafeAppControlHandle handle) { @@ -169,6 +169,9 @@ private AppControl(IntPtr handle) /// /// Gets the SafeAppControlHandle instance. /// + /// + /// This property returns a reference to the underlying SafeAppControlHandle object. + /// /// 3 public SafeAppControlHandle SafeAppControlHandle { @@ -227,7 +230,8 @@ public string Operation /// Gets and sets the explicit MIME type of the data. /// /// - /// (if the mime is null for setter, it clears the previous value.) + /// This property returns the explicitly set MIME type of the data. If no explicit MIME type is set, it will return null. + /// (Setting this property to null will clear any previously set explicit MIME types.) /// /// /// @@ -328,7 +332,8 @@ public string Uri /// Gets and sets the explicit category. /// /// - /// (if the category is null for setter, it clears the previous value.) + /// This property returns the explicitly set category. If no explicit category is set, it will return null. + /// (Setting this property to null will clear any previously set explicit categories.) /// /// 3 public string Category @@ -363,7 +368,8 @@ public string Category /// Gets and sets the application ID to explicitly launch. /// /// - /// (if the application ID is null for setter, it clears the previous value.) + /// This property returns the explicitly set application ID. If no explicit application ID is set, it will return null. + /// (Setting this property to null will clear any previously set explicit application IDs.) /// /// /// @@ -446,7 +452,7 @@ public AppControlLaunchMode LaunchMode /// Gets the collection of the extra data. /// /// - /// Extra data for communication between AppControls. + /// The ExtraData property provides access to a collection of key-value pairs representing additional data associated with the application control. /// /// /// @@ -1023,9 +1029,9 @@ public static IEnumerable GetDefaultApplicationIds() } /// - /// Sets the window position. + /// Sets the position and size of the window. /// - /// The window position object. + /// A structure containing the coordinates and dimensions of the window. /// Thrown when the argument is null. /// Thrown when the argument is invalid. /// Thrown when the invalid operation error occurs. @@ -1054,7 +1060,7 @@ public void SetWindowPosition(WindowPosition windowPosition) /// /// Gets the window position. /// - /// The window position. + /// A structure containing the coordinates and dimensions of the window. /// Thrown when the invalid operation error occurs. /// 11 public WindowPosition GetWindowPosition() @@ -1357,9 +1363,13 @@ public bool TryGet(string key, out IEnumerable value) } /// - /// Removes the extra data. + /// Deletes a particular piece of extra data from the collection. /// - /// The name of the extra data. + /// Identifier of the data to remove. + /// + /// This method enables removal of individual items from the ExtraData collection. + /// It accepts only non-empty strings as valid input parameters. + /// /// Thrown when the key is a zero-length string. /// Thrown when the key is not found. /// Thrown when the key is rejected. diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationComponentType.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationComponentType.cs index c5e9838b2cb..015a3e99941 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationComponentType.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationComponentType.cs @@ -23,27 +23,27 @@ namespace Tizen.Applications public enum ApplicationComponentType { /// - /// Component type is ui application. + /// The user interface (UI) application component type. /// UIApplication = 0, /// - /// Component type is service application. + /// The service application component type. /// ServiceApplication, /// - /// Component type is widget application. + /// The widget application component type. /// WidgetApplication, /// - /// Component type is watch application. + /// The watch application component type. /// WatchApplication, /// - /// Component type is component-based application. + /// The component-based application component type. /// /// 7 ComponentBasedApplication, diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs index b65c4412048..106d9b0ee90 100644 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs @@ -25,7 +25,7 @@ namespace Tizen.Applications public class ApplicationLaunchedEventArgs : EventArgs { /// - /// The information of the application. + /// Gets the current running context of the application. /// /// 3 public ApplicationRunningContext ApplicationRunningContext { get; internal set; } diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs index 21abc91d8c5..904594a832a 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs @@ -43,6 +43,9 @@ public static class ApplicationManager /// /// Occurs whenever the installed application is enabled. /// + /// + /// This event is raised whenever the installed application is enabled. It provides information about the application that was enabled through the arguments passed in the event handler. + /// /// 3 public static event EventHandler ApplicationEnabled { @@ -74,6 +77,10 @@ public static event EventHandler ApplicationEnabled /// /// Occurs whenever the installed application is disabled. /// + /// + /// This event is raised whenever the user disables an installed application through the Settings menu. + /// The event handler receives an argument of type ApplicationDisabledEventArgs which contains information about the disabled application. + /// /// 3 public static event EventHandler ApplicationDisabled { @@ -105,6 +112,10 @@ public static event EventHandler ApplicationDisabl /// /// Occurs whenever the installed applications get launched. /// + /// + /// This event provides information about the application that was just launched, including its package ID, version, and other details. + /// It is useful for tracking and monitoring application launches in order to gather statistics or perform certain actions based on specific conditions. + /// /// 3 public static event EventHandler ApplicationLaunched { @@ -133,9 +144,13 @@ public static event EventHandler ApplicationLaunch } } + /// /// Occurs whenever the installed applications get terminated. /// + /// + /// This event is raised whenever any application gets terminated on the device. It provides information about the terminated application through the arguments passed in the event handler. + /// /// 3 public static event EventHandler ApplicationTerminated { @@ -165,9 +180,24 @@ public static event EventHandler ApplicationTerm } /// - /// Gets the information of the installed applications asynchronously. + /// Asynchronously retrieves information about the installed applications. /// - /// The installed application info list. + /// An asynchronous task that returns a list containing information about the installed applications. + /// + /// By calling this method, you can retrieve details about all the applications currently installed on the device. The returned list contains ApplicationInfo objects, which provide various properties such as package ID, version, and icon. + /// + /// + /// To get the information of the installed applications, you can call the following code snippet: + /// + /// + /// var listApp = await ApplicationManager.GetInstalledApplicationsAsync(); + /// Assert.IsNotEmpty(_listApp, "The list of installed app should not be empty."); + /// foreach (ApplicationInfo instapp in _listApp) + /// { + /// Console.WriteLine(instapp.ApplicationId); + /// } + /// + /// /// 3 public static async Task> GetInstalledApplicationsAsync() { @@ -238,10 +268,25 @@ public static void TerminateBackgroundApplication(ApplicationRunningContext app) } /// - /// Gets the information of the installed applications with the ApplicationInfoFilter asynchronously. + /// Retrieves the information about installed applications that match the specified filter criteria in an asynchronous manner. /// - /// Key-value pairs for filtering. - /// The installed application info list. + /// + /// By specifying the desired filter criteria through the argument, you can retrieve only those applications that meet these conditions. The returned result will contain a list of ApplicationInfo objects representing the matched applications. + /// + /// An ApplicationInfoFilter containing the desired filter criteria. + /// An IEnumerable<ApplicationInfo> containing the information of the installed applications that match the specified filter. + /// + /// The following code snippet demonstrates how to obtain the information of all installed applications: + /// + /// var filter = new ApplicationInfoFilter(); + /// filter.Filter.Add(ApplicationInfoFilter.Keys.Id, "org.exmaple.hello"); + /// var apps = await GetInstalledApplicationsAsync(filter); + /// foreach (var app in apps) + /// { + /// Console.WriteLine(app.ApplicationId); + /// } + /// + /// /// 3 public static async Task> GetInstalledApplicationsAsync(ApplicationInfoFilter filter) { @@ -285,10 +330,27 @@ public static async Task> GetInstalledApplicationsA } /// - /// Gets the information of the installed applications with the ApplicationInfoMetadataFilter asynchronously. + /// Asynchronously retrieves the information about installed applications filtered by the specified criteria in the form of ApplicationInfoMetadataFilter. /// - /// Key-value pairs for filtering. - /// The installed application info list. + /// + /// By providing the filter argument, you can specify various conditions such as package names, types, visibility status, etc., which will help narrow down the search results to only those that match the desired criteria. + /// The returned result is a list of ApplicationInfo objects containing detailed information about each matched application. + /// + /// A dictionary of key-value pairs used to define the specific filtering criteria. + /// An enumerable collection of ApplicationInfo objects representing the installed applications that meet the specified filtering criteria. + /// + /// To retrieve all visible applications: + /// + /// + /// var filter = new ApplicationInfoMetadataFilter(); + /// filter.Filter.Add("http://tizen.org/metadata/test-id", "org.exmaple.hello"); + /// var apps = await GetInstalledApplicationsAsync(filter); + /// foreach (var app in apps) + /// { + /// Console.WriteLine(app.ApplicationId); + /// } + /// + /// /// 3 public static async Task> GetInstalledApplicationsAsync(ApplicationInfoMetadataFilter filter) { @@ -332,9 +394,22 @@ public static async Task> GetInstalledApplicationsA } /// - /// Gets the information of the running applications asynchronously. + /// Asynchronously retrieves the information about currently running applications. /// - /// The application running context list. + /// An enumerable list containing details about the running applications. + /// + /// This method provides an efficient way to gather information about all the active apps on the device without blocking the current thread. It returns a task which can be awaited in order to obtain the desired result. + /// + /// + /// Here's an example demonstrating how to retrieve the running applications and display their IDs: + /// + /// await ApplicationManager.GetRunningApplicationsAsync().ContinueWith((task) => { + /// foreach (var app in task.Result) { + /// Console.WriteLine(app.ApplicationId); + /// } + /// }); + /// + /// /// 3 public static async Task> GetRunningApplicationsAsync() { @@ -371,9 +446,26 @@ public static async Task> GetRunningAppli } /// - /// Gets the information of the running applications including subapp asynchronously. + /// Asynchronously retrieves the information about all currently running applications, including subapps. /// - /// The application running context list. + /// An enumerable list containing details about the running applications. + /// + /// This method provides access to the current state of all active applications on the device, allowing you to gather information such as their IDs, types, and states. + /// By utilizing this functionality, developers can gain insights into the overall system activity and make informed decisions based on the available data. + /// + /// + /// Here is an example that demonstrates how to utilize the GetAllRunningApplicationsAsync method in order to obtain information about the currently running applications: + /// + /// // Initiate the call to get all running applications + /// IEnumerable<ApplicationRunningContext> runningApps = await GetAllRunningApplicationsAsync(); + /// + /// // Iterate through the obtained list of running apps + /// foreach (var app in runningApps) + /// { + /// Console.WriteLine($"Id: {app.ApplicationId}"); + /// } + /// + /// /// 3 public static async Task> GetAllRunningApplicationsAsync() { @@ -410,10 +502,25 @@ public static async Task> GetAllRunningAp } /// - /// Gets the information of the specified application with the application ID. + /// Retrieves the information of the specified application by its application ID. /// - /// Application ID. - /// The application info. + /// The ID of the target application. + /// An object containing detailed information about the requested application. + /// + /// This function enables you to obtain specific information about an application based on its application ID. + /// It returns an object that contains various attributes such as the package name, version, icon URL, etc., which are associated with the identified application. + /// If the specified application does not exist in the system, an error message will be thrown indicating that the requested application could not be found. + /// + /// + /// The following code snippet demonstrates how to retrieve the details of an application with the ID "org.example.app": + /// + /// // Retrieve the application details + /// ApplicationInfo appInfo = ApplicationManager.GetInstalledApplication("org.example.app"); + /// + /// // Print the package ID of the retrieved application + /// Console.WriteLine($"Package ID: {appInfo.PackageId}"); + /// + /// /// 3 public static ApplicationInfo GetInstalledApplication(string applicationId) { @@ -428,11 +535,26 @@ public static ApplicationInfo GetInstalledApplication(string applicationId) } /// - /// Returns if the specified application is running or not. + /// Determines whether the specified application is currently running. /// - /// The application ID. - /// Returns true if the given application is running, otherwise false. - /// Thrown when the given parameter is invalid. + /// The unique identifier of the application to check. + /// True if the application identified by the given ID is currently running, otherwise False. + /// Thrown when the provided argument is invalid or missing. + /// + /// The following code snippet demonstrates how to determine if a specific application is currently running: + /// + /// + /// string applicationId = "org.example.app"; + /// if (ApplicationManager.IsRunning(applicationId)) + /// { + /// Console.WriteLine("The application with ID '{0}' is currently running.", applicationId); + /// } + /// else + /// { + /// Console.WriteLine("The application with ID '{0}' is not currently running.", applicationId); + /// } + /// + /// /// 3 public static bool IsRunning(string applicationId) { @@ -446,11 +568,24 @@ public static bool IsRunning(string applicationId) } /// - /// Returns the application id. + /// Retrieves the application ID based on the specified process ID. /// - /// The application pid. - /// Returns the application id. - /// Thrown when the given parameter is invalid. + /// + /// By providing the process ID as input, this function enables you to obtain the corresponding application ID. + /// It ensures that the correct application is identified even if multiple applications are running simultaneously. + /// + /// The process ID of the target application. + /// The application ID associated with the given process ID. + /// If the argument passed in is not valid. + /// + /// The following code snippet demonstrates how to retrieve the application ID by calling the GetAppId() function: + /// + /// + /// int processId = 12345; // Replace with actual process ID + /// string appId = GetAppId(processId); + /// Console.WriteLine($"Application ID: {appId}"); + /// + /// /// 6 public static string GetAppId(int processId) { diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs index e93d5709368..80a8ae32f50 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs @@ -21,8 +21,12 @@ namespace Tizen.Applications { /// - /// This class provides methods and properties to get information of the application. + /// This class provides methods and properties to retrieve information about the currently running application context. /// + /// + /// The ApplicationRunningContext class enables you to obtain various details related to the current execution environment such as the application ID, process id, and user data directory. + /// It also offers functionality to check if the current application is in foreground or background mode. + /// /// 3 public class ApplicationRunningContext : IDisposable { @@ -37,12 +41,24 @@ internal ApplicationRunningContext(IntPtr contextHandle) } /// - /// A constructor of ApplicationRunningContext that takes the application ID. + /// Constructs an ApplicationRunningContext object from the specified application ID. /// - /// Application ID. - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the "application not exist" error or the system error. - /// Thrown when failed because of out of memory. + /// The ID of the application. + /// + /// The constructor creates a new instance of the ApplicationRunningContext class by passing in the application ID. + /// It throws exceptions if any errors occur during initialization, such as invalid arguments, non-existent applications, system errors, or out of memory conditions. + /// + /// + /// Here's an example demonstrating how to construct an ApplicationRunningContext object using the constructor: + /// + /// + /// // Define the application ID + /// const string APP_ID = "org.example.app"; + /// + /// // Instantiate the ApplicationRunningContext class with the application ID + /// var context = new ApplicationRunningContext(APP_ID); + /// + /// /// 3 public ApplicationRunningContext(string applicationId) { @@ -99,7 +115,7 @@ public ApplicationRunningContext(string applicationId, string instanceId) } /// - /// Destructor of the class. + /// Destroys the current application running context. /// ~ApplicationRunningContext() { diff --git a/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs b/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs index 61960542db2..1bcfe009212 100644 --- a/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs @@ -39,10 +39,15 @@ public class Bundle : IDisposable private readonly HashSet _keys; /// - /// The bundle constructor. + /// Creates a new instance of the Bundle class. /// + /// + /// This constructor initializes a new instance of the Bundle class. It does not perform any specific actions by itself but provides a starting point for creating and managing bundles of data. + /// /// Thrown when out of memory. /// + /// Here's an example showing how to create a new instance of the Bundle class: + /// /// /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); /// @@ -56,10 +61,10 @@ public Bundle() } /// - /// The bundle constructor. + /// Creates a new instance of the Bundle class from the specified SafeBundleHandle. /// - /// The SafeBundleHandle instance. - /// Thrown when the handle is null or invalid. + /// The SafeBundleHandle instance that represents the bundle. + /// Thrown if the handle argument is null or invalid. /// 3 public Bundle(SafeBundleHandle handle) { diff --git a/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs b/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs index 916c7392a26..1e04fc155cc 100644 --- a/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs @@ -28,8 +28,11 @@ namespace Tizen.Applications { /// - /// This class represents an application controlled lifecycles by the backend system. + /// The CoreApplication class provides functionality to manage application lifecycle events that are controlled by the backend system. /// + /// + /// By inheriting from the Application class, CoreApplication enables developers to handle various application states such as creating and terminating. It also allows them to define their own event handlers for these states. + /// /// 3 public class CoreApplication : Application { @@ -38,9 +41,14 @@ public class CoreApplication : Application private bool _disposedValue = false; /// - /// Initializes the CoreApplication class. + /// Initializes the CoreApplication class by providing a specific implementation of the ICoreBackend interface. /// - /// The backend instance implementing ICoreBacked interface. + /// An instance of the desired implementation of the ICoreBackend interface. + /// + /// The CoreApplication class provides access to various features and functionalities related to application management. + /// By initializing the CoreApplication class with a specific implementation of the ICoreBackend interface, developers can customize the behavior and functionality of their applications based on their requirements. + /// It enables them to extend the capabilities of the default CoreApplication class and tailor it according to their needs. + /// /// 3 public CoreApplication(ICoreBackend backend) { @@ -169,8 +177,9 @@ public override void Exit() } /// - /// Overrides this method if want to handle behavior when the application is launched. - /// If base.OnCreated() is not called, the event 'Created' will not be emitted. + /// Overrides this method if you want to handle specific behavior when the application is created. + /// Calling base.OnCreate() ensures that the default implementation is executed before any custom code in this method. + /// If base.OnCreate() is not called, the event 'Created' will not be emitted. /// /// 3 protected virtual void OnCreate() @@ -195,8 +204,8 @@ protected virtual void OnCreate() } /// - /// Overrides this method if want to handle behavior when the application is terminated. - /// If base.OnTerminate() is not called, the event 'Terminated' will not be emitted. + /// Override this method to define specific actions that occur when the application terminates. + /// Calling base.OnTerminate() ensures that the default termination process takes place and the 'Terminated' event is emitted. /// /// 3 protected virtual void OnTerminate() @@ -205,10 +214,10 @@ protected virtual void OnTerminate() } /// - /// Overrides this method if want to handle behavior when the application receives the appcontrol message. - /// If base.OnAppControlReceived() is not called, the event 'AppControlReceived' will not be emitted. + /// Override this method to customize the behavior when the application receives the appcontrol message. + /// If base.OnAppControlReceived() is not called, the event 'AppControlReceived' will not be triggered. /// - /// + /// The arguments passed in the appcontrol message /// 3 protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e) { @@ -222,8 +231,8 @@ protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e) } /// - /// Overrides this method if want to handle behavior when the system memory is low. - /// If base.OnLowMemory() is not called, the event 'LowMemory' will not be emitted. + /// Override this method to handle behavior when the system memory is low. + /// Calling base.OnLowMemory() ensures that the 'LowMemory' event is emitted. /// /// The low memory event argument /// 3 @@ -243,10 +252,10 @@ protected virtual void OnLowMemory(LowMemoryEventArgs e) } /// - /// Overrides this method if want to handle behavior when the system battery is low. - /// If base.OnLowBattery() is not called, the event 'LowBattery' will not be emitted. + /// Override this method to handle the behavior when the system battery level drops. + /// If base.OnLowBattery() is not called, the LowBattery event will not be raised. /// - /// The low battery event argument + /// The arguments for the low battery event /// 3 protected virtual void OnLowBattery(LowBatteryEventArgs e) { @@ -260,10 +269,10 @@ protected virtual void OnLowBattery(LowBatteryEventArgs e) } /// - /// Overrides this method if want to handle behavior when the system language is changed. - /// If base.OnLocaleChanged() is not called, the event 'LocaleChanged' will not be emitted. + /// Override this method to handle changes in the system language. + /// If base.OnLocaleChanged() is not called, the LocaleChanged event will not be triggered. /// - /// The locale changed event argument + /// The arguments passed with the LocaleChanged event /// 3 protected virtual void OnLocaleChanged(LocaleChangedEventArgs e) { @@ -282,10 +291,10 @@ protected virtual void OnLocaleChanged(LocaleChangedEventArgs e) } /// - /// Overrides this method if want to handle behavior when the region format is changed. - /// If base.OnRegionFormatChanged() is not called, the event 'RegionFormatChanged' will not be emitted. + /// Override this method to handle changes in the region format. + /// Make sure to call base.OnRegionFormatChanged() to ensure that the RegionFormatChanged event is raised. /// - /// The region format changed event argument + /// The region format changed event arguments /// 3 protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e) { @@ -304,10 +313,10 @@ protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e) } /// - /// Overrides this method if want to handle behavior when the device orientation is changed. - /// If base.OnRegionFormatChanged() is not called, the event 'RegionFormatChanged' will not be emitted. + /// Override this method to define specific behavior when the device orientation changes. + /// If base.OnDeviceOrientationChanged() is not called, the 'DeviceOrientationChanged' event will not be raised. /// - /// The device orientation changed event argument + /// The arguments for the device orientation change event /// 3 protected virtual void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) { @@ -315,10 +324,10 @@ protected virtual void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) } /// - /// Override this method if you want to handle behavior when the time zone is changed. - /// If base.OnTimeZoneChanged() is not called, the event "TimeZoneChanged" will not be emitted. + /// Override this method to handle changes in the current time zone. + /// Calling base.OnTimeZoneChanged() ensures that the TimeZoneChanged event is triggered. /// - /// The time zone changed event argument + /// The arguments containing details about the time zone change /// 11 protected virtual void OnTimeZoneChanged(TimeZoneChangedEventArgs e) { diff --git a/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentInfo.cs b/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentInfo.cs index 16805c4b013..f0b6ebfb90a 100755 --- a/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentInfo.cs +++ b/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentInfo.cs @@ -20,7 +20,8 @@ namespace Tizen.Applications.ComponentBased { /// - /// This class provides methods and properties to get information of the component. + /// Provides methods and properties to retrieve information about a component in a Tizen application. + /// This class encapsulates details such as component ID, application ID, and other attributes. /// /// 6 public class ComponentInfo : IDisposable @@ -41,13 +42,13 @@ internal ComponentInfo(IntPtr infoHandle) } /// - /// A constructor of ComponentInfo that takes the component ID. + /// Initializes a new instance of the class with the specified component ID. /// - /// Component ID. - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the system error. - /// Thrown when failed because of out of memory. - /// Thrown when failed because of permission denied.> + /// The ID of the component. + /// Thrown when the component ID is invalid. + /// Thrown when a system error occurs. + /// Thrown when memory allocation fails. + /// Thrown when permission is denied. /// http://tizen.org/privilege/packagemanager.info /// 6 public ComponentInfo(string componentId) @@ -63,7 +64,7 @@ public ComponentInfo(string componentId) } /// - /// Destructor of the class. + /// Finalizes an instance of the class. /// ~ComponentInfo() { @@ -71,7 +72,7 @@ public ComponentInfo(string componentId) } /// - /// Gets the component ID. + /// Gets the ID of the component. /// /// 6 public string ComponentId @@ -94,7 +95,7 @@ public string ComponentId } /// - /// Gets the application ID of the component. + /// Gets the application ID associated with the component. /// /// 6 public string ApplicationId @@ -132,7 +133,7 @@ public ComponentType ComponentType } /// - /// Checks whether the icon of the component should be displayed or not. + /// Checks whether the icon of the component should be displayed. /// /// 6 public bool IsIconDisplayed @@ -151,7 +152,7 @@ public bool IsIconDisplayed } /// - /// Checks whether the component should be managed by task-manager or not. + /// Checks whether the component is managed by the task manager. /// /// 6 public bool IsManagedByTaskManager @@ -170,7 +171,7 @@ public bool IsManagedByTaskManager } /// - /// Gets the absolute path of the icon image. + /// Gets the absolute path of the component's icon image. /// /// 6 public string IconPath @@ -207,11 +208,11 @@ public string Label } /// - /// Gets the localized label of the component for the given locale. + /// Gets the localized label of the component for a specified locale. /// - /// Locale. - /// The format of locale is language and country code. (available value: "[2-letter lowercase language code (ISO 639-1)]-[2-letter lowercase country code (ISO 3166-alpha-2)]") - /// The localized label. + /// The locale in the format of language and country code (e.g., "en-US"). + /// Available values are in the format "[2-letter lowercase language code (ISO 639-1)]-[2-letter lowercase country code (ISO 3166-alpha-2)]". + /// The localized label corresponding to the specified locale. /// 6 public string GetLocalizedLabel(string locale) { @@ -226,7 +227,7 @@ public string GetLocalizedLabel(string locale) } /// - /// Releases all resources used by the ComponentInfo class. + /// Releases all resources used by the class. /// /// 6 public void Dispose() @@ -236,7 +237,7 @@ public void Dispose() } /// - /// Releases all resources used by the ComponentInfo class. + /// Releases resources used by the class. /// /// Disposing /// 6 diff --git a/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentManager.cs b/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentManager.cs index 4824e6f4e4b..890c8080fc0 100755 --- a/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentManager.cs +++ b/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentManager.cs @@ -29,15 +29,18 @@ namespace Tizen.Applications.ComponentBased public static class ComponentManager { private const string LogTag = "Tizen.Applications"; - + /// - /// Gets the information of the installed components asynchronously. + /// Asynchronously retrieves a list of installed components. /// - /// The installed component info list. - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the "component not exist" error or the system error. - /// Thrown when failed because of out of memory. - /// Thrown when failed because of permission denied. + /// + /// A task that represents the asynchronous operation. + /// The task result contains an of the installed component information. + /// + /// Thrown when an invalid argument is provided. + /// Thrown when the component does not exist or if a system error occurs. + /// Thrown when the system runs out of memory. + /// Thrown when permission is denied to access the component information. /// http://tizen.org/privilege/packagemanager.info /// 6 public static async Task> GetInstalledComponentsAsync() @@ -74,13 +77,16 @@ public static async Task> GetInstalledComponentsAsync } /// - /// Gets the information of the running components asynchronously. + /// Asynchronously retrieves a list of currently running components. /// - /// The component running context list. - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the "component not exist" error or the system error. - /// Thrown when failed because of out of memory. - /// Thrown when failed because of permission denied. + /// + /// A task that represents the asynchronous operation. + /// The task result contains an of the running components. + /// + /// Thrown when an invalid argument is provided. + /// Thrown when the component does not exist or if a system error occurs. + /// Thrown when the system runs out of memory. + /// Thrown when permission is denied to access the running components. /// http://tizen.org/privilege/packagemanager.info /// 6 public static async Task> GetRunningComponentsAsync() @@ -117,14 +123,16 @@ public static async Task> GetRunningCompone } /// - /// Checks whether the component is running or not. + /// Checks if a specified component is currently running. /// - /// Component ID. - /// Returns true if the component is running, otherwise false. - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the "component not exist" error or the system error. - /// Thrown when failed because of out of memory. - /// Thrown when failed because of permission denied. + /// The unique identifier of the component. + /// + /// True if the component is running; otherwise, false. + /// + /// Thrown when an invalid argument is provided. + /// Thrown when the component does not exist or if a system error occurs. + /// Thrown when the system runs out of memory. + /// Thrown when permission is denied to access the component status. /// http://tizen.org/privilege/packagemanager.info /// 6 public static bool IsRunning(string componentId) @@ -139,17 +147,17 @@ public static bool IsRunning(string componentId) } /// - /// Terminates the component if it is running in the background. + /// Requests to terminate a specified component that is running in the background. /// - /// Component ID - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the "component not exist" error or the system error. - /// Thrown when failed because of out of memory. - /// Thrown when failed because of permission denied. + /// The context of the running component to terminate. + /// Thrown when an invalid argument is provided. + /// Thrown when the component does not exist or if a system error occurs. + /// Thrown when the system runs out of memory. + /// Thrown when permission is denied to terminate the component. /// http://tizen.org/privilege/appmanager.kill.bgapp /// - /// This function returns after it just sends a request for terminating a background component. - /// Platform will decide if the target component could be terminated or not according to the state of the target component. + /// This method sends a request to terminate a background component. + /// The platform determines if the target component can be terminated based on its current state. /// /// 6 public static void TerminateBackgroundComponent(ComponentRunningContext context) diff --git a/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentRunningContext.cs b/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentRunningContext.cs index 4932922087c..0c366ec1c6e 100755 --- a/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentRunningContext.cs +++ b/src/Tizen.Applications.ComponentBased.ComponentManager/Tizen.Applications/ComponentRunningContext.cs @@ -23,7 +23,8 @@ namespace Tizen.Applications.ComponentBased { /// - /// This class provides methods and properties to get information of the running component. + /// Represents the context of a running component, providing methods and properties + /// to retrieve information about the component's state and behavior. /// /// 6 public class ComponentRunningContext : IDisposable @@ -39,13 +40,14 @@ internal ComponentRunningContext(IntPtr contextHandle) } /// - /// A constructor of ComponentRunningContext that takes the component ID. + /// Initializes a new instance of the class + /// with a specified component ID, retrieving the context handle associated with it. /// - /// Component ID. - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the "component not exist" error or the system error. - /// Thrown when failed because of out of memory. - /// Thrown when failed because of permission denied. + /// The ID of the component. + /// Thrown when the component ID is invalid. + /// Thrown when the component does not exist or a system error occurs. + /// Thrown when memory allocation fails. + /// Thrown when permission is denied to access the component. /// http://tizen.org/privilege/packagemanager.info /// 6 public ComponentRunningContext(string componentId) @@ -61,7 +63,7 @@ public ComponentRunningContext(string componentId) } /// - /// Destructor of the class. + /// Finalizes an instance of the class. /// ~ComponentRunningContext() { @@ -69,7 +71,7 @@ public ComponentRunningContext(string componentId) } /// - /// Enumeration for the component state. + /// Represents the possible states of a component. /// /// 6 public enum ComponentState @@ -108,6 +110,7 @@ public enum ComponentState /// /// Gets the ID of the component. /// + /// The component ID as a string. /// 6 public string ComponentId { @@ -129,7 +132,7 @@ public string ComponentId } /// - /// Gets the application ID of the component. + /// Gets the application ID associated with the component. /// /// 6 public string ApplicationId @@ -146,7 +149,7 @@ public string ApplicationId return appId; } } - + /// /// Gets the instance ID of the component. /// @@ -167,7 +170,7 @@ public string InstanceId } /// - /// Gets the state of the component. + /// Gets the current state of the component. /// /// 6 public ComponentState State @@ -186,8 +189,9 @@ public ComponentState State } /// - /// Checks whether the component is terminated or not. + /// Checks whether the component has been terminated. /// + /// true if the component is terminated; otherwise, false. /// 6 public bool IsTerminated { @@ -205,8 +209,9 @@ public bool IsTerminated } /// - /// Checks whether the component is running as sub component of the group. + /// Checks whether the component is running as a sub-component of a group. /// + /// true if the component is a sub-component; otherwise, false. /// 6 public bool IsSubComponent { @@ -224,12 +229,12 @@ public bool IsSubComponent } /// - /// Resumes the running component. + /// Resumes the execution of the running component. /// - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the system error. - /// Thrown when failed because of out of memory. - /// Thrown when failed because of permission denied. + /// Thrown when the argument is invalid. + /// Thrown when a system error occurs. + /// Thrown when memory allocation fails. + /// Thrown when permission is denied to resume the component. /// http://tizen.org/privilege/appmanager.launch /// 6 public void Resume() @@ -237,17 +242,17 @@ public void Resume() Interop.ComponentManager.ErrorCode err = Interop.ComponentManager.ComponentManagerResumeComponent(_contextHandle); if (err != Interop.ComponentManager.ErrorCode.None) { - throw ComponentManager.ComponentManagerErrorFactory.GetException(err, "Failed to Send the resume request."); + throw ComponentManager.ComponentManagerErrorFactory.GetException(err, "Failed to send the resume request."); } } /// - /// Pauses the running component. + /// Pauses the execution of the running component. /// - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the system error. - /// Thrown when failed because of out of memory. - /// Thrown when failed because of permission denied. + /// Thrown when the argument is invalid. + /// Thrown when a system error occurs. + /// Thrown when memory allocation fails. + /// Thrown when permission is denied to pause the component. /// http://tizen.org/privilege/appmanager.launch /// 6 [EditorBrowsable(EditorBrowsableState.Never)] @@ -261,12 +266,12 @@ public void Pause() } /// - /// Terminates the running component. + /// Terminates the execution of the running component. /// - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the system error. - /// Thrown when failed because of out of memory. - /// Thrown when failed because of permission denied. + /// Thrown when the argument is invalid. + /// Thrown when a system error occurs. + /// Thrown when memory allocation fails. + /// Thrown when permission is denied to terminate the component. /// http://tizen.org/privilege/appmanager.launch /// 6 [EditorBrowsable(EditorBrowsableState.Never)] @@ -280,7 +285,7 @@ public void Terminate() } /// - /// Releases all resources used by the ComponentInfo class. + /// Releases all resources used by the class. /// /// 6 public void Dispose() @@ -290,9 +295,9 @@ public void Dispose() } /// - /// Releases all resources used by the ComponentInfo class. + /// Releases all resources used by the class. /// - /// Disposing + /// true to release managed resources; otherwise, false. /// 6 private void Dispose(bool disposing) { diff --git a/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/ComponentPort.cs b/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/ComponentPort.cs index e62d82f764f..a0f70d1dec6 100755 --- a/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/ComponentPort.cs +++ b/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/ComponentPort.cs @@ -43,12 +43,12 @@ public class ComponentPort : IDisposable private static int _requestId = 0; /// - /// Constructor for this class. + /// Constructs a new instance of this class. /// /// Thrown when the argument is invalid. /// Thrown when the memory is insufficient. /// Thrown when because of I/O error. - /// The name of the port. + /// The name of the port to connect to. /// 9 public ComponentPort(string portName) { @@ -77,7 +77,7 @@ public string PortName /// Adds a privilege to the port object. /// /// Thrown when the argument is invalid. - /// privilege data + /// Privilege data specifying the access rights to be granted. /// 9 public void AddPrivilege(string privilege) { @@ -157,8 +157,8 @@ public static Task WaitForPort(string endpoint) /// /// /// This method runs a main loop until Cancel() is called. - /// The code in the next line will not run until Cancel() is called. - /// To avoid blocking the main thread, it's recommended to use the ComponentTask class. + /// The code in the next line will not execute until Cancel() is called. + /// To prevent blocking the main thread, consider using the ComponentTask class instead. /// /// /// @@ -182,15 +182,19 @@ public void Cancel() } /// - /// Sends the request data. + /// Sends the request data to the specified endpoint. /// + /// + /// This method sends the serialized request data to the specified endpoint. + /// If the timeout value is not set (-1), the default timeout will be used. + /// /// Thrown when the argument is invalid. /// Thrown when the memory is insufficient. /// Thrown when permission is denied. /// Thrown when because of I/O error. - /// The name of the endpoint - /// The timeout in milliseconds, -1 to use the default timeout - /// The serializable data to send + /// The name of the endpoint to which the request is sent. + /// The timeout in milliseconds, -1 to use the default timeout. + /// The serializable data to send. /// 9 public void Send(string endpoint, int timeout, object request) { @@ -222,10 +226,10 @@ public void Send(string endpoint, int timeout, object request) /// Thrown when the memory is insufficient. /// Thrown when permission is denied. /// Thrown when because of I/O error. - /// The name of the endpoint - /// The timeout in milliseconds, -1 to use the default timeout - /// The serializable data to send - /// The received serializable data + /// The name of the endpoint to which the request is sent. + /// The timeout in milliseconds, -1 to use the default timeout. + /// The serializable data to send. + /// The received serializable data. /// 9 public object SendAndReceive(string endpoint, int timeout, object request) { @@ -264,11 +268,11 @@ public object SendAndReceive(string endpoint, int timeout, object request) /// Thrown when the memory is insufficient. /// Thrown when permission is denied. /// Thrown when because of I/O error. - /// The name of the endpoint - /// The timeout in milliseconds, -1 to use the default timeout - /// The serializable data to send - /// The received serializable data - /// /// 9 + /// The name of the endpoint to which the request is sent. + /// The timeout in milliseconds, -1 to use the default timeout. + /// The serializable data to send. + /// The received serializable data. + /// 9 public Task SendAndReceiveAsync(string endpoint, int timeout, object request) { try @@ -285,7 +289,7 @@ public Task SendAndReceiveAsync(string endpoint, int timeout, object req /// Occurs whenever the request is received. /// /// - /// If the reply is requested, RequestEventArgs.Request should be set. + /// The event handler receives a RequestEventArgs argument that contains information about the request. If the reply is requested, RequestEventArgs.Request should be set. /// /// 9 public event EventHandler RequestReceived; @@ -422,7 +426,7 @@ protected virtual void Dispose(bool disposing) } /// - /// Finalizer of the class ComponentPort. + /// Finalizes an instance of the class ComponentPort. /// /// 9 ~ComponentPort() @@ -433,7 +437,7 @@ protected virtual void Dispose(bool disposing) /// /// Releases all the resources used by the class ComponentPort. /// - /// 9 > + /// 9 public void Dispose() { Dispose(disposing: true); diff --git a/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/ComponentTask.cs b/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/ComponentTask.cs index 2134be10a4b..9d5bb6c1754 100755 --- a/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/ComponentTask.cs +++ b/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/ComponentTask.cs @@ -59,10 +59,10 @@ private void OnThread() /// /// Starts the task. - /// - /// This method calls ComponentPort.WaitForEvent() in the thread. - /// /// + /// + /// This method calls in the thread. + /// /// 9 public void Start() { @@ -81,7 +81,7 @@ public void Start() /// Stops the task. /// /// - /// This method calls ComponentPort.Cancel() before stopping the thread. + /// This method calls before stopping the thread. /// /// 9 public void Stop() diff --git a/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/Parcel.cs b/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/Parcel.cs index 4f2db8ac6a0..ac10b5e9ef3 100755 --- a/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/Parcel.cs +++ b/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/Parcel.cs @@ -86,7 +86,7 @@ protected virtual void Dispose(bool disposing) } /// - /// Finalizer of the class Parcel. + /// Finalizes an instance of the Parcel class. /// /// 9 ~Parcel() @@ -97,7 +97,7 @@ protected virtual void Dispose(bool disposing) /// /// Releases all the resources used by the class parcel. /// - /// 9 > + /// 9 public void Dispose() { Dispose(disposing: true); @@ -123,4 +123,4 @@ internal static Exception GetException(Interop.Parcel.ErrorCode err, string mess } } } -} \ No newline at end of file +} diff --git a/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/RequestEventArgs.cs b/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/RequestEventArgs.cs index 652c9b1577a..c93086ee17b 100755 --- a/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/RequestEventArgs.cs +++ b/src/Tizen.Applications.ComponentBased.Port/Tizen.Applications.ComponentBased.Port/RequestEventArgs.cs @@ -19,7 +19,7 @@ namespace Tizen.Applications.ComponentBased { /// - /// Arguments for the event raised when the request is received. + /// The arguments for the event raised when the request is received. /// /// 9 public class RequestEventArgs : EventArgs diff --git a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/BaseComponent.cs b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/BaseComponent.cs index 1940a3ff776..52b9ecbdce3 100755 --- a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/BaseComponent.cs +++ b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/BaseComponent.cs @@ -21,11 +21,11 @@ namespace Tizen.Applications.ComponentBased.Common { /// - /// This is a base-component class. - /// It provides common functions of FrameComponent and ServiceComponent. + /// Represents the base class for components, providing common functionalities for both FrameComponent and ServiceComponent. /// /// - /// This class cannot be registered by ComponentBased applications. + /// This class cannot be registered directly by ComponentBased applications. + /// It serves as a base class to be inherited by other components. /// /// 6 public abstract class BaseComponent @@ -75,26 +75,26 @@ public abstract class BaseComponent public event EventHandler TimeZoneChanged; /// - /// A component instance ID. + /// Gets the unique instance ID of the component. /// It will be created after OnCreate method is invoked. /// /// 6 public string Id { get; private set; } /// - /// A component ID + /// Gets the ID of the component. /// /// 6 public string ComponentId { get; private set; } /// - /// Parent object + /// Gets the parent application object to which the component belongs. /// /// 6 public ComponentBasedApplication Parent { get; private set; } /// - /// Finish current component + /// Finishes the current component. /// /// 6 public void Finish() @@ -128,18 +128,18 @@ internal void Bind(IntPtr handle, string compId, string instanceId, ComponentBas } /// - /// Overrides this method if want to handle behavior to restore the previous status. + /// Override this method to handle restoring the previous state of the component. /// - /// Contents. It can be used only in the callback. To use outside, make a copy. + /// A bundle containing the saved state of the component. It can only be used within the callback. To use it outside, create a copy. /// 6 public virtual void OnRestoreContents(Bundle c) { } /// - /// Overrides this method if want to handle behavior to save current status. + /// Override this method to handle saving the current state of the component. /// - /// Contents. It can be used only in the callback. To use outside, make a copy. + /// A bundle containing the current state of the component. It can only be used within the callback. To use it outside, create a copy. /// 6 public virtual void OnSaveContent(Bundle c) { @@ -181,17 +181,18 @@ internal void OnTimeZoneChangedCallback(string timeZone, string timeZoneId) } /// - /// Sends the launch request asynchronously. + /// Sends a launch request asynchronously. /// /// - /// To use group mode, you must use this function instead of SendLaunchRequestAsync(). + /// Use this method to send a launch request with group mode enabled. + /// If group mode is not required, you can use SendLaunchRequestAsync() instead. /// - /// appcontrol object - /// The callback function to be called when the reply is delivered. - /// A task with the result of the launch request. + /// The AppControl object representing the request details. + /// The callback function to be invoked when the reply is received. + /// A task representing the result of the launch request. /// Thrown when failed because of the argument is invalid. - /// Thrown when fail to set component information to the AppControl. - /// Thrown when the application to run is not found. + /// Thrown when there is a failure in setting the component information in the AppControl. + /// Thrown when the target application is not found. /// Thrown when the launch request is rejected. /// http://tizen.org/privilege/appmanager.launch /// 6 diff --git a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/ComponentBasedApplication.cs b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/ComponentBasedApplication.cs index 8b6cf709f15..da36a7fad81 100755 --- a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/ComponentBasedApplication.cs +++ b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/ComponentBasedApplication.cs @@ -20,8 +20,13 @@ namespace Tizen.Applications.ComponentBased.Common { /// - /// The class for supporting multi-components based application model. + /// Represents the base class for a multi-component based application. + /// This class allows the creation and management of multiple application components, such as Frame, Service, and Widget components. /// + /// + /// This abstract class provides the core structure for applications that consist of multiple components. + /// Each component has its own lifecycle, and the framework handles these lifecycles independently. + /// /// 6 public abstract class ComponentBasedApplication : Application { @@ -30,12 +35,24 @@ public abstract class ComponentBasedApplication : Application private Interop.CBApplication.CBAppLifecycleCallbacks _callbacks; /// - /// Initializes the ComponentBasedApplicationBase class. + /// Initializes a new instance of the class with the specified component type information. /// - /// The component type information. - /// The key should be a class type of FrameComponent or SubComponent subclass. - /// The value should be a component id which is declared in tizen-manifest.xml. - /// + /// A dictionary where the key is the component class type (FrameComponent, ServiceComponent or WidgetComponent subclass), + /// and the value is the component ID defined in the tizen-manifest.xml file. + /// + /// This constructor sets up the necessary callbacks for the application lifecycle and registers the provided components. + /// + /// + /// + /// IDictionary<Type, string> components = new Dictionary<Type, string>() + /// { + /// { typeof(MyFrameComponent), "frameComponentId" }, + /// { typeof(MyServiceComponent), "serviceComponentId" } + /// }; + /// ComponentBasedApplication app = new MyApplication(components); + /// app.Run(args); + /// + /// /// 6 public ComponentBasedApplication(IDictionary typeInfo) { @@ -53,11 +70,19 @@ public ComponentBasedApplication(IDictionary typeInfo) } /// - /// Registers a component. + /// Registers a component with the specified type and ID. /// - /// Class type - /// Component ID - /// Thrown when component type is already added or not sub-class of FrameComponent or ServiceComponent + /// The type of the component to register. Must be a subclass of FrameComponent, ServiceComponent, or WidgetComponent. + /// The ID of the component, defined in the tizen-manifest.xml file. + /// Thrown when the component type is already registered or not sub-class of FrameComponent, ServiceComponent or WidgetComponent. + /// + /// This method ensures that only valid component types are registered. The component ID must be unique. + /// + /// + /// + /// app.RegisterComponent(typeof(MyFrameComponent), "frameComponentId"); + /// + /// /// 6 public void RegisterComponent(Type compType, string compId) { @@ -98,8 +123,13 @@ public void RegisterComponent(Type compType, string compId) /// /// Runs the application's main loop. /// - /// Arguments from commandline. + /// The arguments passed from the command line. /// Thrown when component type is already added to the component. + /// + /// + /// app.Run(args); + /// + /// /// 6 public override void Run(string[] args) { @@ -121,7 +151,7 @@ public override void Run(string[] args) } /// - /// Exits the main loop of the application. + /// Exits the application's main loop. /// /// 6 public override void Exit() @@ -166,31 +196,43 @@ private void OnFinishedNative(IntPtr data) } /// - /// This method will be called before running main-loop + /// Called before the main loop starts. /// - /// + /// The arguments passed from the command line. + /// + /// Override this method to handle any initialization logic before the application enters the main event loop. + /// /// 6 protected virtual void OnInit(string[] args) { } /// - /// This method will be called after exiting main-loop + /// Called after the main loop exits. /// + /// + /// Override this method to handle any cleanup logic after the application has finished running. + /// /// 6 protected virtual void OnFinished() { } /// - /// This method will be called to start main-loop + /// Called to start the main loop of the application. /// + /// + /// This is an abstract method that must be implemented by derived classes to define the behavior when the application starts. + /// /// 6 protected abstract void OnRun(); /// - /// This method will be called to exit main-loop + /// Called to exit the main loop of the application. /// + /// + /// Override this method to handle any logic needed before the application exits. + /// /// 6 protected virtual void OnExit() { diff --git a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/FrameComponent.cs b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/FrameComponent.cs index d3b166492dd..5a378791aa5 100644 --- a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/FrameComponent.cs +++ b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/FrameComponent.cs @@ -19,15 +19,19 @@ namespace Tizen.Applications.ComponentBased.Common { /// - /// The class for showing UI module + /// Represents a base class for UI components in the component-based application model. + /// This class provides methods for handling the lifecycle and state of UI components. /// /// 6 public abstract class FrameComponent : BaseComponent { /// - /// Gets the display status of a component. + /// Gets the current display status of the component. /// - /// Thrown when component type is already added to the component. + /// + /// The current of the component. + /// + /// Thrown when the display status cannot be retrieved. /// 6 public DisplayStatus DisplayStatus { @@ -43,31 +47,36 @@ public DisplayStatus DisplayStatus } /// - /// Overrides this method to handle behavior when the component is launched. + /// Called when the component is launched. Override this method to implement custom launch behavior. /// - /// True if a service component is successfully created + /// + /// true if the service component is successfully created; otherwise, false. + /// /// 6 public abstract bool OnCreate(); /// - /// Overrides this method to create window. It will be called before OnCreate method. + /// Called to create the window for the component. Override this method to provide a custom window. + /// This method will be called before method. /// - /// Window object to use + /// + /// An object that represents the created window. + /// /// 6 public abstract IWindowInfo CreateWindowInfo(); /// - /// Overrides this method if want to handle behavior when the component receives the appcontrol message. + /// Called when the component receives an app control message. Override this method to handle app control messages. /// - /// appcontrol object - /// True if it was restarted + /// The object containing the app control data. + /// true if the component was restarted; otherwise, false. /// 6 public virtual void OnStart(AppControl appControl, bool restarted) { } /// - /// Overrides this method if you want to handle the behavior when the component is resumed. + /// Called when the component is resumed. Override this method to handle resume behavior. /// /// 6 public virtual void OnResume() @@ -75,7 +84,7 @@ public virtual void OnResume() } /// - /// Overrides this method if you want to handle the behavior when the component is paused. + /// Called when the component is paused. Override this method to handle pause behavior. /// /// 6 public virtual void OnPause() @@ -83,7 +92,7 @@ public virtual void OnPause() } /// - /// Overrides this method if you want to handle the behavior when the component is stopped. + /// Called when the component is stopped. Override this method to handle stop behavior. /// /// 6 public virtual void OnStop() @@ -91,7 +100,7 @@ public virtual void OnStop() } /// - /// Overrides this method if want to handle behavior when the component is destroyed. + /// Called when the component is destroyed. Override this method to handle destruction behavior. /// /// 6 public virtual void OnDestroy() diff --git a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/ServiceComponent.cs b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/ServiceComponent.cs index 6dc04f2c3b5..3d95badcdc5 100755 --- a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/ServiceComponent.cs +++ b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/ServiceComponent.cs @@ -19,29 +19,33 @@ namespace Tizen.Applications.ComponentBased.Common { /// - /// The class for showing service module + /// Represents a base class for service components in the component-based application model. + /// This class provides methods for handling the lifecycle and state of service components. /// /// 6 public abstract class ServiceComponent : BaseComponent { /// - /// Overrides this method to handle behavior when the component is created. + /// Called when the service component is created. Override this method to implement custom creation behavior. /// - /// True if a service component is successfully created + /// + /// true if the service component is successfully created; otherwise, false. + /// + /// 6 public abstract bool OnCreate(); /// - /// Overrides this method if want to handle behavior when the component receives the start command message. + /// Called when the service component receives a start command message. Override this method to handle start command behavior. /// - /// appcontrol object - /// True if it was restarted + /// The object containing the app control data. + /// true if the component was restarted; otherwise, false. /// 6 public virtual void OnStartCommand(AppControl appControl, bool restarted) { } /// - /// Overrides this method if want to handle behavior when the component is destroyed. + /// Called when the service component is destroyed. Override this method to handle destruction behavior. /// /// 6 public virtual void OnDestroy() @@ -49,3 +53,4 @@ public virtual void OnDestroy() } } } + diff --git a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/WidgetComponent.cs b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/WidgetComponent.cs index 6f69360135a..a4e83f00b2f 100644 --- a/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/WidgetComponent.cs +++ b/src/Tizen.Applications.ComponentBased/Tizen.Applications.ComponentBased.Common/WidgetComponent.cs @@ -19,41 +19,47 @@ namespace Tizen.Applications.ComponentBased.Common { /// - /// The class for showing UI module + /// Represents a base class for widget components in the component-based application model. + /// This class provides methods for handling the lifecycle and state of widget components. /// /// 9 public abstract class WidgetComponent : BaseComponent { - /// - /// Override this method to handle behavior when the component is launched. + /// Called when the widget component is created. Override this method to implement custom creation behavior. /// - /// The width of the widget component instance - /// The height of the widget component instance - /// True if a service component is successfully created + /// The width of the widget component instance. + /// The height of the widget component instance. + /// + /// true if the widget component is successfully created; otherwise, false. + /// /// 9 public abstract bool OnCreate(int width, int height); /// - /// Override this method to create window. It will be called before OnCreate method. + /// Called to create the window for the widget. This method will be called before the method. /// - /// The width of the widget window - /// The height of the widget window - /// Window object to use + /// The width of the widget window. + /// The height of the widget window. + /// + /// An object representing the window to use. + /// /// 9 public abstract IWindowProxy CreateWindowInfo(int width, int height); /// - /// Overrid this method if want to handle behavior when the component is started. + /// Called when the widget component is started. Override this method to handle start behavior. /// - /// True if it was restarted + /// + /// true if the component was restarted; otherwise, false. + /// /// 9 public virtual void OnStart(bool restarted) { } /// - /// Override this method if you want to handle the behavior when the component is resumed. + /// Called when the widget component is resumed. Override this method to handle resume behavior. /// /// 9 public virtual void OnResume() @@ -61,7 +67,7 @@ public virtual void OnResume() } /// - /// Override this method if you want to handle the behavior when the component is paused. + /// Called when the widget component is paused. Override this method to handle pause behavior. /// /// 9 public virtual void OnPause() @@ -69,7 +75,7 @@ public virtual void OnPause() } /// - /// Override this method if you want to handle the behavior when the component is stopped. + /// Called when the widget component is stopped. Override this method to handle stop behavior. /// /// 9 public virtual void OnStop() @@ -77,9 +83,11 @@ public virtual void OnStop() } /// - /// Override this method if want to handle behavior when the component is destroyed. + /// Called when the widget component is destroyed. Override this method to handle destruction behavior. /// - /// True if the instance is permanent + /// + /// true if the instance is permanent; otherwise, false. + /// /// 9 public virtual void OnDestroy(bool permanent) { diff --git a/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs b/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs index 44e6f7e6e19..46988c4ce1d 100644 --- a/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs +++ b/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs @@ -238,6 +238,21 @@ internal static class Notification [DllImport(Libraries.Notification, EntryPoint = "notification_get_check_box")] internal static extern NotificationError GetCheckBox(NotificationSafeHandle handle, out bool flag, out bool checkedValue); + /* apis for do not disturb app */ + internal delegate void DisturbCallback(IntPtr userData); + + [DllImport(Libraries.Notification, EntryPoint = "notification_register_do_not_disturb_app")] + internal static extern NotificationError RegisterDndApp(DisturbCallback cb, IntPtr userData); + + [DllImport(Libraries.Notification, EntryPoint = "notification_unregister_do_not_disturb_app")] + internal static extern NotificationError UnRegisterDndApp(); + + [DllImport(Libraries.Notification, EntryPoint = "notification_set_pairing_type")] + internal static extern NotificationError SetPairingType(NotificationSafeHandle handle, bool pairing); + + [DllImport(Libraries.Notification, EntryPoint = "notification_get_pairing_type")] + internal static extern NotificationError GetPairingType(NotificationSafeHandle handle, out bool pairing); + internal static NotificationError GetText(NotificationSafeHandle handle, NotificationText type, out string text) { NotificationError ret; diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs index 019ea0a9a7e..dbe43211294 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs @@ -212,6 +212,9 @@ public int Count [EditorBrowsable(EditorBrowsableState.Never)] public bool CheckedValue { get; set; } = false; + [EditorBrowsable(EditorBrowsableState.Never)] + public bool PairingType { get; set; } = false; + /// /// Gets or sets NotificationSafeHandle. /// @@ -525,7 +528,7 @@ internal Notification Build() Bundle bundle = new Bundle(new SafeBundleHandle(extension, false)); foreach (string key in bundle.Keys) { - if (key.StartsWith("_NOTIFICATION_EXTENSION_EVENT_")) + if (key.StartsWith("_NOTIFICATION_EXTENSION_EVENT_") || key.StartsWith("_NOTIFICATION_TYPE_PAIRING_")) continue; SafeBundleHandle sbh; diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs index b847e6917a3..750914b164e 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs @@ -62,6 +62,11 @@ internal static void BindObject(Notification notification) { Interop.Notification.SetCheckBox(notification.Handle, notification.CheckBox, notification.CheckedValue); } + + if (notification.PairingType == true) + { + Interop.Notification.SetPairingType(notification.Handle, notification.PairingType); + } } internal static void BindSafeHandle(Notification notification) @@ -91,6 +96,7 @@ internal static void BindSafeHandle(Notification notification) BindSafeHandleTag(notification); BindSafeHandleAction(notification); BindSafeHandleCheckBox(notification); + BindSafeHandlePairingType(notification); } private static void BindNotificationSafeHandle(Notification notification) @@ -250,5 +256,18 @@ private static void BindSafeHandleCheckBox(Notification notification) notification.CheckBox = checkbox; notification.CheckedValue = checkedValue; } + + private static void BindSafeHandlePairingType(Notification notification) + { + NotificationError ret; + bool pairingType= false; + + ret = Interop.Notification.GetPairingType(notification.Handle, out pairingType); + if (ret != NotificationError.None) { + Log.Error(Notification.LogTag, "Failed to get paring type info"); + } + + notification.PairingType = pairingType; + } } } diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs index aadca4ec6b9..2474f7b97a0 100644 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs @@ -29,6 +29,10 @@ public static class NotificationManager private static Interop.Notification.ResponseEventCallback responseEventCallback; + // for disturb app + private static event EventHandler ResponseDisturbHandler; + private static Interop.Notification.DisturbCallback disturbCallback; + private static void ResponseEventCallback(IntPtr ptr, int type, IntPtr userData) { IntPtr cloned; @@ -48,6 +52,12 @@ private static void ResponseEventCallback(IntPtr ptr, int type, IntPtr userData) ResponseEventHandler?.Invoke(null, eventArgs); } + // for disturb app + private static void DisturbCallback(IntPtr userData) + { + ResponseDisturbHandler?.Invoke(null, EventArgs.Empty); + } + /// /// The event handler for receiving a response event from the notification viewers /// @@ -559,5 +569,56 @@ public static Notification MakeNotification(NotificationSafeHandle handle) return notification; } + + /// + /// The event handler to get + /// + /// 12 + [EditorBrowsable(EditorBrowsableState.Never)] + public static event EventHandler DisturbReceived + { + add + { + if (disturbCallback == null) + { + disturbCallback = new Interop.Notification.DisturbCallback(DisturbCallback); + } + + ResponseDisturbHandler += value; + } + + remove + { + if (ResponseDisturbHandler != null && ResponseDisturbHandler.GetInvocationList().Length > 0) + { + NotificationError ret = Interop.Notification.UnRegisterDndApp(); + if (ret != NotificationError.None) + { + throw NotificationErrorFactory.GetException(ret, "register do not disturb app failed"); + } + + ResponseDisturbHandler -= value; + } + } + } + + /// + /// Register do not disturb app + /// + /// 12 + [EditorBrowsable(EditorBrowsableState.Never)] + public static void RegisterDoNotDisturbApp() + { + if (ResponseDisturbHandler != null && ResponseDisturbHandler.GetInvocationList().Length > 0) + { + NotificationError ret = Interop.Notification.RegisterDndApp(disturbCallback, IntPtr.Zero); + if (ret != NotificationError.None) + { + throw NotificationErrorFactory.GetException(ret, "register do not disturb app failed"); + } + } else { + throw NotificationErrorFactory.GetException(NotificationError.InvalidOperation, "Disturb callback not exist"); + } + } } } diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs index 7fb9d7238cc..1156f866b10 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs +++ b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs @@ -172,7 +172,7 @@ internal static NotificationEventArgs BindObject(IntPtr notification, bool data) Bundle bundle = new Bundle(new SafeBundleHandle(extension, false)); foreach (string key in bundle.Keys) { - if (key.StartsWith("_NOTIFICATION_EXTENSION_EVENT_")) + if (key.StartsWith("_NOTIFICATION_EXTENSION_EVENT_") || key.StartsWith("_NOTIFICATION_TYPE_PAIRING_")) continue; SafeBundleHandle sbh; diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs index 9f01052a4db..4c7f7932128 100755 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs +++ b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs @@ -59,6 +59,30 @@ public static class PackageManager /// Event type of the request. /// Current event state of the request. /// Progress for the request being processed by the package manager (in percent). + /// + /// The RequestEventCallback function provides information about the current status of a package request. It is called every time there is an update in the package request process. By monitoring the arguments passed to this function, you can keep track of the progress and events related to the package request. + /// + /// + /// + /// private static void OnRequestEventCallback(string type, string packageId, PackageEventType eventType, PackageEventState eventState, int progress) + /// { + /// switch (eventType) + /// { + /// case PackageEventType.Installing: + /// Console.WriteLine($"Package '{packageId}' is currently installing."); + /// break; + /// case PackageEventType.Updating: + /// Console.WriteLine($"Package '{packageId}' is currently updating."); + /// break; + /// case PackageEventType.Removing: + /// Console.WriteLine($"Package '{packageId}' is currently removing."); + /// break; + /// default: + /// throw new ArgumentException($"Unknown event type: {eventType}"); + /// } + /// } + /// + /// /// 3 public delegate void RequestEventCallback(string type, string packageId, PackageEventType eventType, PackageEventState eventState, int progress); @@ -72,9 +96,9 @@ public static class PackageManager private delegate Interop.PackageManager.ErrorCode InstallPackagesMethod(SafePackageManagerRequestHandle requestHandle, string[] pkgPaths, int pathsCount, out int requestID); /// - /// InstallProgressChanged event. This event occurs when a package is getting installed and the progress of the request to the package manager is changed. + /// InstallProgressChanged event. Occurs when a package is being installed and the progress of the request to the package manager changes. /// - /// Thrown when subscribing to package manager event failed. + /// Thrown when subscribing to package manager event fails. /// 3 public static event EventHandler InstallProgressChanged { @@ -122,7 +146,7 @@ public static event EventHandler UninstallProgressChang UnregisterPackageManagerEventIfNeeded(); UnsetPackageManagerEventStatus(); } - } + } } /// @@ -286,8 +310,8 @@ private static SafePackageManagerHandle Handle /// /// The ID of the application. /// Returns the ID of the package. - /// It returns null if the input is null. - /// Thrown when input application ID does not exist. + /// If the input is null, it returns null. + /// Thrown when the input application ID does not exist. /// Thrown when there is not enough memory to continue the execution of the method. /// Thrown when an application does not have the privilege to access this method. /// http://tizen.org/privilege/packagemanager.info @@ -346,6 +370,10 @@ public static void ClearCacheDirectory(string packageId) /// /// Clears all the application's internal and external cache directories. /// + /// + /// This method clears both the internal and external cache directories of the application. It ensures that any cached files are removed from the device storage. + /// By calling this method, you can free up valuable space on the device and improve its performance. However, note that this operation may take some time depending on the amount of cached data present in the directories. + /// /// Thrown when there is not enough memory to continue the execution of the method. /// Thrown when the method fails due to an internal IO error. /// Thrown when an application does not have the privilege to access this method. @@ -368,13 +396,13 @@ public static void ClearAllCacheDirectory() /// /// /// All files under data, shared/data, and shared/trusted in the internal storage are removed. - /// And, if the external storage exists, then all files under data and shared/trusted in the external storage are removed. + /// And, if the external storage exists, then all files under data and shared/trusted in the external storage are also removed. /// /// ID of the package. /// Thrown when there is not enough memory to continue the execution of the method. - /// Thrown when the method failed due to an internal IO error. - /// Thrown when an application does not have the privilege to access this method. - /// Thrown when the method failed due to an internal system error. + /// Thrown when the method fails due to an internal IO error. + /// Thrown when an application does not have the required privileges to access this method. + /// Thrown when the method fails due to an internal system error. /// http://tizen.org/privilege/packagemanager.admin /// platform /// 3 @@ -533,10 +561,9 @@ public static async Task GetTotalSizeInformationAsync() /// /// Absolute path for the package to be installed. /// Optional parameter to indicate special installation mode. - /// Returns true if the installation request is successful, otherwise false. + /// True if the installation request is successful, otherwise false. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of the installation, the caller should check the progress using the InstallProgressChanged event. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -554,8 +581,7 @@ public static bool Install(string packagePath, InstallationMode installMode = In /// Optional parameter to indicate special installation mode. /// Returns true if installation request is successful, false otherwise. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -573,8 +599,7 @@ public static bool Install(string packagePath, RequestEventCallback eventCallbac /// Optional parameter to indicate special installation mode. /// Returns true if installation request is successful, false otherwise. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -592,8 +617,7 @@ public static bool Install(string packagePath, PackageType type, InstallationMod /// Optional parameter to indicate special installation mode. /// Returns true if installation request is successful, false otherwise. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -612,8 +636,7 @@ public static bool Install(string packagePath, string expansionPackagePath, Inst /// Optional parameter to indicate special installation mode. /// Returns true if installation request is successful, false otherwise. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -632,8 +655,7 @@ public static bool Install(string packagePath, PackageType type, RequestEventCal /// Optional parameter to indicate special installation mode. /// Returns true if installation request is successful, false otherwise. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -652,8 +674,7 @@ public static bool Install(string packagePath, string expansionPackagePath, Requ /// Optional parameter to indicate special installation mode. /// Returns true if installation request is successful, false otherwise. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -673,8 +694,7 @@ public static bool Install(string packagePath, string expansionPackagePath, Pack /// Optional parameter to indicate special installation mode. /// Returns true if installation request is successful, false otherwise. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -691,8 +711,7 @@ public static bool Install(string packagePath, string expansionPackagePath, Pack /// Optional parameter to indicate special installation mode. /// Returns true if installation request is successful, false otherwise. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -710,8 +729,7 @@ public static bool Install(List packagePaths, InstallationMode installMo /// Optional parameter to indicate special installation mode. /// Returns true if installation request is successful, false otherwise. /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. + /// True indicates that the installation request was successful. However, to determine whether the actual installation was completed successfully, the caller must monitor the progress by subscribing to the InstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -878,8 +896,7 @@ private static bool InstallInternal(List packagePaths, string expansionP /// ID of the package to be uninstalled. /// Returns true if the uninstallation request is successful, false otherwise. /// - /// The 'true' means that the request for uninstallation is successful. - /// To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event. + /// The return value 'true' indicates that the uninstallation request was successfully made. However, in order to determine whether the actual uninstallation process completed without any errors, the caller needs to monitor the progress through the UninstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -896,8 +913,7 @@ public static bool Uninstall(string packageId) /// Optional - Package type for the package to be uninstalled. /// Returns true if the uninstallation request is successful, false otherwise. /// - /// The 'true' means that the request for uninstallation is successful. - /// To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event. + /// The return value 'true' indicates that the uninstallation request was successfully made. However, in order to determine whether the actual uninstallation process completed without any errors, the caller needs to monitor the progress through the UninstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -914,8 +930,7 @@ public static bool Uninstall(string packageId, PackageType type) /// Optional - The event callback will be invoked only for the current request. /// Returns true if the uninstallation request is successful, false otherwise. /// - /// The 'true' means that the request for uninstallation is successful. - /// To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event or eventCallback. + /// The return value 'true' indicates that the uninstallation request was successfully made. However, in order to determine whether the actual uninstallation process completed without any errors, the caller needs to monitor the progress through the UninstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -933,8 +948,7 @@ public static bool Uninstall(string packageId, RequestEventCallback eventCallbac /// Optional - The event callback will be invoked only for the current request. /// Returns true if the uninstallation request is successful, false otherwise. /// - /// The 'true' means that the request for uninstallation is successful. - /// To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event or eventCallback. + /// The return value 'true' indicates that the uninstallation request was successfully made. However, in order to determine whether the actual uninstallation process completed without any errors, the caller needs to monitor the progress through the UninstallProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -1005,8 +1019,8 @@ public static bool Uninstall(string packageId, PackageType type, RequestEventCal /// Storage package should be moved to. /// Returns true if the move request is successful, false otherwise. /// - /// The 'true' means that the request for move is successful. - /// To check the result of move, the caller should check the progress using the MoveProgressChanged event. + /// The return value 'true' indicates that the move request was successfully made. + /// To determine whether the actual move operation completed successfully, the caller needs to monitor the progress by handling the MoveProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -1024,8 +1038,8 @@ public static bool Move(string packageId, StorageType newStorage) /// Storage package should be moved to. /// Returns true if the move request is successful, false otherwise. /// - /// The 'true' means that the request for move is successful. - /// To check the result of move, the caller should check the progress using the MoveProgressChanged event. + /// The return value 'true' indicates that the move request was successfully made. + /// To determine whether the actual move operation completed successfully, the caller needs to monitor the progress by handling the MoveProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -1043,8 +1057,8 @@ public static bool Move(string packageId, PackageType type, StorageType newStora /// Optional - The event callback will be invoked only for the current request. /// Returns true if move request is successful, false otherwise. /// - /// The 'true' means that the request for move is successful. - /// To check the result of move, the caller should check the progress using the MoveProgressChanged event. + /// The return value 'true' indicates that the move request was successfully made. + /// To determine whether the actual move operation completed successfully, the caller needs to monitor the progress by handling the MoveProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform @@ -1063,8 +1077,8 @@ public static bool Move(string packageId, StorageType newStorage, RequestEventCa /// Optional - The event callback will be invoked only for the current request. /// Returns true if move request is successful, false otherwise. /// - /// The 'true' means that the request for move is successful. - /// To check the result of move, the caller should check the progress using the MoveProgressChanged event. + /// The return value 'true' indicates that the move request was successfully made. + /// To determine whether the actual move operation completed successfully, the caller needs to monitor the progress by handling the MoveProgressChanged event. /// /// http://tizen.org/privilege/packagemanager.admin /// platform diff --git a/src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs b/src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs index fd5bbc4ef61..99b9280fa22 100755 --- a/src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs +++ b/src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs @@ -21,8 +21,8 @@ namespace Tizen.Applications { /// - /// The preference class provides APIs to store and retrieve an application specific data/preference. A preference is saved in the form of a key-value pair. - /// Keys are always text strings and the value can be any one of the four types: integer, double, string, and boolean. + /// The Preference class provides methods to store and retrieve application specific data/preferences. Preferences are stored in the form of key-value pairs. + /// Key names must be text strings while values can be integers, doubles, strings, or booleans. /// /// 3 public static class Preference @@ -136,6 +136,9 @@ public static WeakReference GetEventContext(string key) /// True if the key exists in the preference, otherwise false. /// Thrown if the key is an invalid parameter. /// Thrown when the method failed due to an internal I/O error. + /// + /// This method checks if the specified key exists in the preferences. It returns true if the key exists, and false if not. The key argument should be a valid parameter. An ArgumentException will be thrown if the key is invalid. Additionally, an IOException may be thrown if the method fails due to an internal input/output error. + /// /// /// /// Preference.Set("active_user", "Joe"); @@ -166,18 +169,18 @@ public static bool Contains(string key) /// /// /// If the key already exists in the preference, the old value will be overwritten with a new value. - /// Data types for supported values are: integer, double, string, and bool. + /// Supported value data types include integers, doubles, strings, and booleans. /// /// The name of the key to create/modify. /// The value corresponding to the key. /// Thrown if the key is an invalid parameter. - /// Thrown when the method failed due to an internal I/O error. + /// Thrown when the method fails due to an internal I/O error. /// /// /// Preference.Set("Option_enabled", true); /// Preference.Set("active_user", "Joe"); /// Preference.Set("default_volume", 10); - /// Preference.Set("brightness", "0.6"); + /// Preference.Set("brightness", 0.6); /// /// /// 3 @@ -362,7 +365,7 @@ private static void DisallowChangeNotifications(string key) } /// - /// The class manages event handlers of the preference keys. The class enables having event handlers for individual preference keys. + /// The class manages event handlers of the preference keys. It provides functionality to have event handlers for individual preference keys. /// /// 3 public class EventContext @@ -377,14 +380,20 @@ internal EventContext(string key) /// /// Occurs whenever there is a change in the value of a preference key. /// + /// + /// This event is raised whenever the value of a preference key changes. It provides information about the changed key through the PreferenceChangedEventArgs argument. + /// The Changed event can be used to keep track of any modifications made to preferences during runtime. + /// /// Thrown when the key does not exist or when there is an invalid parameter. /// Thrown when the bundle instance has been disposed. /// + /// In this example, we show how to handle the Changed event by printing out the key that was modified. We also demonstrate how to subscribe and unsubscribe from the event. /// /// private static void Preference_PreferenceChanged(object sender, PreferenceChangedEventArgs e) /// { /// Console.WriteLine("key {0}", e.Key); /// } + /// /// Preference.EventContext context = null; /// Preference.GetEventContext("active_user").TryGetTarget(out context); /// if(context != null) diff --git a/src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs b/src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs index cb3db24bbfa..e4b12ded3f4 100755 --- a/src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs +++ b/src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs @@ -19,7 +19,7 @@ namespace Tizen.Applications { /// - /// This class is an event argument of the PreferenceChanged event. + /// This class represents the event arguments for the PreferenceChanged event. /// /// 3 public class PreferenceChangedEventArgs : EventArgs diff --git a/src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs b/src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs index 91babc5fe9e..428225acd86 100755 --- a/src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs +++ b/src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs @@ -48,6 +48,9 @@ public override void Run(string[] args) /// /// Exits the main loop of the application without restarting. /// + /// + /// This function terminates the current execution of the application by exiting its main loop. It does not trigger the app restart request. + /// /// 10 [EditorBrowsable(EditorBrowsableState.Never)] public void ExitWithoutRestarting() diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut.csproj b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut.csproj old mode 100644 new mode 100755 diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/HomeShortcutInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/HomeShortcutInfo.cs index 5a344c372ba..c4e52328b5e 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/HomeShortcutInfo.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/HomeShortcutInfo.cs @@ -16,16 +16,20 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// A class that contains the shortcut information. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class HomeShortcutInfo : ShortcutInfo { /// /// Gets or sets the specific information delivered to the viewer for creating a shortcut. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string Uri { get; set; } = string.Empty; } } \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutEnumerations.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutEnumerations.cs index e735cfd1827..0fd5adfb431 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutEnumerations.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutEnumerations.cs @@ -16,10 +16,13 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// Enumeration for the sizes of the shortcut widget. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public enum ShortcutWidgetSize { /// @@ -96,6 +99,7 @@ public enum ShortcutWidgetSize /// /// Enumeration for the shortcut types. /// + [Obsolete("Deprecated since API12. Will be removed in API14.")] internal enum ShortcutType { /// diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutInfo.cs index 5d95b2f4b87..3351c2224f1 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutInfo.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutInfo.cs @@ -16,28 +16,34 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// A class to get the information of the shortcut. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class ShortcutInfo { /// /// Gets or sets the name of the created shortcut icon. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string ShortcutName { get; set; } = string.Empty; /// /// Gets or sets the absolute path of an icon file for this shortcut. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string IconPath { get; set; } = string.Empty; /// /// Gets or sets a value indicating whether to allow or not allow duplication. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool IsAllowDuplicate { get; set; } } } \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutManager.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutManager.cs index 5d3fd7ba0ac..f2be8aa5338 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutManager.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutManager.cs @@ -22,6 +22,7 @@ namespace Tizen.Applications.Shortcut /// This class provides some functions to add or delete a shortcut. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static class ShortcutManager { private const string LogTag = "Tizen.Applications.Shortcut"; @@ -38,6 +39,7 @@ public static class ShortcutManager /// Thrown when the shortcut is not supported. /// Thrown in case of out of memory. /// Thrown in case of any internal error. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void Add(HomeShortcutInfo shortcut) { Interop.Shortcut.ErrorCode err = Interop.Shortcut.ErrorCode.None; @@ -79,6 +81,7 @@ public static void Add(HomeShortcutInfo shortcut) /// Thrown when the shortcut is not supported. /// Thrown in case of out of memory. /// Thrown in case of any internal error. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void Add(WidgetShortcutInfo shortcut) { Interop.Shortcut.ErrorCode err = Interop.Shortcut.ErrorCode.None; @@ -114,6 +117,7 @@ public static void Add(WidgetShortcutInfo shortcut) /// Thrown when the shortcut is not supported. /// Thrown in case of out of memory. /// Thrown in case of any internal error. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void Delete(string shortcutName) { Interop.Shortcut.ErrorCode err = Interop.Shortcut.ErrorCode.None; @@ -149,6 +153,7 @@ public static void Delete(string shortcutName) /// Thrown when the shortcut is not supported. /// Thrown in case of out of memory. /// Thrown in case of any internal error. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void Delete(ShortcutInfo shortcut) { if (shortcut == null) diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/WidgetShortcutInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/WidgetShortcutInfo.cs index 1e0d6052574..549944844ea 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/WidgetShortcutInfo.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/WidgetShortcutInfo.cs @@ -16,28 +16,34 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// A class that contains the information about the widget. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class WidgetShortcutInfo : ShortcutInfo { /// /// Gets or sets the widget ID. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string WidgetId { get; set; } = string.Empty; /// /// Gets or sets the size of the widget. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public ShortcutWidgetSize WidgetSize { get; set; } /// /// Gets or sets the update period in seconds. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public double Period { get; set; } } } \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/HomeShortcutAddedInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/HomeShortcutAddedInfo.cs index df1fe96c846..0e41bd067a8 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/HomeShortcutAddedInfo.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/HomeShortcutAddedInfo.cs @@ -16,22 +16,27 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// A class that contains the shortcut information. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class HomeShortcutAddedInfo : ShortcutAddedInfo { /// /// Gets the name of the application. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string AppId { get; internal set; } /// /// Gets the specific information for creating a new shortcut. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string Uri { get; internal set; } } } \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutAddedInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutAddedInfo.cs index 6eced613f5a..63955c6c881 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutAddedInfo.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutAddedInfo.cs @@ -16,28 +16,34 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// A class for getting the information of the shortcut. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class ShortcutAddedInfo { /// /// Gets the name of the created shortcut icon. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string ShortcutName { get; internal set; } /// /// Gets the absolute path of an icon file for this shortcut. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string IconPath { get; internal set; } /// /// Gets a value indicating whether to allow or not to allow duplication. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool IsAllowDuplicate { get; internal set; } } } \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutDeletedInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutDeletedInfo.cs index dec0ec750d7..aa4ddb675c8 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutDeletedInfo.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutDeletedInfo.cs @@ -16,22 +16,27 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// A class for getting the information of the shortcut. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class ShortcutDeletedInfo { /// /// Gets the name of the package. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string AppId { get; internal set; } /// /// Gets the name of the created shortcut icon. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string ShortcutName { get; internal set; } } } \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventEnumerations.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventEnumerations.cs index 34d72ef7497..a0a18eb32d2 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventEnumerations.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventEnumerations.cs @@ -16,10 +16,13 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// Enumeration for values of the shortcut response types. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public enum ShortcutError { /// diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventManager.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventManager.cs index 7e6c57a16a7..7e3e16dfb40 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventManager.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventManager.cs @@ -26,6 +26,7 @@ namespace Tizen.Applications.Shortcut /// Object that contains the shortcut information to add. /// The result of handling a shortcut add request. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public delegate ShortcutError ShortcutAdded(ShortcutAddedInfo args); /// @@ -34,12 +35,14 @@ namespace Tizen.Applications.Shortcut /// Object that contains the shortcut information to delete. /// The result of handling a shortcut delete request. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public delegate ShortcutError ShortcutDeleted(ShortcutDeletedInfo args); /// /// This class provides a way to register the callback function for the shortcut add and delete events. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static class ShortcutEventManager { private static Interop.Shortcut.AddCallback shortcutAddCallback; @@ -67,6 +70,7 @@ public static class ShortcutEventManager /// Thrown when the shortcut is not supported. /// Thrown in case of out of memory. /// Thrown in case of any internal error. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void RegisterEventHandler(ShortcutAdded addedEvent) { if (shortcutAddCallback == null) @@ -103,6 +107,7 @@ public static void RegisterEventHandler(ShortcutAdded addedEvent) /// Thrown when the shortcut is not supported. /// Thrown in case of out of memory. /// Thrown in case of any internal error. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void RegisterEventHandler(ShortcutDeleted deletedEvent) { if (shortcutDeleteCallback == null) @@ -134,6 +139,7 @@ public static void RegisterEventHandler(ShortcutDeleted deletedEvent) /// Thrown when an argument is invalid. /// Thrown in case the permission is denied. /// Thrown when the shortcut is not supported. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void UnregisterEventHandler(ShortcutAdded addedEvent) { if (shortcutAdded != null && shortcutAdded.Equals(addedEvent)) @@ -168,6 +174,7 @@ public static void UnregisterEventHandler(ShortcutAdded addedEvent) /// Thrown when an argument is invalid. /// Thrown in case the permission is denied. /// Thrown when the shortcut is not supported. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static void UnregisterEventHandler(ShortcutDeleted deletedEvent) { if (shortcutDeleted != null && shortcutDeleted.Equals(deletedEvent)) @@ -205,6 +212,7 @@ public static void UnregisterEventHandler(ShortcutDeleted deletedEvent) /// Thrown when the shortcut is not supported. /// Thrown in case of out of memory. /// Thrown in case of any internal error. + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static IEnumerable GetTemplateList(string appId) { shortcutTemplates.Clear(); diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutTemplate.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutTemplate.cs index 0645e1457be..1b073d33e84 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutTemplate.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutTemplate.cs @@ -16,40 +16,48 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// A class that contains the preset list of the shortcut template from the installed package. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class ShortcutTemplate { /// /// Gets the application ID. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string AppId { get; internal set; } /// /// Gets the name of the created shortcut icon. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string ShortcutName { get; internal set; } /// /// Gets the absolute path of an icon file for this shortcut. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string IconPath { get; internal set; } /// /// Gets the user data. A property of the shortcut element in the manifest file. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string ExtraKey { get; internal set; } /// /// Gets the user data. A property of the shortcut element in the manifest file. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string ExtraData { get; internal set; } } } \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/WidgetShortcutAddedInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/WidgetShortcutAddedInfo.cs index 39892e72178..06e58fb28a8 100755 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/WidgetShortcutAddedInfo.cs +++ b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/WidgetShortcutAddedInfo.cs @@ -16,28 +16,34 @@ namespace Tizen.Applications.Shortcut { + using System; + /// /// A class that contains the information about the widget. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class WidgetShortcutAddedInfo : ShortcutAddedInfo { /// /// Gets the widget ID. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string WidgetId { get; internal set; } /// /// Gets the size of the widget. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public ShortcutWidgetSize WidgetSize { get; internal set; } /// /// Gets the update period in seconds. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public double Period { get; internal set; } } } \ No newline at end of file diff --git a/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs b/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs index 7fb0608a95b..948096e9410 100755 --- a/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs +++ b/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs @@ -23,7 +23,7 @@ namespace Tizen.Applications { /// - /// Represents an application that has an UI screen. The events for resuming and pausing are provided. + /// Represents an application that has an UI screen. It provides events for handling resume and pause actions. /// /// 3 public class CoreUIApplication : CoreApplication @@ -32,7 +32,7 @@ public class CoreUIApplication : CoreApplication /// Initializes the CoreUIApplication class. /// /// - /// The default backend for the UI application will be used. + /// By calling this constructor, the default backend for the UI application will be used. /// /// 3 #pragma warning disable CA2000 @@ -45,9 +45,9 @@ public CoreUIApplication() : base(new UICoreBackend()) /// Initializes the CoreUIApplication class. /// /// - /// If you want to change the backend, use this constructor. + /// This constructor is called if you need to modify the default behavior by providing a custom implementation of the ICoreBackend interface. By passing in your own backend instance, you can customize the application's functionality according to your requirements. /// - /// The backend instance implementing the ICoreBacked interface. + /// The custom implementation of the ICoreBackend interface that provides customized functionalities. /// 3 public CoreUIApplication(ICoreBackend backend) : base(backend) { @@ -91,7 +91,7 @@ public override void Run(string[] args) } /// - /// Overrides this method if you want to handle the behavior before calling OnCreate(). + /// Overrides this method if you want to handle any specific actions before calling the OnCreate() method. /// /// 3 protected virtual void OnPreCreate() @@ -99,8 +99,8 @@ protected virtual void OnPreCreate() } /// - /// Overrides this method if you want to handle the behavior when the application is resumed. - /// If base.OnResume() is not called, the event 'Resumed' will not be emitted. + /// Override this method to define the behavior when the application is resumed. + /// Calling base.OnResume() is required in order for the Resumed event to be raised. /// /// 3 protected virtual void OnResume() @@ -109,8 +109,8 @@ protected virtual void OnResume() } /// - /// Overrides this method if you want to handle the behavior when the application is paused. - /// If base.OnPause() is not called, the event 'Paused' will not be emitted. + /// Override this method to define the behavior when the application is paused. + /// Calling base.OnPause() is required in order for the Paused event to be raised. /// /// 3 protected virtual void OnPause() @@ -122,7 +122,7 @@ protected virtual void OnPause() /// Gets the window position of the application. /// /// The window position. - /// Thrown when there is no window position. + /// Thrown if there is no valid window position available. /// 11 public WindowPosition GetWindowPosition() { diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs b/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs index deed1a6eed5..f0f5edafafb 100644 --- a/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs +++ b/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs @@ -54,11 +54,11 @@ internal static extern MediaContentError ForeachTags(string mediaId, FilterHandl Common.ItemCallback callback, IntPtr userData = default); // Deprecated since API12 [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_bookmark_count_from_db")] - internal static extern MediaContentError GetBookmarkCount(string mediaId, FilterHandle filter, out int bookmarkCount); + internal static extern MediaContentError GetBookmarkCount(string mediaId, FilterHandle filter, out int bookmarkCount); // Deprecated since API12 [DllImport(Libraries.MediaContent, EntryPoint = "media_info_foreach_bookmark_from_db")] internal static extern MediaContentError ForeachBookmarks(string mediaId, FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default); + Common.ItemCallback callback, IntPtr userData = default); // Deprecated since API12 [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_face_count_from_db")] internal static extern MediaContentError GetFaceCount(string mediaId, FilterHandle filter, out int bookmarkCount); // Deprecated diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Bookmark.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Bookmark.cs index 2da1b7ee598..db9b8687477 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Bookmark.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Bookmark.cs @@ -23,6 +23,7 @@ namespace Tizen.Content.MediaContent /// in media (video and audio) to enable fast searching. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class Bookmark { internal Bookmark(IntPtr handle) @@ -38,6 +39,7 @@ internal Bookmark(IntPtr handle) /// /// The ID of the bookmark. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int Id { get; } /// @@ -45,6 +47,7 @@ internal Bookmark(IntPtr handle) /// /// The thumbnail path of the bookmark. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string ThumbnailPath { get; } /// @@ -52,6 +55,7 @@ internal Bookmark(IntPtr handle) /// /// The offset of the bookmark in media in milliseconds. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int Offset { get; } /// @@ -59,6 +63,7 @@ internal Bookmark(IntPtr handle) /// /// The name of the bookmark. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string Name { get; } internal static Bookmark FromHandle(IntPtr handle) => new Bookmark(handle); @@ -68,6 +73,7 @@ internal Bookmark(IntPtr handle) /// /// A string representation of the current bookmark. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public override string ToString() => $"Id={Id}, Name={Name}, ThumbnailPath={ThumbnailPath}, Offset={Offset}"; } diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookmarkCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookmarkCommand.cs index 7037acc6048..9fb80815981 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookmarkCommand.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookmarkCommand.cs @@ -23,6 +23,7 @@ namespace Tizen.Content.MediaContent /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class BookmarkCommand : MediaCommand { /// @@ -32,6 +33,7 @@ public class BookmarkCommand : MediaCommand /// is null. /// has already been disposed. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public BookmarkCommand(MediaDatabase database) : base(database) { } @@ -44,6 +46,7 @@ public BookmarkCommand(MediaDatabase database) : base(database) /// The has already been disposed. /// An error occurred while executing the command. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int Count() { return Count(null); @@ -58,6 +61,7 @@ public int Count() /// The has already been disposed. /// An error occurred while executing the command. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int Count(CountArguments arguments) { ValidateDatabase(); @@ -79,6 +83,7 @@ public int Count(CountArguments arguments) /// is a zero-length string, contains only white space. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Bookmark Insert(string mediaId, int offset) { return Insert(mediaId, offset, null); @@ -99,6 +104,7 @@ public Bookmark Insert(string mediaId, int offset) /// is a zero-length string, contains only white space. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Bookmark Insert(string mediaId, int offset, string name) { return Insert(mediaId, offset, name, null); @@ -123,6 +129,7 @@ public Bookmark Insert(string mediaId, int offset, string name) /// is a zero-length string, contains only white space. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Bookmark Insert(string mediaId, int offset, string name, string thumbnailPath) { ValidateDatabase(); @@ -163,6 +170,7 @@ public Bookmark Insert(string mediaId, int offset, string name, string thumbnail /// is less than zero. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool Delete(int bookmarkId) { ValidateDatabase(); @@ -192,6 +200,7 @@ public bool Delete(int bookmarkId) /// The has already been disposed. /// An error occurred while executing the command. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public MediaDataReader Select() { return Select(null); @@ -206,6 +215,7 @@ public MediaDataReader Select() /// The has already been disposed. /// An error occurred while executing the command. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public MediaDataReader Select(SelectArguments filter) { ValidateDatabase(); diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Columns.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Columns.cs index 0baea5630c4..40036e5bad8 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Columns.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Columns.cs @@ -465,6 +465,7 @@ public static class FolderColumns /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static class PlaylistColumns { /// @@ -476,6 +477,7 @@ public static class PlaylistColumns /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static string Name => "PLAYLIST_NAME"; /// @@ -487,6 +489,7 @@ public static class PlaylistColumns /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static string Id => "PLAYLIST_ID"; /// @@ -498,6 +501,7 @@ public static class PlaylistColumns /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static string MemberOrder => "PLAYLIST_MEMBER_ORDER"; /// @@ -510,6 +514,7 @@ public static class PlaylistColumns /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static string Count => "PLAYLIST_MEDIA_COUNT"; } @@ -579,6 +584,7 @@ public static class TagColumns /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static class BookmarkColumns { /// @@ -590,6 +596,7 @@ public static class BookmarkColumns /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static string Offset => "BOOKMARK_MARKED_TIME"; /// @@ -601,6 +608,7 @@ public static class BookmarkColumns /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static string Id => "BOOKMARK_ID"; /// @@ -612,6 +620,7 @@ public static class BookmarkColumns /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public static string Name => "BOOKMARK_NAME"; } diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs index bafe885a953..6e470084b88 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs @@ -53,6 +53,7 @@ public MediaInfoCommand(MediaDatabase database) : base(database) /// is null. /// is a zero-length string, contains only white space. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int CountBookmark(string mediaId) { return CountBookmark(mediaId, null); @@ -70,6 +71,7 @@ public int CountBookmark(string mediaId) /// is null. /// is a zero-length string, contains only white space. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int CountBookmark(string mediaId, CountArguments arguments) { ValidateDatabase(); @@ -90,6 +92,7 @@ public int CountBookmark(string mediaId, CountArguments arguments) /// is null. /// is a zero-length string, contains only white space. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public MediaDataReader SelectBookmark(string mediaId) { return SelectBookmark(mediaId, null); @@ -107,6 +110,7 @@ public MediaDataReader SelectBookmark(string mediaId) /// is null. /// is a zero-length string, contains only white space. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public MediaDataReader SelectBookmark(string mediaId, SelectArguments filter) { ValidateDatabase(); diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs index a762611cd92..0bb39f454d4 100755 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs @@ -22,6 +22,7 @@ namespace Tizen.Content.MediaContent /// Represents the playlist that is a group of media (usually songs). /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class Playlist { internal Playlist(IntPtr handle) @@ -39,6 +40,7 @@ internal Playlist(IntPtr handle) /// /// The unique ID of the playlist. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int Id { get; } /// @@ -46,6 +48,7 @@ internal Playlist(IntPtr handle) /// /// The name of the playlist. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string Name { get; } /// @@ -53,6 +56,7 @@ internal Playlist(IntPtr handle) /// /// The path to the thumbnail. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string ThumbnailPath { get; } /// @@ -60,6 +64,7 @@ internal Playlist(IntPtr handle) /// /// A string representation of the current playlist. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public override string ToString() => $"Id={Id}, Name={Name}, ThumbnailPath={ThumbnailPath}"; } @@ -72,6 +77,7 @@ public override string ToString() => /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class PlaylistUpdateValues { /// @@ -80,6 +86,7 @@ public class PlaylistUpdateValues /// If the value is null, the update operation will have no effect on the field. /// A string for name; the field will not be updated if null. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string Name { get; set; } /// @@ -88,6 +95,7 @@ public class PlaylistUpdateValues /// If the value is null, the update operation will have no effect on the field. /// A string for the thumbnail path; the field will not be updated if null. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public string ThumbnailPath { get; set; } } @@ -95,6 +103,7 @@ public class PlaylistUpdateValues /// Represents an order of a member of the playlist. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class PlayOrder { /// @@ -108,6 +117,7 @@ public class PlayOrder /// is less than zero. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public PlayOrder(int memberId, int orderValue) { MemberId = memberId; @@ -124,6 +134,7 @@ public PlayOrder(int memberId, int orderValue) /// is less than or equal to zero. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int MemberId { get => _memberId; @@ -148,6 +159,7 @@ public int MemberId /// is less than zero. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int Value { get => _value; diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistCommand.cs index 226534d6f93..edf452efdba 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistCommand.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistCommand.cs @@ -26,6 +26,7 @@ namespace Tizen.Content.MediaContent /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class PlaylistCommand : MediaCommand { /// @@ -35,6 +36,7 @@ public class PlaylistCommand : MediaCommand /// is null. /// has already been disposed. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public PlaylistCommand(MediaDatabase database) : base(database) { } @@ -47,6 +49,7 @@ public PlaylistCommand(MediaDatabase database) : base(database) /// The has already been disposed. /// An error occurred while executing the command. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int Count() { return Count(null); @@ -61,6 +64,7 @@ public int Count() /// The has already been disposed. /// An error occurred while executing the command. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int Count(CountArguments arguments) { ValidateDatabase(); @@ -83,6 +87,7 @@ public int Count(CountArguments arguments) /// is less than or equal to zero. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int GetPlayOrder(int playlistId, int memberId) { ValidateDatabase(); @@ -116,6 +121,7 @@ public int GetPlayOrder(int playlistId, int memberId) /// is less than or equal to zero. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool Delete(int playlistId) { ValidateDatabase(); @@ -164,6 +170,7 @@ public bool Delete(int playlistId) /// does not exists. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Playlist InsertFromFile(string name, string path) { ValidateDatabase(); @@ -222,6 +229,7 @@ public Playlist InsertFromFile(string name, string path) /// No matching playlist exists. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public void ExportToFile(int playlistId, string path) { ValidateDatabase(); @@ -268,6 +276,7 @@ public void ExportToFile(int playlistId, string path) /// is a zero-length string. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Playlist Insert(string name) { return Insert(name, null); @@ -287,6 +296,7 @@ public Playlist Insert(string name) /// is a zero-length string. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Playlist Insert(string name, string thumbnailPath) { ValidateDatabase(); @@ -333,6 +343,7 @@ public Playlist Insert(string name, string thumbnailPath) /// The has already been disposed. /// An error occurred while executing the command. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public MediaDataReader Select() { return Select(null); @@ -347,6 +358,7 @@ public MediaDataReader Select() /// The has already been disposed. /// An error occurred while executing the command. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public MediaDataReader Select(SelectArguments filter) { ValidateDatabase(); @@ -365,6 +377,7 @@ public MediaDataReader Select(SelectArguments filter) /// An error occurred while executing the command. /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public Playlist Select(int playlistId) { ValidateDatabase(); @@ -407,6 +420,7 @@ public Playlist Select(int playlistId) /// An error occurred while executing the command. /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int CountMember(int playlistId) { return CountMember(playlistId, null); @@ -423,6 +437,7 @@ public int CountMember(int playlistId) /// An error occurred while executing the command. /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int CountMember(int playlistId, CountArguments arguments) { ValidateDatabase(); @@ -481,6 +496,7 @@ private static List GetMembers(int playlistId, SelectArguments a /// is null. /// is a zero-length string, contains only white space. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int GetMemberId(int playlistId, string mediaId) { ValidateDatabase(); @@ -512,6 +528,7 @@ public int GetMemberId(int playlistId, string mediaId) /// An error occurred while executing the command. /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public MediaDataReader SelectMember(int playlistId) { return SelectMember(playlistId, null); @@ -528,6 +545,7 @@ public MediaDataReader SelectMember(int playlistId) /// An error occurred while executing the command. /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public MediaDataReader SelectMember(int playlistId, SelectArguments filter) { ValidateDatabase(); @@ -556,6 +574,7 @@ public MediaDataReader SelectMember(int playlistId, SelectArgume /// is less than or equal to zero. /// The caller has no required privilege. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool Update(int playlistId, PlaylistUpdateValues values) { ValidateDatabase(); @@ -617,6 +636,7 @@ public bool Update(int playlistId, PlaylistUpdateValues values) /// is a zero-length string, contains only white space. /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool AddMember(int playlistId, string mediaId) { ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); @@ -644,6 +664,7 @@ public bool AddMember(int playlistId, string mediaId) /// /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool AddMembers(int playlistId, IEnumerable mediaIds) { ValidateDatabase(); @@ -718,6 +739,7 @@ public bool AddMembers(int playlistId, IEnumerable mediaIds) /// is less than or equal to zero. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool RemoveMember(int playlistId, int memberId) { if (memberId <= 0) @@ -747,6 +769,7 @@ public bool RemoveMember(int playlistId, int memberId) /// /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool RemoveMembers(int playlistId, IEnumerable memberIds) { ValidateDatabase(); @@ -814,6 +837,7 @@ public bool RemoveMembers(int playlistId, IEnumerable memberIds) /// is null. /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool UpdatePlayOrder(int playlistId, PlayOrder playOrder) { if (playOrder == null) @@ -841,6 +865,7 @@ public bool UpdatePlayOrder(int playlistId, PlayOrder playOrder) /// /// is less than or equal to zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public bool UpdatePlayOrders(int playlistId, IEnumerable orders) { ValidateDatabase(); diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistMember.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistMember.cs index 8ebf307ec72..35495f7273a 100644 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistMember.cs +++ b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistMember.cs @@ -14,12 +14,15 @@ * limitations under the License. */ +using System; + namespace Tizen.Content.MediaContent { /// /// Represents a member of the . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public class PlaylistMember { /// @@ -27,6 +30,7 @@ public class PlaylistMember /// /// The member ID of the playlist. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public int MemberId { get; } /// @@ -34,6 +38,7 @@ public class PlaylistMember /// /// The of the member. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API14.")] public MediaInfo MediaInfo { get; } internal PlaylistMember(int memberId, MediaInfo mediaInfo) diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeUtil.cs b/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeUtil.cs index 02e45a37ab7..16d0a332501 100644 --- a/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeUtil.cs +++ b/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeUtil.cs @@ -32,10 +32,11 @@ namespace Tizen.Content.MimeType public static class MimeUtil { /// - /// Gets the MIME type for the given file extension. - /// The MIME type is 'application/octet-stream' if the given file extension is not associated with specific file formats. + /// Retrieves the MIME type for the specified file extension. + /// If no specific file format is associated with the given file extension, the default MIME type 'application/octet-stream' is returned. /// - /// The file extension. + /// The file extension for which the MIME type needs to be retrieved. + /// The MIME type for the specified file extension. /// /// /// string mimeType = MimeUtil.GetMimeType("png"); @@ -54,19 +55,22 @@ public static string GetMimeType(string fileExtension) } /// - /// Gets the file extensions for the given MIME type. + /// Retrieves the file extensions associated with the specified MIME type. /// - /// - /// If successful, returns the list of file extension strings for the given MIME type. - /// The array of file extension is without the leading dot ('.'). - /// - /// The MIME type. + /// + /// By calling this function with a specific MIME type argument, you can obtain a list of file extensions related to that MIME type. + /// These file extensions are returned without the leading period ('.') character. + /// + /// The MIME type for which you want to retrieve the associated file extensions. + /// An enumerable collection of file extension strings for the specified MIME type. /// + /// In the following code snippet, we demonstrate how to utilize the GetFileExtension method by retrieving the file extensions associated with the video/mpeg MIME type: + /// /// - /// var extColl = MimeUtil.GetFileExtension("video/mpeg"); - /// foreach ( string obj in extColl ) + /// var fileExtensions = MimeUtil.GetFileExtension("video/mpeg"); + /// foreach (var extension in fileExtensions) /// { - /// Console.WriteLine(obj); + /// Console.WriteLine(extension); /// } /// /// diff --git a/src/Tizen.AIAvatar/src/Extensions/AvatarScene.cs b/src/Tizen.Core/Interop/Interop.Libraries.cs similarity index 56% rename from src/Tizen.AIAvatar/src/Extensions/AvatarScene.cs rename to src/Tizen.Core/Interop/Interop.Libraries.cs index 4f498b34e27..1280560ce0c 100644 --- a/src/Tizen.AIAvatar/src/Extensions/AvatarScene.cs +++ b/src/Tizen.Core/Interop/Interop.Libraries.cs @@ -1,25 +1,23 @@ /* - * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved * - * Licensed under the Apache License, Version 2.0 (the "License"); + * 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, + * 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 Tizen.NUI.Scene3D; - -namespace Tizen.AIAvatar +internal static partial class Interop { - internal class AvatarScene : SceneView + internal static partial class Libraries { + public const string TizenCore = "libtizen-core.so.0"; } } diff --git a/src/Tizen.Core/Interop/Interop.TizenCore.cs b/src/Tizen.Core/Interop/Interop.TizenCore.cs new file mode 100644 index 00000000000..80a1fea238c --- /dev/null +++ b/src/Tizen.Core/Interop/Interop.TizenCore.cs @@ -0,0 +1,331 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Runtime.InteropServices; + +using Tizen; +using Tizen.Internals.Errors; + +internal static partial class Interop +{ + internal static partial class LibTizenCore + { + internal enum ErrorCode + { + None = Tizen.Internals.Errors.ErrorCode.None, + InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, + OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, + InvalidContext = -0x01100000 | 0x01, + } + + internal enum Priority + { + High = -100, + Default = 0, + HighIdle = 100, + DefaultIdle = 200, + Low = 300, + } + + internal enum PollEvent + { + In = 0x0001, + Pri = 0x0002, + Out = 0x0004, + Err = 0x0008, + Hup = 0x0010, + Nval = 0x0020, + } + + internal static partial class TizenCore + { + // typedef void (*tizen_core_channel_receive_cb)(tizen_core_channel_object_h object, void *user_data); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void ChannelReceiveCallback(IntPtr channelObject, IntPtr userData); + + // typedef bool (*tizen_core_task_cb)(void *user_data); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool TaskCallback(IntPtr userData); + + // typedef bool (*tizen_core_source_prepare_cb)(tizen_core_source_h source, int *timeout, void *user_data); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SourcePrepareCallback(IntPtr source, out int timeout, IntPtr userData); + + // typedef bool (*tizen_core_source_check_cb)(tizen_core_source_h source, void *user_data); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SourceCheckCallback(IntPtr source, IntPtr userData); + + // typedef bool (*tizen_core_source_dispatch_cb)(tizen_core_source_h source, void *user_data); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool SourceDispatchCallback(IntPtr source, IntPtr userData); + + // typedef void (*tizen_core_source_finalize_cb)(tizen_core_source_h source, void *user_data); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void SourceFinalizeCallback(IntPtr source, IntPtr userData); + + // void tizen_core_init(void); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_init")] + internal static extern void Init(); + + // void tizen_core_shutdown(void); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_shutdown")] + internal static extern void Shutdown(); + + // bool tizen_core_ready(void); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_ready")] + internal static extern bool Ready(); + + // int tizen_core_task_create(const char *name, bool use_thread, tizen_core_task_h task); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_task_create")] + internal static extern ErrorCode TaskCreate(string name, bool useThread, out IntPtr handle); + + // int tizen_core_task_destroy(tizen_core_task_h task); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_task_destroy")] + internal static extern ErrorCode TaskDestroy(IntPtr handle); + + // int tizen_core_task_run(tizen_core_task_h task); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_task_run")] + internal static extern ErrorCode TaskRun(IntPtr handle); + + // int tizen_core_task_is_running(tizen_core_task_h task, bool *running); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_task_is_running")] + internal static extern ErrorCode TaskIsRunning(IntPtr handle, out bool running); + + // int tizen_core_task_quit(tizen_core_task_h task); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_task_quit")] + internal static extern ErrorCode TaskQuit(IntPtr handle); + + // int tizen_core_task_get_tizen_core(tizen_core_task_h task, tizen_core_h *core); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_task_get_tizen_core")] + internal static extern ErrorCode TaskGetTizenCore(IntPtr handle, out IntPtr coreHandle); + + // int tizen_core_find(const char *name, tizen_core_h *core); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_find")] + internal static extern ErrorCode Find(string name, out IntPtr handle); + + // int tizen_core_find_from_this_thread(tizen_core_h *core); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_find_from_this_thread")] + internal static extern ErrorCode FindFromThisThread(out IntPtr handle); + + // int tizen_core_add_idle_job(tizen_core_h core, tizen_core_task_cb callback, void *user_data, tizen_core_source_h *source); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_add_idle_job")] + internal static extern ErrorCode AddIdleJob(IntPtr handle, TaskCallback callback, IntPtr userData, out IntPtr source); + + // int tizen_core_add_timer(tizen_core_h core, unsigned int interval, tizen_core_task_cb callback, void *user_data, tizen_core_source_h *source); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_add_timer")] + internal static extern ErrorCode AddTimer(IntPtr handle, uint interval, TaskCallback callback, IntPtr userData, out IntPtr source); + + // int tizen_core_add_channel(tizen_core_h core, tizen_core_channel_receiver_h receiver, tizen_core_channel_receive_cb callback, void *user_data, tizen_core_source_h *source); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_add_channel")] + internal static extern ErrorCode AddChannel(IntPtr handle, IntPtr channel, ChannelReceiveCallback callback, IntPtr userData, out IntPtr source); + + // int tizen_core_add_event(tizen_core_h core, tizen_core_event_h event, tizen_core_source_h *source); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_add_event")] + internal static extern ErrorCode AddEvent(IntPtr handle, IntPtr eventHandle, out IntPtr source); + + // int tizen_core_emit_event(tizen_core_h core, tizen_core_event_object_h object); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_emit_event")] + internal static extern ErrorCode EmitEvent(IntPtr handle, IntPtr eventObject); + + // int tizen_core_add_source(tizen_core_h core, tizen_core_source_h source); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_add_source")] + internal static extern ErrorCode AddSource(IntPtr handle, IntPtr source); + + // int tizen_core_remove_source(tizen_core_h core, tizen_core_source_h source); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_remove_source")] + internal static extern ErrorCode RemoveSource(IntPtr handle, IntPtr source); + + // int tizen_core_source_create(tizen_core_source_h *source); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_source_create")] + internal static extern ErrorCode SourceCreate(out IntPtr source); + + // int tizen_core_source_destroy(tizen_core_source_h source); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_source_destroy")] + internal static extern ErrorCode SourceDestroy(IntPtr source); + + // int tizen_core_source_add_poll(tizen_core_source_h source, tizen_core_poll_fd_h poll_fd); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_source_add_poll")] + internal static extern ErrorCode SourceAddPoll(IntPtr source, IntPtr pollFd); + + // int tizen_core_source_remove_poll(tizen_core_source_h source, tizen_core_poll_fd_h poll_fd); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_source_remove_poll")] + internal static extern ErrorCode SourceRemovePoll(IntPtr source, IntPtr pollFd); + + // int tizen_core_source_set_prepare_cb(tizen_core_source_h source, tizen_core_source_prepare_cb callback, void *user_data); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_source_set_prepare_cb")] + internal static extern ErrorCode SourceSetPrepareCallback(IntPtr source, SourcePrepareCallback callback, IntPtr userData); + + // int tizen_core_source_set_check_cb(tizen_core_source_h source, tizen_core_source_check_cb callback, void *user_data); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_source_set_check_cb")] + internal static extern ErrorCode SourceSetCheckCallback(IntPtr source, SourceCheckCallback callback, IntPtr userData); + + // int tizen_core_source_set_dispatch_cb(tizen_core_source_h source, tizen_core_source_dispatch_cb callback, void *user_data); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_source_set_dispatch_cb")] + internal static extern ErrorCode SourceSetDispatchCallback(IntPtr source, SourceDispatchCallback callback, IntPtr userData); + + // int tizen_core_source_set_finalize_cb(tizen_core_source_h source, tizen_core_source_finalize_cb callback, void *user_data); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_source_set_finalize_cb")] + internal static extern ErrorCode SourceSetFinalizeCallback(IntPtr source, SourceFinalizeCallback callback, IntPtr userData); + + // int tizen_core_source_set_priority(tizen_core_source_h source, tizen_core_priority_e priority); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_source_set_priority")] + internal static extern ErrorCode SourceSetPriority(IntPtr source, int priority); + + // int tizen_core_poll_fd_create(tizen_core_poll_fd_h *poll_fd); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_poll_fd_create")] + internal static extern ErrorCode PollFdCreate(out IntPtr handle); + + // int tizen_core_poll_fd_destroy(tizen_core_poll_fd_h poll_fd); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_poll_fd_destroy")] + internal static extern ErrorCode PollFdDestroy(IntPtr handle); + + // int tizen_core_poll_fd_set_fd(tizen_core_poll_fd_h poll_fd, int fd); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_poll_fd_set_fd")] + internal static extern ErrorCode PollFdSetFd(IntPtr handle, int fd); + + // int tizen_core_poll_fd_get_fd(tizen_core_poll_fd_h poll_fd, int *fd); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_poll_fd_get_fd")] + internal static extern ErrorCode PollFdGetFd(IntPtr handle, out int fd); + + // int tizen_core_poll_fd_set_events(tizen_core_poll_fd_h poll_fd, uint16_t events); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_poll_fd_set_events")] + internal static extern ErrorCode PollFdSetEvents(IntPtr handle, UInt16 events); + + // int tizen_core_poll_fd_get_events(tizen_core_poll_fd_h poll_fd, uint16_t *events); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_poll_fd_get_events")] + internal static extern ErrorCode PollFdGetEvents(IntPtr handle, out UInt16 events); + + // int tizen_core_poll_fd_set_returned_events(tizen_core_poll_fd_h poll_fd, uint16_t returned_events); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_poll_fd_set_returned_events")] + internal static extern ErrorCode PollFdSetReturnedEvents(IntPtr handle, UInt16 returnedEvents); + + // int tizen_core_poll_fd_get_events(tizen_core_poll_fd_h poll_fd, uint16_t *returned_events); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_poll_fd_get_returned_events")] + internal static extern ErrorCode PollFdGetReturnedEvents(IntPtr handle, out UInt16 returnedEvents); + } + + internal static partial class TizenCoreChannel + { + // int tizen_core_channel_make_pair(tizen_core_channel_sender_h *sender, tizen_core_channel_receiver_h *receiver); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_make_pair")] + internal static extern ErrorCode MakePair(out IntPtr sender, out IntPtr receiver); + + // int tizen_core_channel_sender_send(tizen_core_channel_sender_h sender, tizen_core_channel_object_h object); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_sender_send")] + internal static extern ErrorCode SenderSend(IntPtr sender, IntPtr channelObject); + + // int tizen_core_channel_sender_destroy(tizen_core_channel_sender_h sender); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_sender_destroy")] + internal static extern ErrorCode SenderDestroy(IntPtr sender); + + // int tizen_core_channel_sender_clone(tizen_core_channel_sender_h sender, tizen_core_channel_sender_h *cloned_sender); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_sender_clone")] + internal static extern ErrorCode SenderClone(IntPtr sender, out IntPtr clonedHandle); + + // int tizen_core_channel_receiver_receive(tizen_core_channel_receiver_h receiver, tizen_core_channel_object_h *object); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_receiver_receive")] + internal static extern ErrorCode ReceiverReceive(IntPtr receiver, out IntPtr channelObject); + + // int tizen_core_channel_receiver_destroy(tizen_core_channel_receiver_h receiver); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_receiver_destroy")] + internal static extern ErrorCode ReceiverDestroy(IntPtr receiver); + + // int tizen_core_channel_object_create(tizen_core_channel_object_h *object); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_object_create")] + internal static extern ErrorCode ObjectCreate(out IntPtr handle); + + // int tizen_core_channel_object_destroy(tizen_core_channel_object_h object); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_object_destroy")] + internal static extern ErrorCode ObjectDestroy(IntPtr handle); + + // int tizen_core_channel_object_set_id(tizen_core_channel_object_h object, int id); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_object_set_id")] + internal static extern ErrorCode ObjectSetId(IntPtr handle, int id); + + // int tizen_core_channel_object_get_id(tizen_core_channel_object_h object, int *id); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_object_get_id")] + internal static extern ErrorCode ObjectGetId(IntPtr handle, out int id); + + // int tizen_core_channel_object_set_data(tizen_core_channel_object_h object, void *data); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_object_set_data")] + internal static extern ErrorCode ObjectSetData(IntPtr handle, IntPtr data); + + // int tizen_core_channel_object_get_data(tizen_core_channel_object_h object, void **data); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_object_get_data")] + internal static extern ErrorCode ObjectGetData(IntPtr handle, out IntPtr data); + + // int tizen_core_channel_object_get_sender_task_name(tizen_core_channel_object_h object, const char **task_name); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_channel_object_get_sender_task_name")] + internal static extern ErrorCode ObjectGetSenderTaskName(IntPtr handle, out IntPtr taskName); + } + + internal static partial class TizenCoreEvent + { + // typedef bool (*tizen_core_event_handler_cb)(tizen_core_event_object_h object, void *user_data); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate bool EventHandlerCallback(IntPtr eventObject, IntPtr userData); + + // typedef void (*tizen_core_event_object_destroy_cb)(void *event_data, void *user_data); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void EventObjectDestroyCallback(IntPtr eventData, IntPtr userData); + + // int tizen_core_event_create(tizen_core_event_h *event); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_create")] + internal static extern ErrorCode Create(out IntPtr handle); + + // int tizen_core_event_destroy(tizen_core_event_h event); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_destroy")] + internal static extern ErrorCode Destroy(IntPtr handle); + + // int tizen_core_event_add_handler(tizen_core_event_h event, tizen_core_event_handler_cb handler, void *user_data, tizen_core_event_handler_h *event_handler); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_add_handler")] + internal static extern ErrorCode AddHandler(IntPtr handle, EventHandlerCallback callback, IntPtr userData, out IntPtr eventHandler); + + // int tizen_core_event_prepend_handler(tizen_core_event_h event, tizen_core_event_handler_cb handler, void *user_data, tizen_core_event_handler_h *event_handler); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_prepend_handler")] + internal static extern ErrorCode PrependHandler(IntPtr handle, EventHandlerCallback callback, IntPtr userData, out IntPtr eventHandler); + + // int tizen_core_event_remove_handler(tizen_core_event_h event, tizen_core_event_handler_h event_handler); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_remove_handler")] + internal static extern ErrorCode RemoveHandler(IntPtr handle, IntPtr eventHandler); + + // int tizen_core_event_emit(tizen_core_event_h event, tizen_core_event_object_h object); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_emit")] + internal static extern ErrorCode Emit(IntPtr handle, IntPtr eventObject); + + // int tizen_core_event_object_create(tizen_core_event_object_h *object, int id, void *data); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_object_create")] + internal static extern ErrorCode ObjectCreate(out IntPtr handle, int id, IntPtr data); + + // int tizen_core_event_object_destroy(tizen_core_event_object_h object); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_object_destroy")] + internal static extern ErrorCode ObjectDestroy(IntPtr handle); + + // int tizen_core_event_object_set_destroy_cb(tizen_core_event_object_h object, tizen_core_event_object_destroy_cb callback, void *user_data); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_object_set_destroy_cb")] + internal static extern ErrorCode ObjectSetDestroyCallback(IntPtr handle, EventObjectDestroyCallback callback, IntPtr userData); + + // int tizen_core_event_object_get_id(tizen_core_event_object_h object, int *id); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_object_get_id")] + internal static extern ErrorCode ObjectGetId(IntPtr handle, out int id); + + // int tizen_core_event_object_get_data(tizen_core_event_object_h object, void *data); + [DllImport(Libraries.TizenCore, EntryPoint = "tizen_core_event_object_get_data")] + internal static extern ErrorCode ObjectGetData(IntPtr handle, out IntPtr data); + } + } +} diff --git a/src/Tizen.Core/Tizen.Core.csproj b/src/Tizen.Core/Tizen.Core.csproj new file mode 100644 index 00000000000..37f8af30eec --- /dev/null +++ b/src/Tizen.Core/Tizen.Core.csproj @@ -0,0 +1,12 @@ + + + + net6.0 + + + + + + + + diff --git a/src/Tizen.Core/Tizen.Core.sln b/src/Tizen.Core/Tizen.Core.sln new file mode 100644 index 00000000000..7dd607db6ab --- /dev/null +++ b/src/Tizen.Core/Tizen.Core.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen.Core", "Tizen.Core.csproj", "{1BA08908-7B2B-42D1-A124-092CB177BF4C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{8DA5B43B-63E9-460C-B64F-0B691539DC5D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1BA08908-7B2B-42D1-A124-092CB177BF4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1BA08908-7B2B-42D1-A124-092CB177BF4C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1BA08908-7B2B-42D1-A124-092CB177BF4C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1BA08908-7B2B-42D1-A124-092CB177BF4C}.Release|Any CPU.Build.0 = Release|Any CPU + {2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}.Release|Any CPU.Build.0 = Release|Any CPU + {8DA5B43B-63E9-460C-B64F-0B691539DC5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8DA5B43B-63E9-460C-B64F-0B691539DC5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8DA5B43B-63E9-460C-B64F-0B691539DC5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8DA5B43B-63E9-460C-B64F-0B691539DC5D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E9B5E719-0EB7-430C-97DC-3FE2E50EE668} + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/src/Tizen.Core/Tizen.Core/Channel.cs b/src/Tizen.Core/Tizen.Core/Channel.cs new file mode 100644 index 00000000000..e1727a642cf --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/Channel.cs @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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; + +namespace Tizen.Core +{ + /// + /// The class for managing communication channels between tasks of Tizen Core. + /// + /// + /// Channels are essential in inter-task communications because they provide a reliable way to exchange messages and data. + /// By creating a channel, you can establish a connection between two tasks that need to communicate with each other. + /// Once created, both tasks can send and receive messages through the channel. + /// It's important to note that channels have a limited capacity, so make sure to handle message overflows appropriately. + /// Additionally, remember to close the channel once it's no longer needed to avoid resource leaks. + /// + /// 12 + public class Channel : IDisposable + { + private bool _disposed = false; + + /// + /// Creates a new channel with a sender and a receiver. + /// + /// + /// This constructor initializes a new channel that enables communication between a sender and a receiver. + /// It throws exceptions if any errors occur during initialization due to insufficient memory or invalid operations. + /// + /// Thrown when out of memory. + /// Thrown when failed because of an invalid operation. + /// + /// In the following code snippet, we attempt to initialize a new channel by calling the constructor. + /// However, if there is not enough memory available, an OutOfMemoryException is thrown. We handle this exception by displaying a message in the console. + /// + /// try + /// { + /// var channel = new Channel(); + /// } + /// catch (OutOfMemoryException) + /// { + /// Console.WriteLine("Exception occurs"); + /// } + /// + /// + /// 12 + public Channel() + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCoreChannel.MakePair(out IntPtr sender, out IntPtr receiver); + TCoreErrorFactory.CheckAndThrownException(error, "Failed to make a channel pair"); + Sender = new ChannelSender(sender); + Receiver = new ChannelReceiver(receiver); + } + + /// + /// Finalizes an instance of the Channel class. + /// + ~Channel() + { + Dispose(false); + } + + /// + /// Gets the channel sender instance. + /// + /// + /// This property provides access to the channel sender instance that can be used to send messages through the specified channel. + /// It ensures that only one sender instance per channel exists in order to avoid any conflicts during message transmission. + /// + /// 12 + public ChannelSender Sender { get; private set; } + + /// + /// Gets the channel receiver instance. + /// + /// + /// This property provides access to the channel receiver instance that handles incoming messages from other applications. + /// By utilizing this instance, you can subscribe to specific channels and receive notifications accordingly. + /// It is crucial to understand the concept of channels in order to effectively utilize this feature. For more details on channels, refer to the official documentation. + /// + /// 12 + public ChannelReceiver Receiver { get; private set; } + + /// + /// Release any unmanaged resources used by this object. + /// + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + Sender.Dispose(); + Receiver.Dispose(); + } + + _disposed = true; + } + } + + /// + /// Release any unmanaged resources used by this object. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + } +} diff --git a/src/Tizen.Core/Tizen.Core/ChannelObject.cs b/src/Tizen.Core/Tizen.Core/ChannelObject.cs new file mode 100644 index 00000000000..eff18ba1fb7 --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/ChannelObject.cs @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Concurrent; +using System.Runtime.InteropServices; +using System.Security.Cryptography; + +namespace Tizen.Core +{ + /// + /// Represents a channel object used for inter-task communication. + /// + /// + /// A channel object provides a mechanism for tasks to communicate with each other in a process. It allows sending messages between tasks without any race conditions. + /// To create a channel object, call the static method 'Create'. Once created, you can send and receive messages through the channel by calling the respective methods on the channel object. + /// When you are done using the channel object, remember to dispose it properly to avoid resource leaks. + /// + /// 12 + public class ChannelObject : IDisposable + { + private IntPtr _handle = IntPtr.Zero; + private bool _disposed = false; + private static readonly ConcurrentDictionary _dataMap = new ConcurrentDictionary(); + private static readonly object _dataLock = new object(); + private static int _dataId = 1; + + /// + /// Constructor for creating a new channel object with specified ID and data. + /// + /// The ID. + /// The data object. + /// Thrown when out of memory. + /// Thrown when failed because of an invalid operation. + /// + /// This constructor creates a new channel object with the specified ID and data. It throws an OutOfMemoryException if there isn't enough memory available to allocate the object. + /// Additionally, it may throw an InvalidOperationException if the operation fails due to an invalid condition. + /// + /// + /// + /// + /// int id = 0; + /// string message = "Test message"; + /// var channelObject = new ChannelObject(id++, message); + /// + /// + /// + /// 12 + public ChannelObject(int id, object data) + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCoreChannel.ObjectCreate(out _handle); + TCoreErrorFactory.CheckAndThrownException(error, "Failed to create channel object"); + Id = id; + Data = data; + IsUsed = false; + IsDestroyable = true; + } + + internal ChannelObject(IntPtr handle) + { + _handle = handle; + IsUsed = false; + IsDestroyable = true; + } + + /// + /// Finalizes an instance of the ChannelObject class. + /// + ~ChannelObject() + { + Dispose(false); + } + + /// + /// Gets and sets the ID. + /// + /// 12 + public int Id + { + get + { + Interop.LibTizenCore.TizenCoreChannel.ObjectGetId(_handle, out int id); + return id; + } + set + { + Interop.LibTizenCore.TizenCoreChannel.ObjectSetId(_handle, value); + } + } + + /// + /// Gets and sets the data object. + /// + /// 12 + public object Data + { + get + { + Interop.LibTizenCore.TizenCoreChannel.ObjectGetData(_handle, out IntPtr handle); + int id = (int)handle; + if (_dataMap.TryGetValue(id, out var data)) + { + return data; + } + return null; + } + set + { + int id; + Interop.LibTizenCore.TizenCoreChannel.ObjectGetData(_handle, out IntPtr handle); + if (handle != IntPtr.Zero) + { + id = (int)handle; + _dataMap.TryRemove(id, out var _); + } + + lock (_dataLock) + { + if (_dataId + 1 < 0) + { + _dataId = 1; + } + id = _dataId++; + } + _dataMap[id] = value; + Interop.LibTizenCore.TizenCoreChannel.ObjectSetData(_handle, (IntPtr)id); + } + } + + /// + /// Gets the name of the sender task. + /// + /// 12 + public string Sender + { + get + { + Interop.LibTizenCore.TizenCoreChannel.ObjectGetSenderTaskName(_handle, out IntPtr taskName); + return Marshal.PtrToStringAnsi(taskName); + } + } + + internal bool IsDestroyable { set; get; } + + internal bool IsUsed { set; get; } + + internal IntPtr Handle { get { return _handle; } } + + /// + /// Release any unmanaged resources used by this object. + /// + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + if (_handle != IntPtr.Zero) + { + if (!IsUsed) + { + Interop.LibTizenCore.TizenCoreChannel.ObjectGetData(_handle, out IntPtr handle); + int id = (int)handle; + _dataMap.TryRemove(id, out var data); + } + + if (IsDestroyable) + { + Interop.LibTizenCore.TizenCoreChannel.ObjectDestroy(_handle); + } + _handle = IntPtr.Zero; + } + } + + _disposed = true; + } + } + + /// + /// Release any unmanaged resources used by this object. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + } +} diff --git a/src/Tizen.Core/Tizen.Core/ChannelReceivedEventArgs.cs b/src/Tizen.Core/Tizen.Core/ChannelReceivedEventArgs.cs new file mode 100644 index 00000000000..64bf33459ef --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/ChannelReceivedEventArgs.cs @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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; + +namespace Tizen.Core +{ + /// + /// Represents the arguments for the event raised when an object has been received through a channel. + /// + /// 12 + public class ChannelReceivedEventArgs : System.EventArgs + { + internal ChannelReceivedEventArgs(ChannelObject channelObject) + { + if (channelObject == null) + { + throw new ArgumentNullException(nameof(channelObject)); + } + + Id = channelObject.Id; + Data = channelObject.Data; + Sender = channelObject.Sender; + } + + /// + /// Gets the ID of the received object. + /// + /// 12 + public int Id { get; private set; } + + /// + /// Gets the Data of the received object. + /// + /// 12 + public object Data { get; private set; } + + /// + /// Gets the name of the sender task of the received object. + /// + /// 12 + public string Sender { get; private set; } + } +} \ No newline at end of file diff --git a/src/Tizen.Core/Tizen.Core/ChannelReceiver.cs b/src/Tizen.Core/Tizen.Core/ChannelReceiver.cs new file mode 100644 index 00000000000..0c6ae5c6b1b --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/ChannelReceiver.cs @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Threading.Tasks; + +namespace Tizen.Core +{ + /// + /// Represents the channel receiver used for inter-task communication. + /// + /// 12 + public class ChannelReceiver : IDisposable + { + private bool _disposed = false; + + internal ChannelReceiver(IntPtr handle) + { + Handle = handle; + Source = IntPtr.Zero; + Id = 0; + } + + /// + /// Finalizes an instance of the ChannelReceiver class. + /// + ~ChannelReceiver() + { + Dispose(false); + } + + /// + /// Occurs whenever a channel object is received in the main loop of the task. + /// + /// + /// The registered event handler will be invoked when the channel receiver is added to the specific task. + /// + /// + /// + /// + /// var channel = new Channel(); + /// var receiver = channel.Receiver; + /// receiver.Received += (sender, args) => { + /// Console.WriteLine("OnChannelObjectReceived. Message = {0}", (string)args.Data); + /// }; + /// + /// + /// + /// 12 + public event EventHandler Received; + + /// + /// Asynchronously receives the channel object from the sender. + /// + /// The received channel object. + /// Thrown when out of memory. + /// Thrown when failed due to an invalid operation. + /// + /// + /// + /// var channel = new Channel(); + /// var task = TizenCore.Find("Test"); + /// task.Send(async () => { + /// try { + /// var channelObject = await channel.Receiver.Receive(); + /// Console.WriteLine("Message = {}", (string)channelObject.Data); + /// } catch (Exception e) { + /// Console.Error.WriteLine("Failed to receive message: {0}", e.ToString()); + /// } + /// }); + /// + /// + /// + /// 12 + public async Task Receive() + { + return await System.Threading.Tasks.Task.Run(() => + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCoreChannel.ReceiverReceive(Handle, out IntPtr channelObject); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + if (error == Interop.LibTizenCore.ErrorCode.InvalidParameter) + { + error = Interop.LibTizenCore.ErrorCode.InvalidContext; + } + TCoreErrorFactory.CheckAndThrownException(error, "Failed to receive channel object"); + } + return new ChannelObject(channelObject); + }).ConfigureAwait(false); + } + + internal IntPtr Handle { get; set; } + internal IntPtr Source { get; set; } + internal int Id { get; set; } + + internal void InvokeEventHandler(object sender, ChannelReceivedEventArgs e) + { + Received?.Invoke(sender, e); + } + + /// + /// Release any unmanaged resources used by this object. + /// + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + if (Handle != IntPtr.Zero) + { + Interop.LibTizenCore.TizenCoreChannel.ReceiverDestroy(Handle); + Handle = IntPtr.Zero; + } + } + + _disposed = true; + } + } + + /// + /// Release any unmanaged resources used by this object. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + } +} diff --git a/src/Tizen.Core/Tizen.Core/ChannelSender.cs b/src/Tizen.Core/Tizen.Core/ChannelSender.cs new file mode 100644 index 00000000000..1156d9ec49e --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/ChannelSender.cs @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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; + +namespace Tizen.Core +{ + /// + /// Represents the channel sender used for inter-task communication. It provides methods to send messages between tasks in order to facilitate task coordination. + /// + /// 12 + public class ChannelSender : IDisposable + { + private bool _disposed = false; + + internal ChannelSender(IntPtr handle) + { + Handle = handle; + } + + /// + /// Finalizes an instance of the ChannelSender class. + /// + ~ChannelSender() + { + Dispose(false); + } + + /// + /// Sends the channel object to the receiver. + /// + /// The channel object instance. + /// Thrown when the argument is null. + /// Thrown when the argument is invalid. + /// Thrown when failed because of an invalid operation. + /// + /// It's important to call the Dispose() method on the passed channel object to release resources. + /// + /// + /// + /// + /// var channel = new Channel(); + /// var sender = channel.Sender; + /// string message = "Test"; + /// using (var channelObject = new ChannelObject(1, message)) + /// { + /// sender.Send(channelObject); + /// } + /// + /// + /// + /// 12 + public void Send(ChannelObject channelObject) + { + if (channelObject == null) + { + throw new ArgumentNullException(nameof(channelObject)); + } + + if (channelObject.Handle == IntPtr.Zero) + { + throw new ArgumentException("Invalid argument"); + } + + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCoreChannel.SenderSend(Handle, channelObject.Handle); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + throw new InvalidOperationException("Failed to send channel object"); + } + channelObject.IsUsed = true; + } + + /// + /// Creates and returns a copy of the channel sender object. + /// + /// A newly created channel sender instance. + /// Thrown when failed because of an invalid operation. + /// Thrown when out of memory. + /// + /// + /// + /// var channel = new Channel(); + /// var sender = channel.Sender; + /// var clonedSender = sender.Clone(); + /// + /// + /// + /// 12 + public ChannelSender Clone() + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCoreChannel.SenderClone(Handle, out IntPtr clonedHandle); + if (error == Interop.LibTizenCore.ErrorCode.InvalidParameter) + { + error = Interop.LibTizenCore.ErrorCode.InvalidContext; + } + TCoreErrorFactory.CheckAndThrownException(error, "Failed to clone channel sender"); + + return new ChannelSender(clonedHandle); + } + + internal IntPtr Handle { get; private set; } + + /// + /// Release any unmanaged resources used by this object. + /// + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + if (Handle != IntPtr.Zero) + { + Interop.LibTizenCore.TizenCoreChannel.SenderDestroy(Handle); + Handle = IntPtr.Zero; + } + } + + _disposed = true; + } + } + + /// + /// Release any unmanaged resources used by this object. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + } +} diff --git a/src/Tizen.Core/Tizen.Core/Event.cs b/src/Tizen.Core/Tizen.Core/Event.cs new file mode 100644 index 00000000000..f705845e561 --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/Event.cs @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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; + +namespace Tizen.Core +{ + /// + /// Represents the event used for broadcasting events. + /// + /// + /// This class provides functionality for managing events that are broadcasted across multiple components in an application. + /// It enables communication between different parts of the code without resorting to direct references or global variables. + /// By implementing the IDisposable interface, it ensures proper resource management and prevents memory leaks. + /// + /// 12 +#pragma warning disable CA1716 + public class Event : IDisposable +#pragma warning restore CA1716 + { + private IntPtr _handle = IntPtr.Zero; + private bool _disposed = false; + private Interop.LibTizenCore.TizenCoreEvent.EventHandlerCallback _callback = null; + + /// + /// Constructor for creating a new event instance. + /// + /// + /// This constructor initializes a new event instance. It may throw exceptions if there are any issues during initialization such as running out of memory or performing an invalid operation. + /// + /// Thrown when out of memory. + /// Thrown when failed because of an invalid operation. + /// + /// Here's an example showing how to create a new event instance: + /// + /// Create a new event instance + /// var coreEvent = new Event(); + /// + /// + /// 12 + public Event() + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCoreEvent.Create(out _handle); + TCoreErrorFactory.CheckAndThrownException(error, "Failed to create event"); + + _callback = new Interop.LibTizenCore.TizenCoreEvent.EventHandlerCallback(EventHandlerCallback); + error = Interop.LibTizenCore.TizenCoreEvent.AddHandler(_handle, _callback, IntPtr.Zero, out IntPtr _); + TCoreErrorFactory.CheckAndThrownException(error, "Failed to add event handler"); + + Source = IntPtr.Zero; + Id = 0; + } + + /// + /// Finalizes an instance of the Event class. + /// + ~Event() + { + Dispose(false); + } + + private bool EventHandlerCallback(IntPtr eventData, IntPtr userData) + { + using (var eventObject = new EventObject(eventData)) + { + EventReceived?.Invoke(this, new EventReceivedEventArgs(eventObject)); + eventObject.Handle = IntPtr.Zero; + } + return true; + } + + /// + /// Occurrs whenever the event is received in the main loop of the task. + /// + /// + /// The registered event handler will be invoked when the event is added to the specific task. + /// + /// + /// + /// + /// var coreEvent = new Event(); + /// coreEvent.EventReceived += (s, e) => { + /// Console.WriteLine("OnEventReceived. Message = {}", (string)e.Data); + /// }; + /// + /// + /// + /// 12 + public event EventHandler EventReceived; + + /// + /// Emits an event object to the event. + /// The emitted event object is queued and delivered to the registered EventHandlers on the main loop of the task. + /// + /// The event object instance. + /// Thrown when the argument is null. + /// Thrown when failed because of an invalid operation. + /// + /// If the event is not added to the task, the emitted event object will be pended until the event is added to the task. + /// + /// + /// + /// + /// var coreEvent = new Event(); + /// coreEvent.EventReceived += (s, e) => { + /// Console.WriteLine("OnEventReceived. Message = {}", (string)e.Data); + /// }; + /// + /// var task = TizenCore.Find("EventTask"); + /// if (task != null) + /// { + /// task.AddEvent(coreEvent); + /// string message = "Test Event"; + /// using (var eventObject = new EventObject(1, message)) + /// { + /// coreEvent.Emit(eventObject); + /// } + /// } + /// + /// + /// + /// 12 + public void Emit(EventObject eventObject) + { + if (eventObject == null) + { + throw new ArgumentNullException(nameof(eventObject)); + } + + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCoreEvent.Emit(_handle, eventObject.Handle); + if (error == Interop.LibTizenCore.ErrorCode.InvalidParameter) + { + error = Interop.LibTizenCore.ErrorCode.InvalidContext; + } + TCoreErrorFactory.CheckAndThrownException(error, "Failed to emit event object"); + eventObject.Handle = IntPtr.Zero; + } + + internal IntPtr Handle { get { return _handle; } } + internal IntPtr Source { get; set; } + internal int Id { get; set; } + + /// + /// Release any unmanaged resources used by this object. + /// + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + if (_handle != IntPtr.Zero) + { + Interop.LibTizenCore.TizenCoreEvent.Destroy(_handle); + _handle = IntPtr.Zero; + } + } + + _disposed = true; + } + } + + /// + /// Release any unmanaged resources used by this object. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + } +} diff --git a/src/Tizen.Core/Tizen.Core/EventObject.cs b/src/Tizen.Core/Tizen.Core/EventObject.cs new file mode 100644 index 00000000000..22d2ff5af07 --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/EventObject.cs @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Concurrent; + +namespace Tizen.Core +{ + /// + /// Represents an event object used for broadcasting the event. + /// + /// 12 + public class EventObject : IDisposable + { + private IntPtr _handle = IntPtr.Zero; + private bool _disposed = false; + private static readonly ConcurrentDictionary _dataMap = new ConcurrentDictionary(); + private static readonly object _dataLock = new object(); + private static int _dataId = 0; + private static Interop.LibTizenCore.TizenCoreEvent.EventObjectDestroyCallback _destroyCallback = new Interop.LibTizenCore.TizenCoreEvent.EventObjectDestroyCallback(NativeObjectDestroyCallback); + + /// + /// Constructor for creating a new event object with specified ID and data. + /// + /// The ID. + /// The data object. + /// Thrown when out of memory. + /// Thrown when failed because of an invalid operation. + /// + /// + /// + /// int id = 0; + /// string message = "Test event"; + /// var eventObject = new EventObject(id++, message); + /// + /// + /// + /// 12 + public EventObject(int id, object data) + { + int dataId; + lock (_dataLock) + { + dataId = _dataId++; + } + + _dataMap[dataId] = data; + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCoreEvent.ObjectCreate(out _handle, id, (IntPtr)dataId); + TCoreErrorFactory.CheckAndThrownException(error, "Failed to create channel object"); + + Interop.LibTizenCore.TizenCoreEvent.ObjectSetDestroyCallback(_handle, _destroyCallback, (IntPtr)dataId); + } + + internal EventObject(IntPtr handle) + { + _handle = handle; + } + + /// + /// Finalizes an instance of the EventObject class. + /// + ~EventObject() + { + Dispose(false); + } + + /// + /// Gets the ID of the event object. + /// + public int Id + { + get + { + Interop.LibTizenCore.TizenCoreEvent.ObjectGetId(_handle, out int id); + return id; + } + } + + /// + /// Gets the Data of the event object. + /// + public object Data + { + get + { + Interop.LibTizenCore.TizenCoreEvent.ObjectGetData(_handle, out IntPtr handle); + int id = (int)handle; + if (_dataMap.TryGetValue(id, out var data)) + { + return data; + } + return null; + } + } + + internal IntPtr Handle { get { return _handle; } set { _handle = value; } } + + /// + /// Release any unmanaged resources used by this object. + /// + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + if (_handle != IntPtr.Zero) + { + Interop.LibTizenCore.TizenCoreEvent.ObjectDestroy(_handle); + _handle = IntPtr.Zero; + } + } + + _disposed = true; + } + } + + /// + /// Release any unmanaged resources used by this object. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private static void NativeObjectDestroyCallback(IntPtr eventData, IntPtr userData) + { + int dataId = (int)eventData; + _dataMap.TryRemove(dataId, out var _); + } + } +} diff --git a/src/Tizen.Core/Tizen.Core/EventReceivedEventArgs.cs b/src/Tizen.Core/Tizen.Core/EventReceivedEventArgs.cs new file mode 100644 index 00000000000..93d91914d81 --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/EventReceivedEventArgs.cs @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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; + +namespace Tizen.Core +{ + /// + /// Represents the arguments passed to the event handler when the event data is received. + /// + /// 12 + public class EventReceivedEventArgs : System.EventArgs + { + internal EventReceivedEventArgs(EventObject eventObject) + { + if (eventObject == null) + { + throw new ArgumentNullException(nameof(eventObject)); + } + + Id = eventObject.Id; + Data = eventObject.Data; + } + + /// + /// Gets the ID of the received object. + /// + /// 12 + public int Id { get; private set; } + + /// + /// Gets the Data of the received object. + /// + /// 12 + public object Data { get; private set; } + } +} diff --git a/src/Tizen.Core/Tizen.Core/Log.cs b/src/Tizen.Core/Tizen.Core/Log.cs new file mode 100644 index 00000000000..17d57a62df2 --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/Log.cs @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Runtime.CompilerServices; + +namespace Tizen.Core +{ + internal class Log + { + private static string LogTag = "Tizen.Core"; + + public static void Error(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Error(LogTag, message, file, func, line); + } + + public static void Warn(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Warn(LogTag, message, file, func, line); + } + + public static void Info(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Info(LogTag, message, file, func, line); + } + + public static void Debug(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) + { + Tizen.Log.Debug(LogTag, message, file, func, line); + } + } +} \ No newline at end of file diff --git a/src/Tizen.Core/Tizen.Core/Task.cs b/src/Tizen.Core/Tizen.Core/Task.cs new file mode 100644 index 00000000000..a6796b368fb --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/Task.cs @@ -0,0 +1,783 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Concurrent; +using System.Diagnostics.Tracing; +using System.Threading.Channels; +using System.Threading.Tasks; + +namespace Tizen.Core +{ + /// + /// Represents the task used for creating, running and terminating the thread with the main loop. + /// The state of the task can be changed as follows: Constructed -> Running -> Terminated. + /// To start the task, use 'Task.Run()' method. Once started, the task enters into 'Running' state. To terminate the task, use 'Task.Quit()' method. + /// After termination, the task returns back to 'Constructed' state. + /// + /// 12 + public class Task : IDisposable + { + private IntPtr _handle = IntPtr.Zero; + private bool _disposed = false; + private static readonly ConcurrentDictionary _coreTaskMap = new ConcurrentDictionary(); + private static readonly ConcurrentDictionary> _taskMap = new ConcurrentDictionary>(); + private static readonly ConcurrentDictionary _actionkMap = new ConcurrentDictionary(); + private static readonly ConcurrentDictionary _timerMap = new ConcurrentDictionary(); + private static readonly ConcurrentDictionary _channelMap = new ConcurrentDictionary(); + private static readonly ConcurrentDictionary _eventMap = new ConcurrentDictionary(); + private static Object _idLock = new Object(); + private static int _id = 1; + + /// + /// Initializes the Task class with the specified ID. + /// + /// The unique identifier for the task. + /// Thrown when the is invalid or a Task with that ID already exists. + /// Thrown when out of memory. + /// Thrown when failed because of an invalid operation. + /// + /// The constructor throws an exception when the ID already exists. + /// By default, the task creates a separate thread. However, if the is set to "main", no separate thread is created. + /// In such case, the 'main' task will operate on the main application thread instead. + /// + /// + /// + /// + /// TizenCore.Initialize(); + /// var task = new Task("Worker"); + /// task.Run(); + /// + /// + /// + /// 12 + public Task(string id) + { + bool useThread = (id == "main") ? false : true; + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.TaskCreate(id, useThread, out _handle); + TCoreErrorFactory.CheckAndThrownException(error, "Failed to create task"); + _coreTaskMap[id] = this; + } + + internal Task(IntPtr handle) + { + _handle = handle; + _disposed = true; + } + + /// + /// Finalizes the Task class. + /// + /// 12 + ~Task() + { + Dispose(false); + } + + /// + /// Posts an action to be executed later. + /// + /// The action callback to post. + /// Thrown when the action argument is null. + /// Thrown when failed because of an invalid operation. + /// Thrown when out of memory. + /// + /// The action callback will be executed by the main loop of the task. + /// If there was any error during this process, an appropriate exception will be thrown. + /// In order to prevent the from throwing an exception, you should add a try/catch block. If not, it may cause the application to crash or terminate. + /// + /// + /// + /// + /// var task = TizenCore.Find("Test") ?? TizenCore.Spawn("Test"); + /// task.Post(() => + /// { + /// Console.WriteLine("Test task"); + /// }); + /// + /// + /// + /// 12 + public void Post(Action action) + { + if (action == null) + { + throw new ArgumentNullException(nameof(action)); + } + + int id; + lock (_idLock) + { + if (_id + 1 < 0) _id = 1; + id = _id++; + } + _actionkMap[id] = action; + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.AddIdleJob(_handle, NativeActionCallback, (IntPtr)id, out IntPtr handle); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + if (error == Interop.LibTizenCore.ErrorCode.InvalidParameter) + { + error = Interop.LibTizenCore.ErrorCode.InvalidContext; + } + TCoreErrorFactory.CheckAndThrownException(error, "Failed to add idle job"); + } + } + + /// + /// Posts a task to be executed later. + /// + /// The task to post. + /// Thrown when the task argument is null. + /// Thrown when failed because of an invalid operation. + /// Thrown when out of memory. + /// + /// The task will be stored in the internal map using its unique identifier. + /// Then it will be added as an idle job to the main loop of the task. + /// If there was any error during this process, the task will be removed from the map and an appropriate exception will be thrown. + /// In order to prevent the from throwing an exception, you should add a try/catch block. If not, it may cause the application to crash or terminate. + /// + /// + /// + /// + /// var channel = new Channel(); + /// var task = TizenCore.Find("Sender") ?? TizenCore.Spawn("Sender"); + /// + /// int id = 0; + /// task.Post(async () => + /// { + /// var channelObject = await channel.Receiver.Receive(); + /// var message = (string)channelObject.Data; + /// Console.WriteLine("Received message = " + message); + /// }); + /// + /// + /// + /// 12 + public void Post(Func task) + { + if (task == null) + { + throw new ArgumentNullException(nameof(task)); + } + + int id; + lock (_idLock) + { + if (_id + 1 < 0) _id = 1; + id = _id++; + } + _taskMap[id] = task; + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.AddIdleJob(_handle, NativeTaskCallback, (IntPtr)id, out IntPtr handle); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + _taskMap.TryRemove(id, out var _); + if (error == Interop.LibTizenCore.ErrorCode.InvalidParameter) + { + error = Interop.LibTizenCore.ErrorCode.InvalidContext; + } + TCoreErrorFactory.CheckAndThrownException(error, "Failed to add idle job"); + } + } + + /// + /// Adds a recurring timer to a main loop of the task. + /// + /// The interval of the timer in milliseconds. + /// The recurring timer callback function which returns whether or not to continue triggering the timer. + /// The registered timer ID to be used with . + /// Thrown when the callback argument is null. + /// Thrown when failed because of an invalid operation. + /// Thrown when out of memory. + /// + /// The callback function will be called every time the specified interval elapses. It should return true to keep the timer running, otherwise the timer will be stopped. + /// + /// + /// + /// + /// var task = TizenCore.Find("TimerTask") ?? TizenCore.Spawn("TimerTask"); + /// var timerId = task.AddTimer(1000, () => { + /// Console.WriteLine("Timer callback is invoked"); + /// return true; + /// }); + /// + /// + /// + /// 12 + public int AddTimer(uint interval, Func callback) + { + if (callback == null) + { + throw new ArgumentNullException(nameof(callback)); + } + + int id; + lock (_idLock) + { + if (_id + 1 < 0) _id = 1; + id = _id++; + } + var timerSource = new TimerSource(id, IntPtr.Zero, callback); + _timerMap[id] = timerSource; + lock (timerSource) + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.AddTimer(_handle, interval, NativeTimerCallback, (IntPtr)id, out IntPtr handle); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + _timerMap.TryRemove(id, out var _); + throw new InvalidOperationException("Failed to add timer"); + } + + timerSource.Handle = handle; + } + return id; + } + + /// + /// Removes the registered timer from the main loop of the task. + /// If the specified timer was already stopped, no action occurs. + /// + /// The registered timer ID. + /// + /// + /// + /// var task = TizenCore.Find("TimerTask") ?? TizenCore.Spawn("TimerTask"); + /// var timerId = task.AddTimer(1000, () => { + /// Console.WriteLine("Timer handler is invoked"); + /// return true; + /// }); + /// ... + /// task.RemoveTimer(timerId); + /// + /// + /// + /// 12 + public void RemoveTimer(int id) + { + if (_timerMap.TryRemove(id, out var timerSource)) + { + lock (timerSource) + { + if (timerSource.Handle != IntPtr.Zero) + { + Interop.LibTizenCore.TizenCore.RemoveSource(_handle, timerSource.Handle); + timerSource.Handle = IntPtr.Zero; + } + } + } + } + + /// + /// Adds a channel receiver to a main loop of the task. + /// + /// The channel receiver instance that needs to be added. + /// Thrown when the argument is null. + /// Thrown when the argument is invalid. + /// Thrown when failed because of an invalid operation. + /// Thrown when out of memory. + /// + /// In the following code snippet, we create a channel, find or spawn a task named "ReceivingTask", and then add the channel receiver to the task's main loop by calling the 'AddChannelReceiver' method. + /// + /// + /// + /// var channel = new Channel(); + /// var task = TizenCore.Find("ReceivingTask") ?? TizenCore.Spawn("ReceivingTask"); + /// var receiver = channel.Receiver; + /// receiver.Received += (sender, args) => { + /// Console.WriteLine("OnChannelMessageReceived. Message = " + (string)args.Data); + /// }; + /// task.AddChannelReceiver(receiver); + /// + /// + /// + /// 12 + public void AddChannelReceiver(ChannelReceiver receiver) + { + if (receiver == null) { throw new ArgumentNullException(nameof(receiver)); } + + if (receiver.Handle == IntPtr.Zero) + { + if (receiver.Source != IntPtr.Zero) + { + throw new ArgumentException("The receiver is already added"); + } + + throw new ArgumentException("Invalid argument"); + } + + int id; + lock (_idLock) + { + if (_id + 1 < 0) _id = 1; + id = _id++; + } + receiver.Id = id; + _channelMap[id] = receiver; + lock (receiver) + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.AddChannel(_handle, receiver.Handle, NativeChannelReceiveCallback, (IntPtr)id, out IntPtr handle); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + _channelMap.TryRemove(id, out var _); + if (error == Interop.LibTizenCore.ErrorCode.InvalidParameter) + { + error = Interop.LibTizenCore.ErrorCode.InvalidContext; + } + TCoreErrorFactory.CheckAndThrownException(error, "Failed to add a channel to the task"); + } + + receiver.Source = handle; + receiver.Handle = IntPtr.Zero; + } + } + + /// + /// Removes the registered channel receiver from the main loop of the task. + /// + /// The channel receiver instance. + /// Thrown when the argument is null. + /// Thrown when the argument is invalid. + /// + /// + /// + /// var channel = new Channel(); + /// var task = TizenCore.Find("ReceivingTask") ?? TizenCore.Spawn("ReceivingTask"); + /// var receiver = channel.Receiver; + /// receiver.Received += (sender, args) => { + /// Console.WriteLine("OnChannelMessageReceived. Message = " + (string)args.Data); + /// }; + /// + /// task.AddChannelReceiver(receiver); + /// task.RemoveChannelReceiver(receiver); + /// + /// + /// + /// 12 + public void RemoveChannelReceiver(ChannelReceiver receiver) + { + if (receiver == null) + { + throw new ArgumentNullException(nameof(receiver)); + } + + if (receiver.Id == 0 || receiver.Source == IntPtr.Zero) + { + throw new ArgumentException("Invalid argument"); + } + + if (_channelMap.TryRemove(receiver.Id, out var _)) + { + lock (receiver) + { + if (receiver.Source != IntPtr.Zero) + { + Interop.LibTizenCore.TizenCore.RemoveSource(_handle, receiver.Source); + receiver.Source = IntPtr.Zero; + receiver.Id = 0; + } + } + } + } + + /// + /// Adds an event to a main loop of the task. + /// If the event is successfully added, its unique identifier is assigned to the event. The identifier can then be used later to identify the specific event among others. + /// + /// The event instance. + /// Thrown when the argument is null. + /// Thrown when the argument is invalid. + /// Thrown when failed because of an invalid operation. + /// Thrown when out of memory. + /// + /// This method allows you to associate an event with a specific task. By adding an event to a task's main loop, other threads can utilize this event to communicate with the task. + /// However, note that once an event is attached to a task, it cannot be reused or attached to another task. + /// If the argument passed to this method is null, an exception will be thrown. Additionally, if the event has been previously added, an argument exception will be raised. + /// + /// + /// + /// + /// var coreEvent = new Event(); + /// coreEvent.EventReceived += (sender, args) => { + /// Console.WriteLine("OnEventReceived. ID = {}, Message = {}", args.Id, (string)args.Data); + /// }; + /// + /// var task = TizenCore.Find("EventTask") ?? TizenCore.Spawn("EventTask"); + /// task.AddEvent(coreEvent); + /// + /// + /// + /// 12 + public void AddEvent(Event coreEvent) + { + if (coreEvent == null) + { + throw new ArgumentNullException(nameof(coreEvent)); + } + + if (coreEvent.Handle == IntPtr.Zero) + { + throw new ArgumentException("Invalid argument"); + } + + if (coreEvent.Source != IntPtr.Zero) + { + throw new ArgumentException("The event is already added"); + } + + int id; + lock (_idLock) + { + if (_id + 1 < 0) + { + _id = 1; + } + id = _id++; + } + coreEvent.Id = id; + _eventMap[id] = coreEvent; + lock (coreEvent) + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.AddEvent(_handle, coreEvent.Handle, out IntPtr handle); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + _eventMap.TryRemove(id, out var _); + if (error == Interop.LibTizenCore.ErrorCode.InvalidParameter) + { + error = Interop.LibTizenCore.ErrorCode.InvalidContext; + } + TCoreErrorFactory.CheckAndThrownException(error, "Failed to add an event to the task"); + } + + coreEvent.Source = handle; + } + } + + /// + /// Removes the registered event from the main loop of the task. + /// + /// The event instance. + /// Thrown when the argument is null. + /// Thrown when the argument is invalid. + /// + /// + /// + /// var coreEvent = new Event(); + /// coreEvent.EventReceived += (sender, args) => { + /// Console.WriteLine("OnEventReceived. ID = {}, Message = {}", args.Id, (string)args.Data); + /// }; + /// + /// var task = TizenCore.Find("EventTask") ?? TizenCore.Spawn("EventTask"); + /// task.AddEvent(coreEvent); + /// task.RemoveEvent(coreEvent); + /// + /// + /// + /// 12 + public void RemoveEvent(Event coreEvent) + { + if (coreEvent == null) + { + throw new ArgumentNullException(nameof(coreEvent)); + } + + if (coreEvent.Id == 0 || coreEvent.Source == IntPtr.Zero) + { + throw new ArgumentException("Invalid argument"); + } + + if (_eventMap.TryRemove(coreEvent.Id, out var _)) + { + lock (coreEvent) + { + if (coreEvent.Source != IntPtr.Zero) + { + Interop.LibTizenCore.TizenCore.RemoveSource(_handle, coreEvent.Source); + coreEvent.Source = IntPtr.Zero; + coreEvent.Id = 0; + } + } + } + } + + /// + /// Emits the event object to all registered event handlers of the task. + /// It's similar to Event.Emit(), but EmitAllEvent() sends the event object to every event handler of the task while Event.Emit() sends the event object only to the target event's event handler. + /// + /// The event object instance to be sent. + /// Thrown when the argument is null. + /// Thrown when the argument is invalid. + /// Thrown when failed because of an invalid operation. + /// + /// + /// + /// int id = 0; + /// string message = "Test Event"; + /// using (var eventObject = new TCoreEventObject(id++, message)) + /// { + /// var task = TizenCore.Find("EventTask") ?? TizenCore.Spawn("EventTask"); + /// task.EmitEvent(eventObject); + /// } + /// + /// + /// + /// 12 + public void EmitEvent(EventObject eventObject) + { + if (eventObject == null) + { + throw new ArgumentNullException(nameof(eventObject)); + } + + if (eventObject.Handle == IntPtr.Zero) + { + throw new ArgumentException("Invalid argument"); + } + + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.EmitEvent(_handle, eventObject.Handle); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + throw new InvalidOperationException("Failed to emit event"); + } + + eventObject.Handle = IntPtr.Zero; + } + + private static bool NativeTaskCallback(IntPtr userData) + { + int taskId = (int)userData; + if (_taskMap.TryRemove(taskId, out Func task)) + { + task(); + } + return false; + } + + private static bool NativeActionCallback(IntPtr userData) + { + int actionId = (int)userData; + if (_actionkMap.TryRemove(actionId, out Action action)) + { + action(); + } + return false; + } + + private static bool NativeTimerCallback(IntPtr userData) + { + int timerId = (int)userData; + if (_timerMap.TryGetValue(timerId, out TimerSource timerSource)) + { + bool result = false; + lock (timerSource) + { + if (timerSource.Handle != IntPtr.Zero) + { + result = timerSource.Handler(); + if (!result) + { + _timerMap.TryRemove(timerId, out TimerSource unusedSource); + } + } + } + return result; + } + return false; + } + + private static void NativeChannelReceiveCallback(IntPtr nativeObject, IntPtr userData) + { + int channelId = (int)userData; + if (_channelMap.TryGetValue(channelId, out ChannelReceiver receiver)) + { + lock (receiver) + { + if (receiver.Source != IntPtr.Zero) + { + using (var channelObject = new ChannelObject(nativeObject)) + { + var eventArgs = new ChannelReceivedEventArgs(channelObject); + receiver.InvokeEventHandler(null, eventArgs); + channelObject.IsDestroyable = false; + } + } + } + } + } + + internal static Task Find(string id) + { + if (_coreTaskMap.TryGetValue(id, out Task task)) { return task; } + + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.Find(id, out IntPtr handle); + if (error == Interop.LibTizenCore.ErrorCode.None) + { + return new Task(handle); + } + + return null; + } + + internal static Task Spawn(string id) + { + if (id == "main") + { + Log.Error("Invalid argument. id = {}", id); + return null; + } + + try + { + var task = new Task(id); + task.Run(); + return task; + } + catch (ArgumentException) + { + Log.Error("ArgumentException occurs"); + } + catch (OutOfMemoryException) + { + Log.Error("OutOfMemoryException occurs"); + } + catch (InvalidOperationException) + { + Log.Error("InvalidOperationException occurs"); + } + + return null; + } + + /// + /// Checks whether the task is running or not. + /// + /// 12 + public bool Running { + get + { + Interop.LibTizenCore.TizenCore.TaskIsRunning(_handle, out bool running); + return running; + } + } + + /// + /// Runs the main loop of the task. + /// + /// Thrown when failed because of an invalid operation. + /// + /// Here's an example that demonstrates how to create a Core Task and run its main loop: + /// + /// // Create a Core Task named "Runner" + /// var coreTask = new TCoreTask("Runner"); + /// + /// // Start the main loop of the task + /// coreTask.Run(); + /// + /// + /// 12 + public void Run() + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.TaskRun(_handle); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + throw new InvalidOperationException("Failed to run task"); + } + } + + /// + /// Quits the main loop of the task. + /// + /// Thrown when failed because of an invalid operation. + /// + /// This function can be called from any thread. + /// It requests the task to finish the current iteration of its loop and stop running. + /// All pending events in the event queue will be processed before quitting. Once the task quits, it's finished. + /// To start another task, you need to create a new one and call the method on it. + /// + /// + /// + /// + /// var coreTask = new TCoreTask("Runner"); + /// coreTask.Run(); + /// if (coreTask.Running) + /// { + /// coreTask.Quit(); + /// } + /// + /// + /// + /// 12 + public void Quit() + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.TaskQuit(_handle); + if (error != Interop.LibTizenCore.ErrorCode.None) + { + throw new InvalidOperationException("Failed to quit task"); + } + } + + /// + /// Release any unmanaged resources used by this object. + /// + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + if (_handle != IntPtr.Zero) + { + if (Running) + { + Quit(); + } + + Interop.LibTizenCore.TizenCore.TaskDestroy(_handle); + _handle = IntPtr.Zero; + } + } + + _disposed = true; + } + } + + /// + /// Release any unmanaged resources used by this object. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + internal class TimerSource + { + public TimerSource(int id, IntPtr handle, Func handler) + { + Id = id; + Handle = handle; + Handler = handler; + } + + public int Id { get; set; } + + public IntPtr Handle { get; set; } + + public Func Handler { get; set; } + } + } +} diff --git a/src/Tizen.Core/Tizen.Core/TizenCore.cs b/src/Tizen.Core/Tizen.Core/TizenCore.cs new file mode 100644 index 00000000000..62057768979 --- /dev/null +++ b/src/Tizen.Core/Tizen.Core/TizenCore.cs @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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; + +namespace Tizen.Core +{ + /// + /// The class which provides functions related to the Tizen Core. + /// + public static class TizenCore + { + /// + /// Initializes Tizen Core. + /// This method should be called once per application before creating any Tasks. + /// Calling this method more than one time will increase internal reference counts which need to be matched by calling Shutdown(). + /// Failing to call Shutdown() in corresponding number of calls may cause resource leakages. + /// + /// + /// + /// + /// TizenCore.Initialize(); + /// var task = TizenCore.Spawn("Worker"); + /// + /// + /// + /// 12 + static public void Initialize() + { + Interop.LibTizenCore.TizenCore.Init(); + } + + /// + /// Shuts down Tizen Core. + /// + /// + /// + /// + /// TizenCore.Shutdown(); + /// + /// + /// + /// 12 + static public void Shutdown() + { + Interop.LibTizenCore.TizenCore.Shutdown(); + } + + /// + /// Finds the task instance. + /// + /// The ID of the task. + /// + /// + /// + /// TizenCore.Initialize(); + /// var task = TizenCore.Find("Test") ?? TizenCore.Spawn("Test"); + /// + /// + /// + /// On success the task instance, othwerwise null. + public static Task Find(string id) + { + return Task.Find(id); + } + + /// + /// Finds the task instance running in the thread of the caller or the "main" task. + /// + /// On success the task instance, othwerwise null. + /// + /// + /// + /// TizenCore.Initialize(); + /// var coreTask = TizenCore.FindFromThisThread(); + /// if (coreTask != null) + /// { + /// coreTask.Post(() => { + /// Console.WriteLine("Idler invoked"); + /// }); + /// } + /// + /// + /// + /// 12 + public static Task FindFromCurrentThread() + { + Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCore.FindFromThisThread(out IntPtr handle); + if (error == Interop.LibTizenCore.ErrorCode.None) + { + return new Task(handle); + } + + return null; + } + + /// + /// Creates and runs the task. + /// + /// The ID of the task. + /// On succes the created task instance, othwerwise null. + /// + /// + /// + /// TizenCore.Initialize(); + /// var task = TizenCore.Spawn("Worker"); + /// if (task != null) + /// { + /// task.AddTimer(5000, () => { + /// Console.WriteLine("Timer expired"); + /// return true; + /// }); + /// } + /// + /// + /// + /// 12 + public static Task Spawn(string id) + { + return Task.Spawn(id); + } + } + + internal static class TCoreErrorFactory + { + internal enum TCoreError + { + None = Interop.LibTizenCore.ErrorCode.None, + InvalidParameter = Interop.LibTizenCore.ErrorCode.InvalidParameter, + OutOfMemory = Interop.LibTizenCore.ErrorCode.OutOfMemory, + InvalidContext = Interop.LibTizenCore.ErrorCode.InvalidContext, + } + + static internal void CheckAndThrownException(Interop.LibTizenCore.ErrorCode error, string message) + { + if ((TCoreError)error == TCoreError.None) + { + return; + } + + if ((TCoreError)error == TCoreError.InvalidParameter) + { + throw new ArgumentException(message); + } + else if ((TCoreError)error == TCoreError.OutOfMemory) + { + throw new OutOfMemoryException(message); + } + else if ((TCoreError)error == TCoreError.InvalidContext) + { + throw new InvalidOperationException(message); + } + } + } +} diff --git a/src/Tizen.Core/doc/api/Tizen.Core.md b/src/Tizen.Core/doc/api/Tizen.Core.md new file mode 100644 index 00000000000..2ec04f67c0a --- /dev/null +++ b/src/Tizen.Core/doc/api/Tizen.Core.md @@ -0,0 +1,177 @@ +--- +# Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved +# +# 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. + +uid: Tizen.Core +summary: Tizen Core (TCore) is a new main loop model that provides per thread loops, message and event transmission, uniquely named threads. +remarks: *content +--- +## Overview +Tizen Core (TCore) is a new main loop that improves the existing main loop model. It supports creating and running the main loop in multiple threads. Tizen Core provides an API that supports secure communication between threads. + +## Preparation +To use the Tizen Core API, you must define `using Tizen.Core`, as shown below: +```cs +using Tizen.Core; +``` + +## Initializing Tizen Core +Before using Tizen Core, Calls TizenCore.Initialize() as shown below: +```cs +TizenCore.Initialize(); +``` + +## Shutting down Tizen Core +When Tizen Core is no longer needed, shut down Tizen Core with the code below: +```cs +TizenCore.Shutdown(); +``` + +## Managing Tizen Core tasks +This section will cover creating, executing, and terminating the CoreTask objects, It will also cover adding idle jobs and timers to the main loop. + +### Creating a task +Here` an example on how to create a Task object: +```cs +{ + TizenCore.Initialize(); + var task = new Task("task1"); +} +``` +`task` was created with the name "task1" and configured to use its own thread. The created `task` instance should be removed using `Dispose()` method when it is no longer needed. + +### Running a task +In this example, we'll cover the code to execute a previously created task: +```cs +{ + task.Run(); +} +``` +`task` creates and runs a thread named "task1". After calling `Run()` method, the thread is created and the loop starts running. + +### Checking if a task is running +An example of checking if a task is running using `Running` property: +```cs +{ + if (task.Running) + { + Log.Debug(LogTag, "task1 is running"); + } + else + { + Log.Debug(LogTag, "task1 is not running"); + } +} +``` + +### Adding an timer job to Tizen Core +Here's an example of registering a timer that calls the handler every 100 ms. +```cs +{ + var timerId = task.AddTimer(100, () => { + Log.Debug(LogTag, "timer handler is invoked"); + return true; + }); +} +``` + +### Adding an action to Tizen Core +Let'w write an example that adds an action to `Task`. +```cs +{ + var task = TizenCore.Find("Test") ?? TizenCore.Spawn("Test"); + task.Post(() => { + Log.Debug(LogTag, "Action is invoked"); + }); +} +``` + +## Managing Tizen Core channels +Tizen Core channel Provides a communication channel that allows safe sending and receiving of data between threads. This channel can be used to exchange information in a synchronized state without data conflict. This section describes how to create a channel sender and receiver pair, send and receive data, and destroy the channel sender and receiver pair. + +### Creating a channel +Here'a an example on how to create a Channel object: +```cs +{ + try { + var channel = new Channel(); + } + catch (OutOfMemoryException) + { + Log.Error(LogTag, "Exception occurs"); + } +} +``` + +### Creating and transmitting a channel object +This example show how to create and transmit a channel object: +```cs +{ + TizenCore.Initialize(); + var channel = new Channel(); + var receiver = channel.Receiver; + receiver.Received += (s, e) => { + Log.Debug(LogTag, "OnChannelObjectReceived. Message = {}", (string)e.Data); + }; + + var task = TizenCore.Find("ReceivingTask") ?? TizenCore.Spawn("ReceivingTask"); + task.AddChannelReceiver(receiver); + + var sender = channel.Sender; + string message = "Test message"; + using (var channelObject = new ChannelObject(1, message)) + { + sender.Send(channelObject); + } +} +``` +The example shows adding a receiver to a ReceivingTask and delivering a message using a ChannelSender. +The channel event is passed to the main loop of the ReceivingTask, causing the event handler to be called. + +## Managing Tizen Core events +A feature to deliver events to specific tasks, which can be used to wait for completion of tasks or send notifications to other threads. This section covers creating events, registering event handlers with them, attaching them to the main loop, and receiving events. + +### Creating an event and registering an event handler +Here's an example of creating an event and registering an event handler: +```cs +{ + var coreEvent = new Event(); + coreEvent.EventReceived += (s, e) => { + Log.Debug(LogTag, "OnEventReceived. Message = {}", (string)e.Data); + } +} +``` +The example shows creating an event and registering an event handler for it. The created event is added to the EventTask. + +### Creating an event object and delivering it to the task. +```cs +{ + TizenCore.Initialize(); + var coreEvent = new Event(); + coreEvent.EventReceived += (s, e) => { + Log.Debug(LogTag, "OnEventReceived. Message = {}", (string)e.Data); + } + + var task = TizenCore.Find("EventTask") ?? TizenCore.Spawn("EventTask"); + task.AddEvent(coreEvent); + + string message = "Event message"; + using (var eventObject = new EventObject(1, message)) + { + task.EmitEvent(eventObject); + } +} +``` +The generated event is added to an EventTask, and a corresponding EventObject is passed to it. +The event is then delivered to the main loop of the EventTask where the EventHandler is called. diff --git a/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs b/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs index d7c1e113e5c..690f6dbb74b 100644 --- a/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs +++ b/src/Tizen.Data.Tdbc/Tizen.Data.Tdbc/DriverManager.cs @@ -58,6 +58,11 @@ public static IConnection GetConnection(Uri uri) throw new SystemException("Failed to open connection due to: " + ex); } + if (conn == null) + { + throw new SystemException("Failed to open connection"); + } + conn.Open(uri); return conn; } @@ -90,6 +95,11 @@ public static IConnection GetConnection(String connectionString) throw new SystemException("Failed to open connection due to: " + ex); } + if (conn == null) + { + throw new SystemException("Failed to open connection"); + } + conn.Open(connectionString); return conn; } diff --git a/src/Tizen.Log/Tizen/Log.cs b/src/Tizen.Log/Tizen/Log.cs index 1e1c645c1c1..eddd5ecb799 100755 --- a/src/Tizen.Log/Tizen/Log.cs +++ b/src/Tizen.Log/Tizen/Log.cs @@ -157,7 +157,7 @@ public class Log { private static char[] sep = { '\\', '/' }; /// - /// Prints a log message with the VERBOSE priority. + /// Prints a regular log message with the VERBOSE priority. /// /// 3 /// The tag name of the log message. @@ -171,7 +171,7 @@ public static void Verbose(string tag, string message, [CallerFilePath] string f } /// - /// Prints a log message with the DEBUG priority. + /// Prints a regular log message with the DEBUG priority. /// /// 3 /// The tag name of the log message. @@ -185,7 +185,7 @@ public static void Debug(string tag, string message, [CallerFilePath] string fil } /// - /// Prints a log message with the INFO priority. + /// Prints a regular log message with the INFO priority. /// /// 3 /// The tag name of the log message. @@ -199,7 +199,7 @@ public static void Info(string tag, string message, [CallerFilePath] string file } /// - /// Prints a log message with the WARNING priority. + /// Prints a regular log message with the WARNING priority. /// /// 3 /// The tag name of the log message. @@ -213,7 +213,7 @@ public static void Warn(string tag, string message, [CallerFilePath] string file } /// - /// Prints a log message with the ERROR priority. + /// Prints a regular log message with the ERROR priority. /// /// 3 /// The tag name of the log message. @@ -227,7 +227,7 @@ public static void Error(string tag, string message, [CallerFilePath] string fil } /// - /// Prints a log message with the FATAL priority. + /// Prints a regular log message with the FATAL priority. /// /// 3 /// The tag name of the log message. @@ -248,6 +248,7 @@ static unsafe void Print(Interop.Dlog.LogPriority priority, string tag, string m /// /// Provides methods to print log messages to the Tizen logging system. + /// Sends "internal" logs, which end up in a different Dlog buffer than regular logs. /// /// 3 [EditorBrowsable(EditorBrowsableState.Never)] @@ -255,7 +256,7 @@ public class InternalLog { private static char[] sep = { '\\', '/' }; /// - /// Prints a log message with the VERBOSE priority. + /// Prints an internal log message with the VERBOSE priority. /// /// 3 /// The tag name of the log message. @@ -270,7 +271,7 @@ public static void Verbose(string tag, string message, [CallerFilePath] string f } /// - /// Prints a log message with the DEBUG priority. + /// Prints an internal log message with the DEBUG priority. /// /// 3 /// The tag name of the log message. @@ -284,7 +285,7 @@ public static void Debug(string tag, string message, [CallerFilePath] string fil } /// - /// Prints a log message with the INFO priority. + /// Prints an internal log message with the INFO priority. /// /// 3 /// The tag name of the log message. @@ -298,7 +299,7 @@ public static void Info(string tag, string message, [CallerFilePath] string file } /// - /// Prints a log message with the WARNING priority. + /// Prints an internal log message with the WARNING priority. /// /// 3 /// The tag name of the log message. @@ -312,7 +313,7 @@ public static void Warn(string tag, string message, [CallerFilePath] string file } /// - /// Prints a log message with the ERROR priority. + /// Prints an internal log message with the ERROR priority. /// /// 3 /// The tag name of the log message. @@ -326,7 +327,7 @@ public static void Error(string tag, string message, [CallerFilePath] string fil } /// - /// Prints a log message with the FATAL priority. + /// Prints an internal log message with the FATAL priority. /// /// 3 /// The tag name of the log message. @@ -347,6 +348,7 @@ static unsafe void Print(Interop.Dlog.LogID log_id, Interop.Dlog.LogPriority pri /// /// Provides methods to print log messages to the Tizen logging system. + /// Sends "secure" logs, which have extra safety not to appear on release builds. /// /// 3 [EditorBrowsable(EditorBrowsableState.Never)] @@ -354,7 +356,7 @@ public class SecureLog { private static char[] sep = { '\\', '/' }; /// - /// Prints a log message with the VERBOSE priority. + /// Prints a secure log message with the VERBOSE priority. /// /// 3 /// The tag name of the log message. @@ -369,7 +371,7 @@ public static void Verbose(string tag, string message, [CallerFilePath] string f } /// - /// Prints a log message with the DEBUG priority. + /// Prints a secure log message with the DEBUG priority. /// /// 3 /// The tag name of the log message. @@ -383,7 +385,7 @@ public static void Debug(string tag, string message, [CallerFilePath] string fil } /// - /// Prints a log message with the INFO priority. + /// Prints a secure log message with the INFO priority. /// /// 3 /// The tag name of the log message. @@ -397,7 +399,7 @@ public static void Info(string tag, string message, [CallerFilePath] string file } /// - /// Prints a log message with the WARNING priority. + /// Prints a secure log message with the WARNING priority. /// /// 3 /// The tag name of the log message. @@ -411,7 +413,7 @@ public static void Warn(string tag, string message, [CallerFilePath] string file } /// - /// Prints a log message with the ERROR priority. + /// Prints a secure log message with the ERROR priority. /// /// 3 /// The tag name of the log message. @@ -425,7 +427,7 @@ public static void Error(string tag, string message, [CallerFilePath] string fil } /// - /// Prints a log message with the FATAL priority. + /// Prints a secure log message with the FATAL priority. /// /// 3 /// The tag name of the log message. diff --git a/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/Commons.cs b/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/Commons.cs index 951ca333c56..ab655239b72 100755 --- a/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/Commons.cs +++ b/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/Commons.cs @@ -272,7 +272,7 @@ internal static class Tensor /// /// The maximum number of other/tensor instances that other/tensors may have. /// - internal const int SizeLimit = 16; + internal const int SizeLimit = 256; /// /// Unknown Type of Tensor information. It is internally used for error check. diff --git a/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/TensorsInfo.cs b/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/TensorsInfo.cs index 094c044eca6..c9927c84755 100755 --- a/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/TensorsInfo.cs +++ b/src/Tizen.MachineLearning.Inference/Tizen.MachineLearning.Inference/TensorsInfo.cs @@ -60,10 +60,10 @@ public TensorsInfo() } /// - /// Add a Tensor information to the TensorsInfo instance. Note that we support up to 16 tensors in TensorsInfo. + /// Add a Tensor information to the TensorsInfo instance. Note that we support up to 256 tensors in TensorsInfo. /// /// Data element type of Tensor. - /// Dimension of Tensor. Note that we support up to 4th ranks. + /// Dimension of Tensor. Note that we support up to 16th ranks. /// http://tizen.org/feature/machine_learning.inference /// Thrown when the number of Tensor already exceeds the size limits (i.e. Tensor.SizeLimit) /// Thrown when the method failed due to an invalid parameter. diff --git a/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Dataset.cs b/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Dataset.cs index cfaf094c2a0..5658d4faa8e 100644 --- a/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Dataset.cs +++ b/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Dataset.cs @@ -37,6 +37,9 @@ public class Dataset: IDisposable private IntPtr handle = IntPtr.Zero; private bool disposed = false; + /// if false, model will be destroy dataset handle + private bool hasOwnership = true; + /// /// Constructs the dataset. /// @@ -44,6 +47,9 @@ public class Dataset: IDisposable public Dataset() { NNTrainerError ret = Interop.Dataset.Create(out handle); + if (ret != NNTrainerError.None) { + handle = IntPtr.Zero; + } NNTrainer.CheckException(ret, "Failed to create dataset instance"); Log.Info(NNTrainer.Tag, "Create Dataset"); } @@ -82,6 +88,14 @@ protected virtual void Dispose(bool disposing) { // release managed object } + + disposed = true; + + if (!hasOwnership){ + Log.Info(NNTrainer.Tag, "Cannot destroy dataset already added in a Model. Model will destroy this dataset"); + return; + } + // release unmanaged object if (handle != IntPtr.Zero) { @@ -92,7 +106,6 @@ protected virtual void Dispose(bool disposing) handle = IntPtr.Zero; } - disposed = true; } /// @@ -124,6 +137,11 @@ internal IntPtr GetHandle() return handle; } + internal void RemoveOwnership() + { + this.hasOwnership = false; + } + /// /// Sets the neural network dataset property. /// diff --git a/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Layer.cs b/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Layer.cs index 8f66059aa7d..db19839f520 100644 --- a/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Layer.cs +++ b/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Layer.cs @@ -49,6 +49,9 @@ public class Layer: IDisposable public Layer(NNTrainerLayerType type) { NNTrainerError ret = Interop.Layer.Create(out handle, type); + if (ret != NNTrainerError.None) { + handle = IntPtr.Zero; + } NNTrainer.CheckException(ret, "Failed to create model instance"); Log.Info(NNTrainer.Tag, $"Create layer with type:{type}"); } @@ -98,7 +101,7 @@ protected virtual void Dispose(bool disposing) disposed = true; if (!hasOwnership){ - Log.Error(NNTrainer.Tag, "Cannot destroy layer already added in a Model. Model will destroy this layer"); + Log.Info(NNTrainer.Tag, "Cannot destroy layer already added in a Model. Model will destroy this layer"); return; } diff --git a/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Model.cs b/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Model.cs index d92636e0f57..fa6a86fa44e 100644 --- a/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Model.cs +++ b/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Model.cs @@ -65,6 +65,9 @@ public Model(string modelConf) NNTrainer.CheckException(NNTrainerError.InvalidParameter, "modelConf is null"); NNTrainerError ret = Interop.Model.ConstructWithConf(modelConf, out handle); + if (ret != NNTrainerError.None) { + handle = IntPtr.Zero; + } NNTrainer.CheckException(ret, "Failed to create model instance with modelConf"); Log.Info(NNTrainer.Tag, "Created Model with Conf path: "+ modelConf); } @@ -281,7 +284,7 @@ public void AddLayer(Layer layer) public Layer GetLayer(string layerName) { IntPtr layerHandle = IntPtr.Zero; - if (string.IsNullOrEmpty(layerName)) + if (string.IsNullOrEmpty(layerName)) NNTrainer.CheckException(NNTrainerError.InvalidParameter, "layerName is null"); NNTrainerError ret = Interop.Model.GetLayer(handle, layerName, out layerHandle); @@ -311,6 +314,7 @@ public void SetOptimizer(Optimizer optimizer) NNTrainerError ret = Interop.Model.SetOptimizer(handle, optimizer.GetHandle()); NNTrainer.CheckException(ret, "Failed to set optimizer"); + optimizer.RemoveOwnership(); } /// @@ -335,6 +339,7 @@ public void SetDataset(Dataset dataset) NNTrainerError ret = Interop.Model.SetDataset(handle, dataset.GetHandle()); NNTrainer.CheckException(ret, "Failed to set dataset"); + dataset.RemoveOwnership(); } internal static TensorsInfo CreateTensorsInfoFormHandle(IntPtr handle) diff --git a/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Optimizer.cs b/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Optimizer.cs index de7bdf389c3..e10174e3d18 100644 --- a/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Optimizer.cs +++ b/src/Tizen.MachineLearning.Train/Tizen.MachineLearning.Train/Optimizer.cs @@ -37,6 +37,9 @@ public class Optimizer: IDisposable private IntPtr handle = IntPtr.Zero; private bool disposed = false; + /// if false, model will be destroy optimizer handle + private bool hasOwnership = true; + /// /// Creates a neural network optimizer. /// @@ -45,6 +48,9 @@ public class Optimizer: IDisposable public Optimizer(NNTrainerOptimizerType type) { NNTrainerError ret = Interop.Optimizer.Create(out handle, type); + if (ret != NNTrainerError.None) { + handle = IntPtr.Zero; + } NNTrainer.CheckException(ret, "Failed to create optimizer instance"); Log.Info(NNTrainer.Tag, $"Create optimizer with type:{type}"); } @@ -83,6 +89,14 @@ protected virtual void Dispose(bool disposing) { // release managed object } + + disposed = true; + + if (!hasOwnership){ + Log.Info(NNTrainer.Tag, "Cannot destroy optimizer already added in a Model. Model will destroy this optimizer"); + return; + } + // release unmanaged object if (handle != IntPtr.Zero) { @@ -93,7 +107,6 @@ protected virtual void Dispose(bool disposing) handle = IntPtr.Zero; } - disposed = true; } /// @@ -122,5 +135,10 @@ internal IntPtr GetHandle() { return handle; } + + internal void RemoveOwnership() + { + this.hasOwnership = false; + } } } diff --git a/src/Tizen.Multimedia.AudioIO/Interop/Interop.WavPlayer.cs b/src/Tizen.Multimedia.AudioIO/Interop/Interop.WavPlayer.cs index 0712ee1c430..7c7299690e5 100644 --- a/src/Tizen.Multimedia.AudioIO/Interop/Interop.WavPlayer.cs +++ b/src/Tizen.Multimedia.AudioIO/Interop/Interop.WavPlayer.cs @@ -29,6 +29,10 @@ internal static partial class WavPlayer internal static extern WavPlayerError Start(string filePath, AudioStreamPolicyHandle streamInfoHandle, WavPlayerCompletedCallback completedCallback, IntPtr userData, out int id); + [DllImport(Libraries.WavPlayer, EntryPoint = "wav_player_start_loop")] + internal static extern WavPlayerError StartLoop(string filePath, AudioStreamPolicyHandle streamInfoHandle, uint count, + WavPlayerCompletedCallback completedCallback, IntPtr userData, out int id); + [DllImport(Libraries.WavPlayer, EntryPoint = "wav_player_stop")] internal static extern WavPlayerError Stop(int id); } diff --git a/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs b/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs index 5c159d5cbff..3dcfb24c26e 100644 --- a/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs +++ b/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -85,20 +86,62 @@ public static Task StartAsync(string path, AudioStreamPolicy streamPolicy, } return cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : - StartAsyncCore(path, streamPolicy, cancellationToken); + StartAsyncCore(path, streamPolicy, 1, cancellationToken); } - private static async Task StartAsyncCore(string path, AudioStreamPolicy streamPolicy, + /// + /// Plays a wav file based on the specified with given repetition number. + /// + /// If loopCount is 0, it means infinite loops + /// A task that represents the asynchronous operation. + /// A file path to play. + /// A . + /// A number of repetitions. + /// A cancellation token which can be used to stop. + /// + /// is null. + /// -or- + /// is null. + /// + /// An internal error occurs. + /// does not exists. + /// The format of is not supported. + /// has already been disposed of. + [EditorBrowsable(EditorBrowsableState.Never)] + public static Task StartAsync(string path, AudioStreamPolicy streamPolicy, uint loopCount, + CancellationToken cancellationToken) + { + if (path == null) + { + throw new ArgumentNullException(nameof(path)); + } + + if (streamPolicy == null) + { + throw new ArgumentNullException(nameof(streamPolicy)); + } + + if (File.Exists(path) == false) + { + throw new FileNotFoundException("File does not exists.", path); + } + + return cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : + StartAsyncCore(path, streamPolicy, loopCount, cancellationToken); + } + + private static async Task StartAsyncCore(string path, AudioStreamPolicy streamPolicy, uint loopCount, CancellationToken cancellationToken) { + int id = 0; var tcs = new TaskCompletionSource(); Native.WavPlayerCompletedCallback cb = (id_, _) => tcs.TrySetResult(true); using (var cbKeeper = ObjectKeeper.Get(cb)) { - Native.Start(path, streamPolicy.Handle, cb, IntPtr.Zero, out var id). - Validate("Failed to play."); + Native.StartLoop(path, streamPolicy.Handle, loopCount, cb, IntPtr.Zero, out id). + Validate("Failed to play with loop."); using (RegisterCancellationAction(tcs, cancellationToken, id)) { diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/AdaptiveVariants.cs b/src/Tizen.Multimedia.MediaPlayer/Player/AdaptiveVariants.cs index b24188e5788..aa66f1f0fa8 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/AdaptiveVariants.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/AdaptiveVariants.cs @@ -93,7 +93,7 @@ internal AdaptiveVariants(Player player) } /// - /// Sets the maximum limit of the streaming variant. + /// Sets the maximum limit of adaptive streaming variants. /// /// The has already been disposed of. /// @@ -119,7 +119,7 @@ public void SetMaxLimit(int bandwidth, int width = -1, int height = -1) } /// - /// Gets the maximum limit of the streaming variant. + /// Gets the maximum limit of the adaptive streaming variant. /// /// The containing the variant information. /// The has already been disposed of. @@ -136,7 +136,7 @@ public VariantInfo GetMaxLimit() } /// - /// Retrieves all the available adaptive variants. + /// Retrieves all the available adaptive streaming variants. /// /// /// It returns a list contained all the available adaptive variants. diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/AudioDataDecodedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/AudioDataDecodedEventArgs.cs index 17a00850c7e..1f0ac187777 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/AudioDataDecodedEventArgs.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/AudioDataDecodedEventArgs.cs @@ -32,7 +32,7 @@ internal AudioDataDecodedEventArgs(MediaPacket packet) } /// - /// Gets the packet containing the decoded frame. + /// Gets the media packet containing the audio decoded frame. /// /// 6 public MediaPacket Packet { get; } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs b/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs index 9815506a3b1..66b670207e4 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs @@ -98,7 +98,7 @@ public void Clear() } /// - /// Gets the number of items. + /// Gets the number of equalizer bands available. /// /// If audio offload is enabled by calling . (Since tizen 6.0) /// -or-
@@ -148,7 +148,7 @@ public Range BandLevelRange } /// - /// Gets the value whether the AudioEffect is available or not. + /// Gets the value indicating whether the AudioEffect is available or not. /// /// This function returns the availability of the . /// It could be unavailable depending on the platform capabilities.
diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/AudioOffload.cs b/src/Tizen.Multimedia.MediaPlayer/Player/AudioOffload.cs index e25c20ea83a..cf474668a61 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/AudioOffload.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/AudioOffload.cs @@ -50,7 +50,7 @@ internal void CheckDisabled() } /// - /// Enables or disables the audio offload. + /// Gets or sets whether the audio offload is enabled. /// /// The value indicating whether or not audio offload is enabled. The default value is false. /// The player lets the hardware decode and render the sound if the audio offload is enabled. @@ -103,7 +103,7 @@ public bool IsEnabled } /// - /// Get a state whether or not the audio offload is activated. + /// Get a value indication whether or not the audio offload is activated. /// /// The value indicating whether or not AudioOffload is activated. /// diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs b/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs index d5c7e5406bb..b359aa05f49 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs @@ -85,7 +85,7 @@ public int Level /// - /// Gets the frequency in dB. + /// Gets the frequency in dB of the equalizer band. /// /// /// If audio offload is enabled by calling . (Since tizen 6.0) @@ -105,7 +105,7 @@ public int Frequency } /// - /// Gets the frequency range in dB. + /// Gets the frequency range in dB of the equalizer band. /// /// /// If audio offload is enabled by calling . (Since tizen 6.0) diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs index 0ad90e3ff76..c2d47dafdcb 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs @@ -33,7 +33,7 @@ public sealed class MediaBufferSource : MediaSource private byte[] _buffer; /// - /// Initializes a new instance of the MediaBufferSource class with an allocated buffer. + /// Initializes a new instance of the MediaBufferSource class with the specified buffer length. /// /// The value indicating the size of the buffer. /// @@ -54,7 +54,7 @@ public MediaBufferSource(int length) } /// - /// Initializes a new instance of the MediaBufferSource class from the buffer. + /// Initializes a new instance of the MediaBufferSource class with the specified buffer. /// /// The source array to be copied into the buffer. /// is null. @@ -65,7 +65,7 @@ public MediaBufferSource(byte[] buffer) : this(buffer, buffer == null ? 0 : buff //TODO remove default parameter. /// - /// Initializes a new instance of the MediaBufferSource class from the buffer + /// Initializes a new instance of the MediaBufferSource class with buffer, length, and optional offset. /// with the specified length and the specified offset. /// /// The source array to be copied into the buffer. @@ -141,4 +141,3 @@ internal override void OnAttached(Player player) } } } - diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamBufferStatusChangedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamBufferStatusChangedEventArgs.cs index dd48e886b80..468a41dfb67 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamBufferStatusChangedEventArgs.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamBufferStatusChangedEventArgs.cs @@ -36,7 +36,7 @@ public MediaStreamBufferStatusChangedEventArgs(MediaStreamBufferStatus status) } /// - /// Gets the status. + /// Gets the current buffer status. /// /// 3 public MediaStreamBufferStatus Status { get; } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs index c8d19defb14..602e7e9156e 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs @@ -59,10 +59,10 @@ internal MediaStreamConfiguration(MediaStreamSource owner, StreamType streamType public event EventHandler SeekingOccurred; /// - /// Gets or sets the max size of the buffer. + /// Gets or sets the maximum size of the buffer for media stream. /// - /// The max size of the buffer. The default is 200000. - /// If the buffer level overflows the max size, will be raised with . + /// The maximum size of the buffer in bytes. The default is 200000. + /// If the buffer level overflows the maximum size, will be raised with . /// The is not assigned to a player. /// is zero. /// @@ -95,7 +95,7 @@ public ulong BufferMaxSize } /// - /// Gets or sets the minimum threshold of the buffer. + /// Gets or sets the minimum threshold of the media stream buffer. /// /// The minimum threshold of the buffer in percentage. The default is zero. /// If the buffer level drops below the threshold value, will be raised with . diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSeekingOccurredEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSeekingOccurredEventArgs.cs index e033ed9f6e8..7de8cc98790 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSeekingOccurredEventArgs.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSeekingOccurredEventArgs.cs @@ -35,8 +35,14 @@ public MediaStreamSeekingOccurredEventArgs(ulong offset) } /// - /// Gets the offset. + /// Gets the next new play position as a result of seeking operation. /// + /// + /// The next playback position after SetPlayPositionAsync could be a little bit different with its input position.
+ /// So user should push the next media data using this time offset in nanoseconds. + ///
+ /// + /// /// 3 public ulong Offset { get; } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs index 0bee6d10c89..ea57faa6d78 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs @@ -37,7 +37,7 @@ public sealed class MediaStreamSource : MediaSource private static List _supportedVideoFormats; /// - /// Gets all supported audio types. + /// Gets the supported audio types of the media stream source. /// /// 3 public static IEnumerable SupportedAudioTypes @@ -50,7 +50,7 @@ public static IEnumerable SupportedAudioTypes } /// - /// Gets all supported video types. + /// Gets the supported video types of the media stream source. /// /// 3 public static IEnumerable SupportedVideoTypes @@ -214,7 +214,7 @@ public MediaStreamSource(VideoMediaFormat videoMediaFormat) public MediaStreamConfiguration VideoConfiguration { get; } /// - /// Pushes elementary stream to decode audio or video. + /// Pushes elementary stream to decode audio or video packet. /// /// This source must be set as a source to a player and the player must be in the , /// , or state. diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs index 240b7a37f03..415a8f17f96 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs @@ -20,7 +20,7 @@ namespace Tizen.Multimedia { /// - /// Represents a media source with a uri. + /// Represents a media source with a URI. /// /// /// The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from a network. @@ -31,9 +31,10 @@ namespace Tizen.Multimedia /// 3 public sealed class MediaUriSource : MediaSource { - // TODO consider using Uri class. + // TODO consider using URI class. /// - /// Initializes a new instance of the MediaUriSource class with the specified uri. + /// Initializes a new instance of the MediaUriSource class with the specified URI. + ///
/// The uri string. /// For HTTP or RSTP, uri should start with "http://" or "rtsp://". /// The default protocol is "file://". @@ -57,4 +58,3 @@ internal override void OnAttached(Player player) } } } - diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlaybackInterruptedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlaybackInterruptedEventArgs.cs index 47475e7a858..679ab19ddac 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlaybackInterruptedEventArgs.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/PlaybackInterruptedEventArgs.cs @@ -35,7 +35,7 @@ public PlaybackInterruptedEventArgs(PlaybackInterruptionReason reason) } /// - /// Gets the reason. + /// Gets the reason for the playback interruption. /// /// 3 public PlaybackInterruptionReason Reason { get; } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs index 1b5d2f3939a..e60b994b413 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs @@ -193,7 +193,7 @@ public PlayerBufferingTime BufferingTime #endregion /// - /// Gets the state of the player. + /// Gets the current state of the player. /// /// The current state of the player. /// The player has already been disposed of. @@ -258,7 +258,7 @@ public AudioLatencyMode AudioLatencyMode } /// - /// Gets or sets the looping state. + /// Gets or sets a value indicationg whether the media source is played in a loop. /// /// true if the playback is looping; otherwise, false. The default value is false. /// The player has already been disposed of. @@ -286,7 +286,7 @@ public bool IsLooping private PlayerDisplaySettings _displaySettings; /// - /// Gets the display settings. + /// Gets the display settings of the player. /// /// A that specifies the display settings. /// 3 @@ -314,7 +314,7 @@ private void ReplaceDisplay(Display newDisplay) } /// - /// Gets or sets the display. + /// Gets or sets the display of the player. /// /// A that specifies the display. /// @@ -387,7 +387,7 @@ PlayerErrorCode IDisplayable.ApplyEcoreWindow(IntPtr windowHand private PlayerTrackInfo _audioTrack; /// - /// Gets the track info for the audio. + /// Gets the audio track information of the player. /// /// A for audio. /// 3 @@ -406,7 +406,7 @@ public PlayerTrackInfo AudioTrackInfo private PlayerTrackInfo _subtitleTrackInfo; /// - /// Gets the track info for the subtitle. + /// Gets the sutitle track information of the player. /// /// A for the subtitle. /// 3 @@ -425,7 +425,7 @@ public PlayerTrackInfo SubtitleTrackInfo private StreamInfo _streamInfo; /// - /// Gets the stream information. + /// Gets the stream information of the player. /// /// A for this player. /// 3 @@ -444,7 +444,7 @@ public StreamInfo StreamInfo private AudioEffect _audioEffect; /// - /// Gets the audio effect. + /// Gets the audio effect of the player. /// /// http://tizen.org/feature/multimedia.custom_audio_effect /// The required feature is not supported. @@ -463,7 +463,7 @@ public AudioEffect AudioEffect } /// - /// Gets or sets the mute state. + /// Gets or sets a value indicationg whether the audio output of the player is muted. /// /// true if the player is muted; otherwise, false. /// The player has already been disposed of. @@ -486,7 +486,7 @@ public bool Muted } /// - /// Gets or sets the current volume. + /// Gets or sets the current volume of the player. /// /// Valid volume range is from 0 to 1.0, inclusive. /// The player has already been disposed of. @@ -520,7 +520,7 @@ public float Volume } /// - /// Gets or sets the audio-only state. + /// Gets or sets a value indicating whether the player is in audio only mode. /// /// true if the playback is audio-only mode; otherwise, false. The default value is false. /// The must be in the , @@ -547,7 +547,7 @@ public bool IsAudioOnly } /// - /// Gets or sets the player's replaygain state. + /// Gets or sets a value indicating whether the replay gain is enabled. /// /// If the replaygain status is true, replaygain is applied (if contents has a replaygain tag); /// otherwise, the replaygain is not affected by tag and properties. @@ -585,8 +585,7 @@ public bool ReplayGain } /// - /// Enables or disables controlling the pitch of audio. - /// Gets the status of controlling the pitch of audio. + /// Gets or sets a value indicating whether the audio pitch control is enabled. /// /// The value indicating whether or not AudioPitch is enabled. The default is false. /// This function is used for audio content only. @@ -628,7 +627,7 @@ public bool AudioPitchEnabled } /// - /// Gets or sets the pitch of audio. + /// Gets or sets the pitch of the audio. /// /// The audio stream pitch value. The default is 1. /// Enabling pitch control could increase the CPU usage on some devices. @@ -783,7 +782,7 @@ public CodecType VideoCodecType private SphericalVideo _sphericalVideo; /// - /// Gets the spherical video settings. + /// Gets the spherical video porperties of the player. /// /// 5 public SphericalVideo SphericalVideo @@ -802,7 +801,7 @@ public SphericalVideo SphericalVideo private AdaptiveVariants _adaptiveVariants; /// - /// Gets the adaptive variants settings. + /// Gets the adaptive variants of the player. /// /// 5 public AdaptiveVariants AdaptiveVariants @@ -821,7 +820,7 @@ public AdaptiveVariants AdaptiveVariants private AudioOffload _audioOffload; /// - /// Gets the setting for audio offload. + /// Gets the audio offload settings of the player. /// /// 6 public AudioOffload AudioOffload diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs index 3b3e2c2e105..0ec788b05e1 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs @@ -184,7 +184,7 @@ internal void ValidateNotDisposed() #region Methods /// - /// Gets the streaming download progress. + /// Gets the download progress of the streaming contents. /// /// The containing current download progress. /// The player must be in the , , @@ -211,7 +211,7 @@ public DownloadProgress GetDownloadProgress() } /// - /// Sets the subtitle path for playback. + /// Sets the subtitle file path for playback. /// /// The absolute path of the subtitle file, it can be NULL in the state. /// Only MicroDVD/SubViewer(*.sub), SAMI(*.smi), and SubRip(*.srt) subtitle formats are supported. @@ -247,7 +247,7 @@ public void SetSubtitle(string path) } /// - /// Removes the subtitle path. + /// Clears the the subtitle path of the media player. /// /// The player must be in the state. /// The player has already been disposed of. @@ -262,7 +262,7 @@ public void ClearSubtitle() } /// - /// Sets the offset for the subtitle. + /// Sets the seek offset for the subtitle. /// /// The value indicating a desired offset in milliseconds. /// The player must be in the or state. @@ -410,7 +410,7 @@ public virtual async Task PrepareAsync(CancellationToken cancellationToken) } /// - /// Unprepares the player. + /// Unprepares the media player. /// /// /// The most recently used source is reset and is no longer associated with the player. Playback is no longer possible. @@ -450,7 +450,7 @@ protected virtual void OnUnprepared() } /// - /// Starts or resumes playback. + /// Starts or resumes playing the media content. /// /// /// Sound can be mixed with other sounds if you don't control the stream focus using .
@@ -505,7 +505,7 @@ public virtual void Stop() } /// - /// Pauses the player. + /// Pauses playing the media content. /// /// /// The player must be in the state. @@ -570,7 +570,7 @@ public void SetSource(MediaSource source) } /// - /// Captures a video frame, asynchronously. + /// Captures the current frame of the video being played, asynchronously. /// /// A task that represents the asynchronous capture operation. /// http://tizen.org/feature/multimedia.raw_video @@ -607,7 +607,7 @@ public async Task CaptureVideoAsync() } /// - /// Gets the play position in milliseconds. + /// Gets the current playback position in milliseconds of the media. /// /// The current position in milliseconds. /// The player must be in the , , @@ -673,7 +673,7 @@ private async Task SetPlayPosition(long position, bool accurate, bool nanosecond } /// - /// Sets the seek position for playback, asynchronously. + /// Sets the playback position in milliseconds of the player, asynchronously. /// /// The value indicating a desired position in milliseconds. /// The value indicating whether the operation performs with accuracy. @@ -701,7 +701,7 @@ public async Task SetPlayPositionAsync(int position, bool accurate) } /// - /// Gets the play position in nanoseconds. + /// Gets the current playback position in nanoseconds of the media. /// /// The current position in nanoseconds. /// The player must be in the , , @@ -725,7 +725,7 @@ public long GetPlayPositionNanoseconds() } /// - /// Sets the seek position in nanoseconds for playback, asynchronously. + /// Sets the playback position in nanoseconds of the player, asynchronously. /// /// The value indicating a desired position in nanoseconds. /// The value indicating whether the operation performs with accuracy. @@ -753,7 +753,7 @@ public async Task SetPlayPositionNanosecondsAsync(long position, bool accurate) } /// - /// Sets the playback rate. + /// Sets the playback rate of the player. /// /// The value for the playback rate. Valid range is -5.0 to 5.0, inclusive. /// @@ -793,7 +793,7 @@ public void SetPlaybackRate(float rate) } /// - /// Applies the audio stream policy. + /// Applies the specified audio stream policy to the player. /// /// The to apply. /// diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs index 38b8a947a24..b8c889befc0 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs @@ -53,7 +53,7 @@ protected PlayerDisplaySettings(Player player) protected Player Player { get; } /// - /// Gets or sets the . + /// Gets or sets the of the player. /// /// /// Operation failed; internal error. @@ -134,7 +134,7 @@ public Rotation Rotation } /// - /// Sets the roi(region of interest). + /// Sets the ROI(Region Of Interest) for the video display. /// /// The region. /// diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs index 137fc1a5865..27378e44466 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs @@ -38,7 +38,7 @@ public enum PlayerError InternalError = ErrorCode.InvalidOperation, /// - /// No space. + /// No space on the device. /// NoSpaceOnDevice = PlayerErrorCode.NoSpaceOnDevice, @@ -269,32 +269,32 @@ public enum PlaybackInterruptionReason public enum StreamMetadataKey { /// - /// Album. + /// The album name of the media content /// Album, /// - /// Artists. + /// The artist(s) of the media content. /// Artist, /// - /// Author. + /// The author(s) of the media content. /// Author, /// - /// Genre. + /// The genre(s) of the media content. /// Genre, /// - /// Title. + /// The title of the media content. /// Title, /// - /// Year. + /// The year of the media content. /// Year } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/SubtitleUpdatedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/SubtitleUpdatedEventArgs.cs index f3ee00a62ab..b46489e700f 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/SubtitleUpdatedEventArgs.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/SubtitleUpdatedEventArgs.cs @@ -30,7 +30,7 @@ internal SubtitleUpdatedEventArgs(uint duration, string text) } /// - /// Gets the duration of the updated subtitle. + /// Gets the duration in milliseconds of the updated subtitle. /// /// 3 public uint Duration { get; } diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/VideoFrameDecodedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/VideoFrameDecodedEventArgs.cs index 89e97d2c5ca..cb978a69cc4 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/VideoFrameDecodedEventArgs.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/VideoFrameDecodedEventArgs.cs @@ -32,7 +32,7 @@ internal VideoFrameDecodedEventArgs(MediaPacket packet) } /// - /// Gets the packet containing the decoded frame. + /// Gets the media packet containing the decoded frame. /// /// 3 public MediaPacket Packet { get; } diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs index d5ca764fefc..0d10a12f376 100644 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs @@ -215,6 +215,8 @@ internal Metadata(MetadataExtractor extractor) DateRecorded = extractor.GetMetadata(MetadataExtractorAttr.RecordingDate); Rotation = extractor.GetMetadata(MetadataExtractorAttr.Rotate); Content360 = extractor.GetMetadata(MetadataExtractorAttr.ContentFor360); + var stitched = ValueConverter.ToNullableInt(extractor.GetMetadata(MetadataExtractorAttr.StitchedContentFor360)); + StitchedContent360 = stitched == 0 || stitched == null ? null : stitched; _description = new Lazy(() => ObjectDescriptionBuilder.BuildWithProperties(this)); } @@ -402,6 +404,13 @@ internal Metadata(MetadataExtractor extractor) /// A string representing the information for 360 content, or null if the information does not exist. public string Content360 { get; } + /// + /// Gets the information about 360 video content being stitched or not. + /// + /// 12 + /// 1 : not stitched, 2 : stitched, or null if the information does not exist. + public int? StitchedContent360 { get; } + private Lazy _description; /// diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorAttr.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorAttr.cs index c2d325c2c00..148522372ad 100644 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorAttr.cs +++ b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorAttr.cs @@ -53,5 +53,6 @@ internal enum MetadataExtractorAttr VideoCodec, AudioCodec, ContentFor360, + StitchedContentFor360, } } diff --git a/src/Tizen.Multimedia.Remoting/Interop/Interop.WebRTC.cs b/src/Tizen.Multimedia.Remoting/Interop/Interop.WebRTC.cs index 9b6e81607d0..a682accafa6 100755 --- a/src/Tizen.Multimedia.Remoting/Interop/Interop.WebRTC.cs +++ b/src/Tizen.Multimedia.Remoting/Interop/Interop.WebRTC.cs @@ -148,6 +148,12 @@ internal static extern WebRTCErrorCode ForeachSupportedTransceiverCodec(IntPtr h [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_transceiver_codec")] internal static extern WebRTCErrorCode GetTransceiverCodec(IntPtr handle, uint sourceId, MediaType type, out TransceiverCodec codec); + [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_payload_type")] + internal static extern WebRTCErrorCode SetPaylodType(IntPtr handle, uint sourceId, TransceiverCodec codec, uint payloadType); + + [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_get_payload_type")] + internal static extern WebRTCErrorCode GetPaylodType(IntPtr handle, uint sourceId, TransceiverCodec codec, out uint payloadType); + [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_media_source_set_pause")] internal static extern WebRTCErrorCode SetPause(IntPtr handle, uint sourceId, MediaType type, bool pause); @@ -256,9 +262,15 @@ internal static extern WebRTCErrorCode ForeachSupportedTransceiverCodec(IntPtr h [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_local_description")] internal static extern WebRTCErrorCode SetLocalDescription(IntPtr handle, string description); + [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_local_description")] + internal static extern WebRTCErrorCode GetLocalDescription(IntPtr handle, out IntPtr description); + [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_remote_description")] internal static extern WebRTCErrorCode SetRemoteDescription(IntPtr handle, string description); + [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_get_remote_description")] + internal static extern WebRTCErrorCode GetRemoteDescription(IntPtr handle, out IntPtr description); + [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_add_ice_candidate")] internal static extern WebRTCErrorCode AddIceCandidate(IntPtr handle, string candidate); @@ -268,7 +280,6 @@ internal static extern WebRTCErrorCode ForeachSupportedTransceiverCodec(IntPtr h [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_foreach_stats")] internal static extern WebRTCErrorCode ForeachStats(IntPtr handle, int typeMask, RetrieveStatsCallback callback, IntPtr userData = default); - [DllImport(Libraries.WebRTC, EntryPoint = "webrtc_set_error_cb")] internal static extern WebRTCErrorCode SetErrorOccurredCb(IntPtr handle, ErrorOccurredCallback callback, IntPtr userData = default); diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaCameraSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaCameraSource.cs index 50a34111a76..2efc12409cb 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaCameraSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaCameraSource.cs @@ -21,7 +21,7 @@ namespace Tizen.Multimedia.Remoting { /// - /// Represents a camera source. + /// Represents a media source that makes video data using camera device internally. /// /// The camera privilege(http://tizen.org/privilege/camera) is required. /// @@ -36,7 +36,7 @@ public sealed class MediaCameraSource : MediaSource public MediaCameraSource() : base(MediaType.Video) {} /// - /// Gets or sets the camera device id. + /// Gets or sets the camera device id that identifies each camera device. /// /// A value that specifies the camera device id. /// MediaSource is not attached yet. diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaCustomSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaCustomSource.cs index 4f42fd930f1..112beb5a5d3 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaCustomSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaCustomSource.cs @@ -22,8 +22,11 @@ namespace Tizen.Multimedia.Remoting { /// - /// Represents a audio, video custom source. + /// Represents a media source that makes audio, video data internally. /// + /// + /// This supports the product infrastructure and is not intended to be used directly from application code. + /// /// /// /// 9 diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaFileSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaFileSource.cs index 45921094074..4cc04bb1b7b 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaFileSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaFileSource.cs @@ -21,7 +21,7 @@ namespace Tizen.Multimedia.Remoting { /// - /// Represents a media source with contents read from a file. + /// Represents a media source that reads media data from a file. /// /// /// Depending on where the source file is located either the media storage privilege (http://tizen.org/privilege/mediastorage) is required or
@@ -107,15 +107,11 @@ public TransceiverDirection GetTransceiverDirection(MediaType type) /// Sets the transceiver direction for receiving media stream. ///
/// - /// The WebRTC must be in the state when transceiver direction is set. + /// This method does not throw state exception anymore(Since API Leve 12). It can be called in any state.
///
/// The media type. /// The transceiver direction. - /// - /// MediaSource is not attached yet.
- /// -or-
- /// The WebRTC is not in the valid state. - ///
+ /// MediaSource is not attached yet. /// The WebRTC has already been disposed. /// 10 public void SetTransceiverDirection(MediaType type, TransceiverDirection direction) diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaMicrophoneSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaMicrophoneSource.cs index d4cd5d082db..7c0cf06f7ef 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaMicrophoneSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaMicrophoneSource.cs @@ -21,7 +21,7 @@ namespace Tizen.Multimedia.Remoting { /// - /// Represents a microphone source. + /// Represents a media source that makes audio data using microphone. /// /// The recorder privilege(http://tizen.org/privilege/recorder) is required. /// @@ -66,8 +66,7 @@ internal override void OnDetached(WebRTC webRtc) ///
/// The to apply. /// - /// The WebRTC must be in the state.
- ///
+ /// This method does not throw state exception anymore(Since API Level 12). It can be called in any state.
/// does not support all .
/// Supported types are , , /// , . @@ -77,7 +76,7 @@ internal override void OnDetached(WebRTC webRtc) /// -or-
/// has already been disposed. /// - /// The WebRTC is not in the valid state. + /// An internal error occurs. /// is null. /// /// of is not supported on the current platform. @@ -91,8 +90,6 @@ public void ApplyAudioStreamPolicy(AudioStreamPolicy policy) throw new ArgumentNullException(nameof(policy), "policy is null"); } - WebRtc.ValidateWebRTCState(WebRTCState.Idle); - var ret = NativeWebRTC.SetAudioStreamPolicyToMicrophoneSource(WebRtc.Handle, SourceId.Value, policy.Handle); if (ret == WebRTCErrorCode.InvalidArgument) diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaNullSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaNullSource.cs index c685439d604..586aede9c94 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaNullSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaNullSource.cs @@ -21,7 +21,9 @@ namespace Tizen.Multimedia.Remoting { - /// Represents a null source. + /// + /// Represents a media source that only receives media streams from peer. + /// /// /// If you add this source, WebRTC only receives media stream.
/// is set by default. @@ -64,16 +66,11 @@ public TransceiverCodec GetTransceiverCodec(MediaType type) /// Sets the transceiver codec for receiving media stream. ///
/// - /// The WebRTC must be in the state when transceiver codec is set.
- /// + /// This method does not throw state exception anymore(Since API Level 12). It can be called in any state.
///
/// The media type. /// The transceiver codec. - /// - /// MediaSource is not attached yet.
- /// -or-
- /// The WebRTC is not in the valid state. - ///
+ /// MediaSource is not attached yet. /// The WebRTC has already been disposed. /// /// 10 @@ -84,14 +81,12 @@ public void SetTransceiverCodec(MediaType type, TransceiverCodec codec) throw new InvalidOperationException("MediaSource is not attached yet. Call AddSource() first."); } - WebRtc.ValidateWebRTCState(WebRTCState.Idle); - NativeWebRTC.SetTransceiverCodec(WebRtc.Handle, SourceId.Value, type, codec). ThrowIfFailed("Failed to set transceiver codec"); } /// - /// Retrieves the supported transceiver codecs. + /// Retrieves the supported transceiver codecs for receiving media stream. /// /// The media type. /// The supported transceiver codecs. diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketBufferStatusChangedEventArgs.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketBufferStatusChangedEventArgs.cs index 2f293e478b7..50a93a2cf95 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketBufferStatusChangedEventArgs.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketBufferStatusChangedEventArgs.cs @@ -31,14 +31,14 @@ internal MediaPacketBufferStatusChangedEventArgs(uint sourceId, MediaPacketBuffe } /// - /// Gets the source ID. + /// Gets the source ID of media packet. /// /// The source ID. /// 9 public uint SourceId { get; } /// - /// Gets the media packet buffer status. + /// Gets the media packet buffer status that indicates underrun or overflow. /// /// The media packet buffer status. /// 9 diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketSource.cs index 09fea0058ed..8f31f186b2c 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketSource.cs @@ -23,7 +23,7 @@ namespace Tizen.Multimedia.Remoting { /// - /// Represents a media packet source. + /// Represents a media source that wraps media data into MediaPacket. /// /// /// diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketSourceConfiguration.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketSourceConfiguration.cs index 979e9caa346..3e0edbded23 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketSourceConfiguration.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaPacketSourceConfiguration.cs @@ -20,7 +20,7 @@ namespace Tizen.Multimedia.Remoting { /// - /// Provides means to configure properties and handle events for . + /// Provides means to configure properties and handle event for . /// /// /// 9 @@ -35,7 +35,7 @@ internal MediaPacketSourceConfiguration(MediaPacketSource owner) } /// - /// Occurs when the buffer underruns or overflows. + /// Occurs when the status of buffer is underruns or overflows. /// /// The event handler will be executed on an internal thread. /// 9 @@ -76,8 +76,12 @@ private void RegisterBufferStatusChangedCallback() private void UnregisterBufferStatusChangedCallback() { + Log.Info(WebRTCLog.Tag, "Enter"); + NativeWebRTC.UnsetBufferStateChangedCb(Handle, SourceId). ThrowIfFailed("Failed to unset buffer status changed callback."); + + Log.Info(WebRTCLog.Tag, "Leave"); } } } \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaScreenSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaScreenSource.cs index 391a13a5aa3..ad51dfb8fe0 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaScreenSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaScreenSource.cs @@ -21,7 +21,7 @@ namespace Tizen.Multimedia.Remoting { /// - /// Represents a screen source. + /// Represents a media source to share screen data. /// /// /// MediaScreenSource is not allowed to be used by third-party applications due to the security reasons. (Since Tizen 7.0) diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaSource.cs index 8798eb2b012..8be7c1f3c1a 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaSource.cs @@ -552,6 +552,58 @@ public int EncoderBitrate } } + /// + /// Sets the RTP payload type of given . + /// + /// + /// should be greater than or equal to 96 and less than or equal to 127. + /// + /// The transceiver codec. + /// The RTP payload type. + /// MediaSource is not attached yet. + /// The WebRTC has already been disposed. + /// + /// is less than 96 or greater than 127. + /// + /// + /// 12 + public void SetPayloadType(TransceiverCodec codec, uint payloadType) + { + if (!SourceId.HasValue) + { + throw new InvalidOperationException("MediaSource is not attached yet. Call AddSource() first."); + } + if (payloadType < 96 || payloadType > 127) + { + throw new ArgumentOutOfRangeException(nameof(payloadType), payloadType, "Valid range : 96 <= payloadType <= 127"); + } + + NativeWebRTC.SetPaylodType(WebRtc.Handle, SourceId.Value, codec, payloadType). + ThrowIfFailed("Failed to set payload type"); + } + + /// + /// Gets the RTP payload type of given . + /// + /// The transceiver codec. + /// The RTP payload type. + /// MediaSource is not attached yet. + /// The WebRTC has already been disposed. + /// + /// 12 + public uint GetPayloadType(TransceiverCodec codec) + { + if (!SourceId.HasValue) + { + throw new InvalidOperationException("MediaSource is not attached yet. Call AddSource() first."); + } + + NativeWebRTC.GetPaylodType(WebRtc.Handle, SourceId.Value, codec, out uint payloadType). + ThrowIfFailed("Failed to get payload type"); + + return payloadType; + } + /// /// Enables the audio loopback. The local audio will be played with . /// diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaStreamTrack.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaStreamTrack.cs index be62bebf236..fcd12909121 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaStreamTrack.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaStreamTrack.cs @@ -21,7 +21,7 @@ namespace Tizen.Multimedia.Remoting { /// - /// Provides the ability to control audio/video track. + /// Provides the ability to control audio or video track from peer. /// /// 9 public sealed class MediaStreamTrack : IDisplayable @@ -38,7 +38,7 @@ internal MediaStreamTrack(WebRTC webRtc, MediaType type, uint trackId) } /// - /// Gets the the of media stream track. + /// Gets the type of media stream track. /// /// /// 9 @@ -55,7 +55,7 @@ private void ReplaceDisplay(Display newDisplay) } /// - /// Gets or sets the display to show remote video. + /// Gets or sets the display to show video data from peer. /// /// A that specifies the display. /// diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/MediaTestSource.cs b/src/Tizen.Multimedia.Remoting/WebRTC/MediaTestSource.cs index d3226b83c7d..a7c514770db 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/MediaTestSource.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/MediaTestSource.cs @@ -21,7 +21,7 @@ namespace Tizen.Multimedia.Remoting { /// - /// Represents an audio or a video test source. + /// Represents a media source that makes test audio or video stream. /// /// /// diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTC.cs b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTC.cs index 7564e86e78c..a6d3ce2857e 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTC.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTC.cs @@ -129,7 +129,7 @@ internal void ValidateNotDisposed() #endregion /// - /// Starts the WebRTC. + /// Starts the WebRTC with specific media source. /// /// /// The WebRTC must be in the state.
@@ -150,7 +150,7 @@ public void Start() } /// - /// Starts the WebRTC asynchronously. + /// Starts the WebRTC asynchronously with specific media source. /// /// /// The WebRTC must be in the state.
@@ -164,6 +164,8 @@ public void Start() /// 9 public async Task StartAsync() { + Log.Info(WebRTCLog.Tag, "Enter"); + ValidateWebRTCState(WebRTCState.Idle); var tcs = new TaskCompletionSource(); @@ -203,6 +205,8 @@ public async Task StartAsync() StateChanged -= stateChangedEventHandler; ErrorOccurred -= errorEventHandler; } + + Log.Info(WebRTCLog.Tag, "Leave"); } /// @@ -224,9 +228,11 @@ public void Stop() } /// - /// Creates SDP offer asynchronously to start a new WebRTC connection to a remote peer. + /// Creates SDP(Session Description Protocol) offer asynchronously to start a new WebRTC connection to a remote peer. /// - /// The WebRTC must be in the + /// + /// The WebRTC must be in the or (Since API Level 12) + /// /// The SDP offer. /// The WebRTC is not in the valid state. /// The WebRTC has already been disposed. @@ -234,7 +240,9 @@ public void Stop() /// 9 public async Task CreateOfferAsync() { - ValidateWebRTCState(WebRTCState.Negotiating); + Log.Info(WebRTCLog.Tag, "Enter"); + + ValidateWebRTCState(WebRTCState.Negotiating, WebRTCState.Playing); var tcsSdpCreated = new TaskCompletionSource(); @@ -253,13 +261,17 @@ public async Task CreateOfferAsync() await Task.Yield(); } + Log.Info(WebRTCLog.Tag, "Leave"); + return offer; } /// - /// Creates SDP answer asynchronously with option to an offer received from a remote peer. + /// Creates SDP(Session Description Protocol) answer asynchronously with option to an offer received from a remote peer. /// - /// The WebRTC must be in the + /// + /// The WebRTC must be in the or (Since API Level 12) + /// /// The SDP answer. /// The WebRTC is not in the valid state. /// The WebRTC has already been disposed. @@ -267,7 +279,9 @@ public async Task CreateOfferAsync() /// 9 public async Task CreateAnswerAsync() { - ValidateWebRTCState(WebRTCState.Negotiating); + Log.Info(WebRTCLog.Tag, "Enter"); + + ValidateWebRTCState(WebRTCState.Negotiating, WebRTCState.Playing); var tcsSdpCreated = new TaskCompletionSource(); @@ -286,13 +300,17 @@ public async Task CreateAnswerAsync() await Task.Yield(); } + Log.Info(WebRTCLog.Tag, "Leave"); + return answer; } /// /// Sets the session description for a local peer. /// - /// The WebRTC must be in the . + /// + /// The WebRTC must be in the or (Since API Level 12) + /// /// The local session description. /// The description is empty string. /// The description is null. @@ -300,20 +318,47 @@ public async Task CreateAnswerAsync() /// The WebRTC has already been disposed. /// /// + /// /// 9 public void SetLocalDescription(string description) { - ValidateWebRTCState(WebRTCState.Negotiating); + ValidateWebRTCState(WebRTCState.Negotiating, WebRTCState.Playing); ValidationUtil.ValidateIsNullOrEmpty(description, nameof(description)); - NativeWebRTC.SetLocalDescription(Handle, description).ThrowIfFailed("Failed to set description."); + NativeWebRTC.SetLocalDescription(Handle, description).ThrowIfFailed("Failed to set local description."); } /// - /// Sets the session description of the remote peer's current offer or answer. + /// Gets the session description for a local peer. /// - /// The WebRTC must be in the . + /// The local session description string + /// The WebRTC has already been disposed. + /// + /// 12 + public string GetLocalDescription() + { + ValidateNotDisposed(); + + IntPtr description = IntPtr.Zero; + try + { + NativeWebRTC.GetLocalDescription(Handle, out description).ThrowIfFailed("Failed to get local description."); + + return Marshal.PtrToStringAnsi(description); + } + finally + { + Marshal.FreeHGlobal(description); + } + } + + /// + /// Sets the offer or answer session description from the current remote peer. + /// + /// + /// The WebRTC must be in the or (Since API Level 12) + /// /// The remote session description. /// The description is empty string. /// The description is null. @@ -321,14 +366,39 @@ public void SetLocalDescription(string description) /// The WebRTC has already been disposed. /// /// + /// /// 9 public void SetRemoteDescription(string description) { - ValidateWebRTCState(WebRTCState.Negotiating); + ValidateWebRTCState(WebRTCState.Negotiating, WebRTCState.Playing); ValidationUtil.ValidateIsNullOrEmpty(description, nameof(description)); - NativeWebRTC.SetRemoteDescription(Handle, description).ThrowIfFailed("Failed to set description."); + NativeWebRTC.SetRemoteDescription(Handle, description).ThrowIfFailed("Failed to set remote description."); + } + + /// + /// Gets the offer or answer session description from the current remote peer. + /// + /// The remote session description string + /// The WebRTC has already been disposed. + /// + /// 12 + public string GetRemoteDescription() + { + ValidateNotDisposed(); + + IntPtr description = IntPtr.Zero; + try + { + NativeWebRTC.GetRemoteDescription(Handle, out description).ThrowIfFailed("Failed to get remote description."); + + return Marshal.PtrToStringAnsi(description); + } + finally + { + Marshal.FreeHGlobal(description); + } } /// @@ -375,10 +445,10 @@ public void AddIceCandidates(IEnumerable iceCandidates) } /// - /// Adds media source. + /// Adds media source to the current WebRTC. /// /// - /// The WebRTC must be in the .
+ /// This method does not throw state exception anymore(Since API Level 12). It can be called in any state.
/// Each MediaSource requires different feature or privilege.
/// needs camera feature and privilege.
/// needs microphone feature and recorder privilege.
@@ -393,7 +463,7 @@ public void AddIceCandidates(IEnumerable iceCandidates) /// http://tizen.org/privilege/recorder /// The media source is null. /// - /// The WebRTC is not in the valid state.
+ /// An internal error occurs.
/// - or -
/// All or one of was already detached. ///
@@ -415,18 +485,16 @@ public void AddSource(MediaSource source) throw new ArgumentNullException(nameof(source), "source is null"); } - ValidateWebRTCState(WebRTCState.Idle); - source?.AttachTo(this); _source.Add(source); } /// - /// Adds media sources. + /// Adds media sources from the current WebRTC. /// /// - /// The WebRTC must be in the .
+ /// This method does not throw state exception anymore(Since API Level 12). It can be called in any state.
/// Each MediaSource requires different feature or privilege.
/// needs camera feature and privilege.
/// needs microphone feature and recorder privilege.
@@ -441,7 +509,7 @@ public void AddSource(MediaSource source) /// http://tizen.org/privilege/recorder /// The media source is null. /// - /// The WebRTC is not in the valid state.
+ /// An internal error occurs.
/// - or -
/// All or one of was already detached. ///
@@ -470,15 +538,15 @@ public void AddSources(params MediaSource[] sources) } /// - /// Removes media source. + /// Removes media source from the current WebRTC. /// /// - /// The WebRTC must be in the .
+ /// This method does not throw state exception anymore(Since API Level 12). It can be called in any state.
/// If user want to use removed MediaSource again, user should create new instance for it. ///
/// The media source to remove. /// The media source is null. - /// The WebRTC is not in the valid state. + /// An internal error occurs. /// The WebRTC has already been disposed. /// /// @@ -495,8 +563,6 @@ public void RemoveSource(MediaSource source) throw new ArgumentNullException(nameof(source), "source is null"); } - ValidateWebRTCState(WebRTCState.Idle); - source?.DetachFrom(this); _source.Remove(source); @@ -505,15 +571,15 @@ public void RemoveSource(MediaSource source) } /// - /// Removes media sources. + /// Removes media sources from the current WebRTC. /// /// - /// The WebRTC must be in the .
+ /// This method does not throw state exception anymore(Since API Level 12). It can be called in any state.
/// If user want to use removed MediaSource again, user should create new instance for it. ///
/// The media source to remove. /// The media source is null. - /// The WebRTC is not in the valid state. + /// An internal error occurs. /// The WebRTC has already been disposed. /// /// @@ -532,7 +598,7 @@ public void RemoveSources(params MediaSource[] sources) } /// - /// Sets a turn server. + /// Sets a turn server for signalling with remote peer which cannot be connected directly. /// /// The is null. /// The WebRTC has already been disposed. @@ -551,7 +617,7 @@ public void SetTurnServer(string turnServer) } /// - /// Sets turn servers. + /// Sets turn servers for signalling with remote peer which cannot be connected directly. /// /// The one of is null. /// The WebRTC has already been disposed. @@ -601,7 +667,9 @@ public ReadOnlyCollection GetTurnServer() /// /// Retrieves the current statistics information. /// - /// The WebRTC must be in the + /// + /// The WebRTC must be in the (Since API Level 12) or + /// /// The WebRTC statistics informations. /// The category of statistics to get. /// The WebRTC has already been disposed. @@ -609,7 +677,7 @@ public ReadOnlyCollection GetTurnServer() /// 10 public ReadOnlyCollection GetStatistics(WebRTCStatisticsCategory category) { - ValidateWebRTCState(WebRTCState.Playing); + ValidateWebRTCState(WebRTCState.Negotiating, WebRTCState.Playing); var stats = new List(); Exception caught = null; diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannel.Events.cs b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannel.Events.cs index b998669d962..d6cb3c03155 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannel.Events.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannel.Events.cs @@ -136,13 +136,18 @@ public event EventHandler ErrorOccurred /// /// Occurs when the buffered data amount is lower than .
- /// If is not set, this event will not be raised. + /// If is not set, this event will not be registered. ///
/// 10 public event EventHandler BufferedAmountLow { add { + if (!_bufferThreshold.HasValue) + { + return; + } + if (_bufferedAmountLowThresholdOccurred == null) { RegisterDataChannelBufferedAmountLowThresholdCallback(); @@ -151,6 +156,11 @@ public event EventHandler BufferedAmountLow } remove { + if (!_bufferThreshold.HasValue) + { + return; + } + _bufferedAmountLowThresholdOccurred -= value; if (_bufferedAmountLowThresholdOccurred == null) { @@ -229,16 +239,12 @@ private void UnregisterDataChannelErrorOccurredCallback() private void RegisterDataChannelBufferedAmountLowThresholdCallback() { - if (_webRtcDataChannelBufferedAmountLowThresholdCallback == null) + _webRtcDataChannelBufferedAmountLowThresholdCallback = (dataChannelHanel, _) => { - _webRtcDataChannelBufferedAmountLowThresholdCallback = (dataChannelHanel, _) => - { - _bufferedAmountLowThresholdOccurred?.Invoke(this, new EventArgs()); - }; - } + _bufferedAmountLowThresholdOccurred?.Invoke(this, new EventArgs()); + }; - NativeDataChannel.SetBufferedAmountLowThresholdCb(_handle, _bufferThreshold.Value, - _webRtcDataChannelBufferedAmountLowThresholdCallback). + NativeDataChannel.SetBufferedAmountLowThresholdCb(_handle, _bufferThreshold.Value, _webRtcDataChannelBufferedAmountLowThresholdCallback). ThrowIfFailed("Failed to set buffered amount low threshold callback."); } diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannel.cs b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannel.cs index fcb1dc7de8e..21a77d49ea9 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannel.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannel.cs @@ -161,8 +161,6 @@ public uint BufferedAmountLowThreshold ValidateNotDisposed(); _bufferThreshold = value; - - RegisterDataChannelBufferedAmountLowThresholdCallback(); } } diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannelErrorOccurredEventArgs.cs b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannelErrorOccurredEventArgs.cs index ddae8b4d3e0..8963ea7c93f 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannelErrorOccurredEventArgs.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCDataChannelErrorOccurredEventArgs.cs @@ -30,7 +30,7 @@ internal WebRTCDataChannelErrorOccurredEventArgs(WebRTCError error) } /// - /// Gets the error. + /// Gets the error of data channel. /// /// The error. /// 9 diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCEnums.cs b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCEnums.cs index 24796c35b57..61cafb38f2a 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCEnums.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCEnums.cs @@ -20,7 +20,7 @@ namespace Tizen.Multimedia.Remoting { /// - /// Specifies errors. + /// Specifies WebRTC errors. /// /// /// @@ -361,7 +361,7 @@ public enum IceTransportPolicy } /// - /// Specifies the display type. + /// Specifies the display mode that indicates the way of displaying video data. /// /// 9 public enum WebRTCDisplayMode @@ -383,7 +383,8 @@ public enum WebRTCDisplayMode } /// - /// Specifies the bundle policy. + /// Specifies the bundle policy that affects which media tracks are negotiated if the remote endpoint is not bundle-aware, + /// and what ICE candidates are gathered. /// /// /// The details of bundle policy enum is described in https://www.w3.org/TR/webrtc/#rtcbundlepolicy-enum. diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCFrameEncodedEventArgs.cs b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCFrameEncodedEventArgs.cs index 455009c5154..aea9583b980 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCFrameEncodedEventArgs.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCFrameEncodedEventArgs.cs @@ -31,7 +31,7 @@ internal WebRTCFrameEncodedEventArgs(MediaStreamTrack track, MediaPacket packet) } /// - /// Gets the track information. + /// Gets the information of media stream track from remote peer. /// /// The media type. /// 9 diff --git a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCTrackAddedEventArgs.cs b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCTrackAddedEventArgs.cs index e95c70eb113..dce812cca78 100755 --- a/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCTrackAddedEventArgs.cs +++ b/src/Tizen.Multimedia.Remoting/WebRTC/WebRTCTrackAddedEventArgs.cs @@ -30,7 +30,7 @@ internal WebRTCTrackAddedEventArgs(MediaStreamTrack track) } /// - /// Gets the media type. + /// Gets the media stream track from reemote peer. /// /// The media type. /// 9 diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.Libraries.cs index 3a22309b08f..647eac18612 100644 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.Libraries.cs +++ b/src/Tizen.Multimedia.Vision/Interop/Interop.Libraries.cs @@ -20,12 +20,17 @@ internal static partial class Libraries { public const string MediaVisionCommon = "libmv_common.so"; public const string MediaVisionFace = "libmv_face.so"; - public const string MediaVisionInference = "libmv_inference.so"; public const string MediaVisionImage = "libmv_image.so"; public const string MediaVisionSurveillance = "libmv_surveillance.so"; public const string MediaVisionBarcodeDetector = "libmv_barcode_detector.so"; public const string MediaVisionBarcodeGenerator = "libmv_barcode_generator.so"; public const string MediaVisionRoiTracker = "libmv_roi_tracker.so"; public const string MediaVisionFaceRecognition = "libmv_face_recognition.so"; // It's based on machine learning + public const string MediaVisionInference = "libmv_inference.so"; + public const string MediaVisionInferenceImageClassification = "libmv_image_classification.so"; // Inference image classification + public const string MediaVisionInferenceObjectDetection = "libmv_object_detection.so"; + public const string MediaVisionInferenceFaceDetection = MediaVisionInferenceObjectDetection; // Inference object detection and face detection + public const string MediaVisionInferenceFacialLandmarkDetection = "libmv_landmark_detection.so"; + public const string MediaVisionInferencePoseLandmarkDetection = "libmv_landmark_detection.so"; // Inference facial landmark detection and pose landmark detection } } diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Face.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Face.cs index 5babae13e62..be33d6b2474 100755 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Face.cs +++ b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Face.cs @@ -35,49 +35,49 @@ internal static partial class Face { [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_detect")] internal static extern MediaVisionError Detect(IntPtr source, IntPtr engineCfg, - DetectedCallback detectedCb, IntPtr userData = default(IntPtr)); + DetectedCallback detectedCb, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognize")] internal static extern MediaVisionError Recognize(IntPtr source, IntPtr recognitionModel, IntPtr engineCfg, - IntPtr faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); + IntPtr faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognize")] internal static extern MediaVisionError Recognize(IntPtr source, IntPtr recognitionModel, IntPtr engineCfg, - ref Rectangle faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); + ref Rectangle faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_track")] internal static extern MediaVisionError Track(IntPtr source, IntPtr trackingModel, IntPtr engineCfg, - TrackedCallback trackedCb, bool doLearn, IntPtr userData = default(IntPtr)); + TrackedCallback trackedCb, bool doLearn, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_eye_condition_recognize")] internal static extern MediaVisionError RecognizeEyeCondition(IntPtr source, IntPtr engineCfg, - Rectangle faceLocation, EyeConditionRecognizedCallback eyeConditionRecognizedCb, IntPtr userData = default(IntPtr)); + Rectangle faceLocation, EyeConditionRecognizedCallback eyeConditionRecognizedCb, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_facial_expression_recognize")] internal static extern MediaVisionError RecognizeFacialExpression(IntPtr source, IntPtr engineCfg, - Rectangle faceLocation, MvFaceFacialExpressionRecognizedCallback expressionRecognizedCb, + Rectangle faceLocation, MvFaceFacialExpressionRecognizedCallback expressionRecognizedCb, // Deprecated in API 12 IntPtr userData = default(IntPtr)); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void DetectedCallback(IntPtr source, IntPtr engineCfg, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] Rectangle[] facesLocations, - int numberOfFaces, IntPtr userData); + int numberOfFaces, IntPtr userData); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void RecognizedCallback(IntPtr source, IntPtr recognitionModel, - IntPtr engineCfg, IntPtr faceLocation, IntPtr faceLabel, double confidence, IntPtr userData); + IntPtr engineCfg, IntPtr faceLocation, IntPtr faceLabel, double confidence, IntPtr userData); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void TrackedCallback(IntPtr source, IntPtr trackingModel, IntPtr engineCfg, - IntPtr location, double confidence, IntPtr userData); + IntPtr location, double confidence, IntPtr userData); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void EyeConditionRecognizedCallback(IntPtr source, IntPtr engineCfg, - Rectangle faceLocation, EyeCondition eyeCondition, IntPtr userData); + Rectangle faceLocation, EyeCondition eyeCondition, IntPtr userData); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void MvFaceFacialExpressionRecognizedCallback(IntPtr source, - IntPtr engineCfg, Rectangle faceLocation, FacialExpression facialExpression, IntPtr userData); + IntPtr engineCfg, Rectangle faceLocation, FacialExpression facialExpression, IntPtr userData); // Deprecated in API 12 } /// @@ -86,39 +86,39 @@ internal delegate void MvFaceFacialExpressionRecognizedCallback(IntPtr source, internal static partial class FaceRecognitionModel { [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_create")] - internal static extern MediaVisionError Create(out IntPtr handle); + internal static extern MediaVisionError Create(out IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_destroy")] - internal static extern int Destroy(IntPtr handle); + internal static extern int Destroy(IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dst); + internal static extern int Clone(IntPtr src, out IntPtr dst); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr handle); + internal static extern MediaVisionError Save(string fileName, IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr handle); + internal static extern MediaVisionError Load(string fileName, out IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_add")] internal static extern MediaVisionError Add(IntPtr source, IntPtr recognitionModel, - ref Rectangle exampleLocation, int faceLabel); + ref Rectangle exampleLocation, int faceLabel); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_add")] internal static extern MediaVisionError Add(IntPtr source, IntPtr recognitionModel, - IntPtr exampleLocation, int faceLabel); + IntPtr exampleLocation, int faceLabel); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_reset")] - internal static extern MediaVisionError Reset(IntPtr recognitionModel, IntPtr faceLabel = default(IntPtr)); + internal static extern MediaVisionError Reset(IntPtr recognitionModel, IntPtr faceLabel = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_reset")] - internal static extern MediaVisionError Remove(IntPtr recognitionModel, ref int faceLabel); + internal static extern MediaVisionError Remove(IntPtr recognitionModel, ref int faceLabel); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_learn")] - internal static extern MediaVisionError Learn(IntPtr engineCfg, IntPtr handle); + internal static extern MediaVisionError Learn(IntPtr engineCfg, IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_recognition_model_query_labels")] - internal static extern MediaVisionError QueryLabels(IntPtr handle, out IntPtr labels, out uint numberOfLabels); + internal static extern MediaVisionError QueryLabels(IntPtr handle, out IntPtr labels, out uint numberOfLabels); // Deprecated in API 12 } /// @@ -127,27 +127,27 @@ internal static extern MediaVisionError Add(IntPtr source, IntPtr recognitionMod internal static partial class FaceTrackingModel { [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_tracking_model_create")] - internal static extern MediaVisionError Create(out IntPtr handle); + internal static extern MediaVisionError Create(out IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_tracking_model_destroy")] - internal static extern int Destroy(IntPtr handle); + internal static extern int Destroy(IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_tracking_model_prepare")] internal static extern MediaVisionError Prepare(IntPtr trackingModel, IntPtr engineCfg, - IntPtr source, ref Quadrangle location); + IntPtr source, ref Quadrangle location); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_tracking_model_prepare")] internal static extern MediaVisionError Prepare(IntPtr trackingModel, IntPtr engineCfg, - IntPtr source, IntPtr location); + IntPtr source, IntPtr location); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_tracking_model_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dst); + internal static extern int Clone(IntPtr src, out IntPtr dst); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_tracking_model_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr handle); + internal static extern MediaVisionError Save(string fileName, IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionFace, EntryPoint = "mv_face_tracking_model_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr handle); + internal static extern MediaVisionError Load(string fileName, out IntPtr handle); // Deprecated in API 12 } /// diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Image.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Image.cs index 36bebd2ade2..e7de6c780d9 100755 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Image.cs +++ b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Image.cs @@ -35,50 +35,50 @@ internal static partial class Image { [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_recognize")] internal static extern MediaVisionError Recognize(IntPtr source, IntPtr[] imageObjects, - int numberOfObjects, IntPtr engineCfg, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); + int numberOfObjects, IntPtr engineCfg, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_track")] internal static extern MediaVisionError Track(IntPtr source, IntPtr imageTrackingModel, - IntPtr engineCfg, TrackedCallback trackedCb, IntPtr userData = default(IntPtr)); + IntPtr engineCfg, TrackedCallback trackedCb, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_create")] - internal static extern MediaVisionError Create(out IntPtr handle); + internal static extern MediaVisionError Create(out IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_destroy")] - internal static extern int Destroy(IntPtr handle); + internal static extern int Destroy(IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_fill")] - internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, ref Rectangle location); + internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, ref Rectangle location); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_fill")] - internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, IntPtr location); + internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, IntPtr location); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_get_recognition_rate")] - internal static extern MediaVisionError GetRecognitionRate(IntPtr handle, out double recognitionRate); + internal static extern MediaVisionError GetRecognitionRate(IntPtr handle, out double recognitionRate); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_set_label")] - internal static extern MediaVisionError SetLabel(IntPtr handle, int label); + internal static extern MediaVisionError SetLabel(IntPtr handle, int label); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_get_label")] - internal static extern MediaVisionError GetLabel(IntPtr handle, out int label); + internal static extern MediaVisionError GetLabel(IntPtr handle, out int label); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dst); + internal static extern int Clone(IntPtr src, out IntPtr dst); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr handle); + internal static extern MediaVisionError Save(string fileName, IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_object_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr handle); + internal static extern MediaVisionError Load(string fileName, out IntPtr handle); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void RecognizedCallback(IntPtr source, IntPtr engineCfg, IntPtr imageObjects, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] - IntPtr[] locations, uint numberOfObjects, IntPtr userData); + IntPtr[] locations, uint numberOfObjects, IntPtr userData); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void TrackedCallback(IntPtr source, IntPtr imageTrackingModel, - IntPtr engineCfg, IntPtr location, IntPtr userData); + IntPtr engineCfg, IntPtr location, IntPtr userData); // Deprecated in API 12 } /// @@ -87,25 +87,25 @@ internal delegate void TrackedCallback(IntPtr source, IntPtr imageTrackingModel, internal static partial class ImageTrackingModel { [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_tracking_model_create")] - internal static extern MediaVisionError Create(out IntPtr imageTrackingModel); + internal static extern MediaVisionError Create(out IntPtr imageTrackingModel); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_tracking_model_set_target")] - internal static extern MediaVisionError SetTarget(IntPtr handle, IntPtr imageTrackingModel); + internal static extern MediaVisionError SetTarget(IntPtr handle, IntPtr imageTrackingModel); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_tracking_model_destroy")] - internal static extern int Destroy(IntPtr imageTrackingModel); + internal static extern int Destroy(IntPtr imageTrackingModel); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_tracking_model_refresh")] - internal static extern MediaVisionError Refresh(IntPtr imageTrackingModel, IntPtr engineCfg); + internal static extern MediaVisionError Refresh(IntPtr imageTrackingModel, IntPtr engineCfg); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_tracking_model_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dest); + internal static extern int Clone(IntPtr src, out IntPtr dest); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_tracking_model_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr imageTrackingModel); + internal static extern MediaVisionError Save(string fileName, IntPtr imageTrackingModel); // Deprecated in API 12 [DllImport(Libraries.MediaVisionImage, EntryPoint = "mv_image_tracking_model_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr imageTrackingModel); + internal static extern MediaVisionError Load(string fileName, out IntPtr imageTrackingModel); // Deprecated in API 12 } } } diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Inference.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Inference.cs index 391afd929b5..dbd93354e86 100644 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Inference.cs +++ b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Inference.cs @@ -37,19 +37,19 @@ internal static partial class Inference internal delegate void FaceDetectedCallback(IntPtr source, int numberOfFaces, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] confidences, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] Rectangle[] location, - IntPtr userData = default(IntPtr)); + IntPtr userData = default(IntPtr)); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void FacialLandmarkDetectedCallback(IntPtr source, int numberOfLandmarks, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] Point[] locations, - IntPtr userData = default(IntPtr)); + IntPtr userData = default(IntPtr)); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImageClassifedCallback(IntPtr source, int numberOfClasses, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] int[] indices, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] string[] names, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] confidences, - IntPtr userData = default(IntPtr)); + IntPtr userData = default(IntPtr)); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ObjectDetectedCallback(IntPtr source, int numberOfObjects, @@ -57,60 +57,200 @@ internal delegate void ObjectDetectedCallback(IntPtr source, int numberOfObjects [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] string[] names, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] float[] confidences, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] Rectangle[] location, - IntPtr userData = default(IntPtr)); + IntPtr userData = default(IntPtr)); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate bool SupportedBackendCallback(string backend, bool isSupported, - IntPtr userData = default(IntPtr)); + IntPtr userData = default(IntPtr)); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void PoseLandmarkDetectedCallback(IntPtr source, IntPtr poses, - IntPtr userData = default(IntPtr)); + IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_create")] - internal static extern MediaVisionError Create(out IntPtr handle); + internal static extern MediaVisionError Create(out IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_destroy")] - internal static extern MediaVisionError Destroy(IntPtr handle); + internal static extern MediaVisionError Destroy(IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_configure")] - internal static extern MediaVisionError Configure(IntPtr handle, IntPtr engineConfig); + internal static extern MediaVisionError Configure(IntPtr handle, IntPtr engineConfig); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_prepare")] - internal static extern MediaVisionError Load(IntPtr handle); + internal static extern MediaVisionError Load(IntPtr handle); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_foreach_supported_engine")] internal static extern MediaVisionError ForeachSupportedBackend(IntPtr handle, - SupportedBackendCallback callback, IntPtr userData = default(IntPtr)); + SupportedBackendCallback callback, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_image_classify")] internal static extern MediaVisionError ClassifyImage(IntPtr source, IntPtr inference, - IntPtr roi, ImageClassifedCallback callback, IntPtr userData = default(IntPtr)); + IntPtr roi, ImageClassifedCallback callback, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_object_detect")] internal static extern MediaVisionError DetectObject(IntPtr source, IntPtr inference, - ObjectDetectedCallback callback, IntPtr userData = default(IntPtr)); + ObjectDetectedCallback callback, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_face_detect")] internal static extern MediaVisionError DetectFace(IntPtr source, IntPtr inference, - FaceDetectedCallback callback, IntPtr userData = default(IntPtr)); + FaceDetectedCallback callback, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_facial_landmark_detect")] internal static extern MediaVisionError DetectFacialLandmark(IntPtr source, IntPtr inference, - IntPtr roi, FacialLandmarkDetectedCallback callback, IntPtr userData = default(IntPtr)); + IntPtr roi, FacialLandmarkDetectedCallback callback, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_pose_get_number_of_poses")] - internal static extern MediaVisionError GetPoseNum(IntPtr result, out int numPose); + internal static extern MediaVisionError GetPoseNum(IntPtr result, out int numPose); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_pose_get_number_of_landmarks")] - internal static extern MediaVisionError GetLandmarkNum(IntPtr result, out int numLandmark); + internal static extern MediaVisionError GetLandmarkNum(IntPtr result, out int numLandmark); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_pose_get_landmark")] - internal static extern MediaVisionError GetLandmark(IntPtr result, int index, int part, out Point location, out float score); + internal static extern MediaVisionError GetLandmark(IntPtr result, int index, int part, out Point location, out float score); // Deprecated in API 12 [DllImport(Libraries.MediaVisionInference, EntryPoint = "mv_inference_pose_landmark_detect")] internal static extern MediaVisionError DetectPoseLandmark(IntPtr source, IntPtr inference, - IntPtr roi, PoseLandmarkDetectedCallback callback, IntPtr userData = default(IntPtr)); + IntPtr roi, PoseLandmarkDetectedCallback callback, IntPtr userData = default(IntPtr)); // Deprecated in API 12 + } + + internal static partial class InferenceImageClassification + { + // Newly added inferernce APIs + [DllImport(Libraries.MediaVisionInferenceImageClassification, EntryPoint = "mv_image_classification_create")] + internal static extern MediaVisionError Create(out IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceImageClassification, EntryPoint = "mv_image_classification_destroy")] + internal static extern MediaVisionError Destroy(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceImageClassification, EntryPoint = "mv_image_classification_configure")] + internal static extern MediaVisionError Configure(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceImageClassification, EntryPoint = "mv_image_classification_prepare")] + internal static extern MediaVisionError Prepare(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceImageClassification, EntryPoint = "mv_image_classification_inference")] + internal static extern MediaVisionError Inference(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferenceImageClassification, EntryPoint = "mv_image_classification_inference_async")] + internal static extern MediaVisionError InferenceAsync(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferenceImageClassification, EntryPoint = "mv_image_classification_get_result_count")] + internal static extern MediaVisionError GetResultCount(IntPtr handle, out ulong requestOrder, out uint count); + + [DllImport(Libraries.MediaVisionInferenceImageClassification, EntryPoint = "mv_image_classification_get_label")] + internal static extern MediaVisionError GetLabels(IntPtr handle, uint index, out IntPtr label); + } + + internal static partial class InferenceFaceDetection + { + // Newly added inferernce APIs + [DllImport(Libraries.MediaVisionInferenceFaceDetection, EntryPoint = "mv_face_detection_create")] + internal static extern MediaVisionError Create(out IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceFaceDetection, EntryPoint = "mv_face_detection_destroy")] + internal static extern MediaVisionError Destroy(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceFaceDetection, EntryPoint = "mv_face_detection_configure")] + internal static extern MediaVisionError Configure(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceFaceDetection, EntryPoint = "mv_face_detection_prepare")] + internal static extern MediaVisionError Prepare(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceFaceDetection, EntryPoint = "mv_face_detection_inference")] + internal static extern MediaVisionError Inference(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferenceFaceDetection, EntryPoint = "mv_face_detection_inference_async")] + internal static extern MediaVisionError InferenceAsync(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferenceFaceDetection, EntryPoint = "mv_face_detection_get_result_count")] + internal static extern MediaVisionError GetResultCount(IntPtr handle, out ulong requestId, out uint count); + + [DllImport(Libraries.MediaVisionInferenceFaceDetection, EntryPoint = "mv_face_detection_get_bound_box")] + internal static extern MediaVisionError GetBoundingBoxes(IntPtr handle, uint index, out int left, out int top, out int right, out int bottom); + } + + internal static partial class InferenceObjectDetection + { + // Newly added inferernce APIs + [DllImport(Libraries.MediaVisionInferenceObjectDetection, EntryPoint = "mv_object_detection_create")] + internal static extern MediaVisionError Create(out IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceObjectDetection, EntryPoint = "mv_object_detection_destroy")] + internal static extern MediaVisionError Destroy(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceObjectDetection, EntryPoint = "mv_object_detection_configure")] + internal static extern MediaVisionError Configure(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceObjectDetection, EntryPoint = "mv_object_detection_prepare")] + internal static extern MediaVisionError Prepare(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceObjectDetection, EntryPoint = "mv_object_detection_inference")] + internal static extern MediaVisionError Inference(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferenceObjectDetection, EntryPoint = "mv_object_detection_inference_async")] + internal static extern MediaVisionError InferenceAsync(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferenceObjectDetection, EntryPoint = "mv_object_detection_get_result_count")] + internal static extern MediaVisionError GetResultCount(IntPtr handle, out ulong requestId, out uint count); + + [DllImport(Libraries.MediaVisionInferenceObjectDetection, EntryPoint = "mv_object_detection_get_bound_box")] + internal static extern MediaVisionError GetBoundingBoxes(IntPtr handle, uint index, out int left, out int top, out int right, out int bottom); + } + + internal static partial class InferenceFacialLandmarkDetection + { + // Newly added inferernce APIs + [DllImport(Libraries.MediaVisionInferenceFacialLandmarkDetection, EntryPoint = "mv_facial_landmark_create")] + internal static extern MediaVisionError Create(out IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceFacialLandmarkDetection, EntryPoint = "mv_facial_landmark_destroy")] + internal static extern MediaVisionError Destroy(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceFacialLandmarkDetection, EntryPoint = "mv_facial_landmark_configure")] + internal static extern MediaVisionError Configure(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceFacialLandmarkDetection, EntryPoint = "mv_facial_landmark_prepare")] + internal static extern MediaVisionError Prepare(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferenceFacialLandmarkDetection, EntryPoint = "mv_facial_landmark_inference")] + internal static extern MediaVisionError Inference(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferenceFacialLandmarkDetection, EntryPoint = "mv_facial_landmark_inference_async")] + internal static extern MediaVisionError InferenceAsync(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferenceFacialLandmarkDetection, EntryPoint = "mv_facial_landmark_get_result_count")] + internal static extern MediaVisionError GetResultCount(IntPtr handle, out ulong requestId, out uint count); + + [DllImport(Libraries.MediaVisionInferenceFacialLandmarkDetection, EntryPoint = "mv_facial_landmark_get_position")] + internal static extern MediaVisionError GetPoints(IntPtr handle, uint index, out uint posX, out uint posY); + } + + internal static partial class InferencePoseLandmarkDetection + { + // Newly added inferernce APIs + [DllImport(Libraries.MediaVisionInferencePoseLandmarkDetection, EntryPoint = "mv_pose_landmark_create")] + internal static extern MediaVisionError Create(out IntPtr handle); + + [DllImport(Libraries.MediaVisionInferencePoseLandmarkDetection, EntryPoint = "mv_pose_landmark_destroy")] + internal static extern MediaVisionError Destroy(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferencePoseLandmarkDetection, EntryPoint = "mv_pose_landmark_configure")] + internal static extern MediaVisionError Configure(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferencePoseLandmarkDetection, EntryPoint = "mv_pose_landmark_prepare")] + internal static extern MediaVisionError Prepare(IntPtr handle); + + [DllImport(Libraries.MediaVisionInferencePoseLandmarkDetection, EntryPoint = "mv_pose_landmark_inference")] + internal static extern MediaVisionError Inference(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferencePoseLandmarkDetection, EntryPoint = "mv_pose_landmark_inference_async")] + internal static extern MediaVisionError InferenceAsync(IntPtr handle, IntPtr source); + + [DllImport(Libraries.MediaVisionInferencePoseLandmarkDetection, EntryPoint = "mv_pose_landmark_get_result_count")] + internal static extern MediaVisionError GetResultCount(IntPtr handle, out ulong requestId, out uint count); + + [DllImport(Libraries.MediaVisionInferencePoseLandmarkDetection, EntryPoint = "mv_pose_landmark_get_position")] + internal static extern MediaVisionError GetPoints(IntPtr handle, uint index, out uint posX, out uint posY); } } } diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Surveillance.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Surveillance.cs index 89f0d31d5c1..ad1db3da814 100755 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Surveillance.cs +++ b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Surveillance.cs @@ -34,58 +34,58 @@ internal static partial class MediaVision internal static partial class Surveillance { [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_event_trigger_create")] - internal static extern MediaVisionError EventTriggerCreate(string eventType, out IntPtr trigger); + internal static extern MediaVisionError EventTriggerCreate(string eventType, out IntPtr trigger); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_event_trigger_destroy")] - internal static extern int EventTriggerDestroy(IntPtr trigger); + internal static extern int EventTriggerDestroy(IntPtr trigger); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_event_trigger_type")] - internal static extern int GetEventTriggerType(IntPtr trigger, out string eventType); + internal static extern int GetEventTriggerType(IntPtr trigger, out string eventType); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_set_event_trigger_roi")] - internal static extern MediaVisionError SetEventTriggerRoi(IntPtr trigger, int numberOfPoints, Point[] roi); + internal static extern MediaVisionError SetEventTriggerRoi(IntPtr trigger, int numberOfPoints, Point[] roi); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_event_trigger_roi")] - internal static extern MediaVisionError GetEventTriggerRoi(IntPtr trigger, out int numberOfPoints, out IntPtr roi); + internal static extern MediaVisionError GetEventTriggerRoi(IntPtr trigger, out int numberOfPoints, out IntPtr roi); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_subscribe_event_trigger")] internal static extern MediaVisionError SubscribeEventTrigger(IntPtr trigger, int videoStreamId, - IntPtr engineCfg, EventOccurredCallback callback, IntPtr userData = default(IntPtr)); + IntPtr engineCfg, EventOccurredCallback callback, IntPtr userData = default(IntPtr)); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_unsubscribe_event_trigger")] - internal static extern MediaVisionError UnsubscribeEventTrigger(IntPtr trigger, int videoStreamId); + internal static extern MediaVisionError UnsubscribeEventTrigger(IntPtr trigger, int videoStreamId); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_push_source")] - internal static extern MediaVisionError PushSource(IntPtr source, int videoStreamId); + internal static extern MediaVisionError PushSource(IntPtr source, int videoStreamId); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_foreach_supported_event_type")] - internal static extern int ForeachSupportedEventType(EventTypeCallback callback, IntPtr userData); + internal static extern int ForeachSupportedEventType(EventTypeCallback callback, IntPtr userData); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_foreach_event_result_name")] internal static extern int ForeachEventResultName(string eventType, EventResultNameCallback callback, - IntPtr userData); + IntPtr userData); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, out int value); + internal static extern MediaVisionError GetResultValue(IntPtr result, string name, out int value); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] int[] value); + internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] int[] value); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] double[] value); + internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] double[] value); // Deprecated in API 12 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] Rectangle[] value); + internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] Rectangle[] value); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void EventOccurredCallback(IntPtr trigger, IntPtr source, - int videoStreamId, IntPtr eventResult, IntPtr userData); + int videoStreamId, IntPtr eventResult, IntPtr userData); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool EventTypeCallback(string eventType, IntPtr userData); + internal delegate bool EventTypeCallback(string eventType, IntPtr userData); // Deprecated in API 12 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool EventResultNameCallback(string name, IntPtr userData); + internal delegate bool EventResultNameCallback(string name, IntPtr userData); // Deprecated in API 12 } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/DeepLearningFaceRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/DeepLearningFaceRecognizer.cs index 0cf02725a51..5f65776d1b2 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/DeepLearningFaceRecognizer.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/DeepLearningFaceRecognizer.cs @@ -56,7 +56,7 @@ public DeepLearningFaceRecognizer() { Log.Error(MediaVisionLog.Tag, e.ToString()); InteropFace.Destroy(_handle); - throw e; + throw; } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/EyeCondition.cs b/src/Tizen.Multimedia.Vision/MediaVision/EyeCondition.cs index 556dc00f27a..cbac00d082e 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/EyeCondition.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/EyeCondition.cs @@ -14,12 +14,15 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// /// Specifies the eyes state types. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public enum EyeCondition { /// diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs index 6a841ab03d6..827e985cf63 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs @@ -23,6 +23,7 @@ namespace Tizen.Multimedia.Vision /// /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class FaceDetectionConfiguration : EngineConfiguration { private const string KeyModelFilePath = "MV_FACE_DETECTION_MODEL_FILE_PATH"; @@ -38,6 +39,7 @@ public class FaceDetectionConfiguration : EngineConfiguration /// /// The feature is not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public FaceDetectionConfiguration() : base("face_recognition") { } @@ -47,6 +49,7 @@ public FaceDetectionConfiguration() : base("face_recognition") /// /// is null. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public string ModelFilePath { get @@ -72,6 +75,7 @@ public string ModelFilePath /// /// is less than zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int? MinHeight { get @@ -100,6 +104,7 @@ public int? MinHeight /// /// is less than zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int? MinWidth { get @@ -140,6 +145,7 @@ public int? MinWidth /// The y position of is less than zero. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Rectangle? Roi { get diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionResult.cs index 899e1e60dcb..d338c4c2b16 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionResult.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionResult.cs @@ -14,7 +14,7 @@ * limitations under the License. */ -using System.Collections.ObjectModel; +using System; namespace Tizen.Multimedia.Vision { @@ -23,6 +23,7 @@ namespace Tizen.Multimedia.Vision /// . /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class FaceDetectionResult { internal FaceDetectionResult(float confidence, global::Interop.MediaVision.Rectangle location) @@ -35,12 +36,14 @@ internal FaceDetectionResult(float confidence, global::Interop.MediaVision.Recta /// Gets the confidence of detected face. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public float Confidence { get; } /// /// Gets the location of detected face. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Rectangle Location { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs index bec227f1385..d9bc59253a6 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs @@ -31,6 +31,7 @@ namespace Tizen.Multimedia.Vision /// please use . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static class FaceDetector { /// @@ -47,6 +48,7 @@ public static class FaceDetector /// /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task DetectAsync(MediaVisionSource source) { return await DetectAsync(source, (FaceDetectionConfiguration)null); @@ -63,6 +65,7 @@ public static async Task DetectAsync(MediaVisionSource source) /// The feature is not supported. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task DetectAsync(MediaVisionSource source, FaceDetectionConfiguration config) { @@ -131,6 +134,7 @@ private static InteropFace.DetectedCallback GetCallback(TaskCompletionSourceThe caller has no required privilege. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task> DetectAsync(MediaVisionSource source, InferenceModelConfiguration config) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs index 9131053591e..97363be0f2e 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs @@ -23,6 +23,7 @@ namespace Tizen.Multimedia.Vision /// /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class FaceRecognitionConfiguration : EngineConfiguration { private const string KeyModelType = "MV_FACE_RECOGNITION_MODEL_TYPE"; @@ -32,6 +33,7 @@ public class FaceRecognitionConfiguration : EngineConfiguration ///
/// The feature is not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public FaceRecognitionConfiguration() : base("face_recognition") { } @@ -42,6 +44,7 @@ public FaceRecognitionConfiguration() : base("face_recognition") ///
/// is not valid. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public FaceRecognitionModelType ModelType { get diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs index 4770a52c8ee..86fc1372bc1 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs @@ -26,6 +26,7 @@ namespace Tizen.Multimedia.Vision ///
/// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class FaceRecognitionModel : IDisposable { private IntPtr _handle = IntPtr.Zero; @@ -36,6 +37,7 @@ public class FaceRecognitionModel : IDisposable ///
/// The feature is not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public FaceRecognitionModel() { InteropModel.Create(out _handle).Validate("Failed to create FaceRecognitionModel"); @@ -58,6 +60,7 @@ public FaceRecognitionModel() /// No permission to access the specified file. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public FaceRecognitionModel(string modelPath) { if (modelPath == null) @@ -82,6 +85,7 @@ public FaceRecognitionModel(string modelPath) ///
/// The has already been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int[] Labels { get @@ -116,6 +120,7 @@ public int[] Labels /// The has already been disposed of. /// The directory for does not exist. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Save(string path) { if (path == null) @@ -159,6 +164,7 @@ private MediaVisionError InvokeAdd(MediaVisionSource source, int label, Rectangl /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Add(MediaVisionSource source, int label) { if (source == null) @@ -185,6 +191,7 @@ public void Add(MediaVisionSource source, int label) /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Add(MediaVisionSource source, int label, Rectangle area) { if (source == null) @@ -204,6 +211,7 @@ public void Add(MediaVisionSource source, int label, Rectangle area) /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public bool Remove(int label) { var ret = InteropModel.Remove(Handle, ref label); @@ -222,6 +230,7 @@ public bool Remove(int label) ///
/// The has already been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Reset() { InteropModel.Reset(Handle).Validate("Failed to reset image example"); @@ -242,6 +251,7 @@ public void Reset() /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Learn() { Learn(null); @@ -266,6 +276,7 @@ public void Learn() /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Learn(FaceRecognitionConfiguration config) { InteropModel.Learn(EngineConfiguration.GetHandle(config), Handle). @@ -276,6 +287,7 @@ public void Learn(FaceRecognitionConfiguration config) /// Releases all the resources used by the object. ///
/// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Dispose() { Dispose(true); @@ -289,6 +301,7 @@ public void Dispose() /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] protected virtual void Dispose(bool disposing) { if (_disposed) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModelType.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModelType.cs index 2625ef0727c..667ea154694 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModelType.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModelType.cs @@ -14,12 +14,15 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// /// Specifies the face recognition model learning algorithms. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public enum FaceRecognitionModelType { /// diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionResult.cs index 283d6d119ad..5b5b6ae2fd4 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionResult.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionResult.cs @@ -14,12 +14,15 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// /// Represents the result of operations. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class FaceRecognitionResult { internal FaceRecognitionResult(bool recognized, double confidence, int label, Rectangle? area) @@ -34,18 +37,21 @@ internal FaceRecognitionResult(bool recognized, double confidence, int label, Re /// Gets the value indicating the recognition is successful. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public bool Success { get; } /// /// Gets the label of the recognized face. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int Label { get; } /// /// Gets the location of the recognized face. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Rectangle? Area { get; } /// @@ -55,6 +61,7 @@ internal FaceRecognitionResult(bool recognized, double confidence, int label, Re /// then threshold can be reduced (0.5-0.85). /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double Confidence { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs index 8ec7764b959..81cf97eff3d 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs @@ -25,6 +25,7 @@ namespace Tizen.Multimedia.Vision /// Provides the ability to recognize faces, face expressions, and eye condition on image sources. ///
/// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static class FaceRecognizer { @@ -44,6 +45,7 @@ public static class FaceRecognizer /// is untrained model. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task RecognizeAsync(MediaVisionSource source, FaceRecognitionModel recognitionModel) { @@ -67,6 +69,7 @@ public static async Task RecognizeAsync(MediaVisionSource /// is untrained model. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task RecognizeAsync(MediaVisionSource source, FaceRecognitionModel recognitionModel, Rectangle bound) { @@ -94,6 +97,7 @@ public static async Task RecognizeAsync(MediaVisionSource /// is untrained model. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task RecognizeAsync(MediaVisionSource source, FaceRecognitionModel recognitionModel, FaceRecognitionConfiguration config) { @@ -123,6 +127,7 @@ public static async Task RecognizeAsync(MediaVisionSource /// is untrained model. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task RecognizeAsync(MediaVisionSource source, FaceRecognitionModel recognitionModel, Rectangle bound, FaceRecognitionConfiguration config) { @@ -216,6 +221,7 @@ private static InteropFace.RecognizedCallback GetRecognizedCallback( /// The feature is not supported. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task RecognizeEyeConditionAsync(MediaVisionSource source, Rectangle bound) { @@ -238,6 +244,7 @@ public static async Task RecognizeEyeConditionAsync(MediaVisionSou /// The feature is not supported. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task RecognizeEyeConditionAsync(MediaVisionSource source, Rectangle bound, FaceRecognitionConfiguration config) { @@ -278,6 +285,7 @@ public static async Task RecognizeEyeConditionAsync(MediaVisionSou /// The feature is not supported. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task RecognizeFacialExpressionAsync(MediaVisionSource source, Rectangle bound) { @@ -300,6 +308,7 @@ public static async Task RecognizeFacialExpressionAsync(MediaV /// The feature is not supported. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task RecognizeFacialExpressionAsync(MediaVisionSource source, Rectangle bound, FaceRecognitionConfiguration config) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs index bc64764533a..d5710b0c4e8 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs @@ -25,6 +25,7 @@ namespace Tizen.Multimedia.Vision /// Provides the ability to track faces on image sources. ///
/// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static class FaceTracker { @@ -51,6 +52,7 @@ public static class FaceTracker /// is not prepared. /// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task TrackAsync(MediaVisionSource source, FaceTrackingModel trackingModel, bool doLearn) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs index 6f52d1e214d..2714af06687 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs @@ -25,6 +25,7 @@ namespace Tizen.Multimedia.Vision ///
/// http://tizen.org/feature/vision.face_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class FaceTrackingModel : IDisposable { private IntPtr _handle = IntPtr.Zero; @@ -35,6 +36,7 @@ public class FaceTrackingModel : IDisposable ///
/// The feature is not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public FaceTrackingModel() { InteropModel.Create(out _handle).Validate("Failed to create FaceTrackingModel."); @@ -57,6 +59,7 @@ public FaceTrackingModel() /// No permission to access the specified file. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public FaceTrackingModel(string modelPath) { if (modelPath == null) @@ -109,6 +112,7 @@ private MediaVisionError InvokePrepare(MediaVisionSource source, Quadrangle regi /// has already bean disposed of. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Prepare(MediaVisionSource source, Quadrangle region) { if (source == null) @@ -128,6 +132,7 @@ public void Prepare(MediaVisionSource source, Quadrangle region) /// The has already been disposed of. /// The directory for does not exist. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Save(string path) { if (path == null) @@ -149,6 +154,7 @@ public void Save(string path) /// Releases all the resources used by the object. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Dispose() { Dispose(true); @@ -162,6 +168,7 @@ public void Dispose() /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] protected virtual void Dispose(bool disposing) { if (_disposed) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs index 99545c11be8..a9938d88a80 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs @@ -14,12 +14,15 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// /// Represents the result of face tracking operation. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class FaceTrackingResult { internal FaceTrackingResult(bool success, double confidence, Quadrangle region) @@ -33,12 +36,14 @@ internal FaceTrackingResult(bool success, double confidence, Quadrangle region) /// Gets the value indicating the tracking is successful. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public bool Success { get; } /// /// Gets the region which determines the new position of the tracked face on the source. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Quadrangle Region { get; } /// @@ -46,6 +51,7 @@ internal FaceTrackingResult(bool success, double confidence, Quadrangle region) /// (value from 0.0 to 1.0). If no location was determined during the last track iteration, then the value is 0.0. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double Confidence { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FacialExpression.cs b/src/Tizen.Multimedia.Vision/MediaVision/FacialExpression.cs index 8a722c6de73..c24487a23fe 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FacialExpression.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FacialExpression.cs @@ -14,12 +14,15 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// /// Specifies the expression types for faces. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public enum FacialExpression { /// diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FacialLandmarkDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/FacialLandmarkDetector.cs index 7a50bdf6d6c..27f53c49cff 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/FacialLandmarkDetector.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/FacialLandmarkDetector.cs @@ -28,6 +28,7 @@ namespace Tizen.Multimedia.Vision /// Provides the ability to detect facial landmarks on image source using inference engine. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static class FacialLandmarkDetector { /// @@ -51,6 +52,7 @@ public static class FacialLandmarkDetector /// The caller has no required privilege. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task> DetectAsync(MediaVisionSource source, InferenceModelConfiguration config) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageClassificationResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageClassificationResult.cs index d7741b15eb1..fcaff0512cc 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageClassificationResult.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageClassificationResult.cs @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -using System.Collections.ObjectModel; +using System; namespace Tizen.Multimedia.Vision { @@ -22,6 +22,7 @@ namespace Tizen.Multimedia.Vision /// . /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class ImageClassificationResult { internal ImageClassificationResult(int indice, string name, float confidence) @@ -35,18 +36,21 @@ internal ImageClassificationResult(int indice, string name, float confidence) /// Gets the indice of detected object. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int Indice { get; } /// /// Gets the name of detected object. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public string Name { get; } /// /// Gets the confidence of detected object. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public float Confidence { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageClassifier.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageClassifier.cs index 44ca7b67a52..8b71f375704 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageClassifier.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageClassifier.cs @@ -27,6 +27,7 @@ namespace Tizen.Multimedia.Vision /// Provides the ability to classify image objects on image source using inference engine. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static class ImageClassifier { /// @@ -47,6 +48,7 @@ public static class ImageClassifier /// The caller has no required privilege. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task> ClassifyAsync(MediaVisionSource source, InferenceModelConfiguration config) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs index 6a52f42b02d..6475c24fb68 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs @@ -23,6 +23,7 @@ namespace Tizen.Multimedia.Vision /// /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class ImageFillConfiguration : EngineConfiguration { private const string KeyScaleFactor = "MV_IMAGE_RECOGNITION_OBJECT_SCALE_FACTOR"; @@ -32,12 +33,14 @@ public class ImageFillConfiguration : EngineConfiguration /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly double DefaultScaleFactor = 1.2; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly int DefaultMaxKeypoints = 1000; /// @@ -45,6 +48,7 @@ public class ImageFillConfiguration : EngineConfiguration /// /// The feature is not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public ImageFillConfiguration() : base("image_recognition") { } @@ -56,6 +60,7 @@ public ImageFillConfiguration() : base("image_recognition") /// /// The already has been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double ObjectScaleFactor { get @@ -76,6 +81,7 @@ public double ObjectScaleFactor /// /// The already has been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int ObjectMaxKeyPoints { get diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs index 61de3cca6cd..dcb48999814 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs @@ -25,6 +25,7 @@ namespace Tizen.Multimedia.Vision /// /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class ImageObject : IDisposable { private IntPtr _handle = IntPtr.Zero; @@ -35,6 +36,7 @@ public class ImageObject : IDisposable /// /// The feature is not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public ImageObject() { InteropImage.Create(out _handle).Validate("Failed to create image object"); @@ -57,6 +59,7 @@ public ImageObject() /// No permission to access the specified file. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public ImageObject(string path) { if (path == null) @@ -92,6 +95,7 @@ public ImageObject(string path) /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double RecognitionRate { get @@ -111,6 +115,7 @@ public double RecognitionRate /// The has already been disposed of. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int? GetLabel() { var ret = InteropImage.GetLabel(Handle, out var label); @@ -130,6 +135,7 @@ public double RecognitionRate /// The label which will be assigned to the image object. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void SetLabel(int label) { InteropImage.SetLabel(Handle, label).Validate("Failed to set label"); @@ -147,6 +153,7 @@ public void SetLabel(int label) /// has already been disposed of. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Fill(MediaVisionSource source) { InvokeFill(source, null, null); @@ -167,6 +174,7 @@ public void Fill(MediaVisionSource source) /// has already been disposed of. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Fill(MediaVisionSource source, ImageFillConfiguration config) { InvokeFill(source, config, null); @@ -186,6 +194,7 @@ public void Fill(MediaVisionSource source, ImageFillConfiguration config) /// has already been disposed of. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Fill(MediaVisionSource source, Rectangle rect) { InvokeFill(source, null, rect); @@ -208,6 +217,7 @@ public void Fill(MediaVisionSource source, Rectangle rect) /// has already been disposed of. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Fill(MediaVisionSource source, ImageFillConfiguration config, Rectangle rect) { InvokeFill(source, config, rect); @@ -245,6 +255,7 @@ private void InvokeFill(MediaVisionSource source, ImageFillConfiguration config, /// The has already been disposed of. /// The directory for does not exist. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Save(string path) { if (path == null) @@ -269,6 +280,7 @@ public void Save(string path) /// Releases all the resources used by the object. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Dispose() { Dispose(true); @@ -282,6 +294,7 @@ public void Dispose() /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] protected virtual void Dispose(bool disposing) { if (_disposed) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs index aeaa3a67ae9..bae52578ea7 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs @@ -23,6 +23,7 @@ namespace Tizen.Multimedia.Vision /// /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class ImageRecognitionConfiguration : EngineConfiguration { private const string KeySceneScaleFactor = "MV_IMAGE_RECOGNITION_SCENE_SCALE_FACTOR"; @@ -36,30 +37,35 @@ public class ImageRecognitionConfiguration : EngineConfiguration /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly double DefaultSceneScaleFactor = 1.2; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly int DefaultSceneMaxKeypoints = 5000; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly int DefaultMinKeyPointMatches = 30; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly double DefaultRequiredMatchPart = 0.05; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly double DefaultTolerantPartMatchError = 0.1; /// @@ -67,6 +73,7 @@ public class ImageRecognitionConfiguration : EngineConfiguration /// /// The feature is not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public ImageRecognitionConfiguration() : base("image_recognition") { } @@ -80,6 +87,7 @@ public ImageRecognitionConfiguration() : base("image_recognition") /// /// The already has been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double SceneScaleFactor { get @@ -103,6 +111,7 @@ public double SceneScaleFactor /// The already has been disposed of. /// is less than zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int SceneMaxKeyPoints { get @@ -130,6 +139,7 @@ public int SceneMaxKeyPoints /// The already has been disposed of. /// is less than zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int MinKeyPointMatches { get @@ -164,6 +174,7 @@ public int MinKeyPointMatches /// is greater than one. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double RequiredMatchingPart { get @@ -195,6 +206,7 @@ public double RequiredMatchingPart /// is greater than one. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double TolerantPartMatchError { get diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs index 34667ca7da7..6f759de861a 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs @@ -14,12 +14,15 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// /// Represents a result of RecognizeAsync operations of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class ImageRecognitionResult { @@ -34,12 +37,14 @@ internal ImageRecognitionResult(bool success, Quadrangle region) /// /// The region of recognized image object if successful, otherwise null. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Quadrangle Region { get; } /// /// Gets the value indicating the recognition is successful. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public bool Success { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs index c2bc20bd1ed..101426bf186 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs @@ -25,6 +25,7 @@ namespace Tizen.Multimedia.Vision /// Provides the ability to recognize images on image sources. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static class ImageRecognizer { /// @@ -45,6 +46,7 @@ public static class ImageRecognizer /// has already been disposed of. /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task> RecognizeAsync( MediaVisionSource source, ImageObject[] imageObjects) { @@ -74,6 +76,7 @@ public static async Task> RecognizeAsync( /// /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task> RecognizeAsync(MediaVisionSource source, ImageObject[] imageObjects, ImageRecognitionConfiguration config) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs index c888a52c229..2c2d6a60f6c 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs @@ -25,6 +25,7 @@ namespace Tizen.Multimedia.Vision /// Provides the ability to track images on image sources. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static class ImageTracker { /// @@ -48,6 +49,7 @@ public static class ImageTracker /// /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task TrackAsync(MediaVisionSource source, ImageTrackingModel trackingModel) { @@ -78,6 +80,7 @@ public static async Task TrackAsync(MediaVisionSource source, /// /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task TrackAsync(MediaVisionSource source, ImageTrackingModel trackingModel, ImageTrackingConfiguration config) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs index abb7f477532..5e56c7e0a8a 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs @@ -23,6 +23,7 @@ namespace Tizen.Multimedia.Vision /// /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class ImageTrackingConfiguration : ImageRecognitionConfiguration { private const string KeyHistoryAmount = "MV_IMAGE_TRACKING_HISTORY_AMOUNT"; @@ -36,36 +37,42 @@ public class ImageTrackingConfiguration : ImageRecognitionConfiguration /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly int DefaultHistoryAmount = 3; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly double DefaultExpectedOffset = 0; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly bool DefaultStabilizationEnabled = true; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly double DefaultStabilizationTolerantShift = 0.00006; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly double DefaultStabilizationSpeed = 0.3; /// /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly double DefaultStabilizationAcceleration = 0.1; /// @@ -73,6 +80,7 @@ public class ImageTrackingConfiguration : ImageRecognitionConfiguration /// /// The feature is not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public ImageTrackingConfiguration() { } @@ -87,6 +95,7 @@ public ImageTrackingConfiguration() /// The already has been disposed of. /// is less than zero. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int HistoryAmount { get @@ -113,6 +122,7 @@ public int HistoryAmount /// /// The already has been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double ExpectedOffset { get @@ -140,6 +150,7 @@ public double ExpectedOffset /// is greater than one. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double StabilizationAcceleration { get @@ -166,6 +177,7 @@ public double StabilizationAcceleration /// /// The already has been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double StabilizationSpeed { get @@ -191,6 +203,7 @@ public double StabilizationSpeed /// /// The already has been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double StabilizationTolerantShift { get @@ -212,6 +225,7 @@ public double StabilizationTolerantShift /// /// The already has been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public bool IsStabilizationEnabled { get diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs index 98f55914f9c..b1bc25680fd 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs @@ -25,6 +25,7 @@ namespace Tizen.Multimedia.Vision /// /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class ImageTrackingModel : IDisposable { private IntPtr _handle = IntPtr.Zero; @@ -35,6 +36,7 @@ public class ImageTrackingModel : IDisposable /// /// The feature is not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public ImageTrackingModel() { InteropModel.Create(out _handle).Validate("Failed to create FaceTrackingModel"); @@ -57,6 +59,7 @@ public ImageTrackingModel() /// No permission to access the specified file. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public ImageTrackingModel(string modelPath) { if (modelPath == null) @@ -87,6 +90,7 @@ public ImageTrackingModel(string modelPath) /// /// Internal error.(Since API level 10) /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void SetTarget(ImageObject imageObject) { if (imageObject == null) @@ -106,6 +110,7 @@ public void SetTarget(ImageObject imageObject) /// /// The has already been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Refresh() { InteropModel.Refresh(Handle, IntPtr.Zero).Validate("Failed to refresh state"); @@ -120,6 +125,7 @@ public void Refresh() /// The has already been disposed of. /// The directory for does not exist. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Save(string path) { if (path == null) @@ -141,6 +147,7 @@ public void Save(string path) /// Releases all resources used by the object. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Dispose() { Dispose(true); @@ -154,6 +161,7 @@ public void Dispose() /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] protected virtual void Dispose(bool disposing) { if (_disposed) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceFaceDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceFaceDetector.cs new file mode 100644 index 00000000000..5d423c9ce1d --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceFaceDetector.cs @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Threading; +using System.Threading.Tasks; +using InteropFD = Interop.MediaVision.InferenceFaceDetection; + +namespace Tizen.Multimedia.Vision +{ + /// + /// Provides the ability to detect faces. + /// + /// http://tizen.org/feature/vision.inference + /// http://tizen.org/feature/vision.inference.face + /// 12 + public class InferenceFaceDetector : IDisposable + { + private IntPtr _handle; + private bool _disposed; + + /// Initializes a new instance of the class. + /// The required features are not supported. + /// 12 + public InferenceFaceDetector() + { + ValidationUtil.ValidateFeatureSupported(VisionFeatures.Inference); + ValidationUtil.ValidateFeatureSupported(VisionFeatures.InferenceFace); + + InteropFD.Create(out _handle).Validate("Failed to create inference face detector."); + + try + { + InteropFD.Configure(_handle).Validate("Failed to configure inference face detector."); + InteropFD.Prepare(_handle).Validate("Failed to prepare inference face detector."); + } + catch (Exception e) + { + Log.Error(MediaVisionLog.Tag, e.ToString()); + InteropFD.Destroy(_handle); + throw; + } + } + + /// + /// Finalizes an instance of the InferenceFaceDetector class. + /// + ~InferenceFaceDetector() + { + Dispose(false); + } + + /// + /// Detects faces on the source image synchronously. + /// + /// + /// can be empty, if there's no detected face. + /// + /// The image data to detect faces. + /// The BoundingBoxes of detected face. + /// The InferenceFaceDetector already has been disposed. + /// is null. + /// 12 + public InferenceFaceDetectorResult Inference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropFD.Inference(_handle, source.Handle).Validate("Failed to inference face detection."); + + return new InferenceFaceDetectorResult(_handle); + } + + /// + /// Detects faces on the source image asynchronously. + /// + /// + /// can be empty, if there's no detected face.
+ /// This method uses about twice as much memory as . + ///
+ /// The image data to detect faces. + /// The InferenceFaceDetector already has been disposed. + /// is null. + /// 12 + public async Task InferenceAsync(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropFD.InferenceAsync(_handle, source.Handle).Validate("Failed to inference face detection."); + + return await Task.Factory.StartNew(() => new InferenceFaceDetectorResult(_handle), + CancellationToken.None, + TaskCreationOptions.DenyChildAttach | TaskCreationOptions.LongRunning, + TaskScheduler.Default); + } + + private ulong _requestId = 1; + /// + /// Requests detecting faces to get their bounding boxes asynchronously. + /// + /// + /// This function does not guarantee that inference is done when this method returns. The user can get the result by using .
+ /// If the user calls this method again before the previous one is finished internally, the call will be ignored.
+ /// can be empty, if there's no detected face.
+ /// Note that this method could use about twice as much memory as . + ///
+ /// The image data to detect faces. + /// The request ID that indicates the order of requests. + /// The InferenceFaceDetector already has been disposed. + /// is null. + /// + /// 12 + public ulong RequestInference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropFD.InferenceAsync(_handle, source.Handle).Validate("Failed to inference face detection."); + + return _requestId++; + } + + /// + /// Gets the bounding boxes as a result of . + /// + /// + /// If there's no detected face, will be empty.
+ /// This method uses about twice as much memory as . + ///
+ /// The bounding boxes of detected face. + /// The InferenceFaceDetector already has been disposed. + /// + /// 12 + public InferenceFaceDetectorResult GetRequestResults() + { + ValidateNotDisposed(); + + return new InferenceFaceDetectorResult(_handle); + } + + /// + /// Releases the unmanaged resources used by the InferenceFaceDetector. + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // to be used if there are any other disposable objects + } + + if (_handle != IntPtr.Zero) + { + InteropFD.Destroy(_handle); + _handle = IntPtr.Zero; + } + + _disposed = true; + } + } + + /// + /// Releases all resources used by the InferenceFaceDetector. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + internal void ValidateNotDisposed() + { + if (_disposed) + { + Log.Error(MediaVisionLog.Tag, "InferenceFaceDetector handle is disposed."); + throw new ObjectDisposedException(nameof(InferenceFaceDetector)); + } + } + } +} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceFaceDetectorResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceFaceDetectorResult.cs new file mode 100755 index 00000000000..7050d37226c --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceFaceDetectorResult.cs @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 InteropFD = Interop.MediaVision.InferenceFaceDetection; + +namespace Tizen.Multimedia.Vision +{ + /// + /// Represents the result of operations. + /// + /// 12 + public class InferenceFaceDetectorResult + { + internal InferenceFaceDetectorResult(IntPtr handle) + { + InteropFD.GetResultCount(handle, out ulong requestId, out uint count). + Validate("Failed to get result count."); + + RequestId = requestId; + var boundingBoxes = new List(); + + for (uint i = 0 ; i < count ; i++) + { + InteropFD.GetBoundingBoxes(handle, i, out int left, out int top, out int right, out int bottom). + Validate("Failed to get bounding boxes."); + boundingBoxes.Add(new Rectangle(left, top, right - left, bottom - top)); + } + + BoundingBoxes = boundingBoxes; + } + + /// + /// Gets the request ID which is matched with request ID of RequestInference() return value.
+ /// It represents the order of request. + ///
+ /// The request ID that indicates the order of request. + /// 12 + public ulong RequestId { get; } + + /// + /// Gets the bounding boxes of the detected face. + /// + /// 12 + public IEnumerable BoundingBoxes { get; } + } +} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceFacialLandmarkDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceFacialLandmarkDetector.cs new file mode 100644 index 00000000000..31c34e05a9b --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceFacialLandmarkDetector.cs @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Threading; +using System.Threading.Tasks; +using InteropFLD = Interop.MediaVision.InferenceFacialLandmarkDetection; + +namespace Tizen.Multimedia.Vision +{ + /// + /// Provides the ability to detect facial landmarks. + /// + /// http://tizen.org/feature/vision.inference + /// http://tizen.org/feature/vision.inference.face + /// 12 + public class InferenceFacialLandmarkDetector : IDisposable + { + private IntPtr _handle; + private bool _disposed; + + /// Initializes a new instance of the class. + /// The required features are not supported. + /// 12 + public InferenceFacialLandmarkDetector() + { + ValidationUtil.ValidateFeatureSupported(VisionFeatures.Inference); + ValidationUtil.ValidateFeatureSupported(VisionFeatures.InferenceFace); + + InteropFLD.Create(out _handle).Validate("Failed to create inference facial landmark detector."); + + try + { + InteropFLD.Configure(_handle).Validate("Failed to configure inference facial landmark detector."); + InteropFLD.Prepare(_handle).Validate("Failed to prepare inference facial landmark detector."); + } + catch (Exception e) + { + Log.Error(MediaVisionLog.Tag, e.ToString()); + InteropFLD.Destroy(_handle); + throw; + } + } + + /// + /// Finalizes an instance of the InferenceFacialLandmarkDetector class. + /// + ~InferenceFacialLandmarkDetector() + { + Dispose(false); + } + + /// + /// Detects facial landmarks on the source image synchronously. + /// + /// + /// can be empty, if there's no detected facial landmark. + /// + /// The image data to detect facial landmarks. + /// The coordinates of detected facial landmarks. + /// The InferenceFacialLandmarkDetector already has been disposed. + /// is null. + /// 12 + public InferenceFacialLandmarkDetectorResult Inference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropFLD.Inference(_handle, source.Handle).Validate("Failed to inference facial landmark detection."); + + return new InferenceFacialLandmarkDetectorResult(_handle); + } + + /// + /// Detects facial landmarks on the source image asynchronously. + /// + /// + /// can be empty, if there's no detected facial landmark.
+ /// This method uses about twice as much memory as . + ///
+ /// The image data to detect facial landmarks. + /// The InferenceFacialLandmarkDetector already has been disposed. + /// is null. + /// 12 + public async Task InferenceAsync(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropFLD.InferenceAsync(_handle, source.Handle).Validate("Failed to inference facial landmark detection."); + + return await Task.Factory.StartNew(() => new InferenceFacialLandmarkDetectorResult(_handle), + CancellationToken.None, + TaskCreationOptions.DenyChildAttach | TaskCreationOptions.LongRunning, + TaskScheduler.Default); + } + + private ulong _requestId = 1; + /// + /// Requests detecting facial landmarks to get their points asynchronously. + /// + /// + /// This function does not guarantee that inference is done when this method returns. The user can get the result by using .
+ /// If the user calls this method again before the previous one is finished internally, the call will be ignored.
+ /// can be empty, if there's no detected facial landmark.
+ /// Note that this method could use about twice as much memory as . + ///
+ /// The image data to detect facial landmarks. + /// The request ID that indicates the order of requests. + /// The InferenceFacialLandmarkDetector already has been disposed. + /// is null. + /// + /// 12 + public ulong RequestInference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropFLD.InferenceAsync(_handle, source.Handle).Validate("Failed to inference facial landmark detection."); + return _requestId++; + } + + /// + /// Gets the points as a result of . + /// + /// + /// If there's no detected facial landmark, will be empty.
+ /// This method uses about twice as much memory as . + ///
+ /// The points of detected facial landmarks. + /// The InferenceFacialLandmarkDetector already has been disposed. + /// + /// 12 + public InferenceFacialLandmarkDetectorResult GetRequestResults() + { + ValidateNotDisposed(); + + return new InferenceFacialLandmarkDetectorResult(_handle); + } + + /// + /// Releases the unmanaged resources used by the InferenceFacialLandmarkDetector. + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // to be used if there are any other disposable objects + } + + if (_handle != IntPtr.Zero) + { + InteropFLD.Destroy(_handle); + _handle = IntPtr.Zero; + } + + _disposed = true; + } + } + + /// + /// Releases all resources used by the InferenceFacialLandmarkDetector. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + internal void ValidateNotDisposed() + { + if (_disposed) + { + Log.Error(MediaVisionLog.Tag, "InferenceFacialLandmarkDetector handle is disposed."); + throw new ObjectDisposedException(nameof(InferenceFacialLandmarkDetector)); + } + } + } +} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceFacialLandmarkDetectorResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceFacialLandmarkDetectorResult.cs new file mode 100755 index 00000000000..67b7b752ac8 --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceFacialLandmarkDetectorResult.cs @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 InteropFLD = Interop.MediaVision.InferenceFacialLandmarkDetection; + + +namespace Tizen.Multimedia.Vision +{ + /// + /// Represents the result of operations. + /// + /// 12 + public class InferenceFacialLandmarkDetectorResult + { + internal InferenceFacialLandmarkDetectorResult(IntPtr handle) + { + InteropFLD.GetResultCount(handle, out ulong requestId, out uint count). + Validate("Failed to get result count."); + + RequestId = requestId; + var points = new List(); + + for (uint i = 0 ; i < count ; i++) + { + InteropFLD.GetPoints(handle, i, out uint x, out uint y).Validate("Failed to get points."); + points.Add(new Point((int)x, (int)y)); + } + + Points = points; + } + + /// + /// Gets the request ID which is matched with request ID of RequestInference() return value.
+ /// It represents the order of request. + ///
+ /// The request ID that indicates the order of request. + /// 12 + public ulong RequestId { get; } + + /// + /// Gets The coordinates of detected facial landmarks. + /// + /// 12 + public IEnumerable Points { get; } + } +} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceImageClassifier.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceImageClassifier.cs new file mode 100644 index 00000000000..95e5b516e29 --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceImageClassifier.cs @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Threading; +using System.Threading.Tasks; +using InteropIC = Interop.MediaVision.InferenceImageClassification; + +namespace Tizen.Multimedia.Vision +{ + /// + /// Provides the ability to classify image. + /// + /// http://tizen.org/feature/vision.inference + /// http://tizen.org/feature/vision.inference.image + /// 12 + public class InferenceImageClassifier : IDisposable + { + private IntPtr _handle; + private bool _disposed; + + /// Initializes a new instance of the class. + /// The required features are not supported. + /// 12 + public InferenceImageClassifier() + { + ValidationUtil.ValidateFeatureSupported(VisionFeatures.Inference); + ValidationUtil.ValidateFeatureSupported(VisionFeatures.InferenceImage); + + InteropIC.Create(out _handle).Validate("Failed to create inference image classifier."); + + try + { + InteropIC.Configure(_handle).Validate("Failed to configure inference image classifier."); + InteropIC.Prepare(_handle).Validate("Failed to prepare inference image classifier."); + } + catch (Exception e) + { + Log.Error(MediaVisionLog.Tag, e.ToString()); + InteropIC.Destroy(_handle); + throw; + } + } + + /// + /// Finalizes an instance of the InferenceImageClassifier class. + /// + ~InferenceImageClassifier() + { + Dispose(false); + } + + /// + /// Classifies image synchronously. + /// + /// + /// can be empty, if image is not classified. + /// + /// The image data to classify. + /// The labels of classified image. + /// The InferenceImageClassifier already has been disposed. + /// is null. + /// 12 + public InferenceImageClassifierResult Inference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropIC.Inference(_handle, source.Handle).Validate("Failed to inference image classification"); + + return new InferenceImageClassifierResult(_handle); + } + + /// + /// Classifies image asynchronously. + /// + /// + /// can be empty, if image is not classified.
+ /// This method uses about twice as much memory as . + ///
+ /// The image data to classify. + /// The InferenceImageClassifier already has been disposed. + /// is null. + /// 12 + public async Task InferenceAsync(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropIC.InferenceAsync(_handle, source.Handle).Validate("Failed to inference image classification"); + + return await Task.Factory.StartNew(() => new InferenceImageClassifierResult(_handle), + CancellationToken.None, + TaskCreationOptions.DenyChildAttach | TaskCreationOptions.LongRunning, + TaskScheduler.Default); + } + + private ulong _requestId = 1; + /// + /// Requests classifing image to get its labels asynchronously. + /// + /// + /// This function does not guarantee that inference is done when this method returns. The user can get the result by using .
+ /// If the user calls this method again before the previous one is finished internally, the call will be ignored.
+ /// can be empty, if image is not classified.
+ /// Note that this method could use about twice as much memory as . + ///
+ /// The image data to classify. + /// The request ID that indicates the order of requests. + /// The InferenceImageClassifier already has been disposed. + /// is null. + /// + /// 12 + public ulong RequestInference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropIC.InferenceAsync(_handle, source.Handle).Validate("Failed to inference image classification."); + + return _requestId++; + } + + /// + /// Gets the labels as a result of . + /// + /// + /// If image is not classified, will be empty.
+ /// This method uses about twice as much memory as . + ///
+ /// The labels of classified image. + /// The InferenceImageClassifier already has been disposed. + /// + /// 12 + public InferenceImageClassifierResult GetRequestResults() + { + ValidateNotDisposed(); + + return new InferenceImageClassifierResult(_handle); + } + + /// + /// Releases the unmanaged resources used by the InferenceImageClassifier. + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // to be used if there are any other disposable objects + } + + if (_handle != IntPtr.Zero) + { + InteropIC.Destroy(_handle); + _handle = IntPtr.Zero; + } + + _disposed = true; + } + } + + /// + /// Releases all resources used by the InferenceImageClassifier. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + internal void ValidateNotDisposed() + { + if (_disposed) + { + Log.Error(MediaVisionLog.Tag, "InferenceImageClassifier handle is disposed."); + throw new ObjectDisposedException(nameof(InferenceImageClassifier)); + } + } + } +} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceImageClassifierResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceImageClassifierResult.cs new file mode 100755 index 00000000000..70b59184c68 --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceImageClassifierResult.cs @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Runtime.InteropServices; +using InteropIC = Interop.MediaVision.InferenceImageClassification; + +namespace Tizen.Multimedia.Vision +{ + /// + /// Represents the result of operations. + /// + /// 12 + public class InferenceImageClassifierResult + { + internal InferenceImageClassifierResult(IntPtr handle) + { + InteropIC.GetResultCount(handle, out ulong requestId, out uint count). + Validate("Failed to get result count."); + + RequestId = requestId; + var labels = new List(); + + for (uint i = 0 ; i < count ; i++) + { + InteropIC.GetLabels(handle, i, out IntPtr label).Validate("Failed to get labels."); + labels.Add(Marshal.PtrToStringAnsi(label)); + } + + Labels = labels; + } + + /// + /// Gets the request ID which is matched with request ID of RequestInference() return value.
+ /// It represents the order of request. + ///
+ /// The request ID that indicates the order of request. + /// 12 + public ulong RequestId { get; } + + /// + /// Gets the labels of the classified image. + /// + /// 12 + public IEnumerable Labels { get; } + } +} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceModelConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceModelConfiguration.cs index e12c60a8f26..72bab33ead4 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/InferenceModelConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceModelConfiguration.cs @@ -35,6 +35,7 @@ namespace Tizen.Multimedia.Vision /// http://tizen.org/feature/vision.inference.face /// http://tizen.org/feature/vision.inference.image /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class InferenceModelConfiguration : EngineConfiguration { private IntPtr _inferenceHandle = IntPtr.Zero; @@ -73,6 +74,7 @@ public class InferenceModelConfiguration : EngineConfiguration /// http://tizen.org/feature/vision.inference.image /// The feature is not supported. /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public InferenceModelConfiguration() : base("inference") { InteropInference.Create(out _inferenceHandle).Validate("Failed to create inference configuration"); @@ -101,6 +103,7 @@ public InferenceModelConfiguration() : base("inference") /// Internal operation error. /// The caller has no required privilege. /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void LoadInferenceModel() { InteropInference.Configure(_inferenceHandle, GetHandle(this)). @@ -130,6 +133,7 @@ internal IntPtr GetHandle() /// /// If there's no supported backend, empty collection will be returned. /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public IEnumerable SupportedBackend { get @@ -193,6 +197,7 @@ private void GetSupportedBackend() /// /// Input file path is null. /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public string ConfigurationFilePath { get @@ -215,6 +220,7 @@ public string ConfigurationFilePath /// /// Input file path is null. /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public string WeightFilePath { get @@ -240,6 +246,7 @@ public string WeightFilePath /// /// Input file path is null. /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public string CategoryFilePath { get @@ -265,6 +272,7 @@ public string CategoryFilePath /// /// Metadata file path is null. /// 9 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public string MetadataFilePath { get @@ -340,6 +348,7 @@ public double StdValue /// The engine type is not supported. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public InferenceBackendType Backend { get @@ -370,6 +379,7 @@ public InferenceBackendType Backend /// /// is not valid. /// 8 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public InferenceTargetDevice Device { get @@ -601,6 +611,7 @@ public double ConfidenceThreshold /// /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Rectangle? Roi { get @@ -651,6 +662,7 @@ private static void ValidateRoi(Rectangle roi) /// true to release both managed and unmanaged resources, otherwise false to release only unmanaged resources. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] protected override void Dispose(bool disposing) { base.Dispose(disposing); diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceObjectDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceObjectDetector.cs new file mode 100644 index 00000000000..ee41d7c0ac4 --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceObjectDetector.cs @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Threading; +using System.Threading.Tasks; +using InteropOD = Interop.MediaVision.InferenceObjectDetection; + +namespace Tizen.Multimedia.Vision +{ + /// + /// Provides the ability to detect object. + /// + /// http://tizen.org/feature/vision.inference + /// http://tizen.org/feature/vision.inference.image + /// 12 + public class InferenceObjectDetector : IDisposable + { + private IntPtr _handle; + private bool _disposed; + + /// Initializes a new instance of the class. + /// The required features are not supported. + /// 12 + public InferenceObjectDetector() + { + ValidationUtil.ValidateFeatureSupported(VisionFeatures.Inference); + ValidationUtil.ValidateFeatureSupported(VisionFeatures.InferenceImage); + + InteropOD.Create(out _handle).Validate("Failed to create inference object detector."); + + try + { + InteropOD.Configure(_handle).Validate("Failed to configure inference object detector."); + InteropOD.Prepare(_handle).Validate("Failed to prepare inference object detector."); + } + catch (Exception e) + { + Log.Error(MediaVisionLog.Tag, e.ToString()); + InteropOD.Destroy(_handle); + throw; + } + } + + /// + /// Finalizes an instance of the InferenceObjectDetector class. + /// + ~InferenceObjectDetector() + { + Dispose(false); + } + + /// + /// Detects objects on the source image synchronously. + /// + /// + /// can be empty, if there's no detected object. + /// + /// The image data to detect object. + /// BoundingBoxes of detected object. + /// The InferenceObjectDetector already has been disposed. + /// is null. + /// 12 + public InferenceObjectDetectorResult Inference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropOD.Inference(_handle, source.Handle).Validate("Failed to inference object detection."); + + return new InferenceObjectDetectorResult(_handle); + } + + /// + /// Detects objects on the source image asynchronously. + /// + /// + /// can be empty, if there's no detected object.
+ /// This method uses about twice as much memory as . + ///
+ /// The image data to detect object. + /// The InferenceObjectDetector already has been disposed. + /// is null. + /// 12 + public async Task InferenceAsync(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropOD.InferenceAsync(_handle, source.Handle).Validate("Failed to inference object detection."); + + return await Task.Factory.StartNew(() => new InferenceObjectDetectorResult(_handle), + CancellationToken.None, + TaskCreationOptions.DenyChildAttach | TaskCreationOptions.LongRunning, + TaskScheduler.Default); + } + + private ulong _requestId = 1; + /// + /// Requests detecting objects to get their bounding boxes asynchronously. + /// + /// + /// This function does not guarantee that inference is done when this method returns. The user can get the result by using .
+ /// If the user calls this method again before the previous one is finished internally, the call will be ignored.
+ /// can be empty, if there's no detected object.
+ /// Note that this method could use about twice as much memory as . + ///
+ /// The image data to detect object. + /// The request ID that indicates the order of requests. + /// The InferenceObjectDetector already has been disposed. + /// is null. + /// + /// 12 + public ulong RequestInference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropOD.InferenceAsync(_handle, source.Handle).Validate("Failed to inference object detection."); + + return _requestId++; + } + + /// + /// Gets the bounding boxes as a result of . + /// + /// + /// If there's no detected object, will be empty.
+ /// This method uses about twice as much memory as . + ///
+ /// The bounding boxes of detected object. + /// The InferenceObjectDetector already has been disposed. + /// + /// 12 + public InferenceObjectDetectorResult GetRequestResults() + { + ValidateNotDisposed(); + + return new InferenceObjectDetectorResult(_handle); + } + + /// + /// Releases the unmanaged resources used by the InferenceObjectDetector. + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // to be used if there are any other disposable objects + } + + if (_handle != IntPtr.Zero) + { + InteropOD.Destroy(_handle); + _handle = IntPtr.Zero; + } + + _disposed = true; + } + } + + /// + /// Releases all resources used by the InferenceObjectDetector. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + internal void ValidateNotDisposed() + { + if (_disposed) + { + Log.Error(MediaVisionLog.Tag, "InferenceObjectDetector handle is disposed."); + throw new ObjectDisposedException(nameof(InferenceObjectDetector)); + } + } + } +} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceObjectDetectorResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceObjectDetectorResult.cs new file mode 100755 index 00000000000..090031aa46a --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceObjectDetectorResult.cs @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 InteropOD = Interop.MediaVision.InferenceObjectDetection; + +namespace Tizen.Multimedia.Vision +{ + /// + /// Represents the result of operations. + /// + /// 12 + public class InferenceObjectDetectorResult + { + internal InferenceObjectDetectorResult(IntPtr handle) + { + InteropOD.GetResultCount(handle, out ulong requestId, out uint count). + Validate("Failed to get result count."); + + RequestId = requestId; + var boundingBoxes = new List(); + + for (uint i = 0 ; i < count ; i++) + { + InteropOD.GetBoundingBoxes(handle, i, out int left, out int top, out int right, out int bottom). + Validate("Failed to get bounding boxes."); + boundingBoxes.Add(new Rectangle(left, top, right - left, bottom - top)); + } + + BoundingBoxes = boundingBoxes; + } + + /// + /// Gets the request ID which is matched with request ID of RequestInference() return value.
+ /// It represents the order of request. + ///
+ /// The request ID that indicates the order of request. + /// 12 + public ulong RequestId { get; } + + /// + /// Gets the bounding boxes of the detected object. + /// + /// 12 + public IEnumerable BoundingBoxes { get; } + } +} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferencePoseLandmarkDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferencePoseLandmarkDetector.cs new file mode 100644 index 00000000000..73fc5fbb44a --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferencePoseLandmarkDetector.cs @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.Threading; +using System.Threading.Tasks; +using InteropPLD = Interop.MediaVision.InferencePoseLandmarkDetection; + +namespace Tizen.Multimedia.Vision +{ + /// + /// Provides the ability to detect pose landmark. + /// + /// http://tizen.org/feature/vision.inference + /// http://tizen.org/feature/vision.inference.face + /// 12 + public class InferencePoseLandmarkDetector : IDisposable + { + private IntPtr _handle; + private bool _disposed; + + /// Initializes a new instance of the class. + /// The required features are not supported. + /// 12 + public InferencePoseLandmarkDetector() + { + ValidationUtil.ValidateFeatureSupported(VisionFeatures.Inference); + ValidationUtil.ValidateFeatureSupported(VisionFeatures.InferenceFace); + + InteropPLD.Create(out _handle).Validate("Failed to create inference pose landmark detector."); + + try + { + InteropPLD.Configure(_handle).Validate("Failed to configure inference pose landmark detector."); + InteropPLD.Prepare(_handle).Validate("Failed to prepare inference pose landmark detector."); + } + catch (Exception e) + { + Log.Error(MediaVisionLog.Tag, e.ToString()); + InteropPLD.Destroy(_handle); + throw; + } + } + + /// + /// Finalizes an instance of the InferencePoseLandmarkDetector class. + /// + ~InferencePoseLandmarkDetector() + { + Dispose(false); + } + + /// + /// Detects pose landmarks on the source image synchronously. + /// + /// + /// can be empty, if there's no detected pose landmark. + /// + /// The image data to detect pose landmark. + /// The coordinates of detected pose landmarks. + /// The InferencePoseLandmarkDetector already has been disposed. + /// is null. + /// 12 + public InferencePoseLandmarkDetectorResult Inference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropPLD.Inference(_handle, source.Handle).Validate("Failed to inference pose landmark detection."); + + return new InferencePoseLandmarkDetectorResult(_handle); + } + + /// + /// Detects pose landmarks on the source image asynchronously. + /// + /// + /// can be empty, if there's no detected pose landmark.
+ /// This method uses about twice as much memory as . + ///
+ /// The image data to detect pose landmark. + /// The InferencePoseLandmarkDetector already has been disposed. + /// is null. + /// 12 + public async Task InferenceAsync(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropPLD.InferenceAsync(_handle, source.Handle).Validate("Failed to inference pose landmark detection."); + + return await Task.Factory.StartNew(() => new InferencePoseLandmarkDetectorResult(_handle), + CancellationToken.None, + TaskCreationOptions.DenyChildAttach | TaskCreationOptions.LongRunning, + TaskScheduler.Default); + } + + private ulong _requestId = 1; + /// + /// Requests detecting pose landmarks to get their points asynchronously. + /// + /// + /// This function does not guarantee that inference is done when this method returns. The user can get the result by using .
+ /// If the user calls this method again before the previous one is finished internally, the call will be ignored.
+ /// can be empty, if there's no detected pose landmark.
+ /// Note that this method could use about twice as much memory as . + ///
+ /// The image data to detect pose landmark. + /// The request ID that indicates the order of requests. + /// The InferencePoseLandmarkDetector already has been disposed. + /// is null. + /// + /// 12 + public ulong RequestInference(MediaVisionSource source) + { + ValidateNotDisposed(); + + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + InteropPLD.InferenceAsync(_handle, source.Handle).Validate("Failed to inference pose landmark detection."); + + return _requestId++; + } + + /// + /// Gets the points as a result of . + /// + /// + /// If there's no detected pose landmark, will be empty.
+ /// This method uses about twice as much memory as . + ///
+ /// The points of detected pose landmark. + /// The InferencePoseLandmarkDetector already has been disposed. + /// + /// 12 + public InferencePoseLandmarkDetectorResult GetRequestResults() + { + ValidateNotDisposed(); + + return new InferencePoseLandmarkDetectorResult(_handle); + } + + /// + /// Releases the unmanaged resources used by the InferencePoseLandmarkDetector. + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. + /// 12 + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // to be used if there are any other disposable objects + } + + if (_handle != IntPtr.Zero) + { + InteropPLD.Destroy(_handle); + _handle = IntPtr.Zero; + } + + _disposed = true; + } + } + + /// + /// Releases all resources used by the InferencePoseLandmarkDetector. + /// + /// 12 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + internal void ValidateNotDisposed() + { + if (_disposed) + { + Log.Error(MediaVisionLog.Tag, "InferencePoseLandmarkDetector handle is disposed."); + throw new ObjectDisposedException(nameof(InferencePoseLandmarkDetector)); + } + } + } +} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferencePoseLandmarkDetectorResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferencePoseLandmarkDetectorResult.cs new file mode 100755 index 00000000000..d7c9c16d713 --- /dev/null +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferencePoseLandmarkDetectorResult.cs @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 InteropPLD = Interop.MediaVision.InferencePoseLandmarkDetection; + + +namespace Tizen.Multimedia.Vision +{ + /// + /// Represents the result of operations. + /// + /// 12 + public class InferencePoseLandmarkDetectorResult + { + internal InferencePoseLandmarkDetectorResult(IntPtr handle) + { + InteropPLD.GetResultCount(handle, out ulong requestId, out uint count). + Validate("Failed to get result count."); + + RequestId = requestId; + var points = new List(); + + for (uint i = 0 ; i < count ; i++) + { + InteropPLD.GetPoints(handle, i, out uint x, out uint y).Validate("Failed to get points."); + points.Add(new Point((int)x, (int)y)); + } + + Points = points; + } + + /// + /// Gets the request ID which is matched with request ID of RequestInference() return value.
+ /// It represents the order of request. + ///
+ /// The request ID that indicates the order of request. + /// 12 + public ulong RequestId { get; } + + /// + /// Gets the coordinates of detected pose landmarks. + /// + /// 12 + public IEnumerable Points { get; } + } +} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/InferenceType.cs b/src/Tizen.Multimedia.Vision/MediaVision/InferenceType.cs index 29b844b611c..0d1f74147ba 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/InferenceType.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/InferenceType.cs @@ -22,6 +22,7 @@ namespace Tizen.Multimedia.Vision /// Specifies the type of inference backend. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public enum InferenceBackendType { /// @@ -77,6 +78,7 @@ public enum InferenceBackendType /// Specifies the target device which is used for running . /// /// 8 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public enum InferenceTargetDevice { /// @@ -99,6 +101,7 @@ public enum InferenceTargetDevice /// Specifies the data type. /// /// 8 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public enum InferenceDataType { /// diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectedEventArgs.cs b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectedEventArgs.cs index 0cb70fcc392..1b162a8427f 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectedEventArgs.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectedEventArgs.cs @@ -23,12 +23,14 @@ namespace Tizen.Multimedia.Vision /// Provides data for the event. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class MovementDetectedEventArgs : EventArgs { /// /// Initializes a new instance of the class. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public MovementDetectedEventArgs(IEnumerable areas) { Areas = areas; @@ -38,6 +40,7 @@ public MovementDetectedEventArgs(IEnumerable areas) /// Gets a set of rectangular regions where movement was detected. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public IEnumerable Areas { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs index 833a59e0732..d45417db880 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs @@ -24,6 +24,7 @@ namespace Tizen.Multimedia.Vision /// http://tizen.org/feature/vision.face_recognition /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class MovementDetectionConfiguration : SurveillanceEngineConfiguration { private const string KeyThreshold = "MV_SURVEILLANCE_MOVEMENT_DETECTION_THRESHOLD"; @@ -32,6 +33,7 @@ public class MovementDetectionConfiguration : SurveillanceEngineConfiguration /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly int DefaultThreshold = 10; /// @@ -39,6 +41,7 @@ public class MovementDetectionConfiguration : SurveillanceEngineConfiguration /// /// The required features are not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public MovementDetectionConfiguration() { } @@ -61,6 +64,7 @@ public MovementDetectionConfiguration() /// is greater than 255. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int Threshold { get diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs index e49e994bd7c..ddd689b9653 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs @@ -26,6 +26,7 @@ namespace Tizen.Multimedia.Vision /// http://tizen.org/feature/vision.image_recognition /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class MovementDetector : SurveillanceEngine { private const string KeyNumberOfRegions = "NUMBER_OF_MOVEMENT_REGIONS"; @@ -38,6 +39,7 @@ public class MovementDetector : SurveillanceEngine /// /// The required features are not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public MovementDetector() : base(MovementDetectedEventType) { } @@ -47,6 +49,7 @@ public MovementDetector() : base(MovementDetectedEventType) /// /// The event handler will be executed on an internal thread. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public event EventHandler Detected; private void RegisterEvent() @@ -88,6 +91,7 @@ private static MovementDetectedEventArgs CreateMovementDetectedEventArgs(IntPtr /// The has already been disposed of. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void AddSource(SurveillanceSource source) { AddSource(source, null); @@ -106,6 +110,7 @@ public void AddSource(SurveillanceSource source) /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void AddSource(SurveillanceSource source, MovementDetectionConfiguration config) { RegisterEvent(); diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ObjectDetectionResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/ObjectDetectionResult.cs index 9922341cf7a..faec5aa6c04 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ObjectDetectionResult.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ObjectDetectionResult.cs @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -using System.Collections.ObjectModel; +using System; namespace Tizen.Multimedia.Vision { @@ -22,6 +22,7 @@ namespace Tizen.Multimedia.Vision /// . /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class ObjectDetectionResult { internal ObjectDetectionResult(int indice, string name, float confidence, @@ -37,24 +38,28 @@ internal ObjectDetectionResult(int indice, string name, float confidence, /// Gets the indice of detected object. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int Indice { get; } /// /// Gets the name of detected object. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public string Name { get; } /// /// Gets the confidence of detected object. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public float Confidence { get; } /// /// Gets the location of detected object. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Rectangle Location { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ObjectDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/ObjectDetector.cs index 31caef671e1..4b356a416c8 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/ObjectDetector.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/ObjectDetector.cs @@ -26,6 +26,7 @@ namespace Tizen.Multimedia.Vision /// Provides the ability to detect objects and get its locations on image source using inference engine. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static class ObjectDetector { /// @@ -46,6 +47,7 @@ public static class ObjectDetector /// The caller has no required privilege. /// /// 6 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task> DetectAsync(MediaVisionSource source, InferenceModelConfiguration config) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectedEventArgs.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectedEventArgs.cs index 70d4a09e83f..027ed74beb2 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectedEventArgs.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectedEventArgs.cs @@ -23,12 +23,14 @@ namespace Tizen.Multimedia.Vision /// Provides data for the event. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class PersonAppearanceDetectedEventArgs : EventArgs { /// /// Initializes a new instance of the class. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public PersonAppearanceDetectedEventArgs(IEnumerable appeared, IEnumerable disappeared, IEnumerable tracked) { @@ -41,18 +43,21 @@ public PersonAppearanceDetectedEventArgs(IEnumerable appeared, /// Gets a set of rectangular regions where appearances of the persons were detected. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public IEnumerable AppearanceAreas { get; } /// /// Gets a set of rectangular regions where disappearances of the persons were detected. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public IEnumerable DisappearanceAreas { get; } /// /// Gets a set of rectangular regions where persons were tracked. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public IEnumerable TrackedAreas { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs index 4a713770047..29a2407cfa0 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs @@ -24,6 +24,7 @@ namespace Tizen.Multimedia.Vision /// http://tizen.org/feature/vision.face_recognition /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class PersonAppearanceDetectionConfiguration : SurveillanceEngineConfiguration { private const string KeySkipFramesCount = "MV_SURVEILLANCE_SKIP_FRAMES_COUNT"; @@ -32,6 +33,7 @@ public class PersonAppearanceDetectionConfiguration : SurveillanceEngineConfigur /// A read-only field that represents the default value of . /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static readonly int DefaultSkipFramesCount = 0; /// @@ -39,6 +41,7 @@ public class PersonAppearanceDetectionConfiguration : SurveillanceEngineConfigur /// /// The required features are not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public PersonAppearanceDetectionConfiguration() { } @@ -57,6 +60,7 @@ public PersonAppearanceDetectionConfiguration() /// is less than zero. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int SkipFramesCount { get diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs index d6c4de3c17c..4525a08298c 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs @@ -26,6 +26,7 @@ namespace Tizen.Multimedia.Vision /// http://tizen.org/feature/vision.image_recognition /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class PersonAppearanceDetector : SurveillanceEngine { private const string KeyAppearedNumber = "NUMBER_OF_APPEARED_PERSONS"; @@ -42,6 +43,7 @@ public class PersonAppearanceDetector : SurveillanceEngine /// /// The required features are not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public PersonAppearanceDetector() : base(PersonAppearanceEventType) { } @@ -51,6 +53,7 @@ public PersonAppearanceDetector() : base(PersonAppearanceEventType) /// /// The event handler will be executed on an internal thread. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public event EventHandler Detected; private void RegisterEvent() @@ -93,6 +96,7 @@ private static Rectangle[] GetResultAreas(IntPtr result, string countKey, string /// The has already been disposed of. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void AddSource(SurveillanceSource source) { AddSource(source, null); @@ -111,6 +115,7 @@ public void AddSource(SurveillanceSource source) /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void AddSource(SurveillanceSource source, PersonAppearanceDetectionConfiguration config) { RegisterEvent(); diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs index 792320d4aa6..88a2c435c2f 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs @@ -24,6 +24,7 @@ namespace Tizen.Multimedia.Vision /// http://tizen.org/feature/vision.face_recognition /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class PersonRecognitionConfiguration : SurveillanceEngineConfiguration { private const string KeyFaceRecognitionModelFilePath = "MV_SURVEILLANCE_FACE_RECOGNITION_MODEL_FILE_PATH"; @@ -35,6 +36,7 @@ public class PersonRecognitionConfiguration : SurveillanceEngineConfiguration /// is null. /// The required features are not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public PersonRecognitionConfiguration(string modelPath) { FaceRecognitionModelPath = modelPath; @@ -46,6 +48,7 @@ public PersonRecognitionConfiguration(string modelPath) /// is null. /// The already has been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public string FaceRecognitionModelPath { get diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionInfo.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionInfo.cs index eb622bb0243..970f3456525 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionInfo.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionInfo.cs @@ -14,18 +14,22 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// /// Represents a result of instances. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class PersonRecognitionInfo { /// /// Initializes a new instance of the class. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public PersonRecognitionInfo(Rectangle area, int label, double confidence) { Area = area; @@ -37,18 +41,21 @@ public PersonRecognitionInfo(Rectangle area, int label, double confidence) /// Gets the rectangular location where person face was recognized. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Rectangle Area { get; } /// /// Gets the label that correspond to the recognized person. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public int Label { get; } /// /// Gets the confidence value that correspond to the recognized person. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public double Confidence { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizedEventArgs.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizedEventArgs.cs index e28e981a52b..1009d4d6ac9 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizedEventArgs.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizedEventArgs.cs @@ -23,12 +23,14 @@ namespace Tizen.Multimedia.Vision /// Provides data for the event. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class PersonRecognizedEventArgs : EventArgs { /// /// Initializes a new instance of the class. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public PersonRecognizedEventArgs(IEnumerable recognitionInfo) { Recognitions = recognitionInfo; @@ -38,6 +40,7 @@ public PersonRecognizedEventArgs(IEnumerable recognitionI /// Gets a set of information that correspond to the recognized persons. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public IEnumerable Recognitions { get; } } } diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs index 69c4e25e65f..cd963373ce3 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs @@ -26,6 +26,7 @@ namespace Tizen.Multimedia.Vision /// http://tizen.org/feature/vision.image_recognition /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class PersonRecognizer : SurveillanceEngine { private const string KeyCount = "NUMBER_OF_PERSONS"; @@ -40,6 +41,7 @@ public class PersonRecognizer : SurveillanceEngine /// /// The required features are not supported. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public PersonRecognizer() : base(PersonRecognizedEventType) { @@ -51,6 +53,7 @@ public PersonRecognizer() : base(PersonRecognizedEventType) /// The event handler will be executed on an internal thread. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public event EventHandler Recognized; private void RegisterEvent() @@ -114,6 +117,7 @@ private PersonRecognizedEventArgs CreatePersonRecognizedEventArgs(IntPtr result) /// The model file is not supported format or file. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void AddSource(SurveillanceSource source, PersonRecognitionConfiguration config) { if (config == null) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PoseLandmarkDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/PoseLandmarkDetector.cs index 1ff688a221e..0e01df90db6 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/PoseLandmarkDetector.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/PoseLandmarkDetector.cs @@ -30,12 +30,14 @@ namespace Tizen.Multimedia.Vision /// Represents a Landmark in pose detection. /// /// 9 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public struct Landmark { /// /// Represents a location in the 2D space. /// /// 9 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Point Location { get; @@ -45,6 +47,7 @@ public Point Location /// Confidence score of point. /// /// 9 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public float Score { get; @@ -55,6 +58,7 @@ public float Score /// Provides the ability to detect Pose landmarks on image source using inference engine. /// /// 9 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static class PoseLandmarkDetector { /// @@ -77,6 +81,7 @@ public static class PoseLandmarkDetector /// The caller has no required privilege. /// /// 9 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public static async Task DetectAsync(MediaVisionSource source, InferenceModelConfiguration config) { diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs index 1fadd6d4063..2bbc1406071 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs @@ -14,6 +14,8 @@ * limitations under the License. */ +using System; + namespace Tizen.Multimedia.Vision { /// @@ -22,6 +24,7 @@ namespace Tizen.Multimedia.Vision /// http://tizen.org/feature/vision.face_recognition /// http://tizen.org/feature/vision.image_recognition /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class SurveillanceEngineConfiguration : EngineConfiguration { internal SurveillanceEngineConfiguration() : base("face_recognition", "image_recognition") diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs index cfbd25abe22..6a05ff2142f 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs @@ -30,6 +30,7 @@ namespace Tizen.Multimedia.Vision /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public abstract class SurveillanceEngine : IDisposable { private IntPtr _handle = IntPtr.Zero; @@ -70,6 +71,7 @@ internal IntPtr Handle /// /// The has already been disposed of. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public Point[] Roi { get @@ -123,6 +125,7 @@ internal void InvokeAddSource(SurveillanceSource source, SurveillanceEngineConfi /// The has already been disposed of. /// has not been added. /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void RemoveSource(SurveillanceSource source) { if (source == null) @@ -136,6 +139,7 @@ public void RemoveSource(SurveillanceSource source) /// Releases all the resources used by the object. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Dispose() { Dispose(true); @@ -149,6 +153,7 @@ public void Dispose() /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] protected virtual void Dispose(bool disposing) { if (_disposed) diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs index 7a1eb5031d5..815cc78e1c9 100755 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs +++ b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs @@ -26,6 +26,7 @@ namespace Tizen.Multimedia.Vision /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public class SurveillanceSource { private static int _nextStreamId = int.MinValue; @@ -47,6 +48,7 @@ private static int GetNextStreamId() /// Initializes a new instance of the class. /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public SurveillanceSource() { StreamId = GetNextStreamId(); @@ -65,6 +67,7 @@ public SurveillanceSource() /// /// /// 4 + [Obsolete("Deprecated since API12. Will be removed in API15.")] public void Push(MediaVisionSource source) { if (source == null) diff --git a/src/Tizen.Multimedia/AudioManager/AudioDevice.cs b/src/Tizen.Multimedia/AudioManager/AudioDevice.cs index 2f8103e7570..81a80382094 100755 --- a/src/Tizen.Multimedia/AudioManager/AudioDevice.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDevice.cs @@ -23,7 +23,11 @@ namespace Tizen.Multimedia { /// - /// Provides the ability to query the information of sound devices. + /// Represents an audio device in the system, providing functionality to query and manipulate its properties. + /// The class allows developers to interact with audio devices by retrieving + /// detailed information such as the device's ID, name, type, I/O direction, and its current running state. + /// Furthermore, it provides methods for getting and setting sample formats and rates, managing resampling options, + /// and restricting stream types to media-only, facilitating optimized audio handling for diverse applications. /// /// 3 public class AudioDevice @@ -51,35 +55,47 @@ internal AudioDevice(IntPtr deviceHandle) } /// - /// Gets the ID of the device. + /// Gets the unique identifier of the audio device. + /// This ID serves as a reference to identify the device within the system and + /// is crucial for performing operations on specific devices. /// /// The id of the device. /// 3 public int Id => _id; /// - /// Gets the name of the device. + /// Gets the name of the audio device. + /// This property provides a human-readable identifier for the device, + /// which can be used in user interfaces or logs to display information + /// about the current audio output/input device. /// /// The name of the device. /// 3 public string Name { get; } /// - /// Gets the type of the device. + /// Gets the type of the audio device. + /// This property returns an enumerated value of type + /// that indicates the specific category of the device, such as speakers, microphones, + /// or headphones, which helps in distinguishing between different device functionalities. /// /// The of the device. /// 3 public AudioDeviceType Type => _type; /// - /// Gets the IO direction of the device. + /// Gets the input/output (I/O) direction of the audio device. + /// This property indicates whether the device is designed for input (recording) or output (playback), + /// allowing developers to manage device usage appropriately in their applications. /// /// The IO direction of the device. /// 3 public AudioDeviceIoDirection IoDirection => _ioDirection; /// - /// Gets the running state of the device. + /// Gets a value indicating whether the audio device is currently running. + /// This property checks the operational state of the device and returns true + /// if the device is active and processing audio, or false if it is idle or inactive. /// /// true if the audio stream of device is running actually; otherwise, false. /// 5 @@ -95,7 +111,10 @@ public bool IsRunning } /// - /// Gets the device's supported sample formats. + /// Retrieves a collection of audio sample formats supported by the device. + /// This method returns an enumerable list of values + /// indicating the different audio formats the device can handle, enabling applications + /// to select a compatible format for audio processing. /// /// An IEnumerable<AudioSampleFormat> that contains supported sample formats. /// @@ -127,7 +146,9 @@ IEnumerable RetrieveFormats() } /// - /// Sets the device's sample format. + /// Sets the sample format for the audio device. + /// This method allows developers to specify a desired for + /// audio playback or recording. /// /// The to set to the device. /// @@ -142,7 +163,9 @@ public void SetSampleFormat(AudioSampleFormat format) } /// - /// Gets the device's sample format. + /// Gets the current sample format used by the audio device. + /// This method retrieves the current the device is operating with, + /// allowing applications to verify or adjust to the active format being utilized for audio streams. /// /// The of the device. /// @@ -195,7 +218,9 @@ private uint ConvertRateToCoreValue(uint rate) } /// - /// Gets the device's supported sample rates. + /// Retrieves the sample rates that the audio device supports. + /// This method returns an enumerable list of supported sample rates, allowing developers + /// to select an appropriate rate for audio processing based on the capabilities of the device. /// /// An IEnumerable<uint> that contains supported sample rates. /// @@ -229,7 +254,10 @@ IEnumerable RetrieveRates() } /// - /// Sets the device's sample rate. + /// Sets the sample rate for the audio device. + /// This method allows you to specify a desired sample rate (in Hz) for audio playback or recording. + /// Choosing an appropriate sample rate is important for maintaining audio quality and ensuring compatibility + /// with audio data formats. /// /// The sample rate to set to the device. /// @@ -244,7 +272,9 @@ public void SetSampleRate(uint rate) } /// - /// Gets the device's sample rate. + /// Gets the current sample rate of the audio device. + /// This method retrieves the sample rate currently in use for audio processing, allowing + /// applications to ensure they are operating with the correct audio quality settings. /// /// The sample rate of the device. /// @@ -261,7 +291,10 @@ public uint GetSampleRate() } /// - /// Sets the device's 'avoid resampling' property. + /// Sets the 'avoid resampling' property for the audio device. + /// This property controls whether the device should avoid resampling audio data during playback. + /// Enabling this feature can help preserve audio quality by preventing alterations to audio that + /// may happen during playback. /// /// The 'avoid resampling' value to set to the device. /// @@ -279,7 +312,9 @@ public void SetAvoidResampling(bool enable) } /// - /// Gets the device's 'avoid resampling' property. + /// Gets the current state of the 'avoid resampling' property for the audio device. + /// This method returns whether the device is currently configured to avoid resampling audio data, + /// allowing developers to assess the current settings related to audio processing quality. /// /// The 'avoid resampling' property of the device. /// @@ -298,7 +333,10 @@ public bool GetAvoidResampling() } /// - /// Sets the restriction of stream type only for media. + /// Sets a restriction on the audio device to allow only media streams. + /// This method configures the device to accept only audio streams of type + /// . When enabled, the device will reject + /// any other stream types, ensuring that it is exclusively used for media playback. /// /// The 'media stream only' value to set to the device. /// @@ -315,7 +353,9 @@ public void SetMediaStreamOnly(bool enable) } /// - /// Gets the restriction of stream type only for media. + /// Retrieves the current restriction status of the audio device regarding media streams. + /// This method checks whether the device is currently configured to accept only media streams, + /// returning a boolean value that indicates the state of the restriction. /// /// The 'media stream only' property of the device. /// @@ -334,7 +374,11 @@ public bool GetMediaStreamOnly() } /// - /// Returns a string that represents the current object. + /// Returns a string representation of the current instance. + /// This method provides a formatted string that includes key properties of the audio device, + /// such as its unique identifier, name, type, I/O direction, and running state. + /// This representation can be useful for logging, debugging, or displaying device information + /// in user interfaces. /// /// A string that represents the current object. /// 4 @@ -342,7 +386,9 @@ public override string ToString() => $"Id={Id}, Name={Name}, Type={Type}, IoDirection={IoDirection}, IsRunning={IsRunning}"; /// - /// Compares an object to an instance of for equality. + /// Compares the current instance of with another object for equality. + /// This method checks if the specified object is an instance of + /// and compares their unique identifiers to determine if they represent the same audio device. /// /// A to compare. /// true if the two devices are equal; otherwise, false. @@ -359,7 +405,10 @@ public override bool Equals(object obj) } /// - /// Gets the hash code for this instance of . + /// Retrieves the hash code for the current instance of . + /// This method generates a hash code based on the unique identifier of the audio device, + /// which can be useful for storing instances in hash-based collections such as dictionaries + /// or hash sets. /// /// The hash code for this instance of . /// 4 diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs index a35b013331b..2e1e26dca88 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs @@ -20,6 +20,12 @@ namespace Tizen.Multimedia { /// /// Provides data for the event. + /// This event is triggered when there is a change in the connection status of an audio device, + /// such as when a device is connected or disconnected from the system. + /// The class encapsulates information + /// about the device involved in the connection change and its current connection state, + /// allowing developers to easily respond to changes in the audio subsystem and update + /// application behavior accordingly. /// /// 3 public class AudioDeviceConnectionChangedEventArgs : EventArgs @@ -31,14 +37,23 @@ internal AudioDeviceConnectionChangedEventArgs(AudioDevice device, bool isConnec } /// - /// Gets the device. + /// Gets the device that is involved in the connection change. + /// This property returns an instance of , which represents + /// the specific audio device that has been connected or disconnected. + /// This information is essential for applications that need to manage multiple audio devices, + /// allowing them to identify the affected device and adjust their functionality accordingly. /// /// The . /// 3 public AudioDevice Device { get; } /// - /// Gets the connection state of the device. + /// Gets the current connection state of the device. + /// This property indicates whether the audio device is currently connected to the system. + /// It will return true if the device is connected and false if it has + /// been disconnected. This information is crucial for determining the audio routing and + /// playback options, enabling applications to appropriately react to the presence + /// or absence of audio devices in the environment. /// /// true if the device is connected; otherwise, false. /// 3 diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceIoDirection.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceIoDirection.cs index 26a2c89b4f7..08dfb462c42 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioDeviceIoDirection.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDeviceIoDirection.cs @@ -17,7 +17,9 @@ namespace Tizen.Multimedia { /// - /// Specifies the audio device directions. + /// Defines the data flow directions for audio devices, indicating whether + /// a device is for input, output, or both. This helps in managing audio + /// interactions within applications effectively. /// /// 3 public enum AudioDeviceIoDirection diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceRunningChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceRunningChangedEventArgs.cs index 795d2eeb017..98a8554b97c 100755 --- a/src/Tizen.Multimedia/AudioManager/AudioDeviceRunningChangedEventArgs.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDeviceRunningChangedEventArgs.cs @@ -19,7 +19,11 @@ namespace Tizen.Multimedia { /// - /// Provides data for the event. + /// Provides the data for the event, + /// which is triggered when the running state of an audio device changes. + /// This class encapsulates information about the specific audio device + /// that has undergone a state change, as well as its current running status, + /// allowing subscribers to respond appropriately to changes in audio device activity. /// /// 5 public class AudioDeviceRunningChangedEventArgs : EventArgs @@ -44,4 +48,4 @@ internal AudioDeviceRunningChangedEventArgs(AudioDevice device, bool isRunning) /// 5 public bool IsRunning { get; } } -} \ No newline at end of file +} diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceType.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceType.cs index 7fd9822e1a5..f6e4199159c 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioDeviceType.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDeviceType.cs @@ -17,58 +17,75 @@ namespace Tizen.Multimedia { /// - /// Specifies the audio device types. + /// Represents the various types of audio devices available in the system. + /// This enumeration categorizes audio devices based on their functionality and + /// connection type, enabling developers to easily identify and utilize + /// the appropriate audio device for their applications. The types include + /// built-in speakers and microphones, external connections like audio jacks, + /// Bluetooth, HDMI, USB audio, and network audio devices, facilitating + /// effective audio management in diverse scenarios. /// /// 3 public enum AudioDeviceType { /// - /// Built-in speaker. + /// Represents the built-in speaker of the device, typically used for + /// playback of audio through the device's internal audio output. /// BuiltinSpeaker, /// - /// Built-in receiver. + /// Represents the built-in receiver, usually utilized for phone calls + /// and communication through the device, providing audio input and output. /// BuiltinReceiver, /// - /// Built-in microphone. + /// Represents the built-in microphone, used for capturing audio input + /// from the environment, such as for voice commands, calls, or recordings. /// BuiltinMic, /// - /// Audio jack that can be connected to wired accessories such as headphones and headsets. + /// Indicates an audio jack that allows the connection of wired accessories + /// such as headphones and headsets, providing a physical interface for + /// audio playback and recording. /// AudioJack, /// - /// Bluetooth media (A2DP). + /// Represents Bluetooth media devices using the A2DP (Advanced Audio + /// Distribution Profile) standard for streaming high-quality audio wirelessly. /// BluetoothMedia, /// - /// HDMI. + /// Represents HDMI audio output, allowing the transmission of high-fidelity + /// audio and video to external displays or audio receivers through an HDMI cable. /// Hdmi, /// - /// Device for forwarding. + /// Represents devices used for forwarding audio data, which may involve + /// relaying audio signals to other devices or systems for processing or playback. /// Forwarding, /// - /// USB audio. + /// Represents USB audio devices, which connect through USB ports to provide + /// audio input and output, such as external sound cards or USB microphones. /// UsbAudio, /// - /// Bluetooth voice (SCO). + /// Represents Bluetooth voice devices using the SCO (Synchronous Connection + /// Oriented) profile, primarily used for voice communication over Bluetooth. /// BluetoothVoice, /// - /// Device for the transmission of audio data over a network + /// Represents devices that transmit audio data over a network, enabling audio + /// streaming or communication over internet or local networks. /// Network } diff --git a/src/Tizen.Multimedia/AudioManager/AudioDucking.cs b/src/Tizen.Multimedia/AudioManager/AudioDucking.cs index 3934a926887..e45ddc4240c 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioDucking.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDucking.cs @@ -20,7 +20,10 @@ namespace Tizen.Multimedia { /// - /// Provides the functionalities to control audio ducking. + /// Controls audio ducking for specific audio streams, allowing for dynamic + /// adjustment of audio levels during playback. This class enables the activation + /// and deactivation of ducking, monitors ducking state changes, and ensures proper + /// privileges are in place for volume adjustments. /// /// /// 6 @@ -31,7 +34,9 @@ public sealed class AudioDucking : IDisposable private Interop.AudioDucking.DuckingStateChangedCallback _duckingStateChangedCallback; /// - /// Initializes a new instance of the class with . + /// Initializes a new instance of the class for a specified audio stream type. + /// This constructor sets up the audio ducking mechanism for the target stream, allowing + /// the application to respond to ducking state changes. /// /// The type of sound stream affected by this new instance. /// is invalid. @@ -54,13 +59,16 @@ public AudioDucking(AudioStreamType targetType) } /// - /// Occurs when the ducking state is changed. + /// Occurs when the ducking state of the audio stream changes, + /// notifying subscribers of the current ducking status. /// /// 6 public event EventHandler DuckingStateChanged; /// - /// Gets the ducking state of the stream. + /// Gets a value indicating whether the audio stream is currently ducked. + /// This property checks the ducking state and returns true if the audio + /// level is lowered; otherwise, false. /// /// true if the audio stream is ducked; otherwise, false. /// Operation failed; internal error. @@ -83,7 +91,9 @@ public bool IsDucked } /// - /// Activate audio ducking + /// Activates audio ducking for a specified duration and volume ratio. + /// This method lowers the audio level of the target stream for a defined + /// period, enabling a smoother audio experience during events like notifications. /// /// The duration for ducking in milliseconds. /// The volume ratio when ducked. @@ -124,7 +134,9 @@ public void Activate(uint duration, double ratio) } /// - /// Deactivate audio ducking + /// Deactivates audio ducking, restoring the audio levels of the target stream + /// to their original state. This method is used to stop the ducking effect + /// applied earlier when needed. /// /// To deactivate ducking, the specified privilege is required. /// http://tizen.org/privilege/volume.set @@ -148,7 +160,9 @@ public void Deactivate() } /// - /// Releases all resources used by the . + /// Releases all resources used by the instance. + /// This method clears any allocated resources and should be called when + /// the object is no longer needed. /// /// 6 public void Dispose() @@ -179,4 +193,4 @@ internal AudioDuckingHandle Handle } } } -} \ No newline at end of file +} diff --git a/src/Tizen.Multimedia/AudioManager/AudioDuckingStateChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/AudioDuckingStateChangedEventArgs.cs index 484f794b8b3..7e9e2f3e9ae 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioDuckingStateChangedEventArgs.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioDuckingStateChangedEventArgs.cs @@ -19,7 +19,9 @@ namespace Tizen.Multimedia { /// - /// Provides data for the state change event of . + /// Represents the event data for the event, + /// which is triggered when the ducking state of an audio stream changes. + /// This class provides information about whether the audio stream is currently ducked or not. /// /// 6 public class AudioDuckingStateChangedEventArgs : EventArgs @@ -30,7 +32,10 @@ internal AudioDuckingStateChangedEventArgs(bool isDucked) } /// - /// Gets the ducking state of the stream. + /// Gets a value indicating whether the audio stream is currently in a ducked state. + /// This property reflects the status of the audio stream, where true + /// signifies that the audio level has been lowered, and false indicates + /// that the audio is at its normal level. /// /// true if the state is ducked; otherwise, false. /// 6 diff --git a/src/Tizen.Multimedia/AudioManager/AudioManager.cs b/src/Tizen.Multimedia/AudioManager/AudioManager.cs index 4b848c94233..4bb63d80107 100755 --- a/src/Tizen.Multimedia/AudioManager/AudioManager.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioManager.cs @@ -21,7 +21,10 @@ namespace Tizen.Multimedia { /// - /// Provides the ability to control volume levels and monitor audio devices. + /// Provides functionality to control volume levels and monitor the status of audio devices within the system. + /// The class enables developers to retrieve the volume controller, + /// obtain a list of currently connected audio devices, and subscribe to events related to device connection changes + /// as well as audio stream status changes, thereby facilitating comprehensive audio management. /// /// 3 public static class AudioManager @@ -32,14 +35,20 @@ static AudioManager() } /// - /// Gets the volume controller. + /// Gets the volume controller, which allows for adjustment and retrieval of the current audio volume level. + /// This property provides access to methods and properties that enable developers to manage volume settings + /// for different audio streams and ensure that the audio experience meets user preferences. /// /// The . /// 3 public static AudioVolume VolumeController { get; } /// - /// Gets the all devices currently connected. + /// Retrieves a collection of all audio devices currently connected to the system. + /// This method returns an , allowing developers to easily enumerate + /// through all available audio devices, such as speakers, microphones, and headphones. + /// It is useful for applications that need to adapt to changes in the audio environment or support + /// multiple audio output/input devices. /// /// An IEnumerable<AudioDevice> that contains connected devices. /// 4 @@ -94,7 +103,9 @@ IEnumerable RetrieveDevices() private static readonly object _audioDeviceConnectionLock = new object(); /// - /// Occurs when the state of a connection of an audio device changes. + /// Occurs when the state of an audio device connection changes, such as when a device is connected or disconnected. + /// Subscribing to this event allows developers to be notified of changes in the audio setup, enabling + /// dynamic adjustments in the application to accommodate new devices or handle disconnections accordingly. /// /// 3 public static event EventHandler DeviceConnectionChanged @@ -160,7 +171,12 @@ private static void UnregisterDeviceConnectionChangedEvent() private static readonly object _audioDeviceRunningLock = new object(); /// - /// Occurs when the audio stream started actually to run on the device. + /// Occurs when an audio stream starts running on a connected audio device. + /// This event is triggered when a new audio stream begins after all previous streams have stopped. + /// It is important to note that if this event is invoked while an audio stream is still running, + /// it will not be triggered again until all streams have been stopped and a new one starts. + /// This is especially useful for managing audio playback scenarios where multiple audio streams + /// may be played sequentially. /// /// /// If this event is invoked once and the audio stream is still running on the device,
diff --git a/src/Tizen.Multimedia/AudioManager/AudioPolicyException.cs b/src/Tizen.Multimedia/AudioManager/AudioPolicyException.cs index c0113f81019..33a5a24a1a8 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioPolicyException.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioPolicyException.cs @@ -19,13 +19,18 @@ namespace Tizen.Multimedia { /// - /// The exception that is thrown when noncompliance with the sound system policy happens. + /// Represents an exception that is thrown when there is a violation of the sound system policy. + /// This exception indicates that an operation has attempted to perform an action that + /// is not compliant with the established audio policies, which may affect audio playback or + /// manipulation within the application. /// /// 4 public class AudioPolicyException : InvalidOperationException { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class + /// without any error message. This constructor is typically used when the + /// exception is thrown without specific details about the error. /// /// 4 public AudioPolicyException() @@ -33,7 +38,10 @@ public AudioPolicyException() } /// - /// Initializes a new instance of the class with a specified error message. + /// Initializes a new instance of the class + /// with a specified error message. This message provides additional context + /// regarding the reason for the exception, which can be useful for debugging + /// and logging purposes. /// /// The error message that explains the reason for the exception. /// 4 @@ -42,7 +50,9 @@ public AudioPolicyException(string message) : base(message) } /// - /// Initializes a new instance of the class with a specified error message and inner exception. + /// Initializes a new instance of the class + /// with a specified error message and a reference to the inner exception + /// that is the cause of this exception. /// /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception.. diff --git a/src/Tizen.Multimedia/AudioManager/AudioSampleFormat.cs b/src/Tizen.Multimedia/AudioManager/AudioSampleFormat.cs index c679adcfc2c..1c1fc36a95f 100755 --- a/src/Tizen.Multimedia/AudioManager/AudioSampleFormat.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioSampleFormat.cs @@ -19,26 +19,42 @@ namespace Tizen.Multimedia /// /// Specifies the audio sample formats. /// + /// + /// Enumerates the various audio sample formats that are supported in the audio + /// processing system. Each format represents a different way that audio signal + /// data can be encoded and represented in memory. + /// /// 5 public enum AudioSampleFormat { /// - /// Unsigned 8 bit samples. + /// Represents audio samples encoded as unsigned 8-bit integers. + /// This format is often used in low-quality audio files and + /// applications where bandwidth or storage space is limited. /// U8, /// - /// Signed 16 bit samples. + /// Represents audio samples encoded as signed 16-bit integers in + /// little-endian format. This format is commonly used in CD-quality + /// audio, providing a good balance between audio fidelity and file size. /// S16LE, /// - /// Signed 24 bit samples. + /// Represents audio samples encoded as signed 24-bit integers in + /// little-endian format. This high-resolution format allows for greater + /// dynamic range and fidelity, making it suitable for professional audio + /// applications and high-quality sound recordings. /// S24LE, /// - /// Signed 24 bit(packed in 32 bit) samples. + /// Represents audio samples encoded as signed 24-bit integers, + /// packed into 32-bit containers in little-endian format. This format + /// can be used for applications that require compatibility with 32-bit + /// processing, allowing for easier manipulation of samples at the cost of + /// additional space. /// S24PackedIn32LE, } diff --git a/src/Tizen.Multimedia/AudioManager/AudioStreamBehaviors.cs b/src/Tizen.Multimedia/AudioManager/AudioStreamBehaviors.cs index d9c3621d15d..b991c90dbec 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioStreamBehaviors.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioStreamBehaviors.cs @@ -19,7 +19,9 @@ namespace Tizen.Multimedia { /// - /// Specifies the flags for the audio stream behaviors. + /// Defines the flags that specify the behaviors of audio streams. + /// This enumeration allows for a bitwise combination of its member values, + /// enabling flexible configurations for audio playback and management. /// /// This enumeration has a attribute that allows a bitwise combination of its member values. /// @@ -29,12 +31,18 @@ namespace Tizen.Multimedia public enum AudioStreamBehaviors { /// - /// No Resume. + /// Indicates that the audio stream should not resume automatically + /// after being paused or stopped. This flag can be used when + /// explicit control over playback is desired, requiring the application + /// to manually manage the resumption of audio playback. /// NoResume = 0x0001, /// - /// Fading. + /// Indicates that the audio stream should apply a fading effect + /// during transitions. This behavior is useful for creating smoother + /// audio experiences, such as gradually lowering the volume before + /// stopping or increasing the volume when starting playback. /// Fading = 0x0002 } diff --git a/src/Tizen.Multimedia/AudioManager/AudioStreamFocusChangedReason.cs b/src/Tizen.Multimedia/AudioManager/AudioStreamFocusChangedReason.cs index 2cc6a7cefff..13b398e0193 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioStreamFocusChangedReason.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioStreamFocusChangedReason.cs @@ -17,7 +17,9 @@ namespace Tizen.Multimedia { /// - /// Specifies the change reasons of the audio stream focus state. + /// Enumerates the reasons for changes in the focus state of an audio stream. + /// This enumeration provides specific contexts in which the audio stream + /// focus may be gained or lost, ensuring developers can respond appropriately. /// /// 3 public enum AudioStreamFocusChangedReason diff --git a/src/Tizen.Multimedia/AudioManager/AudioStreamFocusOptions.cs b/src/Tizen.Multimedia/AudioManager/AudioStreamFocusOptions.cs index efd6680a6d2..d6f58252a8d 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioStreamFocusOptions.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioStreamFocusOptions.cs @@ -19,7 +19,10 @@ namespace Tizen.Multimedia { /// - /// Specifies the flags for the audio stream focus options. + /// Defines the flags for configuring audio stream focus options. + /// This enumeration allows developers to specify different behaviors + /// regarding how audio focus should be managed within an application + /// or among multiple audio streams. /// /// This enumeration has a attribute that allows a bitwise combination of its member values. /// diff --git a/src/Tizen.Multimedia/AudioManager/AudioStreamFocusState.cs b/src/Tizen.Multimedia/AudioManager/AudioStreamFocusState.cs index 4872792eb2f..597a1d6c52a 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioStreamFocusState.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioStreamFocusState.cs @@ -17,7 +17,10 @@ namespace Tizen.Multimedia { /// - /// Specifies the audio stream focus states. + /// Represents the various states of audio stream focus within an application. + /// This enumeration defines the focus states that can be utilized to manage + /// audio playback effectively, ensuring that developers can track and respond + /// to changes in audio focus, which is crucial in multi-stream environments. /// /// 3 public enum AudioStreamFocusState diff --git a/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs b/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs index 9d450f638bb..742dad82524 100644 --- a/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs +++ b/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs @@ -15,12 +15,17 @@ */ using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Linq; namespace Tizen.Multimedia { /// - /// Provides the ability to control the sound stream. + /// Provides functionalities to control and manage sound streams within an application. + /// The class enables developers to set policies for + /// playback and recording audio streams, adjusting settings for focus and routing, + /// as well as configuring audio devices and sound effects. /// /// 3 public class AudioStreamPolicy : IDisposable @@ -62,7 +67,9 @@ public AudioStreamPolicy(AudioStreamType streamType) } /// - /// Occurs when the state of focus that belongs to the current AudioStreamPolicy is changed. + /// Occurs when the state of focus for the current changes. + /// This event allows subscribers to react to changes in audio focus state, + /// helping to manage audio playback or recording effectively. /// /// /// The event is raised in the internal thread. @@ -421,6 +428,104 @@ public bool HasStreamOnDevice(AudioDevice device) return isOn; } + /// + /// Sets the sound effect. + /// + /// + /// If is true, must be or + /// or . + /// And must not be null.
+ /// If is false, must be or + /// or . + ///
+ /// See . + /// A reference device for sound effect. + /// When is true, A reference device is null. + /// The current is not supported for sound effect with reference. + /// The has already been disposed. + /// 12 + public void SetSoundEffect(SoundEffectInfo info, bool withReference) + { + if (withReference) + { + var set = new SoundEffectType[] { SoundEffectType.ReferenceCopy, SoundEffectType.AecSpeex, SoundEffectType.AecWebrtc }; + if (!set.Contains(info.Type)) + { + Log.Error(Tag, $"Type={info.Type} is not supported for setting with reference."); + throw new ArgumentException($"{info.Type} is not supported for setting with reference."); + } + if (info.ReferenceDevice == null) + { + throw new ArgumentNullException(nameof(info.ReferenceDevice)); + } + + Log.Info(Tag, $"{info.ReferenceDevice}"); + + Interop.AudioStreamPolicy.SetSoundEffectWithReference(Handle, (SoundEffectWithReferenceNative)info.Type.ToNative(), + info.ReferenceDevice.Id).ThrowIfError("Failed to set audio effect with reference"); + } + else + { + var set = new SoundEffectType[] { SoundEffectType.NoiseSuppression, SoundEffectType.AutoGainControl, SoundEffectType.NsWithAgc }; + if (!set.Contains(info.Type)) + { + throw new ArgumentException($"{info.Type} is not supported for setting without reference."); + } + + Interop.AudioStreamPolicy.SetSoundEffect(Handle, info.Type.ToNative()). + ThrowIfError("Failed to set sound effect with reference"); + } + } + + /// + /// Gets the sound effect. + /// + /// + /// If is false, of returned value will be null. + /// + /// + /// The sound effect is not set yet.
+ /// - or -
+ /// There's no matched AudioDevice. + ///
+ /// Sound effect is not set yet. + /// The has already been disposed. + /// 12 + public SoundEffectInfo GetSoundEffect(bool withReference) + { + AudioManagerError ret = AudioManagerError.None; + SoundEffectInfo soundEffectInfo; + int deviceId = 0; + + if (withReference) + { + ret = Interop.AudioStreamPolicy.GetSoundEffectWithReference(Handle, out SoundEffectWithReferenceNative nativeEffect, out deviceId); + if (ret == AudioManagerError.InvalidParameter) + { + throw new InvalidOperationException("There's no sound effect with reference"); + } + ret.ThrowIfError("Failed to get sound effect with reference"); + + Log.Info(Tag, $"Device ID : {deviceId}"); + + soundEffectInfo = new SoundEffectInfo(nativeEffect.ToPublic(), + AudioManager.GetConnectedDevices().Where(d => d.Id == deviceId).Single()); + } + else + { + ret = Interop.AudioStreamPolicy.GetSoundEffect(Handle, out int nativeEffect); + if (ret == AudioManagerError.InvalidParameter) + { + throw new InvalidOperationException("There's no sound effect"); + } + ret.ThrowIfError("Failed to get sound effect"); + + soundEffectInfo = new SoundEffectInfo(((SoundEffectNative)nativeEffect).ToPublic()); + } + + return soundEffectInfo; + } + /// /// Releases all resources used by the . /// diff --git a/src/Tizen.Multimedia/AudioManager/SoundEffect.cs b/src/Tizen.Multimedia/AudioManager/SoundEffect.cs new file mode 100644 index 00000000000..5e6356e7e11 --- /dev/null +++ b/src/Tizen.Multimedia/AudioManager/SoundEffect.cs @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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; + +namespace Tizen.Multimedia +{ + /// + /// Defines the various types of sound effects that can be applied to audio processing. + /// Each sound effect type serves a specific purpose in enhancing audio quality for different scenarios. + /// + /// 12 + public enum SoundEffectType + { + /// + /// Applies noise suppression specifically designed for voice calls, + /// reducing background noise to enhance the clarity of the speaker's voice. + /// + NoiseSuppression, + + /// + /// Implements Auto Gain Control (AGC) to automatically adjust the audio levels + /// during normal audio capturing, ensuring consistent volume regardless of input variations. + /// + AutoGainControl, + + /// + /// Combines both Noise Suppression and Auto Gain Control, + /// providing a comprehensive solution for clear and balanced audio during calls or recordings. + /// + NsWithAgc, + + /// + /// Captures and includes the output sound from a reference audio device + /// in the recorded audio, allowing for enhanced audio mixing and playback. j + /// This effect is particularly useful when used with . + /// + /// + /// This effect should be used in conjunction with + /// to specify the audio source from which the reference sound is taken. + /// + ReferenceCopy = 0x1001, + + /// + /// Implements Acoustic Echo Cancellation (AEC) using the Speex algorithm, + /// which helps to eliminate echo and improve voice clarity during calls or recordings. + /// + /// + /// This effect should be used with + /// to optimize echo cancellation based on the reference audio input. + /// + AecSpeex, + + /// + /// Utilizes the WebRTC algorithm for Acoustic Echo Cancellation (AEC), + /// effectively reducing echo and enhancing the quality of audio communications. + /// + /// + /// This effect should be used together with + /// to ensure optimal performance in echo cancellation. + /// + AecWebrtc + } + + /// + /// Represents the configuration and parameters for applying sound effects to audio processing. + /// This structure allows you to specify the type of sound effect and, if necessary, + /// a reference audio device to enhance the audio processing capabilities. + /// + /// 12 + public struct SoundEffectInfo + { + /// + /// Initializes a new instance of the structure + /// with the specified sound effect type. The reference device is set to null. + /// + /// The SoundEffectType. + /// Invalid input enum type. + /// 12 + public SoundEffectInfo(SoundEffectType type) + { + ValidationUtil.ValidateEnum(typeof(SoundEffectType), type, nameof(type)); + + Type = type; + ReferenceDevice = null; + } + + /// + /// Initializes a new instance of the structure + /// with the specified sound effect type and a reference audio device. + /// This allows for enhanced audio processing by using additional audio data from the specified device. + /// + /// The SoundEffectType. + /// The AudioDevice to be refered. + /// 12 + public SoundEffectInfo(SoundEffectType type, AudioDevice device) + { + ValidationUtil.ValidateEnum(typeof(SoundEffectType), type, nameof(type)); + + Type = type; + ReferenceDevice = device; + } + + /// + /// Gets the type of sound effect that will be applied, as specified in the enum. + /// + /// 12 + public SoundEffectType Type { get; } + + /// + /// Gets the reference audio device used by the sound effect as an additional source of audio data. + /// + /// 12 + public AudioDevice ReferenceDevice { get; } + } + + [Flags] + internal enum SoundEffectNative + { + NoiseSuppression = 1, + AutoGainControl = 2 + } + + internal enum SoundEffectWithReferenceNative + { + ReferenceCopy = 1, + AecSpeex = 2, + AecWebrtc = 4 + } + + internal static class EnumExtensions + { + private const string Tag = "Tizen.Multimedia.AudioManager"; + + internal static int ToNative(this SoundEffectType effect) + { + int ret = 0; + + /* Native enum values are defined as below: + typedef enum { + SOUND_EFFECT_REFERENCE_COPY = 0x0001, //< Including reference source + SOUND_EFFECT_ACOUSTIC_ECHO_CANCEL_SPEEX = 0x0002, //< Acoustic echo cancel with speex + SOUND_EFFECT_ACOUSTIC_ECHO_CANCEL_WEBRTC = 0x0004, //< Acoustic echo cancel with webrtc + } sound_effect_method_with_reference_e; + + typedef enum { + SOUND_EFFECT_NOISE_SUPPRESSION_VOIP = 0x0001, //< Noise suppression for voice call + SOUND_EFFECT_AUTOMATIC_GAIN_CONTROL_CAPTURE = 0x0002, //< Auto Gain Control for normal capturing + } sound_effect_method_e; + */ + switch (effect) + { + case SoundEffectType.NoiseSuppression: + ret = 1; + break; + case SoundEffectType.AutoGainControl: + ret = 2; + break; + case SoundEffectType.NsWithAgc: + ret = 3; + break; + case SoundEffectType.ReferenceCopy: + ret = 1; + break; + case SoundEffectType.AecSpeex: + ret = 2; + break; + case SoundEffectType.AecWebrtc: + ret = 4; + break; + default: + Log.Error(Tag, "Invalid sound effect type."); + break; + } + + return ret; + } + + internal static SoundEffectType ToPublic(this SoundEffectNative effect) + { + SoundEffectType ret = SoundEffectType.NoiseSuppression; + + /* Native enum values are defined as below. And these can be set together. + typedef enum { + SOUND_EFFECT_NOISE_SUPPRESSION_VOIP = 0x0001, //< Noise suppression for voice call + SOUND_EFFECT_AUTOMATIC_GAIN_CONTROL_CAPTURE = 0x0002, //< Auto Gain Control for normal capturing + } sound_effect_method_e; + */ + switch (effect) + { + case SoundEffectNative.NoiseSuppression: + ret = SoundEffectType.NoiseSuppression; + break; + case SoundEffectNative.AutoGainControl: + ret = SoundEffectType.AutoGainControl; + break; + case SoundEffectNative.NoiseSuppression | SoundEffectNative.AutoGainControl: + ret = SoundEffectType.NsWithAgc; + break; + default: + Log.Error(Tag, "Invalid sound effect type."); + break; + } + + return ret; + } + + internal static SoundEffectType ToPublic(this SoundEffectWithReferenceNative effect) + { + SoundEffectType ret = SoundEffectType.ReferenceCopy; + + /* Native enum values are defined as below. And these cannot be set together. + typedef enum { + SOUND_EFFECT_REFERENCE_COPY = 0x0001, //< Including reference source + SOUND_EFFECT_ACOUSTIC_ECHO_CANCEL_SPEEX = 0x0002, //< Acoustic echo cancel with speex + SOUND_EFFECT_ACOUSTIC_ECHO_CANCEL_WEBRTC = 0x0004, //< Acoustic echo cancel with webrtc + } sound_effect_method_with_reference_e; + */ + switch (effect) + { + case SoundEffectWithReferenceNative.ReferenceCopy: + ret = SoundEffectType.ReferenceCopy; + break; + case SoundEffectWithReferenceNative.AecSpeex: + ret = SoundEffectType.AecSpeex; + break; + case SoundEffectWithReferenceNative.AecWebrtc: + ret = SoundEffectType.AecWebrtc; + break; + default: + Log.Error(Tag, "Invalid sound effect type."); + break; + } + + return ret; + } + } + +} diff --git a/src/Tizen.Multimedia/Common/Display.cs b/src/Tizen.Multimedia/Common/Display.cs index 841595178a8..f000d49b038 100644 --- a/src/Tizen.Multimedia/Common/Display.cs +++ b/src/Tizen.Multimedia/Common/Display.cs @@ -15,6 +15,7 @@ */ using System; using ElmSharp; +using Tizen.Common; namespace Tizen.Multimedia { @@ -175,9 +176,9 @@ public Display(NUI.Window window, bool uiSync) } /// - /// Initializes a new instance of the class with an interface. + /// Initializes a new instance of the class with an interface. /// - /// An object that provides a handle to a window. + /// An object that provides a handle to a window. /// 12 public Display(IWindowProvider window) : this(window, false) @@ -185,9 +186,9 @@ public Display(IWindowProvider window) } /// - /// Initializes a new instance of the class with an interface. + /// Initializes a new instance of the class with an interface. /// - /// An object that provides a handle to a window. + /// An object that provides a handle to a window. /// A value indicating whether video and UI are in sync or not. /// /// UI sync is only for and @@ -208,7 +209,6 @@ public Display(IWindowProvider window, bool uiSync) UiSync = uiSync; } - private EvasObject EvasObject { get; } private DisplayType Type { get; } diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs b/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs index d088bbff8bc..029ed1cc254 100644 --- a/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs +++ b/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs @@ -115,6 +115,13 @@ internal static class MediaPacket [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_duration")] internal static extern int GetDuration(IntPtr handle, out ulong value); + + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_tbm_surface")] + internal static extern int GetTbmSurface(IntPtr handle, out IntPtr surface); + + [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_has_tbm_surface_buffer")] + internal static extern int HasTbmSurface(IntPtr handle, out bool hasTbmSurface); + } internal static class MediaFormat diff --git a/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs b/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs index ede35629858..1c8f91b97a9 100644 --- a/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs +++ b/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs @@ -91,6 +91,20 @@ internal static extern AudioManagerError AddFocusStateWatchCallback(AudioStreamF [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_is_stream_on_device_by_id")] internal static extern AudioManagerError IsStreamOnDevice(AudioStreamPolicyHandle streamInfo, int deviceId, out bool isOn); + + [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_set_effect_method_with_reference_by_id")] + internal static extern AudioManagerError SetSoundEffectWithReference(AudioStreamPolicyHandle streamInfo, + SoundEffectWithReferenceNative effect, int deviceId); + + [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_effect_method_with_reference")] + internal static extern AudioManagerError GetSoundEffectWithReference(AudioStreamPolicyHandle streamInfo, + out SoundEffectWithReferenceNative effect, out int deviceId); + + [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_set_effect_method")] + internal static extern AudioManagerError SetSoundEffect(AudioStreamPolicyHandle streamInfo, int effect); + + [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_effect_method")] + internal static extern AudioManagerError GetSoundEffect(AudioStreamPolicyHandle streamInfo, out int effect); } } } \ No newline at end of file diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacket.cs b/src/Tizen.Multimedia/MediaTool/MediaPacket.cs index affdc4d77f2..7d49b8ff7c4 100644 --- a/src/Tizen.Multimedia/MediaTool/MediaPacket.cs +++ b/src/Tizen.Multimedia/MediaTool/MediaPacket.cs @@ -502,6 +502,47 @@ public MediaPacketBufferFlags BufferFlags } } + /// + /// Gets the pointer to the TBM surface object associated with the packet. + /// + /// + /// The pointer to the TBM surface object.
+ /// If packet doesn't have TBM surface, this will return IntPtr.Zero. + ///
+ /// The MediaPacket has already been disposed. + /// 12 + public IntPtr TbmSurface + { + get + { + ValidateNotDisposed(); + + int ret = Native.GetTbmSurface(_handle, out var value); + MultimediaDebug.AssertNoError(ret); + + return value; + } + } + + /// + /// Gets a value indicating whether the packet has TBM surface or not. + /// + /// true if the packet has TBM surface; otherwise, false. + /// The MediaPacket has already been disposed. + /// 12 + public bool HasTbmSurface + { + get + { + ValidateNotDisposed(); + + int ret = Native.HasTbmSurface(_handle, out var value); + MultimediaDebug.AssertNoError(ret); + + return value; + } + } + #region Dispose support /// /// Gets a value indicating whether the packet has been disposed. diff --git a/src/Tizen.NUI.AIAvatar/Tizen.NUI.AIAvatar.csproj b/src/Tizen.NUI.AIAvatar/Tizen.NUI.AIAvatar.csproj new file mode 100644 index 00000000000..0fac1407c14 --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/Tizen.NUI.AIAvatar.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + 9.0 + $(NoWarn);0618;CA1054;CA1056 + + + + + + + + + diff --git a/src/Tizen.NUI.AIAvatar/src/Animator/AnimatorBase.cs b/src/Tizen.NUI.AIAvatar/src/Animator/AnimatorBase.cs new file mode 100644 index 00000000000..a5c2ebbe7ff --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/Animator/AnimatorBase.cs @@ -0,0 +1,298 @@ +/* + * Copyright(c) 2024 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.Linq; + +namespace Tizen.NUI.AIAvatar +{ + /// + /// The base class for all animator implementations. Provides basic functionality for adding, playing, stopping, pausing, and removing animations. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public abstract class AnimatorBase : IAnimator + { + private bool disposed = false; + private string animationName = ""; + private AnimatorState currentAnimatorState = AnimatorState.Unavailable; + + + private Dictionary nameToIndex = new Dictionary(); + private Dictionary indexToName = new Dictionary(); + + /// + /// A dictionary to store animations. Each animation has a unique ID of type uint, which can be used as a key to store and retrieve the animations. + /// + protected Dictionary animations = new Dictionary(); + + + /// + /// Event triggered when the state of the animator changes. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler AnimatorStateChanged; + + /// + /// Initializes a new instance of the AnimatorBase class. + /// + protected AnimatorBase() { } + + /// + /// Adds an animation to the animator. + /// + /// The animation to add. + /// The name of the animation. + /// The index of the added animation. + [EditorBrowsable(EditorBrowsableState.Never)] + public int Add(Animation animation, string name) + { + if (animation == null) + { + throw new ArgumentNullException(nameof(animation)); + } + + if (!nameToIndex.ContainsKey(name)) + { + uint index = animation.ID; + animations.Add(index, animation); + nameToIndex.Add(name, index); + indexToName.Add(index, name); + + return (int)index; + } + else + { + throw new ArgumentException("Duplicate name: " + name); + } + + + } + + /// + /// Gets the number of animations currently added to the animator. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int Count + { + get + { + return animations.Count; + } + } + + /// + /// Plays an animation by its index. + /// + /// The index of the animation to play. + [EditorBrowsable(EditorBrowsableState.Never)] + public abstract void Play(uint index); + + /// + /// Plays an animation by its name. + /// + /// The name of the animation to play. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Play(string name) + { + if (nameToIndex.TryGetValue(name, out uint index)) + { + Play(index); + } + else + { + throw new ArgumentException($"Animation with name {name} does not exist."); + } + } + + /// + /// Stops all currently playing animations. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public abstract void Stop(); + + /// + /// Pauses all currently playing animations. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public abstract void Pause(); + + /// + /// Removes an animation by its index. + /// + /// The index of the animation to remove. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Remove(uint index) + { + if (!animations.ContainsKey(index)) + { + throw new ArgumentException($"Animation with index {index} does not exist."); + } + + Stop(); + animations.Remove(index); + nameToIndex.Remove(indexToName[index]); + indexToName.Remove(index); + } + + /// + /// Removes an animation by its name. + /// + /// The name of the animation to remove. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Remove(string name) + { + uint index = GetIndexByName(name); + + animations.Remove(index); + nameToIndex.Remove(name); + indexToName.Remove(index); + } + + /// + /// Gets the index of an animation by its name. + /// + /// The name of the animation. + /// The index of the animation. + [EditorBrowsable(EditorBrowsableState.Never)] + public uint GetIndexByName(string name) + { + if (!nameToIndex.TryGetValue(name, out uint index)) + { + throw new ArgumentException($"Animation with name {name} does not exist."); + } + return index; + } + + /// + /// Gets the name of an animation by its index. + /// + /// The index of the animation. + /// The name of the animation. + [EditorBrowsable(EditorBrowsableState.Never)] + public string GetNameByIndex(uint index) + { + if (!indexToName.TryGetValue(index, out string name)) + { + throw new ArgumentException($"Animation with index {index} does not exist."); + } + return name; + } + + /// + /// Gets the key element at the specified index in the animations dictionary. + /// + /// The zero-based index of the key element to retrieve. + /// The key element at the specified index. + [EditorBrowsable(EditorBrowsableState.Never)] + public uint GetKeyElementAt(int index) + { + return animations.Keys.ElementAt(index); + } + + /// + /// Gets or sets the current state of the animator. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public AnimatorState CurrentAnimatorState + { + get => currentAnimatorState; + protected set + { + if (currentAnimatorState != AnimatorState.AnimationFinished && currentAnimatorState == value) return; + + var preState = currentAnimatorState; + currentAnimatorState = value; + + var message = animationName; + AnimatorStateChanged?.Invoke(this, new AnimatorChangedEventArgs(preState, currentAnimatorState, message)); + animationName = ""; + } + } + + /// + /// Changes the state of the animator. + /// + /// The new state of the animator. + /// The name of the animation associated with the state change. + protected void ChangeAnimatorState(AnimatorState newState, string animationName) + { + this.animationName = animationName; + CurrentAnimatorState = newState; + } + + /// + /// Handles the Finished event of an animation. + /// + /// The object that raised the event. + /// The event arguments. + protected void OnAnimationFinished(object sender, EventArgs e) + { + if (!(sender is Animation anim)) return; + + anim.Finished -= OnAnimationFinished; + foreach (var animation in animations.Values) + { + if (animation.State == Animation.States.Playing) + { + ChangeAnimatorState(AnimatorState.AnimationFinished, indexToName[anim.ID]); + return; + } + } + + ChangeAnimatorState(AnimatorState.Stopped, indexToName[anim.ID]); + } + + /// + /// Releases all resources used by the AnimatorBase class. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Releases the unmanaged resources used by the AnimatorBase class and optionally releases the managed resources. + /// + /// True to release both managed and unmanaged resources; false to release only unmanaged resources. + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + // Managed resources cleanup + if (animations != null) + { + foreach (var animation in animations.Values) + { + animation.Dispose(); + } + animations.Clear(); + animations = null; + } + } + // Unmanaged resources cleanup + + disposed = true; + } + } + } +} diff --git a/src/Tizen.AIAvatar/src/Animations/AvatarMotionChangedEventArgs.cs b/src/Tizen.NUI.AIAvatar/src/Animator/Core/AnimatorChangedEventArgs.cs similarity index 75% rename from src/Tizen.AIAvatar/src/Animations/AvatarMotionChangedEventArgs.cs rename to src/Tizen.NUI.AIAvatar/src/Animator/Core/AnimatorChangedEventArgs.cs index 4210248d020..aa2bef2701f 100644 --- a/src/Tizen.AIAvatar/src/Animations/AvatarMotionChangedEventArgs.cs +++ b/src/Tizen.NUI.AIAvatar/src/Animator/Core/AnimatorChangedEventArgs.cs @@ -18,7 +18,7 @@ using System; using System.ComponentModel; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { /// /// This class provides arguments for handling avatar motion change events. @@ -26,25 +26,27 @@ namespace Tizen.AIAvatar /// The current state of the avatar's motion. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class AvatarMotionChangedEventArgs : EventArgs + public class AnimatorChangedEventArgs : EventArgs { /// /// Initializes a new instance of the AvatarMotionChangedEventArgs class with the specified previous and current states. /// /// The previous state of the avatar's motion. /// The current state of the avatar's motion. + /// The current Animation of the Animation name. [EditorBrowsable(EditorBrowsableState.Never)] - public AvatarMotionChangedEventArgs(AvatarMotionState previous, AvatarMotionState current) + public AnimatorChangedEventArgs(AnimatorState previous, AnimatorState current, string message = "") { Previous = previous; Current = current; + Message = message; } /// /// The previous state. /// [EditorBrowsable(EditorBrowsableState.Never)] - public AvatarMotionState Previous + public AnimatorState Previous { get; internal set; @@ -54,7 +56,17 @@ public AvatarMotionState Previous /// The current state. /// [EditorBrowsable(EditorBrowsableState.Never)] - public AvatarMotionState Current + public AnimatorState Current + { + get; + internal set; + } + + /// + /// The Message string. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Message { get; internal set; diff --git a/src/Tizen.NUI.AIAvatar/src/Animator/Core/AnimatorState.cs b/src/Tizen.NUI.AIAvatar/src/Animator/Core/AnimatorState.cs new file mode 100644 index 00000000000..2f100cfa40a --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/Animator/Core/AnimatorState.cs @@ -0,0 +1,70 @@ +/* + * Copyright(c) 2024 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.ComponentModel; + +namespace Tizen.NUI.AIAvatar +{ + /// + /// Enumeration for the states. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum AnimatorState + { + /// + /// Fail state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Failed = -1, + + /// + /// Ready state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Ready = 0, + + /// + /// Playing state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Playing = 3, + + /// + /// Paused state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Paused = 4, + + /// + /// Stopped state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Stopped = 5, + + /// + /// AnimationFinished state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + AnimationFinished = 6, + + /// + /// Unavailable state. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Unavailable + }; +} diff --git a/src/Tizen.NUI.AIAvatar/src/Animator/Core/IAnimator.cs b/src/Tizen.NUI.AIAvatar/src/Animator/Core/IAnimator.cs new file mode 100644 index 00000000000..bd364236462 --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/Animator/Core/IAnimator.cs @@ -0,0 +1,99 @@ + +using System; +using System.ComponentModel; +using Tizen.NUI; + +namespace Tizen.NUI.AIAvatar +{ + /// + /// Represents an animator that can play and manage a collection of animations. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public interface IAnimator : IDisposable + { + /// + /// Adds an animation to the animator with a given name. + /// + /// The animation to add. + /// The name to associate with the animation. + /// The index of the added animation. + [EditorBrowsable(EditorBrowsableState.Never)] + int Add(Animation animation, string name); + + /// + /// Gets the number of animations currently managed by the animator. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + int Count { get; } + + /// + /// Plays the animation at the specified index. + /// + /// The index of the animation to play. + [EditorBrowsable(EditorBrowsableState.Never)] + void Play(uint index); + + /// + /// Plays the animation with the specified name. + /// + /// The name of the animation to play. + [EditorBrowsable(EditorBrowsableState.Never)] + void Play(string name); + + /// + /// Stops all currently playing animations. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + void Stop(); + + /// + /// Pauses all currently playing animations. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + void Pause(); + + /// + /// Removes the animation at the specified index. + /// + /// The index of the animation to remove. + [EditorBrowsable(EditorBrowsableState.Never)] + void Remove(uint index); + + /// + /// Removes the animation with the specified name. + /// + /// The name of the animation to remove. + [EditorBrowsable(EditorBrowsableState.Never)] + void Remove(string name); + + /// + /// Gets the index of the animation with the specified name. + /// + /// The name of the animation to find. + /// The index of the animation with the specified name. + [EditorBrowsable(EditorBrowsableState.Never)] + uint GetIndexByName(string name); + + /// + /// Gets the name of the animation at the specified index. + /// + /// The index of the animation to find. + /// The name of the animation at the specified index. + [EditorBrowsable(EditorBrowsableState.Never)] + string GetNameByIndex(uint index); + + /// + /// Gets the key element at the specified index in the animator's collection. + /// + /// The index of the key element to retrieve. + /// The key element at the specified index. + [EditorBrowsable(EditorBrowsableState.Never)] + uint GetKeyElementAt(int index); + + /// + /// Gets the current state of the animator. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + AnimatorState CurrentAnimatorState { get; } + } +} diff --git a/src/Tizen.NUI.AIAvatar/src/Animator/EmotionAnimator.cs b/src/Tizen.NUI.AIAvatar/src/Animator/EmotionAnimator.cs new file mode 100644 index 00000000000..41ff5eaba42 --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/Animator/EmotionAnimator.cs @@ -0,0 +1,164 @@ +/* + * Copyright(c) 2024 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 System.Text.Json; +using Tizen.NUI.Scene3D; + +namespace Tizen.NUI.AIAvatar +{ + /// + /// The EmotionAnimator class extends SerialAnimator and provides functionality to play animations based on emotions. + /// It manages emotion configurations, generates expression data animations, and loads necessary resources. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class EmotionAnimator : SerialAnimator + { + + private EmotionConfig EmotionConfigData; + private Dictionary> expressionDataByCategory; + private Dictionary> expressionIdByCategory; + + /// + /// Plays a random animation from the specified emotion category. + /// If the emotion is not found, plays a random animation from the "normal" category. + /// + /// The emotion category to play. + [EditorBrowsable(EditorBrowsableState.Never)] + public new void Play(string emotion) + { + if (expressionIdByCategory.TryGetValue(emotion.ToLower(), out List expressionList)) + { + int randomIndex = new Random().Next(0, expressionList.Count); + base.Play(expressionList[randomIndex]); + } + else if (expressionIdByCategory.TryGetValue("normal", out List normalList)) + { + int randomIndex = new Random().Next(0, normalList.Count); + base.Play(normalList[randomIndex]); + } + } + + /// + /// Generates expression data animations for the given model. + /// Throws exceptions if the model is null or its resources are not ready. + /// + /// The model to generate animations for. + [EditorBrowsable(EditorBrowsableState.Never)] + public void GenerateExpressionDataAnimation(Model model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + if (!model.IsResourceReady()) + { + throw new InvalidOperationException("The model resource is not ready."); + } + + expressionIdByCategory = new Dictionary>(); + + foreach (var category in expressionDataByCategory) + { + int categoryCount = 0; + + if (!expressionIdByCategory.ContainsKey(category.Key)) + { + expressionIdByCategory[category.Key] = new List(); + } + + foreach (var motionData in category.Value) + { + var animation = model.GenerateMotionDataAnimation(motionData); + string key = $"{category.Key}_{categoryCount}"; + uint animationId = (uint)Add(animation, key); + expressionIdByCategory[category.Key].Add(animationId); + categoryCount++; + } + } + } + + /// + /// Loads the emotion configuration data from the specified JSON file and expression data from the given resource path. + /// Throws exceptions if there are errors reading the files or if the paths are invalid. + /// + /// The path to the emotion configuration JSON file. + /// The path to the directory containing expression resource files. + [EditorBrowsable(EditorBrowsableState.Never)] + public void LoadEmotionConfig(in string configPath, in string expressionResourcePath) + { + try + { + string json = File.ReadAllText(configPath); + EmotionConfigData = JsonSerializer.Deserialize(json); + } + catch (JsonException ex) + { + throw new Exception($"Error loading Emotion Config data from {configPath}: {ex}"); + } + + LoadExpressionData(expressionResourcePath); + + } + + /// + /// Loads expression data from the specified resource path. + /// Throws exceptions if the resource path is null or empty, or if any expression files are missing. + /// + /// The path to the directory containing expression resource files. + private void LoadExpressionData(string expressionResourcePath) + { + + if (string.IsNullOrEmpty(expressionResourcePath)) + { + throw new ArgumentException("expressionResourcePath cannot be null or empty.", nameof(expressionResourcePath)); + } + + + expressionDataByCategory = new Dictionary>(); + + foreach (Expression expression in EmotionConfigData.expressions) + { + if (!expressionDataByCategory.ContainsKey(expression.name)) + { + expressionDataByCategory[expression.name] = new List(); + } + + foreach (string filename in expression.filename) + { + string expressionFile = global::System.IO.Path.Combine(expressionResourcePath, filename); + + if (!File.Exists(expressionFile)) + { + throw new FileNotFoundException($"Expression file not found: {expressionFile}", expressionFile); + } + + string expressionJson = File.ReadAllText(expressionFile); + + FaceAnimationData expressionFaceAnimationData = JsonSerializer.Deserialize(expressionJson); + MotionData expressionFaceMotionData = AnimationLoader.Instance.CreateFacialMotionData(expressionFaceAnimationData, EmotionConfigData.ignoreBlendShapes); + expressionDataByCategory[expression.name].Add(expressionFaceMotionData); + } + + } + } + } +} diff --git a/src/Tizen.NUI.AIAvatar/src/Animator/ParallelAnimator.cs b/src/Tizen.NUI.AIAvatar/src/Animator/ParallelAnimator.cs new file mode 100644 index 00000000000..033400b493d --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/Animator/ParallelAnimator.cs @@ -0,0 +1,174 @@ +/* + * Copyright(c) 2024 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.Linq; +using Tizen.NUI; + +namespace Tizen.NUI.AIAvatar +{ + /// + /// The ParallelAnimator class extends the AnimatorBase class and provides methods to play, stop, and pause animations in parallel. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class ParallelAnimator : AnimatorBase + { + /// + /// Plays the animation at the specified index. + /// + /// The index of the animation to play. + [EditorBrowsable(EditorBrowsableState.Never)] + public override void Play(uint index) + { + Play(new List { index }); + } + + /// + /// Stops all playing animations. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void Stop() + { + Stop(null); + } + + /// + /// Pauses all playing animations. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void Pause() + { + Pause(null); + } + + /// + /// Plays the specified animations in parallel. + /// + /// A list of indices of the animations to play. If null, all animations will be played. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Play(IEnumerable indexes = null) + { + string names = string.Join(", ", indexes?.Select(index => GetNameByIndex(animations[index].ID)).Where(name => !string.IsNullOrEmpty(name)) ?? Enumerable.Empty()); + + if (indexes == null) + { + foreach (var animation in animations.Values) + { + animation.Finished += OnAnimationFinished; + animation.Play(); + } + } + else + { + foreach (var index in indexes) + { + if (animations.TryGetValue(index, out var animation)) + { + animation.Finished += OnAnimationFinished; + animation.Play(); + } + } + } + + ChangeAnimatorState(AnimatorState.Playing, names); + } + + /// + /// Stops the specified animations or all playing animations if no indices are provided. + /// + /// A list of indices of the animations to stop. If null, all playing animations will be stopped. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Stop(IEnumerable indexes = null) + { + int count = 0; + string names = string.Join(", ", indexes?.Select(index => GetNameByIndex(animations[index].ID)).Where(name => !string.IsNullOrEmpty(name)) ?? Enumerable.Empty()); + + if (indexes == null) + { + foreach (var animation in animations.Values) + { + if (animation.State == Animation.States.Playing) + { + animation.Finished -= OnAnimationFinished; + animation.Stop(); + count++; + } + } + } + else + { + foreach (var index in indexes) + { + if (animations.TryGetValue(index, out var animation)) + { + if (animation.State == Animation.States.Playing) + { + animation.Finished -= OnAnimationFinished; + animation.Stop(); + count++; + } + } + } + } + + if(count > 0) ChangeAnimatorState(AnimatorState.Stopped, names); + } + + /// + /// Pauses the specified animations or all playing animations if no indices are provided. + /// + /// A list of indices of the animations to pause. If null, all playing animations will be paused. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Pause(IEnumerable indexes = null) + { + int count = 0; + string names = string.Join(", ", indexes?.Select(index => GetNameByIndex(animations[index].ID)).Where(name => !string.IsNullOrEmpty(name)) ?? Enumerable.Empty()); + + if (indexes == null) + { + foreach (var animation in animations.Values) + { + if (animation.State == Animation.States.Playing) + { + animation.Finished -= OnAnimationFinished; + animation.Pause(); + count++; + } + } + } + else + { + foreach (var index in indexes) + { + if (animations.TryGetValue(index, out var animation)) + { + if (animation.State == Animation.States.Playing) + { + animation.Finished -= OnAnimationFinished; + animation.Pause(); + count++; + } + } + } + } + + if(count > 0) ChangeAnimatorState(AnimatorState.Paused, names); + } + } +} diff --git a/src/Tizen.NUI.AIAvatar/src/Animator/SerialAnimator.cs b/src/Tizen.NUI.AIAvatar/src/Animator/SerialAnimator.cs new file mode 100644 index 00000000000..3762f9f6db9 --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/Animator/SerialAnimator.cs @@ -0,0 +1,89 @@ +/* + * Copyright(c) 2024 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.ComponentModel; +using Tizen.Applications; + +namespace Tizen.NUI.AIAvatar +{ + /// + /// Represents an animator that plays animations in a serial manner. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class SerialAnimator : AnimatorBase + { + private uint playIndex; + + private void PlayMainThreadAnimation() + { + animations[playIndex].Finished += OnAnimationFinished; + animations[playIndex].Play(); + + ChangeAnimatorState(AnimatorState.Playing, GetNameByIndex(playIndex)); + } + + /// + /// Plays the animation corresponding to the specified index. + /// + /// The index of the animation to play. + /// Thrown when the specified animation index does not exist. + [EditorBrowsable(EditorBrowsableState.Never)] + public override void Play(uint index) + { + Stop(); + + if (!animations.ContainsKey(index)) + { + throw new ArgumentException($"Animation with index {index} does not exist."); + } + + playIndex = index; + CoreApplication.Post(PlayMainThreadAnimation); + } + + /// + /// Stops the currently playing animation. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void Stop() + { + if (animations.ContainsKey(playIndex)) + { + animations[playIndex].Finished -= OnAnimationFinished; + animations[playIndex].Stop(); + + ChangeAnimatorState(AnimatorState.Stopped, GetNameByIndex(playIndex)); + } + } + + /// + /// Pauses the currently playing animation. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void Pause() + { + if (animations.ContainsKey(playIndex)) + { + animations[playIndex].Finished -= OnAnimationFinished; + animations[playIndex].Pause(); + + ChangeAnimatorState(AnimatorState.Paused, GetNameByIndex(playIndex)); + } + } + } +} diff --git a/src/Tizen.NUI.AIAvatar/src/Animator/Utility/AnimationLoader.cs b/src/Tizen.NUI.AIAvatar/src/Animator/Utility/AnimationLoader.cs new file mode 100644 index 00000000000..8f54fb96325 --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/Animator/Utility/AnimationLoader.cs @@ -0,0 +1,208 @@ +/* + * Copyright(c) 2024 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.Collections.Generic; +using System.IO; +using System.Security; +using System; +using Tizen.NUI.Scene3D; +using Tizen.NUI; +using System.Text.Json; +using System.Linq; +using System.Xml.Linq; +using System.ComponentModel; + +namespace Tizen.NUI.AIAvatar +{ + /// + /// The AnimationLoader class provides methods to load and manage body and face motion data from specified resources. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class AnimationLoader + { + /// + /// A singleton instance of the AnimationLoader class. + /// + private static readonly Lazy instance = new Lazy(() => new AnimationLoader()); + + /// + /// Gets the singleton instance of the AnimationLoader class. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static AnimationLoader Instance => instance.Value; + + + /// + /// Loads a single body motion from the specified resource path. + /// + /// The path to the body motion resource file. + /// A boolean indicating whether to use only root translation. + /// The scale factor to apply to the motion data. + /// A boolean indicating whether to load the data synchronously. + /// A MotionInfo object containing the loaded body motion data. + /// Thrown if there is an error loading the body motion data. + [EditorBrowsable(EditorBrowsableState.Never)] + public MotionInfo LoadBodyMotion(in string resourcePath, bool useRootTranslationOnly, Vector3 scale = null, bool synchronousLoad = false) + { + try + { + string fileName = global::System.IO.Path.GetFileNameWithoutExtension(resourcePath); + var bodyMotionData = new MotionData(); + bodyMotionData.LoadMotionCaptureAnimation(resourcePath, useRootTranslationOnly, scale, synchronousLoad); + return new MotionInfo(bodyMotionData, fileName); + } + catch (Exception ex) + { + throw new Exception($"Error loading body motion data from {resourcePath}: {ex}"); + } + } + + /// + /// Loads multiple body motions from the specified directory path. + /// + /// The path to the directory containing body motion resource files. + /// A boolean indicating whether to use only root translation. + /// The scale factor to apply to the motion data. + /// A boolean indicating whether to load the data synchronously. + /// A list of MotionInfo objects containing the loaded body motion data. + /// Thrown if there is an error reading the body motion resource directory. + [EditorBrowsable(EditorBrowsableState.Never)] + public List LoadBodyMotions(in string bodyMotionDirectoryPath, bool useRootTranslationOnly, Vector3 scale = null, bool synchronousLoad = false) + { + try + { + var motionInfoList = new List(); + var bodyMotionAnimations = Directory.GetFiles(bodyMotionDirectoryPath, "*.bvh"); + + foreach (var path in bodyMotionAnimations) + { + motionInfoList.Add(LoadBodyMotion(path, useRootTranslationOnly, scale, synchronousLoad)); + } + return motionInfoList; + } + catch (DirectoryNotFoundException ex) + { + throw new Exception($"Body motion resource directory not found: {ex.Message}"); + } + catch (IOException ex) + { + throw new Exception($"Error reading body motion resource directory: {ex.Message}"); + } + catch (SecurityException ex) + { + throw new Exception($"Security error reading body motion resource directory: {ex.Message}"); + } + } + + /// + /// Loads a single face motion from the specified resource path. + /// + /// The path to the face motion resource file. + /// A MotionInfo object containing the loaded face motion data. + /// Thrown if there is an error loading the face animation data. + [EditorBrowsable(EditorBrowsableState.Never)] + public MotionInfo LoadFaceMotion(in string resourcePath) + { + try + { + string fileName = global::System.IO.Path.GetFileNameWithoutExtension(resourcePath); + string json = File.ReadAllText(resourcePath); + var faceAnimationData = JsonSerializer.Deserialize(json); + var motionData = CreateFacialMotionData(faceAnimationData); + return new MotionInfo(motionData, fileName); + } + catch (JsonException ex) + { + throw new Exception($"Error loading face animation data from {resourcePath}: {ex}"); + } + } + + /// + /// Loads multiple face motions from the specified directory path. + /// + /// The path to the directory containing face motion resource files. + /// A list of MotionInfo objects containing the loaded face motion data. + /// Thrown if there is an error reading the face motion resource directory. + [EditorBrowsable(EditorBrowsableState.Never)] + public List LoadFaceMotions(in string faceMotionDirectoryPath) + { + try + { + var motionInfoList = new List(); + var faceMotionAnimations = Directory.GetFiles(faceMotionDirectoryPath, "*.json"); + + foreach (var path in faceMotionAnimations) + { + motionInfoList.Add(LoadFaceMotion(path)); + } + return motionInfoList; + } + catch (DirectoryNotFoundException ex) + { + throw new Exception($"Face motion resource directory not found: {ex.Message}"); + } + catch (IOException ex) + { + throw new Exception($"Error reading face motion resource directory: {ex.Message}"); + } + catch (SecurityException ex) + { + throw new Exception($"Security error reading face motion resource directory: {ex.Message}"); + } + } + + + internal MotionData CreateFacialMotionData(FaceAnimationData facialAnimation, List ignoreBlendShapes = null) + { + + int frames = facialAnimation.frames; + + if (frames == 0) return null; + + int endTime = facialAnimation.time[frames - 1] + 200; + MotionData motionData = new MotionData((int)(endTime * 1.5)); + + + foreach (var blendshape in facialAnimation.blendShapes) + { + using var modelNodeID = new PropertyKey(blendshape.name); + IgnoreBlendShape ignoreBS = ignoreBlendShapes?.FirstOrDefault(x => x.name == blendshape.name); + + + for (int target = 0; target < blendshape.morphtarget; target++) + { + if (ignoreBS != null && ignoreBS.morphname.Contains(blendshape.morphname[target])) continue; + + using var keyFrames = new KeyFrames(); + using var blendShapeID = new PropertyKey(blendshape.morphname[target]); + using var blendshapeIndex = new BlendShapeIndex(modelNodeID, blendShapeID); + + for (int frame = 0; frame < frames; frame++) + { + keyFrames.Add((float)facialAnimation.time[frame] / endTime, blendshape.key[frame][target]); + } + keyFrames.Add((float)(facialAnimation.time[frames - 1] + 200) / endTime, 0.0f); + + using var motionValue = new MotionValue(keyFrames); + + motionData.Add(blendshapeIndex, motionValue); + } + } + + return motionData; + } + } +} diff --git a/src/Tizen.NUI.AIAvatar/src/Animator/Utility/FaceAnimationData.cs b/src/Tizen.NUI.AIAvatar/src/Animator/Utility/FaceAnimationData.cs new file mode 100644 index 00000000000..a6055cd9796 --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/Animator/Utility/FaceAnimationData.cs @@ -0,0 +1,62 @@ +/* + * Copyright(c) 2024 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.Collections.Generic; +using System.Linq.Expressions; + +namespace Tizen.NUI.AIAvatar +{ + internal class FaceAnimationData + { + public string name { get; set; } + public string version { get; set; } + public List blendShapes { get; set; } + public int shapesAmount { get; set; } + public List time { get; set; } + public int frames { get; set; } + } + internal class FaceAnimBlendShape + { + public string name { get; set; } + public string fullName { get; set; } + public string blendShapeVersion { get; set; } + public int morphtarget { get; set; } + public List morphname { get; set; } + public List> key { get; set; } + } + + + internal class Expression + { + public string name { get; set; } + public List filename { get; set; } + } + + internal class IgnoreBlendShape + { + public string name { get; set; } + public List morphname { get; set; } + } + + + internal class EmotionConfig + { + public List expressions { get; set; } + public List ignoreBlendShapes { get; set; } + } + + +} diff --git a/src/Tizen.AIAvatar/src/Common/AvatarInfo.cs b/src/Tizen.NUI.AIAvatar/src/Common/AvatarInfo.cs similarity index 92% rename from src/Tizen.AIAvatar/src/Common/AvatarInfo.cs rename to src/Tizen.NUI.AIAvatar/src/Common/AvatarInfo.cs index 3a4cf3d6133..74440f9f79e 100644 --- a/src/Tizen.AIAvatar/src/Common/AvatarInfo.cs +++ b/src/Tizen.NUI.AIAvatar/src/Common/AvatarInfo.cs @@ -17,8 +17,6 @@ using System.ComponentModel; -using static Tizen.AIAvatar.AIAvatar; - namespace Tizen.AIAvatar { /// @@ -76,11 +74,10 @@ public AvatarInfo(string name, string path, AvatarInfoOption info = AvatarInfoOp } } - internal AvatarInfo(string directoryPath) - { - string path = ApplicationResourcePath + EmojiAvatarResourcePath; - Name = directoryPath.Substring(path.Length, directoryPath.Length - path.Length); - ResourcePath = $"{directoryPath}/{AIAvatar.ExternalModel}"; + internal AvatarInfo(string avatarPath) + { + Name = global::System.IO.Path.GetFileNameWithoutExtension(avatarPath); + ResourcePath = avatarPath; } } diff --git a/src/Tizen.AIAvatar/src/Common/AvatarProperties.cs b/src/Tizen.NUI.AIAvatar/src/Common/Properties/AvatarProperties.cs similarity index 98% rename from src/Tizen.AIAvatar/src/Common/AvatarProperties.cs rename to src/Tizen.NUI.AIAvatar/src/Common/Properties/AvatarProperties.cs index 6a3f73ffde9..5a338bd60f0 100644 --- a/src/Tizen.AIAvatar/src/Common/AvatarProperties.cs +++ b/src/Tizen.NUI.AIAvatar/src/Common/Properties/AvatarProperties.cs @@ -19,7 +19,7 @@ using System.ComponentModel; using Tizen.NUI.Scene3D; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { /// @@ -29,7 +29,7 @@ namespace Tizen.AIAvatar /// This structure enables users to work with Avatar properties in a more convenient way. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class AvatarProperties + internal abstract class AvatarProperties { private AvatarPropertyMapper jointMapper; private AvatarPropertyMapper blendShapeMapper; diff --git a/src/Tizen.AIAvatar/src/Common/AvatarPropertyMapper.cs b/src/Tizen.NUI.AIAvatar/src/Common/Properties/AvatarPropertyMapper.cs similarity index 94% rename from src/Tizen.AIAvatar/src/Common/AvatarPropertyMapper.cs rename to src/Tizen.NUI.AIAvatar/src/Common/Properties/AvatarPropertyMapper.cs index 8098dd6e92b..ae4d96ce676 100644 --- a/src/Tizen.AIAvatar/src/Common/AvatarPropertyMapper.cs +++ b/src/Tizen.NUI.AIAvatar/src/Common/Properties/AvatarPropertyMapper.cs @@ -18,7 +18,7 @@ using System.Collections.Generic; using System.ComponentModel; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { /// /// The AvatarPropertyMapper class manages property mapping information for specific attributes of an Avatar model. @@ -27,7 +27,7 @@ namespace Tizen.AIAvatar /// This approach provides consistency and convenience when working with Avatar models. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class AvatarPropertyMapper + internal class AvatarPropertyMapper { /// /// Mapper between index and property name @@ -161,5 +161,15 @@ public string GetPropertyName(uint index) mapper.TryGetValue(index, out ret); return ret; } + + /// + /// Clear AvatarPropertyNameMapper. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Clear() + { + mapper.Clear(); + customIndexCounter = 0u; + } } } diff --git a/src/Tizen.AIAvatar/src/Internal/DefaultAvatarProperties.cs b/src/Tizen.NUI.AIAvatar/src/Common/Properties/EmojiAvatarProperties.cs similarity index 74% rename from src/Tizen.AIAvatar/src/Internal/DefaultAvatarProperties.cs rename to src/Tizen.NUI.AIAvatar/src/Common/Properties/EmojiAvatarProperties.cs index 57fe550e5dc..bda0975c038 100644 --- a/src/Tizen.AIAvatar/src/Internal/DefaultAvatarProperties.cs +++ b/src/Tizen.NUI.AIAvatar/src/Common/Properties/EmojiAvatarProperties.cs @@ -17,15 +17,21 @@ using System.Collections.Generic; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { - internal class DefaultAvatarProperties : AvatarProperties + /// + /// Represents properties specific to an Emoji avatar, including mappings for joints, blend shapes, and nodes. + /// + internal class EmojiAvatarProperties : AvatarProperties { private static AvatarPropertyMapper defaultJointMapper = new AvatarPropertyMapper(); private static AvatarPropertyMapper defaultBlendShapeNameMapper = new AvatarPropertyMapper(); private static AvatarPropertyMapper defaultNodeMapper = new AvatarPropertyMapper(); - internal DefaultAvatarProperties() : base(defaultJointMapper, defaultBlendShapeNameMapper, defaultNodeMapper) + /// + /// Initializes a new instance of the EmojiAvatarProperties class using default mappers for joints, blend shapes, and nodes. + /// + public EmojiAvatarProperties() : base(defaultJointMapper, defaultBlendShapeNameMapper, defaultNodeMapper) { Initialize(); } @@ -49,8 +55,74 @@ private void Initialize() } + /// + /// Reinitializes the property mappings for joints and nodes. + /// + public void Reinitialize() + { + BlendShapeMapper.Clear(); + JointMapper.Clear(); + NodeMapper.Clear(); + Initialize(); + } + + /// + /// Updates a blend shape mapping. + /// + /// The blend shape type identifier. + /// The blend shape name. + public void UpdateBlendShapeMapping(BlendShapeType key, string value) + { + var existingIndex = blendShapeList.FindIndex(item => item.Item1 == key); + if (existingIndex >= 0) + { + blendShapeList[existingIndex] = (key, value); + } + else + { + throw new KeyNotFoundException("Blend shape type identifier not found."); + } + } + + /// + /// Updates a joint mapping. + /// + /// The joint type identifier. + /// The joint name. + public void UpdateJointMapping(JointType key, string value) + { + var existingIndex = jointList.FindIndex(item => item.Item1 == key); + if (existingIndex >= 0) + { + jointList[existingIndex] = (key, value); + } + else + { + throw new KeyNotFoundException("Joint type identifier not found."); + } + } + + /// + /// Updates a node mapping. + /// + /// The node type identifier. + /// The node name. + public void UpdateNodeMapping(NodeType key, string value) + { + var existingIndex = nodeList.FindIndex(item => item.Item1 == key); + if (existingIndex >= 0) + { + nodeList[existingIndex] = (key, value); + } + else + { + throw new KeyNotFoundException("Node type identifier not found."); + } + } + + #region AR Emoji BlendShape name list - private static readonly List<(BlendShapeType, string)> blendShapeList = new List<(BlendShapeType, string)>() + private List<(BlendShapeType, string)> blendShapeList = new List<(BlendShapeType, string)>() { (BlendShapeType.EyeBlinkLeft, "EyeBlink_Left"), (BlendShapeType.EyeSquintLeft, "EyeSquint_Left"), @@ -119,7 +191,7 @@ private void Initialize() #endregion #region AR Emoji Joint name list - private static readonly List<(JointType, string)> jointList = new List<(JointType, string)> + private List<(JointType, string)> jointList = new List<(JointType, string)> { (JointType.Head, "head_JNT"), (JointType.Neck, "neck_JNT"), @@ -189,7 +261,7 @@ private void Initialize() #endregion #region AR Emoji Joint name list - private static readonly List<(NodeType, string)> nodeList = new List<(NodeType, string)> + private List<(NodeType, string)> nodeList = new List<(NodeType, string)> { (NodeType.HeadGeo, "head_GEO"), (NodeType.MouthGeo, "mouth_GEO"), diff --git a/src/Tizen.AIAvatar/src/Common/BlendShapeType.cs b/src/Tizen.NUI.AIAvatar/src/Common/Properties/EnumType/BlendShapeType.cs similarity index 99% rename from src/Tizen.AIAvatar/src/Common/BlendShapeType.cs rename to src/Tizen.NUI.AIAvatar/src/Common/Properties/EnumType/BlendShapeType.cs index 78c27f796fb..b25b0582ab7 100644 --- a/src/Tizen.AIAvatar/src/Common/BlendShapeType.cs +++ b/src/Tizen.NUI.AIAvatar/src/Common/Properties/EnumType/BlendShapeType.cs @@ -17,7 +17,7 @@ using System.ComponentModel; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { /// /// The type of predefined blendshape. We can customize each type name by "TODO_mapper" @@ -25,7 +25,7 @@ namespace Tizen.AIAvatar /// Contains the BlendShape information of AIAvatar. /// [EditorBrowsable(EditorBrowsableState.Never)] - public enum BlendShapeType + internal enum BlendShapeType { #region Left Eyes /// diff --git a/src/Tizen.AIAvatar/src/Common/JointType.cs b/src/Tizen.NUI.AIAvatar/src/Common/Properties/EnumType/JointType.cs similarity index 99% rename from src/Tizen.AIAvatar/src/Common/JointType.cs rename to src/Tizen.NUI.AIAvatar/src/Common/Properties/EnumType/JointType.cs index 78589bf9369..e7d22c5de89 100644 --- a/src/Tizen.AIAvatar/src/Common/JointType.cs +++ b/src/Tizen.NUI.AIAvatar/src/Common/Properties/EnumType/JointType.cs @@ -17,7 +17,7 @@ using System.ComponentModel; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { /// /// The type of predefined skeleton joint. We can customize each type name by "TODO_mapper" @@ -25,7 +25,7 @@ namespace Tizen.AIAvatar /// Contains the joint information of AIAvatar. /// [EditorBrowsable(EditorBrowsableState.Never)] - public enum JointType + internal enum JointType { #region Head /// diff --git a/src/Tizen.AIAvatar/src/Common/NodeType.cs b/src/Tizen.NUI.AIAvatar/src/Common/Properties/EnumType/NodeType.cs similarity index 96% rename from src/Tizen.AIAvatar/src/Common/NodeType.cs rename to src/Tizen.NUI.AIAvatar/src/Common/Properties/EnumType/NodeType.cs index 784f2061f6d..5710eca691a 100644 --- a/src/Tizen.AIAvatar/src/Common/NodeType.cs +++ b/src/Tizen.NUI.AIAvatar/src/Common/Properties/EnumType/NodeType.cs @@ -17,7 +17,7 @@ using System.ComponentModel; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { /// /// The type of predefined node. We can customize each type name by "TODO_mapper" @@ -25,7 +25,7 @@ namespace Tizen.AIAvatar /// Contains the node information of AIAvatar. /// [EditorBrowsable(EditorBrowsableState.Never)] - public enum NodeType + internal enum NodeType { /// /// head geometry diff --git a/src/Tizen.AIAvatar/src/Internal/AvatarBlendShapeIndex.cs b/src/Tizen.NUI.AIAvatar/src/Common/Properties/MotionIndex/AvatarBlendShapeIndex.cs similarity index 84% rename from src/Tizen.AIAvatar/src/Internal/AvatarBlendShapeIndex.cs rename to src/Tizen.NUI.AIAvatar/src/Common/Properties/MotionIndex/AvatarBlendShapeIndex.cs index c2185dd6ea5..60d3f4d9ecf 100644 --- a/src/Tizen.AIAvatar/src/Internal/AvatarBlendShapeIndex.cs +++ b/src/Tizen.NUI.AIAvatar/src/Common/Properties/MotionIndex/AvatarBlendShapeIndex.cs @@ -19,7 +19,7 @@ using Tizen.NUI; using Tizen.NUI.Scene3D; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { /// /// Specialized to control avatar blend shape. @@ -36,35 +36,35 @@ namespace Tizen.AIAvatar [EditorBrowsable(EditorBrowsableState.Never)] internal class AvatarBlendShapeIndex : BlendShapeIndex { - internal AvatarPropertyMapper nameMapper = null; - internal uint blendShapeType; + public AvatarPropertyMapper nameMapper = null; + public uint blendShapeType; - internal AvatarBlendShapeIndex(AvatarPropertyMapper mapper) : base() + public AvatarBlendShapeIndex(AvatarPropertyMapper mapper) : base() { nameMapper = mapper; } - internal AvatarBlendShapeIndex(AvatarPropertyMapper mapper, PropertyKey blendShapeId) : base(new PropertyKey(GetPropertyNameFromMapper(mapper, blendShapeId))) + public AvatarBlendShapeIndex(AvatarPropertyMapper mapper, PropertyKey blendShapeId) : base(new PropertyKey(GetPropertyNameFromMapper(mapper, blendShapeId))) { nameMapper = mapper; } - internal AvatarBlendShapeIndex(AvatarPropertyMapper nodeMapper, NodeType nodeType, PropertyKey blendShapeId) + public AvatarBlendShapeIndex(AvatarPropertyMapper nodeMapper, NodeType nodeType, PropertyKey blendShapeId) : base(new PropertyKey(GetPropertyNameFromMapper(nodeMapper, (uint)nodeType)), blendShapeId) { } - internal AvatarBlendShapeIndex(AvatarPropertyMapper blendShapeMapper, BlendShapeType blendShapeType) : this(blendShapeMapper, (uint)blendShapeType) + public AvatarBlendShapeIndex(AvatarPropertyMapper blendShapeMapper, BlendShapeType blendShapeType) : this(blendShapeMapper, (uint)blendShapeType) { } - internal AvatarBlendShapeIndex(AvatarPropertyMapper mapper, uint blendShapeType) : base(new PropertyKey(GetPropertyNameFromMapper(mapper, blendShapeType))) + public AvatarBlendShapeIndex(AvatarPropertyMapper mapper, uint blendShapeType) : base(new PropertyKey(GetPropertyNameFromMapper(mapper, blendShapeType))) { nameMapper = mapper; this.blendShapeType = blendShapeType; } - internal AvatarBlendShapeIndex(AvatarPropertyMapper nodeMapper, NodeType nodeType, AvatarPropertyMapper blendShapeMapper, BlendShapeType blendShapeType) + public AvatarBlendShapeIndex(AvatarPropertyMapper nodeMapper, NodeType nodeType, AvatarPropertyMapper blendShapeMapper, BlendShapeType blendShapeType) : base(new PropertyKey(GetPropertyNameFromMapper(nodeMapper, (uint)nodeType)), new PropertyKey(GetPropertyNameFromMapper(blendShapeMapper, (uint)blendShapeType))) { nameMapper = blendShapeMapper; diff --git a/src/Tizen.AIAvatar/src/Internal/AvatarJointTransformIndex.cs b/src/Tizen.NUI.AIAvatar/src/Common/Properties/MotionIndex/AvatarJointTransformIndex.cs similarity index 99% rename from src/Tizen.AIAvatar/src/Internal/AvatarJointTransformIndex.cs rename to src/Tizen.NUI.AIAvatar/src/Common/Properties/MotionIndex/AvatarJointTransformIndex.cs index bf21dde3405..80d59fc4c9f 100644 --- a/src/Tizen.AIAvatar/src/Internal/AvatarJointTransformIndex.cs +++ b/src/Tizen.NUI.AIAvatar/src/Common/Properties/MotionIndex/AvatarJointTransformIndex.cs @@ -19,7 +19,7 @@ using Tizen.NUI; using Tizen.NUI.Scene3D; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { /// /// Specialized to control avatar joint transform. diff --git a/src/Tizen.AIAvatar/src/Extensions/Interop.SceneView.cs b/src/Tizen.NUI.AIAvatar/src/Extensions/Interop.SceneView.cs similarity index 100% rename from src/Tizen.AIAvatar/src/Extensions/Interop.SceneView.cs rename to src/Tizen.NUI.AIAvatar/src/Extensions/Interop.SceneView.cs diff --git a/src/Tizen.AIAvatar/src/Extensions/SceneViewExtension.cs b/src/Tizen.NUI.AIAvatar/src/Extensions/SceneViewExtension.cs similarity index 60% rename from src/Tizen.AIAvatar/src/Extensions/SceneViewExtension.cs rename to src/Tizen.NUI.AIAvatar/src/Extensions/SceneViewExtension.cs index ae8552fe86a..65144d63a35 100644 --- a/src/Tizen.AIAvatar/src/Extensions/SceneViewExtension.cs +++ b/src/Tizen.NUI.AIAvatar/src/Extensions/SceneViewExtension.cs @@ -20,9 +20,17 @@ namespace Tizen.AIAvatar { + /// + /// Extension methods for SceneView to manipulate alpha mask URL, mask content scale factor, and crop to mask settings. + /// [EditorBrowsable(EditorBrowsableState.Never)] public static class SceneViewExtension { + /// + /// Sets the URL of the alpha mask for the SceneView. + /// + /// The SceneView instance to apply the property. + /// The URL of the alpha mask image. [EditorBrowsable(EditorBrowsableState.Never)] public static void SetAlphaMaskUrl(this SceneView sceneView, string url) { @@ -31,6 +39,11 @@ public static void SetAlphaMaskUrl(this SceneView sceneView, string url) setValue.Dispose(); } + /// + /// Retrieves the URL of the alpha mask for the SceneView. + /// + /// The SceneView instance to retrieve the property from. + /// The URL of the alpha mask image. [EditorBrowsable(EditorBrowsableState.Never)] public static string GetAlphaMaskUrl(this SceneView sceneView) { @@ -41,6 +54,11 @@ public static string GetAlphaMaskUrl(this SceneView sceneView) return returnValue; } + /// + /// Sets the content scale factor for the mask applied to the SceneView. + /// + /// The SceneView instance to apply the property. + /// The scaling factor for the mask content. [EditorBrowsable(EditorBrowsableState.Never)] public static void SetMaskContentScaleFactor(this SceneView sceneView, float factor) { @@ -49,6 +67,11 @@ public static void SetMaskContentScaleFactor(this SceneView sceneView, float fac setValue.Dispose(); } + /// + /// Retrieves the content scale factor for the mask applied to the SceneView. + /// + /// The SceneView instance to retrieve the property from. + /// The scaling factor for the mask content. [EditorBrowsable(EditorBrowsableState.Never)] public static float GetMaskContentScaleFactor(this SceneView sceneView) { @@ -59,6 +82,11 @@ public static float GetMaskContentScaleFactor(this SceneView sceneView) return returnValue; } + /// + /// Enables or disables cropping to the mask for the SceneView. + /// + /// The SceneView instance to apply the property. + /// True to enable cropping to the mask, false otherwise. [EditorBrowsable(EditorBrowsableState.Never)] public static void EnableCropToMask(this SceneView sceneView, bool enableCropToMask) { @@ -67,6 +95,11 @@ public static void EnableCropToMask(this SceneView sceneView, bool enableCropToM setValue.Dispose(); } + /// + /// Checks if cropping to the mask is enabled for the SceneView. + /// + /// The SceneView instance to retrieve the property from. + /// True if cropping to the mask is enabled, false otherwise. [EditorBrowsable(EditorBrowsableState.Never)] public static bool IsEnabledCropToMask(this SceneView sceneView) { diff --git a/src/Tizen.NUI.AIAvatar/src/LipSync/Data/LipData.cs b/src/Tizen.NUI.AIAvatar/src/LipSync/Data/LipData.cs new file mode 100644 index 00000000000..c788ee819da --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/LipSync/Data/LipData.cs @@ -0,0 +1,118 @@ +/* + * Copyright(c) 2024 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.Collections.Generic; +using System.ComponentModel; + +namespace Tizen.NUI.AIAvatar +{ + internal class KeyFrame + { + public KeyFrame(float t, float v) + { + time = t; + value = v; + } + public float time; + public float value; + } + + internal class LipData + { + private Dictionary[]> blendShapeKeyFrames; + + [EditorBrowsable(EditorBrowsableState.Never)] + public string[] NodeNames { get; private set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + public int[] BlendShapeCounts { get; private set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + public string BlendShapeKeyFormat { get; private set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + public float Duration { get; private set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + public LipData(string[] nodeNames, + int[] blendShapeCounts, + string blendShapeKeyFormat) + { + blendShapeKeyFrames = new Dictionary[]>(); + NodeNames = nodeNames; + BlendShapeCounts = blendShapeCounts; + BlendShapeKeyFormat = blendShapeKeyFormat; + + Initialize(nodeNames, blendShapeCounts); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetDuration(float duration) + { + Duration = duration; + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public List GetKeyFrames(string nodeName, int blendShapeId) + { + return blendShapeKeyFrames[nodeName][blendShapeId]; + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddKeyFrame(string nodeName, int blendShapeId, float time, float value) + { + blendShapeKeyFrames[nodeName][blendShapeId].Add(new KeyFrame(time, value)); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddKeyFrame(string nodeName, int blendShapeId, KeyFrame value) + { + blendShapeKeyFrames[nodeName][blendShapeId].Add(value); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public void Initialize(string[] nodeNames, int[] blendShapeCounts) + { + Clear(); + + for (int i = 0; i < nodeNames.Length; i++) + { + var nodeName = nodeNames[i]; + var blendShapeCount = blendShapeCounts[i]; + + blendShapeKeyFrames.Add(nodeName, new List[blendShapeCount]); + + for (int j = 0; j < blendShapeCount; j++) + { + blendShapeKeyFrames[nodeName][j] = new List(); + } + } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public void Clear() + { + foreach (KeyValuePair[]> blendShapeData in blendShapeKeyFrames) + { + foreach (List keyFrames in blendShapeData.Value) + { + keyFrames.Clear(); + } + } + } + } +} diff --git a/src/Tizen.NUI.AIAvatar/src/LipSync/Data/VisemeData.cs b/src/Tizen.NUI.AIAvatar/src/LipSync/Data/VisemeData.cs new file mode 100644 index 00000000000..91fbb4ea937 --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/LipSync/Data/VisemeData.cs @@ -0,0 +1,103 @@ +/* + * Copyright(c) 2024 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.Linq; +using System.Text.Json.Serialization; + +namespace Tizen.NUI.AIAvatar +{ + internal class VisemeData + { + [EditorBrowsable(EditorBrowsableState.Never)] + [JsonPropertyName("visemeParameters")] + public VisemeParameters visemeParameters { get; set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + [JsonPropertyName("visemes")] + public List visemes { get; set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + public VisemeData() + { + visemeParameters = new VisemeParameters(); + visemes = new List(); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public Dictionary GetVisemeMap() + { + Dictionary visemeMap + = new Dictionary(); + + foreach (var viseme in this.visemes) + { + if (!visemeMap.ContainsKey(viseme.name)) + { + visemeMap.Add(viseme.name, viseme.values.Select(v => new BlendShapeValue { nodeName = v.nodeName, id = v.id, value = (float)v.value }).ToArray()); + } + } + + return visemeMap; + } + } + + internal class VisemeParameters + { + [EditorBrowsable(EditorBrowsableState.Never)] + [JsonPropertyName("keyFormat")] + public string keyFormat { get; set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + [JsonPropertyName("nodeNames")] + public List nodeNames { get; set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + [JsonPropertyName("blendShapeCount")] + public List blendShapeCount { get; set; } + } + + internal class Viseme + { + [EditorBrowsable(EditorBrowsableState.Never)] + [JsonPropertyName("name")] + public string name { get; set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + [JsonPropertyName("symbol")] + public string symbol { get; set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + [JsonPropertyName("values")] + public List values { get; set; } + } + + + internal class BlendShapeValue + { + [JsonPropertyName("nodeName")] + public string nodeName { get; set; } + + [JsonPropertyName("id")] + public int id { get; set; } + + [JsonPropertyName("value")] + public float value { get; set; } + } +} diff --git a/src/Tizen.NUI.AIAvatar/src/LipSync/LipSyncTransformer.cs b/src/Tizen.NUI.AIAvatar/src/LipSync/LipSyncTransformer.cs new file mode 100644 index 00000000000..7194818edd2 --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/LipSync/LipSyncTransformer.cs @@ -0,0 +1,129 @@ +/* + * Copyright(c) 2024 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 System.Text.Json; + +namespace Tizen.NUI.AIAvatar +{ + + internal class LipSyncTransformer + { + private LipData lipData; + private VisemeData visemeData; + private Dictionary visemeMap; + + private bool isInitialized; + + [EditorBrowsable(EditorBrowsableState.Never)] + public LipSyncTransformer() { } + + [EditorBrowsable(EditorBrowsableState.Never)] + public void Initialize(string visemeDefinitionPath) + { + try + { + using (StreamReader v = new StreamReader(visemeDefinitionPath)) + { + var jsonString = v.ReadToEnd(); + + try + { + visemeData = JsonSerializer.Deserialize(jsonString); + visemeMap = visemeData.GetVisemeMap(); + }catch (JsonException e) + { + Log.Error("Tizen.AIAvatar", e.Message); + } + } + + var nodeNames = visemeData.visemeParameters.nodeNames; + var blendShapeCounts = visemeData.visemeParameters.blendShapeCount; + var blendShapeKeyFormat = visemeData.visemeParameters.keyFormat; + + lipData = new LipData(nodeNames.ToArray(), + blendShapeCounts.ToArray(), + blendShapeKeyFormat); + isInitialized = true; + } + catch (FileNotFoundException e) + { + throw new FileNotFoundException($"File not found: {visemeDefinitionPath}", e); + } + catch (IOException e) + { + throw new IOException($"IO error occurred while reading file: {visemeDefinitionPath}", e); + } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public LipData TransformVowelsToLipData(string[] vowels, float stepTime, bool isStreaming) + { + if (!isInitialized) throw new InvalidOperationException("LipSyncer is not initialized"); + + lipData.Clear(); + VowelsToAnimationKeyFrame(vowels, stepTime, isStreaming); + + return lipData; + } + + + + private void VowelsToAnimationKeyFrame(in string[] visemes, float stepTime, bool isStreaming) + { + int numVisemes = visemes.Length; + float animationTime = 0f; + + if (isStreaming) + { + animationTime = (numVisemes-1) * stepTime; + } + else + { + animationTime = numVisemes * stepTime; + } + + + lipData.SetDuration(animationTime); + + for (int i = 0; i < numVisemes; i++) + { + float timeStamp = GetTimeStamp(i, stepTime) / animationTime; + + foreach (var blendshape in visemeMap[visemes[i]]) + { + lipData.AddKeyFrame(blendshape.nodeName, + blendshape.id, + timeStamp, + blendshape.value); + } + } + } + + + private float GetTimeStamp(int idx, float stepTime) + { + if (idx > 0) + return (idx * stepTime) - (stepTime / 8.0f); + else + return (stepTime / 8.0f); + } + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.AIAvatar/src/LipSync/LipSyncer.cs b/src/Tizen.NUI.AIAvatar/src/LipSync/LipSyncer.cs new file mode 100644 index 00000000000..073bc276cc3 --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/LipSync/LipSyncer.cs @@ -0,0 +1,244 @@ + + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Tizen.NUI.Scene3D; + +namespace Tizen.NUI.AIAvatar +{ + /// + /// LipSyncer class manages the synchronization of an avatar's mouth movements with audio input. + /// It handles the creation, enqueuing, playing, pausing, and stopping of animations based on lip-sync data. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class LipSyncer + { + private Model avatar; + private Animation currentAnimation; + private Animation silenceAnimation; + private Queue queuedAnimations = new Queue(); + private Timer animationTimer; + + private readonly AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInOut); + private readonly LipSyncTransformer lipSyncTransformer = new LipSyncTransformer(); + private AnimatorState currentAnimatorState = AnimatorState.Unavailable; + + private string prevVowel = "sil"; + + /// + /// Event triggered when the state of the animator changes. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler AnimatorStateChanged; + + /// + /// Initializes a new instance of the LipSyncer class. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public LipSyncer() + { + + } + + /// + /// Initializes the LipSyncer with the given avatar and viseme definition path. + /// + /// The avatar to apply lip-sync animations to. + /// The path to the viseme definition file. + [EditorBrowsable(EditorBrowsableState.Never)] + public void Initialize(Model avatar, string visemeDefinitionPath) + { + this.avatar = avatar; + lipSyncTransformer.Initialize(visemeDefinitionPath); + silenceAnimation = GenerateAnimationFromVowels(new string[] { "sil", "sil" }, 0.5f); + } + + /// + /// Enqueues a lip-sync animation to be played later. + /// + /// The animation to enqueue. + /// is auto play (default is true). + [EditorBrowsable(EditorBrowsableState.Never)] + public void Enqueue(Animation lipAnimation, bool isAutoPlay = true) + { + queuedAnimations.Enqueue(lipAnimation); + if (isAutoPlay) + { + Play(); + } + } + + /// + /// Generates an animation from a list of vowels. + /// + /// The list of vowels to generate the animation from. + /// The time interval between each key frame (default is 0.08 seconds). + /// Indicates whether the animation is streaming (default is false). + /// The generated animation. + [EditorBrowsable(EditorBrowsableState.Never)] + public Animation GenerateAnimationFromVowels(string[] vowels, float stepTime = 0.08f, bool isStreaming = false) + { + if (isStreaming) + { + var vowelList = new List(vowels); + vowelList.Insert(0, prevVowel); + prevVowel = vowelList[vowelList.Count - 1]; + vowels = vowelList.ToArray(); + } + + var lipData = lipSyncTransformer.TransformVowelsToLipData(vowels, stepTime, isStreaming); + using var motionData = GenerateMotionFromLipData(lipData); + var animation = avatar.GenerateMotionDataAnimation(motionData); + + return animation; + } + + + /// + /// Plays the current animation or dequeues and plays the next animation if available. + /// If no animations are queued, plays a silence animation. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Play() + { + if (animationTimer == null) + { + PlayNextAnimation(null, null); + return; + } + + if (animationTimer != null && !animationTimer.IsRunning()) + { + PlayNextAnimation(null, null); + } + } + + /// + /// Pauses the current animation. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Pause() + { + if (currentAnimation != null) + { + currentAnimation.Pause(); + CurrentAnimatorState = AnimatorState.Paused; + } + } + + /// + /// Stops and disposes of the current animation. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Stop() + { + if (currentAnimation != null) + { + currentAnimation.Stop(); + currentAnimation.Dispose(); + currentAnimation = null; + + queuedAnimations.Clear(); + animationTimer.Stop(); + animationTimer.Dispose(); + + CurrentAnimatorState = AnimatorState.Stopped; + } + } + + /// + /// Gets or sets the current state of the animator. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public AnimatorState CurrentAnimatorState + { + get => currentAnimatorState; + protected set + { + if (currentAnimatorState != AnimatorState.AnimationFinished && currentAnimatorState == value) return; + + var preState = currentAnimatorState; + currentAnimatorState = value; + + AnimatorStateChanged?.Invoke(this, new AnimatorChangedEventArgs(preState, currentAnimatorState)); + } + } + + private bool PlayNextAnimation(object source, Timer.TickEventArgs e) + { + // 현재 애니메이션을 정지 및 해제 + currentAnimation?.Stop(); + currentAnimation?.Dispose(); + currentAnimation = null; + + if (queuedAnimations.Count > 0) + { + currentAnimation = queuedAnimations.Dequeue(); + currentAnimation.Play(); + CurrentAnimatorState = AnimatorState.Playing; + + // 현재 애니메이션의 Duration을 기준으로 타이머 설정 + animationTimer = new Timer((uint)currentAnimation.Duration - 1); // 밀리초 단위 + animationTimer.Tick += PlayNextAnimation; + animationTimer.Start(); + } + else + { + prevVowel = "sil"; + silenceAnimation.Play(); + CurrentAnimatorState = AnimatorState.AnimationFinished; + } + + return false; + } + + + private void OnAnimationFinished(object sender, EventArgs e) + { + currentAnimation.Dispose(); + currentAnimation = null; + Play(); + } + + private MotionData GenerateMotionFromLipData(LipData animationKeyFrames) + { + int animationTime = (int)(animationKeyFrames.Duration * 1000f); + + var motionData = new MotionData(animationTime); + for (var i = 0; i < animationKeyFrames.NodeNames.Length; i++) + { + string nodeName = animationKeyFrames.NodeNames[i]; + for (var j = 0; j < animationKeyFrames.BlendShapeCounts[i]; j++) + { + using var modelNodeID = new PropertyKey(nodeName); + using var blendShapeID = new PropertyKey(j); + var blendShapeIndex = new BlendShapeIndex(modelNodeID, blendShapeID); + var keyFrameList = animationKeyFrames.GetKeyFrames(nodeName, j); + if (keyFrameList.Count == 0) + { + continue; + } + + var keyFrames = CreateKeyTimeFrames(keyFrameList); + + motionData.Add(blendShapeIndex, new MotionValue(keyFrames)); + } + } + + return motionData; + } + + private KeyFrames CreateKeyTimeFrames(List keyFrameList) + { + var keyFrames = new KeyFrames(); + + foreach (var key in keyFrameList) + { + keyFrames.Add(key.time, key.value, alphaFunction); + } + + return keyFrames; + } + } +} diff --git a/src/Tizen.NUI.AIAvatar/src/Motion/ICustomMotionData.cs b/src/Tizen.NUI.AIAvatar/src/Motion/ICustomMotionData.cs new file mode 100644 index 00000000000..4b942f83dce --- /dev/null +++ b/src/Tizen.NUI.AIAvatar/src/Motion/ICustomMotionData.cs @@ -0,0 +1,42 @@ +/* + * Copyright(c) 2024 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.ComponentModel; +using Tizen.NUI.Scene3D; + +namespace Tizen.NUI.AIAvatar +{ + /// + /// Represents an interface for custom motion data operations. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public interface ICustomMotionData + { + /// + /// Initializes the instance of the custom motion data. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Initialize(); + + /// + /// Retrieves motion data based on the specified duration in milliseconds. + /// + /// The duration in milliseconds for which to retrieve motion data. + /// An instance of MotionData representing the motion data for the given duration. + [EditorBrowsable(EditorBrowsableState.Never)] + public MotionData GetMotionData(int durationMilliseconds); + } +} diff --git a/src/Tizen.AIAvatar/src/Animations/AnimationInfo.cs b/src/Tizen.NUI.AIAvatar/src/Motion/MotionInfo.cs similarity index 82% rename from src/Tizen.AIAvatar/src/Animations/AnimationInfo.cs rename to src/Tizen.NUI.AIAvatar/src/Motion/MotionInfo.cs index c6da89f9e12..a0d76e53679 100644 --- a/src/Tizen.AIAvatar/src/Animations/AnimationInfo.cs +++ b/src/Tizen.NUI.AIAvatar/src/Motion/MotionInfo.cs @@ -15,16 +15,17 @@ * */ +using System; using System.ComponentModel; using Tizen.NUI.Scene3D; -namespace Tizen.AIAvatar +namespace Tizen.NUI.AIAvatar { /// /// The AnimationInfo class manages animation data for an Avatar, including motion data and names. It is not meant to be directly edited by users or editors. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class AnimationInfo + public class MotionInfo { /// /// Gets the motion data associated with this animation. @@ -38,14 +39,20 @@ public class AnimationInfo [EditorBrowsable(EditorBrowsableState.Never)] public string MotionName { get; private set; } + /// /// Initializes a new instance of the AnimationInfo class with the specified motion data and name. /// - /// TheThe motion data associated with this animation. + /// The motion data associated with this animation. /// The name of this animation. [EditorBrowsable(EditorBrowsableState.Never)] - public AnimationInfo(MotionData motionData, string motionName) + public MotionInfo(MotionData motionData, string motionName) { + if (motionData == null) + { + throw new ArgumentNullException(nameof(motionData)); + } + MotionData = motionData; MotionName = motionName; } diff --git a/src/Tizen.NUI.Components/Controls/Button.Internal.cs b/src/Tizen.NUI.Components/Controls/Button.Internal.cs index 9fa9e2b47d4..79d7b6b62a7 100644 --- a/src/Tizen.NUI.Components/Controls/Button.Internal.cs +++ b/src/Tizen.NUI.Components/Controls/Button.Internal.cs @@ -20,7 +20,6 @@ using System.Diagnostics; using Tizen.NUI.BaseComponents; using Tizen.NUI.Components.Extension; -using Tizen.NUI.Accessibility; // To use AccessibilityManager namespace Tizen.NUI.Components { @@ -278,8 +277,6 @@ public override void OnInitialize() AccessibilityHighlightable = true; EnableControlStatePropagation = true; - AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Trait, "Button"); - buttonText = CreateText(); buttonIcon = CreateIcon(); LayoutItems(); diff --git a/src/Tizen.NUI.Components/Controls/Loading.cs b/src/Tizen.NUI.Components/Controls/Loading.cs index 8e3c94a95e0..f996b327a25 100755 --- a/src/Tizen.NUI.Components/Controls/Loading.cs +++ b/src/Tizen.NUI.Components/Controls/Loading.cs @@ -20,7 +20,6 @@ using System.Diagnostics; using Tizen.NUI.BaseComponents; using Tizen.NUI.Binding; -using Tizen.NUI.Accessibility; namespace Tizen.NUI.Components { @@ -267,8 +266,6 @@ public override void OnInitialize() AccessibilityRole = Role.ProgressBar; EnsureLottieView(lottieResource); - - AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Trait, "Loading"); } /// diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs index 834052a3c20..6a0c46b2f42 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs @@ -16,7 +16,6 @@ using System; using System.ComponentModel; using Tizen.NUI.BaseComponents; -using Tizen.NUI.Accessibility; namespace Tizen.NUI.Components { @@ -127,7 +126,7 @@ public string IconUrl // Tizen.Log.Error("IconUrl only can set Icon is ImageView"); return; } - (Icon as ImageView).ResourceUrl = value; + (Icon as ImageView).ResourceUrl = value; } } */ @@ -154,7 +153,6 @@ public TextLabel Label internal set { itemLabel = value; - AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Label, itemLabel.Text); } } diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs index dc48d10a547..7808987ba31 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs @@ -17,7 +17,6 @@ using System; using System.ComponentModel; using Tizen.NUI.BaseComponents; -using Tizen.NUI.Accessibility; // To use AccessibilityManager namespace Tizen.NUI.Components { @@ -198,8 +197,6 @@ public override void OnInitialize() Layout = new AbsoluteLayout(); UpdateState(); - AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Trait, "ViewItem"); - AccessibilityRole = Role.ListItem; AccessibilityHighlightable = true; } diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs index e83a1bf60f7..d7f18d49fbf 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs @@ -19,7 +19,6 @@ using System.ComponentModel; using System.Diagnostics; using System.Runtime.InteropServices; -using Tizen.NUI.Accessibility; namespace Tizen.NUI.Components { @@ -963,8 +962,6 @@ private void Initialize() WheelEvent += OnWheelEvent; - AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Trait, "ScrollableBase"); - SetKeyboardNavigationSupport(true); } @@ -1810,17 +1807,6 @@ internal void BaseRemove(View view) base.Remove(view); } - internal override bool OnAccessibilityPan(PanGesture gestures) - { - if (SnapToPage && scrollAnimation != null && scrollAnimation.State == Animation.States.Playing) - { - return false; - } - - OnPanGesture(gestures); - return true; - } - private float CustomScrollAlphaFunction(float progress) { if (panAnimationDelta == 0) diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadget.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadget.cs index 6a766047b51..2f48cca2ee2 100755 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadget.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadget.cs @@ -22,8 +22,13 @@ namespace Tizen.NUI { /// - /// This class represents a NUIGadget controlled lifecycles. + /// Represents a NUIGadget controlled lifecycle. /// + /// + /// This class provides functionality related to managing the lifecycle of a NUIGadget. + /// It enables developers to handle events such as initialization, activation, deactivation, and destruction of the gadget. + /// By implementing this class, developers can define their own behavior for these events and customize the lifecycle of their gadgets accordingly. + /// /// 10 [EditorBrowsable(EditorBrowsableState.Never)] public abstract class NUIGadget @@ -31,7 +36,11 @@ public abstract class NUIGadget /// /// Initializes the gadget. /// - /// /// The type of the NUIGadget. + /// The type of the NUIGadget. + /// + /// This constructor initializes a new instance of the NUIGadget class based on the specified type. + /// It is important to provide the correct type argument in order to ensure proper functionality and compatibility with other components. + /// /// 10 public NUIGadget(NUIGadgetType type) { @@ -44,7 +53,11 @@ public NUIGadget(NUIGadgetType type) /// /// Gets the class representing information of the current gadget. /// - /// This property is set before the OnCreate() is called, after the instance has been created. + /// + /// This property is set before the OnCreate() is called, after the instance has been created. + /// It provides details about the current gadget such as its ID, name, version, and other relevant information. + /// By accessing this property, developers can retrieve the necessary information about the gadget they are working on. + /// /// 10 public NUIGadgetInfo NUIGadgetInfo { @@ -53,7 +66,7 @@ public NUIGadgetInfo NUIGadgetInfo } /// - /// Gets the type. + /// Gets the type of the NUI gadget. /// /// 10 public NUIGadgetType Type @@ -65,7 +78,10 @@ public NUIGadgetType Type /// /// Gets the class name. /// - /// This property is set before the OnCreate() is called, after the instance has been created. + /// + /// This property is set before the OnCreate() is called, after the instance has been created. + /// It provides access to the name of the class that was used to create the current instance. + /// /// 10 public string ClassName { @@ -74,7 +90,7 @@ public string ClassName } /// - /// Gets the main view. + /// Gets the main view of the NUI gadget.. /// /// 10 public View MainView @@ -84,7 +100,7 @@ public View MainView } /// - /// Gets the lifecycle state. + /// Gets the current lifecycle state of the gadget. /// /// 10 public NUIGadgetLifecycleState State @@ -96,7 +112,11 @@ public NUIGadgetLifecycleState State /// /// Gets the resource manager. /// - /// This property is set before the OnCreate() is called, after the instance has been created. + /// This property is set before the OnCreate() is called, after the instance has been created. + /// It provides access to various resources such as images, sounds, and fonts that can be used in your application. + /// By utilizing the resource manager, you can easily manage and retrieve these resources without having to manually handle their loading and unloading. + /// Additionally, the resource manager ensures efficient memory management by automatically handling the caching and recycling of resources. + /// /// 10 public NUIGadgetResourceManager NUIGadgetResourceManager { @@ -172,8 +192,8 @@ private void NotifyLifecycleChanged() } /// - /// Overrides this method if want to handle behavior when the gedget is started. - /// If 'base.OnCreate()' is not called, the event 'NUIGadgetLifecycleChanged' with the 'NUIGadgetLifecycleState.Created' state will not be emitted. + /// Override this method to define the behavior when the gadget is created. + /// Calling 'base.OnCreate()' is necessary in order to emit the 'NUIGadgetLifecycleChanged' event with the 'NUIGadgetLifecycleState.Created' state. /// /// The main view object. /// 10 @@ -187,15 +207,19 @@ protected virtual Tizen.NUI.BaseComponents.View OnCreate() /// /// Overrides this method if want to handle behavior when the gadget receives the appcontrol message. /// - /// The appcontrol received event argument. + /// + /// This method provides a way to customize the response when the gadget receives an appcontrol message. + /// By overriding this method in your derived class, you can define specific actions based on the incoming arguments. + /// + /// The appcontrol received event argument containing details about the received message. /// 10 protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e) { } /// - /// Overrides this method if want to handle behavior when the gadget is destroyed. - /// If 'base.OnDestroy()' is not called. the event 'NUIGadgetLifecycleChanged' with the 'NUIGadgetLifecycleState.Destroyed' state will not be emitted. + /// Override this method to handle the behavior when the gadget is destroyed. + /// If 'base.OnDestroy()' is not called, the 'NUIGadgetLifecycleChanged' event with the 'NUIGadgetLifecycleState.Destroyed' state will not be emitted. /// /// 10 protected virtual void OnDestroy() diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs index 9946fe8caad..424ca30cf0b 100644 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.IO; using System.Reflection; using System.Runtime.Loader; @@ -35,20 +36,26 @@ protected override Assembly Load(AssemblyName name) } } - internal class NUIGadgetAssembly + /// + /// Represents a class that provides access to the methods and properties of the NUIGadgetAssembly. + /// + /// 10 + [EditorBrowsable(EditorBrowsableState.Never)] + public class NUIGadgetAssembly { private static readonly object _assemblyLock = new object(); private readonly string _assemblyPath; private WeakReference _assemblyRef; private Assembly _assembly = null; + private bool _loaded = false; - public NUIGadgetAssembly(string assemblyPath) { _assemblyPath = assemblyPath; } + internal NUIGadgetAssembly(string assemblyPath) { _assemblyPath = assemblyPath; } - public void Load() + internal void Load() { lock (_assemblyLock) { - if (_assembly != null) + if (_loaded) { return; } @@ -62,12 +69,13 @@ public void Load() Log.Debug("NativeImagePath=" + nativeImagePath + ", AssemblyPath=" + _assemblyPath); _assembly = context.LoadFromNativeImagePath(nativeImagePath, _assemblyPath); Log.Warn("Load(): " + _assemblyPath + " --"); + _loaded = true; } } - public bool IsLoaded { get { return _assembly != null; } } + internal bool IsLoaded { get { return _loaded; } } - public NUIGadget CreateInstance(string className) + internal NUIGadget CreateInstance(string className) { lock (_assemblyLock) { @@ -75,11 +83,17 @@ public NUIGadget CreateInstance(string className) } } - public void Unload() + /// + /// Property indicating whether the weak reference to the gadget assembly is still alive. + /// + /// 12 + public bool IsAlive { get { return _assemblyRef.IsAlive; } } + + internal void Unload() { lock (_assemblyLock) { - if (_assembly == null) + if (!_loaded) { return; } @@ -90,9 +104,9 @@ public void Unload() (_assemblyRef.Target as NUIGadgetAssemblyLoadContext).Unload(); } - _assembly = null; + _loaded = false; Log.Warn("Unload(): " + _assemblyPath + " --"); } } } -} \ No newline at end of file +} diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs index d25f5200717..ca3f7d05b04 100755 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs @@ -17,6 +17,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.IO; using System.Reflection; using System.Runtime.InteropServices; using Tizen.Applications; @@ -26,7 +27,7 @@ namespace Tizen.NUI { /// - /// This class provides properties to get information the gadget. + /// This class provides properties to retrieve information the gadget. /// /// 10 [EditorBrowsable(EditorBrowsableState.Never)] @@ -69,6 +70,15 @@ public string ResourcePath get; private set; } + /// + /// Gets the gadget resource path of the gadget. + /// + /// 12 + public string GadgetResourcePath + { + get; private set; + } + /// /// Gets the executable file of the gadget. /// @@ -85,9 +95,17 @@ public string ResourcePath internal string ResourceClassName { get; set; } - internal Assembly Assembly { get; set; } + /// + /// Gets the assembly of the gadget. + /// + /// 12 + public Assembly Assembly { get; internal set; } - internal NUIGadgetAssembly NUIGadgetAssembly { get; set; } + /// + /// Gets the assembly of the gadget. + /// + /// 12 + public NUIGadgetAssembly NUIGadgetAssembly { get; set; } internal static NUIGadgetInfo CreateNUIGadgetInfo(string packageId) { @@ -178,7 +196,17 @@ int callback(string key, string value, IntPtr userData) Log.Warn("Failed to destroy package info. error = " + errorCode); } - info.ResourcePath = SystemIO.Path.GetDirectoryName(Application.Current.ApplicationInfo.ExecutablePath) + "/"; + info.ResourcePath = SystemIO.Path.GetDirectoryName(Application.Current.ApplicationInfo.ExecutablePath) + "/.res_mount/"; + if (!Directory.Exists(info.ResourcePath)) + { + info.ResourcePath = SystemIO.Path.GetDirectoryName(Application.Current.ApplicationInfo.ExecutablePath) + "/"; + } + + info.GadgetResourcePath = info.ResourcePath + info.ResourceType + "/"; + if (!Directory.Exists(info.GadgetResourcePath)) + { + info.GadgetResourcePath = info.ResourcePath; + } return info; } } diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetLifecycleChangedEventArgs.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetLifecycleChangedEventArgs.cs index 2db245cd121..9c9e063f757 100755 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetLifecycleChangedEventArgs.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetLifecycleChangedEventArgs.cs @@ -20,20 +20,20 @@ namespace Tizen.NUI { /// - /// Arguments for the event raised when the NUIGadget lifecycle is changed. + /// Event arguments for the NUIGadget lifecycle change event. /// /// 10 [EditorBrowsable(EditorBrowsableState.Never)] public class NUIGadgetLifecycleChangedEventArgs : EventArgs { /// - /// The NUIGadget object. + /// Gets the NUIGadget object that triggered the event. /// /// 10 public NUIGadget Gadget { get; internal set; } /// - /// The state of the NUIGadget lifecycle. + /// Gets the current state of the NUIGadget lifecycle. /// /// 10 public NUIGadgetLifecycleState State { get; internal set; } diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs index 05aa1746632..2d3f2de87ce 100755 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs @@ -31,7 +31,7 @@ namespace Tizen.NUI { /// - /// This class has the methods and events of the NUIGadgetManager. + /// The NUIGadgetManager provides methods and events related to managing gadgets in the NUI. /// /// 10 [EditorBrowsable(EditorBrowsableState.Never)] @@ -109,6 +109,10 @@ private static void OnDeviceOrientationChanged(object sender, DeviceOrientationE /// /// Occurs when the lifecycle of the NUIGadget is changed. /// + /// + /// This event is raised when the state of the NUIGadget changes. + /// It provides information about the current state through the NUIGadgetLifecycleChangedEventArgs argument. + /// /// 10 public static event EventHandler NUIGadgetLifecycleChanged; @@ -137,6 +141,10 @@ private static NUIGadgetInfo Find(string resourceType) /// Loads an assembly of the NUIGadget. /// /// The resource type of the NUIGadget package. + /// + /// This method loads an assembly of the NUIGadget based on the specified resource type. + /// It throws an ArgumentException if the argument is invalid, or an InvalidOperationException if the operation fails due to any reason. + /// /// Thrown when failed because of a invalid argument. /// Thrown when failed because of an invalid operation. /// 10 @@ -149,9 +157,9 @@ public static void Load(string resourceType) /// Loads an assembly of the NUIGadget. /// /// The resource type of the NUIGadget package. - /// The flag if ture, use a default load context. Otherwise, use a new load context. - /// Thrown when failed because of a invalid argument. - /// Thrown when failed because of an invalid operation. + /// Indicates whether to use a default load context or not. + /// Thrown when failed due to an invalid argument. + /// Thrown when failed due to an invalid operation. /// 10 public static void Load(string resourceType, bool useDefaultContext) { @@ -165,10 +173,23 @@ public static void Load(string resourceType, bool useDefaultContext) } /// - /// Unloads the loaded assembly of the NUIGadget. + /// Unloads the specified NUIGadget assembly from memory. /// - /// The resource type of the NUIGadget package. - /// Thrown when failed because of a invalid argument. + /// + /// To use this method properly, the assembly of the gadget must be loaded using Load() with the custom context. + /// + /// The resource type of the NUIGadget package to unload. + /// Thrown when the argument passed is not valid. + /// + /// + /// /// Load an assembly of the NUIGadget. + /// NUIGadgetManager.Load("org.tizen.appfw.gadget.NetworkSetting", false); + /// /// NUIGadgetManager.Add("org.tizen.appfw.gadget.NetworkSetting", "NetworkSettingGadget", false); + /// + /// /// Unload the loaded assembly + /// NUIGadgetManager.Unload("org.tizen.appfw.gadget.NetworkSetting"); + /// + /// /// 10 public static void Unload(string resourceType) { @@ -193,7 +214,6 @@ private static void Unload(NUIGadgetInfo info) if (info.NUIGadgetAssembly != null && info.NUIGadgetAssembly.IsLoaded) { info.NUIGadgetAssembly.Unload(); - info.NUIGadgetAssembly = null; } } } @@ -221,12 +241,12 @@ private static void Load(NUIGadgetInfo info, bool useDefaultContext) } else { - if (info.NUIGadgetAssembly == null) + if (info.NUIGadgetAssembly == null || !info.NUIGadgetAssembly.IsLoaded) { - Log.Warn("NUIGadgetAssembly.Load(): " + info.ResourcePath + info.ExecutableFile + " ++"); - info.NUIGadgetAssembly = new NUIGadgetAssembly(info.ResourcePath + info.ExecutableFile); + Log.Warn("NUIGadgetAssembly.Load(): " + info.GadgetResourcePath + info.ExecutableFile + " ++"); + info.NUIGadgetAssembly = new NUIGadgetAssembly(info.GadgetResourcePath + info.ExecutableFile); info.NUIGadgetAssembly.Load(); - Log.Warn("NUIGadgetAssembly.Load(): " + info.ResourcePath + info.ExecutableFile + " --"); + Log.Warn("NUIGadgetAssembly.Load(): " + info.GadgetResourcePath + info.ExecutableFile + " --"); } } } @@ -258,6 +278,9 @@ public static NUIGadget Add(string resourceType, string className) /// /// Adds a NUIGadget to the NUIGadgetManager. /// + /// + /// To use Unload() method, the useDefaultContext must be'false'. + /// /// The resource type of the NUIGadget package. /// The class name of the NUIGadget. /// The flag it true, use a default context. Otherwise, use a new load context. @@ -295,9 +318,9 @@ public static NUIGadget Add(string resourceType, string className, bool useDefau } /// - /// Gets the instance of the running NUIGadgets. + /// Retrieves the instances of currently running NUIGadgets. /// - /// The NUIGadget list. + /// An enumerable list containing all the active NUIGadgets. /// 10 public static IEnumerable GetGadgets() { @@ -305,14 +328,14 @@ public static IEnumerable GetGadgets() } /// - /// Gets the information of the available NUIGadgets. + /// Retrieves information about available NUIGadgets. /// /// - /// This method only returns the available gadget informations, not all installed gadget informations. - /// The resource package of the NUIGadget can set the allowed packages using "allowed-package". - /// When executing an application, the platform mounts the resource package into the resource path of the application. + /// This method provides details on gadgets that are currently accessible rather than listing all installed gadgets. + /// A NUIGadget's resource package may specify which applications have access through the "allowed-packages" setting. + /// During execution, the platform mounts the resource package in the application's resources directory. /// - /// The NUIGadgetInfo list. + /// An enumerable list of NUIGadgetInfo objects. /// 10 public static IEnumerable GetGadgetInfos() { @@ -320,9 +343,15 @@ public static IEnumerable GetGadgetInfos() } /// - /// Removes the NUIGadget from the NUIGadgetManager. + /// Removes the specified NUIGadget from the NUIGadgetManager. /// - /// The NUIGadget object. + /// The NUIGadget object that needs to be removed. + /// + /// This method allows you to remove a specific NUIGadget from the NUIGadgetManager. + /// By passing the NUIGadget object as an argument, you can ensure that only the desired gadget is removed. + /// It is important to note that once a gadget is removed, any references to it become invalid. + /// Therefore, it is crucial to handle the removal process carefully to avoid any potential issues. + /// /// 10 public static void Remove(NUIGadget gadget) { @@ -346,6 +375,10 @@ public static void Remove(NUIGadget gadget) /// /// Removes all NUIGadgets from the NUIGadgetManager. /// + /// + /// This method is called to remove all NUIGadgets that are currently registered in the NUIGadgetManager. + /// It ensures that no more NUIGadgets exist after calling this method. + /// /// 10 public static void RemoveAll() { @@ -356,12 +389,33 @@ public static void RemoveAll() } /// - /// Resumes the running NUIGadget. + /// Resumes the execution of the specified NUIGadget. /// - /// The NUIGadget object. + /// + /// By calling this method, you can resume the execution of the currently suspended NUIGadget. + /// It takes the NUIGadget object as an argument which represents the target gadget that needs to be resumed. + /// + /// The NUIGadget object whose execution needs to be resumed. + /// Thrown if the 'gadget' argument is null. + /// + /// To resume the execution of a specific NUIGadget named 'MyGadget', you can call the following code snippet: + /// + /// + /// // Get the reference to the NUIGadget object + /// NUIGadget MyGadget = ...; + /// + /// // Resume its execution + /// GadgetResume(MyGadget); + /// + /// /// 10 public static void Resume(NUIGadget gadget) { + if (gadget == null) + { + throw new ArgumentNullException(nameof(gadget)); + } + if (!_gadgets.Contains(gadget)) { return; @@ -375,12 +429,21 @@ public static void Resume(NUIGadget gadget) } /// - /// Pauses the running NUIGadget. + /// Pauses the execution of the specified NUIGadget. /// - /// The NUIGadget object. + /// + /// Calling this method pauses the currently executing NUIGadget. It does not affect any other gadgets that may be running simultaneously. + /// + /// The NUIGadget object whose execution needs to be paused. + /// Thrown if the argument 'gadget' is null. /// 10 public static void Pause(NUIGadget gadget) { + if (gadget == null) + { + throw new ArgumentNullException(nameof(gadget)); + } + if (!_gadgets.Contains(gadget)) { return; @@ -394,12 +457,12 @@ public static void Pause(NUIGadget gadget) } /// - /// Sends the appcontrol to the running NUIGadget. + /// Sends the specified application control to the currently running NUIGadget. /// - /// The NUIGadget object. - /// The appcontrol object. - /// Thrown when failed because of a invalid argument. - /// Thrown when failed because the argument is null. + /// The NUIGadget object that will receive the app control. + /// The app control object containing the desired arguments and actions. + /// Thrown if any of the arguments are invalid or missing. + /// Thrown if either 'gadget' or 'appControl' is null. /// 10 public static void SendAppControl(NUIGadget gadget, AppControl appControl) { diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetResourceManager.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetResourceManager.cs index d99a2c382e8..6f20fba2bfc 100755 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetResourceManager.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetResourceManager.cs @@ -25,7 +25,7 @@ namespace Tizen.NUI { /// - /// This class has the methods of the NUIGadgetResourceManager. + /// Manages resources related to NUI gadgets. /// /// 10 [EditorBrowsable(EditorBrowsableState.Never)] @@ -40,8 +40,8 @@ public class NUIGadgetResourceManager /// Initializes the resource manager of the gadget. /// /// The information of the gadget. - /// Thrown when failed because of a invalid argument. - /// 11 + /// Thrown when the argument is not valid. + /// 10 public NUIGadgetResourceManager(NUIGadgetInfo info) { if (info == null) @@ -57,9 +57,9 @@ public NUIGadgetResourceManager(NUIGadgetInfo info) /// /// Initializes the resource manager of the gadget. /// - /// The path of the resource - /// The file name of the resource. - /// The class name of the resource. + /// The path where the resources are located. + /// The name of the DLL containing the resources. + /// The name of the class that represents the resources. /// 10 public NUIGadgetResourceManager(string resourcePath, string resourceDll, string resourceClassName) { @@ -69,10 +69,26 @@ public NUIGadgetResourceManager(string resourcePath, string resourceDll, string } /// - /// Get the value of the specified string resource. + /// Retrieves the value of the specified string resource. /// - /// The name of the resource to retrieve. - /// The value of the resource, or null if name cannot be found in a resource set. + /// The unique identifier for the string resource to retrieve. + /// The value of the requested string resource, or null if no matching resource could be found. + /// + /// This function allows you to access localized string resources by providing their names. + /// It returns the actual value of the requested resource, which can then be displayed to users or used elsewhere in your application logic. + /// If the specified resource does not exist or cannot be found, the function will return null instead. + /// + /// + /// Here's an example demonstrating how to retrieve a string resource named "greeting" from the current context: + /// + /// + /// // Retrieve the greeting message + /// string greetingMessage = GetString("greeting"); + /// + /// // Display the greeting message to the user + /// Console.WriteLine(greetingMessage); + /// + /// /// 10 public string GetString(string name) { @@ -80,12 +96,16 @@ public string GetString(string name) } /// - /// Gets the return value of the string resource localized for the specified culture. + /// Retrieves the localized string resource for the specified culture. /// - /// The name of the resource to retrieve. - /// An object that represents the culture for which the resource is localied. - /// The value of the resource localied for the specified culture, or null if name cannot be found in a resource set. - /// Thrown when failed because of a invalid argument. + /// + /// This method enables you to obtain a localized version of a specific string resource based on the provided culture. + /// It returns the desired resource value or null if the requested resource cannot be found in the resource set. + /// + /// The name of the resource to fetch. + /// An object representing the culture for which the resource needs to be localized. + /// The localized string resource for the specified culture, or null if the resource cannot be found. + /// Thrown when an invalid argument causes failure. /// 10 public string GetString(string name, CultureInfo cultureInfo) { diff --git a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs index 9786dda336f..f336d341243 100755 --- a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs +++ b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Model.cs @@ -35,9 +35,6 @@ internal static partial class Model [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_delete_Model")] public static extern void DeleteModel(global::System.Runtime.InteropServices.HandleRef model); - [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Model_Assign")] - public static extern global::System.IntPtr ModelAssign(global::System.Runtime.InteropServices.HandleRef model, global::System.Runtime.InteropServices.HandleRef sourceModel); - [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Model_GetModelRoot")] public static extern global::System.IntPtr GetModelRoot(global::System.Runtime.InteropServices.HandleRef model); diff --git a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Panel.cs b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Panel.cs new file mode 100755 index 00000000000..f10313781b0 --- /dev/null +++ b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.Panel.cs @@ -0,0 +1,73 @@ +/* + * Copyright(c) 2024 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.Runtime.InteropServices; +namespace Tizen.NUI.Scene3D +{ + internal static partial class Interop + { + internal static partial class Panel + { + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_New_SWIG_0")] + public static extern global::System.IntPtr PanelNew(); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_delete_Panel")] + public static extern void DeletePanel(global::System.Runtime.InteropServices.HandleRef panel); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_SetPanelResolution")] + public static extern void SetPanelResolution(global::System.Runtime.InteropServices.HandleRef panel, global::System.Runtime.InteropServices.HandleRef resolution); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_GetPanelResolution")] + public static extern global::System.IntPtr GetPanelResolution(global::System.Runtime.InteropServices.HandleRef panel); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_SetContent")] + public static extern void SetContent(global::System.Runtime.InteropServices.HandleRef panel, global::System.Runtime.InteropServices.HandleRef resolution); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_GetContent")] + public static extern global::System.IntPtr GetContent(global::System.Runtime.InteropServices.HandleRef panel); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_CastShadow")] + public static extern void CastShadow(global::System.Runtime.InteropServices.HandleRef panel, bool castShadow); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_IsShadowCasting")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool IsShadowCasting(global::System.Runtime.InteropServices.HandleRef panel); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_ReceiveShadow")] + public static extern void ReceiveShadow(global::System.Runtime.InteropServices.HandleRef panel, bool receiveShadow); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_IsShadowReceiving")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool IsShadowReceiving(global::System.Runtime.InteropServices.HandleRef panel); + + + // For Property index + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_property_TRANSPARENT_get")] + public static extern int PropertyTransparentIndexGet(); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_property_DOUBLE_SIDED_get")] + public static extern int PropertyDoubleSidedIndexGet(); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_property_USE_BACK_FACE_PLANE_get")] + public static extern int PropertyUseBackFacePlaneIndexGet(); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_Panel_property_BACK_FACE_PLANE_COLOR_get")] + public static extern int PropertyBackFacePlaneColorIndexGet(); + } + } +} diff --git a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs index 0e0dfd11da6..0fcb98b5a47 100755 --- a/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs +++ b/src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs @@ -105,6 +105,46 @@ internal static partial class SceneView [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_GetSkyboxOrientation")] public static extern global::System.IntPtr GetSkyboxOrientation(global::System.Runtime.InteropServices.HandleRef sceneView); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_StartCameraTransition_Index")] + public static extern void StartCameraTransitionByIndex(global::System.Runtime.InteropServices.HandleRef sceneView, uint index, int durationMilliSeconds, global::System.Runtime.InteropServices.HandleRef alphaFunction); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_StartCameraTransition_Name")] + public static extern void StartCameraTransitionByName(global::System.Runtime.InteropServices.HandleRef sceneView, string name, int durationMilliSeconds, global::System.Runtime.InteropServices.HandleRef alphaFunction); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_CameraTransitionFinishedSignal_Connect")] + public static extern void CameraTransitionFinishedConnect(global::System.Runtime.InteropServices.HandleRef actor, global::System.Runtime.InteropServices.HandleRef handler); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_CameraTransitionFinishedSignal_Disconnect")] + public static extern void CameraTransitionFinishedDisconnect(global::System.Runtime.InteropServices.HandleRef actor, global::System.Runtime.InteropServices.HandleRef handler); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_Capture")] + public static extern int Capture(global::System.Runtime.InteropServices.HandleRef sceneView, global::System.Runtime.InteropServices.HandleRef camera, global::System.Runtime.InteropServices.HandleRef size); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_CaptureFinishedSignal_Connect")] + public static extern void CaptureFinishedConnect(global::System.Runtime.InteropServices.HandleRef actor, global::System.Runtime.InteropServices.HandleRef handler); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_CaptureFinishedSignal_Disconnect")] + public static extern void CaptureFinishedDisconnect(global::System.Runtime.InteropServices.HandleRef actor, global::System.Runtime.InteropServices.HandleRef handler); + + /// Property enum get + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_Property_CornerRadius_get")] + public static extern int CornerRadiusGet(); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_Property_CornerRadiusPolicy_get")] + public static extern int CornerRadiusPolicyGet(); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_Property_BorderlineWidth_get")] + public static extern int BorderlineWidthGet(); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_Property_BorderlineColor_get")] + public static extern int BorderlineColorGet(); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_Property_BorderlineOffset_get")] + public static extern int BorderlineOffsetGet(); + + [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_Property_CornerSquareness_get")] + public static extern int CornerSquarenessGet(); } } } diff --git a/src/Tizen.AIAvatar/src/Extensions/AvatarExtension.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/CaptureFinishedEventArgs.cs similarity index 53% rename from src/Tizen.AIAvatar/src/Extensions/AvatarExtension.cs rename to src/Tizen.NUI.Scene3D/src/public/Controls/CaptureFinishedEventArgs.cs index afe62cdd856..588f9cefbbd 100644 --- a/src/Tizen.AIAvatar/src/Extensions/AvatarExtension.cs +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/CaptureFinishedEventArgs.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright(c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,30 +15,34 @@ * */ -using System.Collections.Generic; -using System.IO; +using System; using System.ComponentModel; -using static Tizen.AIAvatar.AIAvatar; - -namespace Tizen.AIAvatar +namespace Tizen.NUI.Scene3D { + /// + /// Event arguments of SceneView capture finished event. + /// [EditorBrowsable(EditorBrowsableState.Never)] - public static class AvatarExtension + public class CaptureFinishedEventArgs : EventArgs { + /// + /// Integer ID of the capture request. + /// [EditorBrowsable(EditorBrowsableState.Never)] - public static List GetDefaultAvatarList() + public int CaptureId { - var list = new List(); - var avatarModelFolders = Directory.GetDirectories(ApplicationResourcePath + EmojiAvatarResourcePath); - foreach (var directoryInfo in avatarModelFolders) - { - Log.Info(LogTag, $"Directory Path : {directoryInfo}"); - var avatarInfo = new AvatarInfo(directoryInfo); - list.Add(avatarInfo); - } + get; set; + } - return list; + /// + /// ImageUrl of the captured result + /// If the capture is failed, it is null. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public ImageUrl CapturedImageUrl + { + get; set; } } } diff --git a/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs index 18cbf0524ab..e5e845c42dd 100755 --- a/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs @@ -128,19 +128,6 @@ public Model(Model model) : this(Interop.Model.NewModel(Model.getCPtr(model)), t this.PositionUsesPivotPoint = model.PositionUsesPivotPoint; } - /// - /// Assignment operator. - /// - /// Source object to be assigned. - /// Reference to this. - internal Model Assign(Model model) - { - Model ret = new Model(Interop.Model.ModelAssign(SwigCPtr, Model.getCPtr(model)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - ret.PositionUsesPivotPoint = model.PositionUsesPivotPoint; - return ret; - } - /// /// Get The original pivot point of the model /// @@ -188,6 +175,44 @@ public ModelNode ModelRoot } } + /// + /// Whether this Model casts shadow or not by directional light. + /// If it is true, this Model is drawn on Shadow Map. + /// Default value is true. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ShadowCast + { + get + { + return IsShadowCasting(); + } + set + { + CastShadow(value); + } + } + + /// + /// Whether this Model receives shadow or not by directional light. + /// If it is true, shadows are drawn on this Model. + /// Default value is true. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ShadowReceive + { + get + { + return IsShadowReceiving(); + } + set + { + ReceiveShadow(value); + } + } + /// /// Adds modelNode to this Model. /// @@ -601,9 +626,7 @@ public void SetMotionData(MotionData motionData) /// However, same property of each child ModelNode can be changed respectively and it not changes parent's property. /// /// Whether this Model casts shadow or not. - // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) - [EditorBrowsable(EditorBrowsableState.Never)] - public void CastShadow(bool castShadow) + private void CastShadow(bool castShadow) { Interop.Model.CastShadow(SwigCPtr, castShadow); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -614,9 +637,7 @@ public void CastShadow(bool castShadow) /// Note: IBL does not cast any shadow. /// /// True if this model casts shadow. - // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) - [EditorBrowsable(EditorBrowsableState.Never)] - public bool IsShadowCasting() + private bool IsShadowCasting() { var isShadowCasting = Interop.Model.IsShadowCasting(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -630,9 +651,7 @@ public bool IsShadowCasting() /// However, same property of each child ModelNode can be changed respectively and it not changes parent's property. /// /// Whether this Model receives shadow or not. - // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) - [EditorBrowsable(EditorBrowsableState.Never)] - public void ReceiveShadow(bool receiveShadow) + private void ReceiveShadow(bool receiveShadow) { Interop.Model.ReceiveShadow(SwigCPtr, receiveShadow); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -643,9 +662,7 @@ public void ReceiveShadow(bool receiveShadow) /// If it is true, this model is drawn on Shadow Map. /// /// True if this model receives shadow. - // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) - [EditorBrowsable(EditorBrowsableState.Never)] - public bool IsShadowReceiving() + private bool IsShadowReceiving() { var isShadowReceiving = Interop.Model.IsShadowReceiving(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -656,8 +673,6 @@ public bool IsShadowReceiving() /// Retrieves model root Actor. /// /// Root View of the model. - // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) - [EditorBrowsable(EditorBrowsableState.Never)] private ModelNode GetModelRoot() { global::System.IntPtr cPtr = Interop.Model.GetModelRoot(SwigCPtr); diff --git a/src/Tizen.NUI.Scene3D/src/public/Controls/Panel.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/Panel.cs new file mode 100755 index 00000000000..36059df181a --- /dev/null +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/Panel.cs @@ -0,0 +1,379 @@ +/* + * Copyright(c) 2024 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.Runtime.InteropServices; +using System.ComponentModel; +using Tizen.NUI; +using Tizen.NUI.Binding; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Scene3D +{ + /// + /// Panel is a control to show 2D UI on 3D Scene. + /// 2D UI contents set on this Panel are rendered on a screen panel that is placed on 3D scene. + /// Each Panel has a single plane with defined resolution. + /// The plane is always placed at center to fit within the boundaries of the panel while maintaining the aspect ratio of the resolution. + /// + /// + /// + /// 2D UI Content can be added on Panel, but the result that another 3D SceneView is added on Panel is not guaranteed. + /// + /// + /// + /// + /// View contentRoot = CreateUIContent(); // Create 2D UI Scene + /// Panel panel = new Panel() + /// { + /// Size = new Size(width, height), + /// }; + /// panel.PanelResolution = new Vector2(resolutionWidth, resolutionHeight)); + /// panel.Content = contentRoot; + /// + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public partial class Panel : View + { + internal Panel(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn) + { + } + + internal Panel(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, true, cRegister) + { + } + + /// + /// Create an initialized Panel. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public Panel() : this(Interop.Panel.PanelNew(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + this.PositionUsesPivotPoint = true; + } + + /// + /// Resolution of the Panel. + /// The resolution is independent from the Panel size property. + /// The resolution defines a plane that the 2D UI scene will be rendered. + /// And the shape of the panel plane is defined by aspect ratio of the input resolution. + /// The plane is cleared by white color. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 PanelResolution + { + get + { + return GetPanelResolution(); + } + set + { + SetPanelResolution(value); + } + } + + /// + /// Root View of 2D UI content. + /// The content is rendered on the plane of the Panel by using off screen rendering. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public View Content + { + get + { + return GetContent(); + } + set + { + SetContent(value); + } + } + + /// + /// Whether Transparent background is used or not. Default value is false + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Transparent + { + get + { + bool transparent = false; + using var pValue = GetProperty(Interop.Panel.PropertyTransparentIndexGet()); + pValue?.Get(out transparent); + pValue?.Dispose(); + return transparent; + } + set + { + using var transparent = new Tizen.NUI.PropertyValue(value); + SetProperty(Interop.Panel.PropertyTransparentIndexGet(), transparent); + transparent.Dispose(); + } + } + + /// + /// Whether the content is rendered as double sided or not. + /// Default value is false. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public bool DoubleSided + { + get + { + bool doubleSided = false; + using var pValue = GetProperty(Interop.Panel.PropertyDoubleSidedIndexGet()); + pValue?.Get(out doubleSided); + pValue?.Dispose(); + return doubleSided; + } + set + { + using var doubleSided = new Tizen.NUI.PropertyValue(value); + SetProperty(Interop.Panel.PropertyDoubleSidedIndexGet(), doubleSided); + doubleSided.Dispose(); + } + } + + /// + /// Whether to use back face plane or not. + /// If this property is true, an opaque plane will be displayed when viewed from behind the Panel. + /// Default value is true. + /// Default back face plane color is white. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public bool UsingBackFacePlane + { + get + { + bool isUsingBackFacePlane = true; + using var pValue = GetProperty(Interop.Panel.PropertyUseBackFacePlaneIndexGet()); + pValue?.Get(out isUsingBackFacePlane); + pValue?.Dispose(); + return isUsingBackFacePlane; + } + set + { + using var isUsingBackFacePlane = new Tizen.NUI.PropertyValue(value); + SetProperty(Interop.Panel.PropertyUseBackFacePlaneIndexGet(), isUsingBackFacePlane); + isUsingBackFacePlane.Dispose(); + } + } + + /// + /// Color of back face plane. + /// Default color is white. + /// + /// + /// Because back face plane is always opaque, alpha channel is ignored. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public Color BackFacePlaneColor + { + get + { + Vector3 backFacePlaneColorVector3 = new Vector3(1.0f, 1.0f, 1.0f); + using var pValue = GetProperty(Interop.Panel.PropertyBackFacePlaneColorIndexGet()); + pValue?.Get(backFacePlaneColorVector3); + pValue?.Dispose(); + Color backFacePlaneColor = new Vector4(backFacePlaneColorVector3); + backFacePlaneColor.A = 1.0f; + return backFacePlaneColor; + } + set + { + Vector3 backFacePlaneColorVector3 = new Vector3(value.R, value.G, value.B); + using var backFacePlaneColor = new Tizen.NUI.PropertyValue(backFacePlaneColorVector3); + SetProperty(Interop.Panel.PropertyBackFacePlaneColorIndexGet(), backFacePlaneColor); + backFacePlaneColor.Dispose(); + } + } + + /// + /// Whether this Panel casts shadow or not by directional light. + /// If it is true, this panel is drawn on Shadow Map. + /// Default value is true. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ShadowCast + { + get + { + return IsShadowCasting(); + } + set + { + CastShadow(value); + } + } + + /// + /// Whether this Panel receives shadow or not by directional light. + /// If it is true, shadows are drawn on this panel. + /// Default value is true. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ShadowReceive + { + get + { + return IsShadowReceiving(); + } + set + { + ReceiveShadow(value); + } + } + + /// + /// Sets whether this Panel casts shadow or not. + /// If it is true, this panels is drawn on Shadow Map. + /// + /// Whether this Panel casts shadow or not. + private void CastShadow(bool castShadow) + { + Interop.Panel.CastShadow(SwigCPtr, castShadow); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Retrieves whether the Panel casts shadow or not for Light. + /// Note: IBL does not cast any shadow. + /// + /// True if this model casts shadow. + private bool IsShadowCasting() + { + var isShadowCasting = Interop.Panel.IsShadowCasting(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return isShadowCasting; + } + + /// + /// Sets whether this Panel receives shadow or not. + /// If it is true, shadows are drawn on this panel. + /// + /// Whether this Panel receives shadow or not. + private void ReceiveShadow(bool receiveShadow) + { + Interop.Panel.ReceiveShadow(SwigCPtr, receiveShadow); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Retrieves whether the Panel receives shadow or not for Light + /// If it is true, this model is drawn on Shadow Map. + /// + /// True if this model receives shadow. + private bool IsShadowReceiving() + { + var isShadowReceiving = Interop.Panel.IsShadowReceiving(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return isShadowReceiving; + } + + /// + /// Sets defined resolution to the Panel. + /// The resolution is independent from the Panel size property. + /// The resolution defines a plane that the 2D UI scene will be rendered. + /// And the shape of the panel plane is defined by aspect ratio of the input resolution. + /// + /// The resolution defines panel plane. + /// True if this model receives shadow. + private void SetPanelResolution(Vector2 resolution) + { + Interop.Panel.SetPanelResolution(SwigCPtr, Vector2.getCPtr(resolution)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Retrieves panel resolution. + /// + /// Resolution of the panel plane. + private Vector2 GetPanelResolution() + { + Vector2 resolution = new Vector2(Interop.Panel.GetPanelResolution(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return resolution; + } + + /// + /// Sets root Actor of 2D UI content. + /// The content is rendered on the plane of the Panel by using off screen rendering. + /// + /// Root View of 2D UI content. + private void SetContent(View content) + { + Interop.Panel.SetContent(SwigCPtr, content.SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Retrieves root View of 2D UI content. + /// + /// Root View of 2D UI content. + private View GetContent() + { + IntPtr cPtr = Interop.Panel.GetContent(SwigCPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; + if (ret != null) + { + NUI.Interop.BaseHandle.DeleteBaseHandle(new HandleRef(this, cPtr)); + } + else + { + ret = new View(cPtr, true); + } + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + + /// + /// To make transitionSet instance be disposed. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + base.Dispose(type); + } + + /// + /// Release swigCPtr. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.Panel.DeletePanel(swigCPtr); + } + } +} diff --git a/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs index 217a7a17be7..a88525c6a82 100755 --- a/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs @@ -22,6 +22,9 @@ using Tizen.NUI; using Tizen.NUI.Binding; using Tizen.NUI.BaseComponents; +using System.Threading.Tasks; +using System.Collections.Generic; +using System.Diagnostics; namespace Tizen.NUI.Scene3D { @@ -68,10 +71,24 @@ namespace Tizen.NUI.Scene3D /// 10 public class SceneView : View { - private bool inCameraTransition = false; - private Animation cameraTransition; + private Dictionary> asyncCaptureIds = new(); private string skyboxUrl; + // CameraTransitionFinishedEvent + private EventHandler cameraTransitionFinishedEventHandler; + private CameraTransitionFinishedEventCallbackType cameraTransitionFinishedEventCallback; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void CameraTransitionFinishedEventCallbackType(IntPtr data); + + // CaptureFinishedEvent + private EventHandler captureFinishedEventHandler; + private EventHandler asyncCaptureFinishedEventHandler; + private CaptureFinishedEventCallbackType captureFinishedEventCallback; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void CaptureFinishedEventCallbackType(IntPtr data, int captureId, IntPtr capturedImageUrl); + internal SceneView(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn) { } @@ -80,6 +97,40 @@ internal SceneView(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) { } + /// + /// Dispose Explicit or Implicit + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (Disposed) + { + return; + } + + if (cameraTransitionFinishedEventCallback != null) + { + NUILog.Debug($"[Dispose] cameraTransitionFinishedEventCallback"); + + Interop.SceneView.CameraTransitionFinishedDisconnect(GetBaseHandleCPtrHandleRef, cameraTransitionFinishedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExistsDebug(); + cameraTransitionFinishedEventCallback = null; + } + + if (captureFinishedEventCallback != null) + { + NUILog.Debug($"[Dispose] captureFinishedEventCallback"); + + Interop.SceneView.CaptureFinishedDisconnect(GetBaseHandleCPtrHandleRef, captureFinishedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExistsDebug(); + captureFinishedEventCallback = null; + } + + LayoutCount = 0; + + base.Dispose(type); + } + /// /// Create an initialized SceneView. /// @@ -116,7 +167,88 @@ internal SceneView Assign(SceneView sceneView) ///
// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler CameraTransitionFinished; + public event EventHandler CameraTransitionFinished + { + add + { + if (cameraTransitionFinishedEventHandler == null) + { + cameraTransitionFinishedEventCallback = OnCameraTransitionFinished; + Interop.SceneView.CameraTransitionFinishedConnect(SwigCPtr, cameraTransitionFinishedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + cameraTransitionFinishedEventHandler += value; + } + + remove + { + cameraTransitionFinishedEventHandler -= value; + if (cameraTransitionFinishedEventHandler == null && cameraTransitionFinishedEventCallback != null) + { + Interop.SceneView.CameraTransitionFinishedDisconnect(SwigCPtr, cameraTransitionFinishedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + cameraTransitionFinishedEventCallback = null; + } + } + } + + /// + /// An event emitted when Capture is finished. + /// If Capture is successed, CaptureFinishedEventArgs includes finished capture ID and ImageUrl of the captured image. + /// If Capture is failed, the ImageUrl is null. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler CaptureFinished + { + add + { + if (captureFinishedEventHandler == null) + { + captureFinishedEventCallback = OnCaptureFinished; + Interop.SceneView.CaptureFinishedConnect(SwigCPtr, captureFinishedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + captureFinishedEventHandler += value; + } + + remove + { + captureFinishedEventHandler -= value; + if (captureFinishedEventHandler == null && captureFinishedEventCallback != null) + { + Interop.SceneView.CaptureFinishedDisconnect(SwigCPtr, captureFinishedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + captureFinishedEventCallback = null; + } + } + } + + /// + /// An event emitted when CaptureAsync is finished. + /// + private event EventHandler AsyncCaptureFinished + { + add + { + if (asyncCaptureFinishedEventHandler == null) + { + CaptureFinished += dummy; + } + asyncCaptureFinishedEventHandler += value; + } + + remove + { + asyncCaptureFinishedEventHandler -= value; + if (asyncCaptureFinishedEventHandler == null) + { + CaptureFinished += dummy; + } + } + } + + void dummy(object sender, CaptureFinishedEventArgs e) {} /// /// Set/Get the ImageBasedLight ScaleFactor. @@ -314,7 +446,7 @@ public Camera GetCamera(uint index) { // We found matched NUI camera. Reduce cPtr reference count. HandleRef handle = new HandleRef(this, cPtr); - Interop.Camera.DeleteCameraProperty(handle); + Interop.Camera.DeleteCamera(handle); handle = new HandleRef(null, IntPtr.Zero); } if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -340,7 +472,7 @@ public Camera GetCamera(string name) { // We found matched NUI camera. Reduce cPtr reference count. HandleRef handle = new HandleRef(this, cPtr); - Interop.Camera.DeleteCameraProperty(handle); + Interop.Camera.DeleteCamera(handle); handle = new HandleRef(null, IntPtr.Zero); } if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -354,11 +486,6 @@ public Camera GetCamera(string name) /// 10 public void SelectCamera(uint index) { - if (inCameraTransition) - { - return; - } - this.GetSelectedCamera()?.Unparent(); Interop.SceneView.SelectCamera(SwigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -370,11 +497,6 @@ public void SelectCamera(uint index) /// 10 public void SelectCamera(string name) { - if (inCameraTransition) - { - return; - } - this.GetSelectedCamera()?.Unparent(); Interop.SceneView.SelectCamera(SwigCPtr, name); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -384,7 +506,7 @@ public void SelectCamera(string name) /// Camera Position, Orientation and FieldOfView are smoothly animated. /// /// - /// The selected camera is switched to the Camera of the index when the transition is started. + /// The selected camera is switched to the Camera of the index when the transition is finished. /// During camera transition, Selected Camera should not be changed by using SelectCamera() or CameraTransition() method. /// During camera transition, Camera properties of Selected Camera should not be changed. /// @@ -395,14 +517,13 @@ public void SelectCamera(string name) [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "The ownership of camera object is not owned by this class.")] public void CameraTransition(uint index, int durationMilliSeconds, AlphaFunction alphaFunction = null) { - if (inCameraTransition || GetSelectedCamera() == GetCamera(index)) + AlphaFunction actualAlphaFunction = alphaFunction; + if(actualAlphaFunction == null) { - return; + actualAlphaFunction = new AlphaFunction(); } - Camera source = GetSelectedCamera(); - SelectCamera(index); - Camera destination = GetSelectedCamera(); - CameraTransition(source, destination, durationMilliSeconds, alphaFunction); + Interop.SceneView.StartCameraTransitionByIndex(SwigCPtr, index, durationMilliSeconds, actualAlphaFunction.SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// @@ -410,7 +531,7 @@ public void CameraTransition(uint index, int durationMilliSeconds, AlphaFunction /// Camera Position, Orientation and FieldOfView are smoothly animated. /// /// - /// The selected camera is switched to the Camera of the input name when the transition is started. + /// The selected camera is switched to the Camera of the input name when the transition is finished. /// During camera transition, Selected Camera should not be changed by using SelectCamera() or CameraTransition() method. /// During camera transition, Camera properties of Selected Camera should not be changed. /// @@ -421,14 +542,13 @@ public void CameraTransition(uint index, int durationMilliSeconds, AlphaFunction [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "The ownership of camera object is not owned by this class.")] public void CameraTransition(string name, int durationMilliSeconds, AlphaFunction alphaFunction = null) { - if (inCameraTransition || GetSelectedCamera() == GetCamera(name)) + AlphaFunction actualAlphaFunction = alphaFunction; + if(actualAlphaFunction == null) { - return; + actualAlphaFunction = new AlphaFunction(); } - Camera source = GetSelectedCamera(); - SelectCamera(name); - Camera destination = GetSelectedCamera(); - CameraTransition(source, destination, durationMilliSeconds, alphaFunction); + Interop.SceneView.StartCameraTransitionByName(SwigCPtr, name, durationMilliSeconds, actualAlphaFunction.SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// @@ -449,7 +569,7 @@ public Camera GetSelectedCamera() { // We found matched NUI camera. Reduce cPtr reference count. HandleRef handle = new HandleRef(this, cPtr); - Interop.Camera.DeleteCameraProperty(handle); + Interop.Camera.DeleteCamera(handle); handle = new HandleRef(null, IntPtr.Zero); } if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -496,7 +616,7 @@ public void SetResolution(uint width, uint height) /// /// If the SceneView not uses FBO, this method returns SceneView's width. /// - /// Camera currently used in SceneView as a selected Camera. + /// Width of the SceneView resolution // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] public uint GetResolutionWidth() @@ -512,7 +632,7 @@ public uint GetResolutionWidth() /// /// If the SceneView not uses FBO, this method returns SceneView's height. /// - /// Camera currently used in SceneView as a selected Camera. + /// Height of the SceneView resolution. // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] public uint GetResolutionHeight() @@ -533,6 +653,82 @@ public void ResetResolution() if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Requests to capture this SceneView with the Camera. + /// When the capture is finished, CaptureFinished Event is emited. + /// includes and . + /// If the capture is successful, the contains url of captured image. + /// If the capture fails, the is null. + /// + /// Camera to be used for capture. + /// captured size. + /// + /// The input camera should not be used for any other purpose during Capture. + /// (Simultaneous usage elsewhere may result in incorrect rendering.) + /// The camera is required to be added in this SceneView. (Not need to be a selected camera) + /// If the SceneView is disconnected from Scene, the left capture requests are canceled with fail. + /// + /// capture id that id unique value to distinguish each requiest. + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public int Capture(Scene3D.Camera camera, Vector2 size) + { + int id = Interop.SceneView.Capture(SwigCPtr, camera.SwigCPtr, Vector2.getCPtr(size)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return id; + } + + /// + /// Requests to capture this SceneView with the Camera asynchronously. + /// + /// Camera to be used for capture. + /// captured size. + /// + /// The input camera should not be used for any other purpose during Capture. + /// (Simultaneous usage elsewhere may result in incorrect rendering.) + /// The camera is required to be added in this SceneView. (Not need to be a selected camera) + /// If the SceneView is disconnected from Scene, the left capture requests are canceled with fail. + /// + /// + /// A task that represents the asynchronous operation. The task result contains the URL of the captured image. + /// If the capture is successful, the task result is the ImageURL. + /// If the capture fails, the task will complete with an + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public Task CaptureAsync(Scene3D.Camera camera, Vector2 size) + { + void Handler(object _, CaptureFinishedEventArgs e) + { + if (asyncCaptureIds.TryGetValue(e.CaptureId, out var tcs)) + { + try + { + if (e.CapturedImageUrl != null) + { + tcs.SetResult(e.CapturedImageUrl); + } + else + { + tcs.SetException(new InvalidOperationException("Fail to Capture")); + } + } + finally + { + AsyncCaptureFinished -= Handler; + asyncCaptureIds.Remove(e.CaptureId); + } + } + }; + + AsyncCaptureFinished += Handler; + var captureId = Interop.SceneView.Capture(SwigCPtr, camera.SwigCPtr, Vector2.getCPtr(size)); + TaskCompletionSource ret = new TaskCompletionSource(); + asyncCaptureIds.Add(captureId, ret); + + return ret.Task; + } + internal void SetUseFramebuffer(bool useFramebuffer) { Interop.SceneView.UseFramebuffer(SwigCPtr, useFramebuffer); @@ -638,100 +834,62 @@ private Rotation GetSkyboxOrientation() return ret; } - private void CameraTransition(Camera sourceCamera, Camera destinationCamera, int durationMilliSeconds, AlphaFunction alphaFunction) + /// + /// Callback when CornerRadius property changed. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + internal override void ApplyCornerRadius() { - inCameraTransition = true; - - Position sourcePosition = sourceCamera.Position; - Rotation sourceOrientation = sourceCamera.Orientation; - - Position destinationPosition = destinationCamera.Position; - Rotation destinationOrientation = destinationCamera.Orientation; + base.ApplyCornerRadius(); - cameraTransition = new Animation(durationMilliSeconds); + if (backgroundExtraData == null) return; - KeyFrames positionKeyFrames = new KeyFrames(); - positionKeyFrames.Add(0.0f, sourcePosition); - positionKeyFrames.Add(1.0f, destinationPosition); - - KeyFrames orientationKeyFrames = new KeyFrames(); - orientationKeyFrames.Add(0.0f, sourceOrientation); - orientationKeyFrames.Add(1.0f, destinationOrientation); - - cameraTransition.AnimateBetween(destinationCamera, "Position", positionKeyFrames, Animation.Interpolation.Linear, alphaFunction); - cameraTransition.AnimateBetween(destinationCamera, "Orientation", orientationKeyFrames, Animation.Interpolation.Linear, alphaFunction); - - if (destinationCamera.ProjectionMode == Camera.ProjectionModeType.Perspective) + // Update corner radius properties to image by ActionUpdateProperty + if (backgroundExtraDataUpdatedFlag.HasFlag(BackgroundExtraDataUpdatedFlag.ContentsCornerRadius)) { - Radian sourceFieldOfView = sourceCamera.FieldOfView; - Radian destinationFieldOfView = destinationCamera.FieldOfView; - - // If ProjectionDirection is not equal, match the value. - if (sourceCamera.ProjectionDirection != destinationCamera.ProjectionDirection) + if (backgroundExtraData.CornerRadius != null) { - float aspect = destinationCamera.AspectRatio; - if (destinationCamera.ProjectionDirection == Camera.ProjectionDirectionType.Vertical) - { - Camera.ConvertFovFromHorizontalToVertical(aspect, ref sourceFieldOfView); - } - else - { - Camera.ConvertFovFromVerticalToHorizontal(aspect, ref sourceFieldOfView); - } + using var setValue = new Tizen.NUI.PropertyValue(backgroundExtraData.CornerRadius); + SetProperty(Interop.SceneView.CornerRadiusGet(), setValue); } - - KeyFrames fieldOfViewKeyFrames = new KeyFrames(); - fieldOfViewKeyFrames.Add(0.0f, sourceFieldOfView.ConvertToFloat()); - fieldOfViewKeyFrames.Add(1.0f, destinationFieldOfView.ConvertToFloat()); - cameraTransition.AnimateBetween(destinationCamera, "FieldOfView", fieldOfViewKeyFrames, Animation.Interpolation.Linear, alphaFunction); - - sourceFieldOfView.Dispose(); - destinationFieldOfView.Dispose(); - fieldOfViewKeyFrames.Dispose(); - } - else - { - float sourceOrthographicSize = sourceCamera.OrthographicSize; - float destinationOrthographicSize = destinationCamera.OrthographicSize; - - // If ProjectionDirection is not equal, match the value. - if (sourceCamera.ProjectionDirection != destinationCamera.ProjectionDirection) + if (backgroundExtraData.CornerSquareness != null) { - float aspect = destinationCamera.AspectRatio; - if (destinationCamera.ProjectionDirection == Camera.ProjectionDirectionType.Vertical) - { - sourceOrthographicSize = sourceOrthographicSize / aspect; - } - else - { - sourceOrthographicSize = sourceOrthographicSize * aspect; - } + using var setValue = new Tizen.NUI.PropertyValue(backgroundExtraData.CornerSquareness); + SetProperty(Interop.SceneView.CornerSquarenessGet(), setValue); + } + { + using var setValue = new Tizen.NUI.PropertyValue((int)backgroundExtraData.CornerRadiusPolicy); + SetProperty(Interop.SceneView.CornerRadiusPolicyGet(), setValue); } - - KeyFrames orthographicSizeKeyFrames = new KeyFrames(); - orthographicSizeKeyFrames.Add(0.0f, sourceOrthographicSize); - orthographicSizeKeyFrames.Add(1.0f, destinationOrthographicSize); - cameraTransition.AnimateBetween(destinationCamera, "OrthographicSize", orthographicSizeKeyFrames, Animation.Interpolation.Linear, alphaFunction); - - orthographicSizeKeyFrames.Dispose(); } + } + + /// + /// Callback when Borderline property changed. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + internal override void ApplyBorderline() + { + base.ApplyBorderline(); - float destinationNearPlaneDistance = destinationCamera.NearPlaneDistance; - float destinationFarPlaneDistance = destinationCamera.FarPlaneDistance; - destinationCamera.NearPlaneDistance = Math.Min(sourceCamera.NearPlaneDistance, destinationCamera.NearPlaneDistance); - destinationCamera.FarPlaneDistance = Math.Max(sourceCamera.FarPlaneDistance, destinationCamera.FarPlaneDistance); + if (backgroundExtraData == null) return; - cameraTransition.Finished += (s, e) => + // Update corner radius properties to image by ActionUpdateProperty + if (backgroundExtraDataUpdatedFlag.HasFlag(BackgroundExtraDataUpdatedFlag.ContentsBorderline)) { - this.GetSelectedCamera().NearPlaneDistance = destinationNearPlaneDistance; - this.GetSelectedCamera().FarPlaneDistance = destinationFarPlaneDistance; - inCameraTransition = false; - CameraTransitionFinished?.Invoke(this, EventArgs.Empty); - }; - cameraTransition.Play(); - - positionKeyFrames.Dispose(); - orientationKeyFrames.Dispose(); + { + using var setValue = new Tizen.NUI.PropertyValue(backgroundExtraData.BorderlineWidth); + SetProperty(Interop.SceneView.BorderlineWidthGet(), setValue); + } + { + using var setValue = new Tizen.NUI.PropertyValue((backgroundExtraData.BorderlineColor ?? Color.Black)); + SetProperty(Interop.SceneView.BorderlineColorGet(), setValue); + } + { + using var setValue = new Tizen.NUI.PropertyValue(backgroundExtraData.BorderlineOffset); + SetProperty(Interop.SceneView.BorderlineOffsetGet(), setValue); + } + } } /// @@ -743,5 +901,31 @@ protected override void ReleaseSwigCPtr(global::System.Runtime.InteropServices.H { Interop.SceneView.DeleteScene(swigCPtr); } + + // Callback for camera transition finished signal + private void OnCameraTransitionFinished(IntPtr data) + { + cameraTransitionFinishedEventHandler?.Invoke(this, EventArgs.Empty); + } + + // Callback for capture finished signal + private void OnCaptureFinished(IntPtr data, int captureId, IntPtr capturedImageUrl) + { + CaptureFinishedEventArgs e = new CaptureFinishedEventArgs(); + ImageUrl imageUrl = new ImageUrl(NUI.Interop.ImageUrl.NewImageUrl(new ImageUrl(capturedImageUrl, false).SwigCPtr), true); + NDalicPINVOKE.ThrowExceptionIfExists(); + + e.CaptureId = captureId; + e.CapturedImageUrl = imageUrl.HasBody() ? imageUrl : null; + + if (asyncCaptureIds.ContainsKey(e.CaptureId)) + { + asyncCaptureFinishedEventHandler?.Invoke(this, e); + } + else + { + captureFinishedEventHandler?.Invoke(this, e); + } + } } } diff --git a/src/Tizen.NUI.WindowSystem/Tizen.NUI.WindowSystem.sln b/src/Tizen.NUI.WindowSystem/Tizen.NUI.WindowSystem.sln new file mode 100644 index 00000000000..d2b2920f0d4 --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/Tizen.NUI.WindowSystem.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.WindowSystem", "Tizen.NUI.WindowSystem.csproj", "{4736851E-294E-4EBA-9DF1-79D2D78176B9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4736851E-294E-4EBA-9DF1-79D2D78176B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4736851E-294E-4EBA-9DF1-79D2D78176B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4736851E-294E-4EBA-9DF1-79D2D78176B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4736851E-294E-4EBA-9DF1-79D2D78176B9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0EBD4ED2-63CC-4DCC-A57A-68DBC451B9F2} + EndGlobalSection +EndGlobal diff --git a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.EcoreWl2.cs b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.EcoreWl2.cs new file mode 100644 index 00000000000..0d7fad833db --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.EcoreWl2.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Tizen.NUI.WindowSystem +{ + internal static partial class Interop + { + internal static partial class EcoreWl2 + { + const string lib = "libecore_wl2.so.1"; + + [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "ecore_wl2_window_id_get")] + internal static extern int GetWindowId(IntPtr win); + } + } +} diff --git a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.InputGesture.cs b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.InputGesture.cs new file mode 100644 index 00000000000..f602a008881 --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.InputGesture.cs @@ -0,0 +1,93 @@ +using System; +using System.Runtime.InteropServices; +using System.Collections.Generic; +using System.Text; + +namespace Tizen.NUI.WindowSystem +{ + internal static partial class Interop + { + internal static class InputGesture + { + const string lib = "libcapi-ui-efl-util.so.0"; + + internal static string LogTag = "Tizen.NUI.WindowSystem"; + + [DllImport(lib, EntryPoint = "efl_util_gesture_initialize")] + internal static extern IntPtr Initialize(); + + [DllImport(lib, EntryPoint = "efl_util_gesture_deinitialize")] + internal static extern ErrorCode Deinitialize(IntPtr gestureHandler); + + [DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_new")] + internal static extern IntPtr EdgeSwipeNew(IntPtr gestureHandler, int fingers, int edge); + + [DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_free")] + internal static extern ErrorCode EdgeSwipeFree(IntPtr gestureHandler, IntPtr gestureData); + + [DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_size_set")] + internal static extern ErrorCode EdgeSwipeSizeSet(IntPtr gestureData, int edgeSize, int startPoint, int endPoint); + + [DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_new")] + internal static extern IntPtr EdgeDragNew(IntPtr gestureHandler, int fingers, int edge); + + [DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_free")] + internal static extern ErrorCode EdgeDragFree(IntPtr gestureHandler, IntPtr gestureData); + + [DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_size_set")] + internal static extern ErrorCode EdgeDragSizeSet(IntPtr gestureData, int edgeSize, int startPoint, int endPoint); + + [DllImport(lib, EntryPoint = "efl_util_gesture_tap_new")] + internal static extern IntPtr TapNew(IntPtr gestureHandler, int fingers, int repeats); + + [DllImport(lib, EntryPoint = "efl_util_gesture_tap_free")] + internal static extern ErrorCode TapFree(IntPtr gestureHandler, IntPtr gestureData); + + [DllImport(lib, EntryPoint = "efl_util_gesture_palm_cover_new")] + internal static extern IntPtr PalmCoverNew(IntPtr gestureHandler); + + [DllImport(lib, EntryPoint = "efl_util_gesture_palm_cover_free")] + internal static extern ErrorCode PalmCoverFree(IntPtr gestureHandler, IntPtr gestureData); + + [DllImport(lib, EntryPoint = "efl_util_gesture_grab")] + internal static extern ErrorCode GestureGrab(IntPtr gestureHandler, IntPtr gestureData); + + [DllImport(lib, EntryPoint = "efl_util_gesture_ungrab")] + internal static extern ErrorCode GestureUngrab(IntPtr gestureHandler, IntPtr gestureData); + + [DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_cb_set")] + internal static extern ErrorCode SetEdgeSwipeCb(IntPtr gestureHandler, EdgeSwipeCb cbFunc, IntPtr usergestureData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void EdgeSwipeCb(IntPtr usergestureData, int mode, int fingers, int sx, int sy, int edge); + + [DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_cb_set")] + internal static extern ErrorCode SetEdgeDragCb(IntPtr gestureHandler, EdgeDragCb cbFunc, IntPtr usergestureData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void EdgeDragCb(IntPtr usergestureData, int mode, int fingers, int cx, int cy, int edge); + + [DllImport(lib, EntryPoint = "efl_util_gesture_tap_cb_set")] + internal static extern ErrorCode SetTapCb(IntPtr gestureHandler, TapCb cbFunc, IntPtr usergestureData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void TapCb(IntPtr usergestureData, int mode, int fingers, int repeats); + + [DllImport(lib, EntryPoint = "efl_util_gesture_palm_cover_cb_set")] + internal static extern ErrorCode SetPalmCoverCb(IntPtr gestureHandler, PalmCoverCb cbFunc, IntPtr usergestureData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void PalmCoverCb(IntPtr usergestureData, int mode, int duration, int cx, int cy, int size, double pressure); + + internal enum ErrorCode + { + None = Tizen.Internals.Errors.ErrorCode.None, // Successful + OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, // Out of memory + InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, // Invalid parameter + InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation, // Invalid operation + PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, // Permission denied + NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, // NOT supported + }; + } + } +} diff --git a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.KVMService.cs b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.KVMService.cs index 63eebfb407e..bd661204857 100644 --- a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.KVMService.cs +++ b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.KVMService.cs @@ -11,7 +11,7 @@ internal static partial class KVMService const string lib = "libtzsh_kvm_service.so.0"; [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_kvm_service_create")] - internal static extern IntPtr Create(IntPtr tzsh, IntPtr win); + internal static extern IntPtr Create(IntPtr tzsh, uint win); [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_kvm_service_destroy")] internal static extern int Destroy(IntPtr kvmService); diff --git a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.QuickPanelClient.cs b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.QuickPanelClient.cs index 0c541500b57..36f35668749 100644 --- a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.QuickPanelClient.cs +++ b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.QuickPanelClient.cs @@ -11,7 +11,7 @@ internal static partial class QuickPanelClient const string lib = "libtzsh_quickpanel.so.0"; [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_quickpanel_create_with_type")] - internal static extern IntPtr CreateWithType(IntPtr tzsh, IntPtr win, int type); + internal static extern IntPtr CreateWithType(IntPtr tzsh, uint win, int type); [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_quickpanel_destroy")] internal static extern int Destroy(IntPtr qpClient); diff --git a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.QuickPanelService.cs b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.QuickPanelService.cs index a0297f508eb..d12888c713a 100644 --- a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.QuickPanelService.cs +++ b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.QuickPanelService.cs @@ -11,7 +11,7 @@ internal static partial class QuickPanelService const string lib = "libtzsh_quickpanel_service.so.0"; [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_quickpanel_service_create_with_type")] - internal static extern IntPtr CreateWithType(IntPtr tzsh, IntPtr win, int type); + internal static extern IntPtr CreateWithType(IntPtr tzsh, uint win, int type); [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_quickpanel_service_destroy")] internal static extern int Destroy(IntPtr service); diff --git a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.ScreensaverService.cs b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.ScreensaverService.cs new file mode 100644 index 00000000000..f01f0ea3ff3 --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.ScreensaverService.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Tizen.NUI.WindowSystem.Shell +{ + internal static partial class Interop + { + internal static partial class ScreensaverService + { + const string lib = "libtzsh_screensaver_service.so.0"; + + [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_screensaver_service_create")] + internal static extern IntPtr Create(IntPtr tzsh, uint win); + + [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_screensaver_service_destroy")] + internal static extern int Destroy(IntPtr ScreensaverService); + } + } +} diff --git a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.SoftkeyClient.cs b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.SoftkeyClient.cs index 13e8e109585..5b27bd68628 100644 --- a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.SoftkeyClient.cs +++ b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.SoftkeyClient.cs @@ -11,7 +11,7 @@ internal static partial class SoftkeyClient const string lib = "libtzsh_softkey.so.0"; [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_softkey_create")] - internal static extern IntPtr Create(IntPtr tzsh, IntPtr win); + internal static extern IntPtr Create(IntPtr tzsh, uint win); [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_softkey_destroy")] internal static extern int Destroy(IntPtr softkeyClient); diff --git a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.SoftkeyService.cs b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.SoftkeyService.cs index f70ba6f185e..0835f287fc8 100644 --- a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.SoftkeyService.cs +++ b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.SoftkeyService.cs @@ -11,7 +11,7 @@ internal static partial class SoftkeyService const string lib = "libtzsh_softkey_service.so.0"; [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_softkey_service_create")] - internal static extern IntPtr Create(IntPtr tzsh, IntPtr win); + internal static extern IntPtr Create(IntPtr tzsh, uint win); [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_softkey_service_destroy")] internal static extern int Destroy(IntPtr softkeyService); diff --git a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.TaskbarService.cs b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.TaskbarService.cs index 139edbe58ee..33b631f1ac6 100755 --- a/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.TaskbarService.cs +++ b/src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.TaskbarService.cs @@ -11,7 +11,7 @@ internal static partial class TaskbarService const string lib = "libtzsh_taskbar_service.so.0"; [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_taskbar_service_create")] - internal static extern IntPtr Create(IntPtr tzsh, IntPtr win); + internal static extern IntPtr Create(IntPtr tzsh, uint win); [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "tzsh_taskbar_service_destroy")] internal static extern int Destroy(IntPtr taskbarService); diff --git a/src/Tizen.NUI.WindowSystem/src/public/EdgeDragEventArgs.cs b/src/Tizen.NUI.WindowSystem/src/public/EdgeDragEventArgs.cs new file mode 100644 index 00000000000..540df835ce1 --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/src/public/EdgeDragEventArgs.cs @@ -0,0 +1,58 @@ +/* + * Copyright(c) 2024 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.ComponentModel; + +namespace Tizen.NUI.WindowSystem +{ + /// + /// This class contains the data related to the EdgeDrag event. + /// + /// This class is need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class EdgeDragEventArgs : EventArgs + { + internal EdgeDragEventArgs(int mode, int fingers, int cx, int cy, int edge) + { + Mode = mode; + Fingers = fingers; + Cx = cx; + Cy = cy; + Edge = edge; + } + /// + /// Mode + /// + public int Mode{ get; internal set; } + /// + /// Fingers + /// + public int Fingers{ get; internal set;} + /// + /// Cx + /// + public int Cx{ get; internal set;} + /// + /// Cy + /// + public int Cy{ get; internal set;} + /// + /// Edge + /// + public int Edge{ get; internal set;} + } +} diff --git a/src/Tizen.NUI.WindowSystem/src/public/EdgeSwipeEventArgs.cs b/src/Tizen.NUI.WindowSystem/src/public/EdgeSwipeEventArgs.cs new file mode 100644 index 00000000000..e782d87d825 --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/src/public/EdgeSwipeEventArgs.cs @@ -0,0 +1,58 @@ +/* + * Copyright(c) 2024 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.ComponentModel; + +namespace Tizen.NUI.WindowSystem +{ + /// + /// This class contains the data related to the EdgeSwipe event. + /// + /// This class is need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class EdgeSwipeEventArgs : EventArgs + { + internal EdgeSwipeEventArgs(int mode, int fingers, int sx, int sy, int edge) + { + Mode = mode; + Fingers = fingers; + Sx = sx; + Sy = sy; + Edge = edge; + } + /// + /// Mode + /// + public int Mode{ get; internal set; } + /// + /// Fingers + /// + public int Fingers{ get; internal set;} + /// + /// Sx + /// + public int Sx{ get; internal set;} + /// + /// Sy + /// + public int Sy{ get; internal set;} + /// + /// Edge + /// + public int Edge{ get; internal set;} + } +} diff --git a/src/Tizen.NUI.WindowSystem/src/public/InputGesture.cs b/src/Tizen.NUI.WindowSystem/src/public/InputGesture.cs new file mode 100644 index 00000000000..b78fb7a269b --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/src/public/InputGesture.cs @@ -0,0 +1,578 @@ +/* + * Copyright(c) 2024 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.ComponentModel; +using static Tizen.NUI.WindowSystem.Interop.InputGesture; + +namespace Tizen.NUI.WindowSystem +{ + /// + /// Enumeration of gesture modes. + /// + /// This enum is need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum GestureMode + { + /// + /// None. + /// + None, + + /// + /// Begin. + /// + Begin, + + /// + /// Update. + /// + Update, + + /// + /// End. + /// + End, + + /// + /// Done. + /// + Done, + } + + /// + /// Enumeration of gesture edges. + /// + /// This enum is need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum GestureEdge + { + /// + /// edge none. + /// + None, + + /// + /// edge top. + /// + Top, + + /// + /// edge right. + /// + Right, + + /// + /// edge bottom. + /// + Bottom, + + /// + /// edge left. + /// + Left, + } + + /// + /// Enumeration of gesture edge sizes. + /// + /// This enum is need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum GestureEdgeSize + { + /// + /// edge size none. + /// + None, + + /// + /// edge size full. + /// + Full, + + /// + /// edge size partial. + /// + Partial, + } + + /// + /// Class for the Tizen Input Gesture. + /// + /// + /// http://tizen.org/privilege/gesturegrab + /// + /// This class is need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class InputGesture : IDisposable + { + private IntPtr _handler; + private bool disposed = false; + private bool isDisposeQueued = false; + + private event EventHandler _edgeSwipeEventHandler; + private EdgeSwipeCb _edgeSwipeDelegate; + + private event EventHandler _edgeDragEventHandler; + private EdgeDragCb _edgeDragDelegate; + + private event EventHandler _tapEventHandler; + private TapCb _tapDelegate; + + private event EventHandler _palmCoverEventHandler; + private PalmCoverCb _palmCoverDelegate; + + internal void ErrorCodeThrow(Interop.InputGesture.ErrorCode error) + { + switch (error) + { + case Interop.InputGesture.ErrorCode.None : + return; + case Interop.InputGesture.ErrorCode.OutOfMemory : + throw new Tizen.Applications.Exceptions.OutOfMemoryException("Out of Memory"); + case Interop.InputGesture.ErrorCode.InvalidParameter : + throw new ArgumentException("Invalid Parameter"); + case Interop.InputGesture.ErrorCode.PermissionDenied : + throw new Tizen.Applications.Exceptions.PermissionDeniedException("Permission denied"); + case Interop.InputGesture.ErrorCode.NotSupported : + throw new NotSupportedException("Not Supported"); + default : + throw new InvalidOperationException("Unknown Error"); + } + } + + /// + /// Creates a new InputGesture. + /// + /// This module operates in a NUI application and requires instantiation and disposal on the main thread. + /// Thrown when the memory is not enough to allocate. + /// Thrown when the feature is not supported. + /// Thrown when the permission is denied. + public InputGesture() + { + _handler = Interop.InputGesture.Initialize(); + if (_handler == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + ErrorCodeThrow((Interop.InputGesture.ErrorCode)err); + } + Log.Debug(LogTag, "InputGesture Created"); + } + + /// + /// Destructor. + /// + ~InputGesture() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// Dispose. + /// + public void Dispose() + { + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + GC.SuppressFinalize(this); + } + } + + /// + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (_handler != global::System.IntPtr.Zero) + { + Interop.InputGesture.ErrorCode res = Interop.InputGesture.Deinitialize(_handler); + ErrorCodeThrow(res); + _handler = IntPtr.Zero; + } + + disposed = true; + } + + /// + /// Generates a edge swipe gesture's grab info handle + /// + /// The number of fingers + /// The position of edge + /// The edge swipe gesture data handle + /// Thrown when failed of invalid argument. + /// Thrown when the memory is not enough to allocate. + public IntPtr CreateEdgeSwipeData(int fingers, GestureEdge edge) + { + IntPtr edgeSwipeG = IntPtr.Zero; + edgeSwipeG = Interop.InputGesture.EdgeSwipeNew(_handler, fingers, (int)edge); + if (edgeSwipeG == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + ErrorCodeThrow((Interop.InputGesture.ErrorCode)err); + } + Log.Debug(LogTag, "CreateEdgeSwipeData" + "fingers: " + fingers, "edge: " + (int)edge); + return edgeSwipeG; + } + + /// + /// Frees a memory of edge swipe gesture's grab info handle + /// + /// The edge swipe gesture data handle + /// Thrown when failed of invalid argument. + public void ReleaseEdgeSwipeData(IntPtr data) + { + if (data == IntPtr.Zero) + { + throw new ArgumentException("EdgeSwipeData is not valid."); + } + Interop.InputGesture.ErrorCode res = Interop.InputGesture.EdgeSwipeFree(_handler, data); + ErrorCodeThrow(res); + Log.Debug(LogTag, "ReleaseEdgeSwipeData"); + } + + /// + /// Sets a specific size of edge for edge swipe gesture + /// + /// The edge swipe gesture data handle + /// The enum of gesture edge size + /// The start point of edge area + /// The end point of edge area + /// Thrown when failed of invalid argument. + public void SetEdgeSwipeSize(IntPtr data, GestureEdgeSize edgeSize, int startPoint, int endPoint) + { + if (data == IntPtr.Zero) + { + throw new ArgumentException("EdgeSwipeData is not valid."); + } + Interop.InputGesture.ErrorCode res = Interop.InputGesture.EdgeSwipeSizeSet(data, (int)edgeSize, startPoint, endPoint); + ErrorCodeThrow(res); + Log.Debug(LogTag, "SetEdgeSwipeSize" + "size: " + (int)edgeSize + "startPoint: " + startPoint + "endPoint: " + endPoint); + } + + /// + /// Generates a edge drag gesture's grab info handle + /// + /// The number of fingers + /// The position of edge + /// The edge drag gesture data handle + /// Thrown when failed of invalid argument. + /// Thrown when the memory is not enough to allocate. + public IntPtr CreateEdgeDragData(int fingers, GestureEdge edge) + { + IntPtr edgeDragG = IntPtr.Zero; + edgeDragG = Interop.InputGesture.EdgeDragNew(_handler, fingers, (int)edge); + if (edgeDragG == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + ErrorCodeThrow((Interop.InputGesture.ErrorCode)err); + } + Log.Debug(LogTag, "CreateEdgeDragData" + "fingers: " + fingers, "edge: " + (int)edge); + return edgeDragG; + } + + /// + /// Frees a memory of edge drag gesture's grab info handle + /// + /// The edge drag gesture data handle + /// Thrown when failed of invalid argument. + public void ReleaseEdgeDrageData(IntPtr data) + { + if (data == IntPtr.Zero) + { + throw new ArgumentException("EdgeDragData is not valid."); + } + Interop.InputGesture.ErrorCode res = Interop.InputGesture.EdgeDragFree(_handler, data); + ErrorCodeThrow(res); + Log.Debug(LogTag, "ReleaseEdgeDrageData"); + } + + /// + /// Sets a specific size of edge for edge drag gesture + /// + /// The edge drag gesture data handle + /// The enum of gesture edge size + /// The start point of edge area + /// The end point of edge area + /// Thrown when failed of invalid argument. + public void SetEdgeDragSize(IntPtr data, GestureEdgeSize edgeSize, int startPoint, int endPoint) + { + if (data == IntPtr.Zero) + { + throw new ArgumentException("EdgeDragData is not valid."); + } + Interop.InputGesture.ErrorCode res = Interop.InputGesture.EdgeDragSizeSet(data, (int)edgeSize, startPoint, endPoint); + ErrorCodeThrow(res); + Log.Debug(LogTag, "SetEdgeDragSize" + "size: " + (int)edgeSize + "startPoint: " + startPoint + "endPoint: " + endPoint); + } + + /// + /// Generates a tap gesture's grab info handle + /// + /// The number of fingers + /// The number of repeats + /// The tap gesture data handle + /// Thrown when failed of invalid argument. + /// Thrown when the memory is not enough to allocate. + public IntPtr CreateTapData(int fingers, int repeats) + { + IntPtr tapG = IntPtr.Zero; + tapG = Interop.InputGesture.TapNew(_handler, fingers, repeats); + if (tapG == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + ErrorCodeThrow((Interop.InputGesture.ErrorCode)err); + } + Log.Debug(LogTag, "CreateTapData" + "fingers: " + fingers, "repeats: " + repeats); + return tapG; + } + + /// + /// Frees a memory of tap gesture's grab info handle + /// + /// The tap gesture data handle + /// Thrown when failed of invalid argument. + public void ReleaseTapData(IntPtr data) + { + if (data == IntPtr.Zero) + { + throw new ArgumentException("tapData is not valid."); + } + Interop.InputGesture.ErrorCode res = Interop.InputGesture.TapFree(_handler, data); + ErrorCodeThrow(res); + Log.Debug(LogTag, "ReleaseTapData"); + } + + /// + /// Generates a palm cover gesture's grab info handle + /// + /// The palm cover gesture data handle + /// Thrown when failed of invalid argument. + /// Thrown when the memory is not enough to allocate. + public IntPtr CreatePalmCoverData() + { + IntPtr palmCoverG = IntPtr.Zero; + palmCoverG = Interop.InputGesture.PalmCoverNew(_handler); + if (palmCoverG == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + ErrorCodeThrow((Interop.InputGesture.ErrorCode)err); + } + Log.Debug(LogTag, "CreatePalmCoverData"); + return palmCoverG; + } + + /// + /// Frees a memory of palm cover gesture's grab info handle + /// + /// The palm cover gesture data handle + /// Thrown when failed of invalid argument. + public void ReleasePalmCoverData(IntPtr data) + { + if (data == IntPtr.Zero) + { + throw new ArgumentException("palmCoverData is not valid."); + } + Interop.InputGesture.ErrorCode res = Interop.InputGesture.PalmCoverFree(_handler, data); + ErrorCodeThrow(res); + Log.Debug(LogTag, "ReleasePalmCoverData"); + } + + /// + /// Grabs a global gesture + /// + /// gesture data to grab + /// Thrown when failed of invalid argument. + public void GrabGesture(IntPtr data) + { + if (data == IntPtr.Zero) + { + throw new ArgumentException("gesture data is not valid."); + } + Interop.InputGesture.ErrorCode res = Interop.InputGesture.GestureGrab(_handler, data); + ErrorCodeThrow(res); + Log.Debug(LogTag, "GrabGesture"); + } + + /// + /// Ungrabs a global gesture. + /// + /// gesture data to ungrab + /// Thrown when failed of invalid argument. + public void UngrabGesture(IntPtr data) + { + if (data == IntPtr.Zero) + { + throw new ArgumentException("gesture data is not valid."); + } + Interop.InputGesture.ErrorCode res = Interop.InputGesture.GestureUngrab(_handler, data); + ErrorCodeThrow(res); + Log.Debug(LogTag, "UngrabGesture"); + } + + /// + /// Emits the event when the edge swipe event comes + /// + /// Thrown when failed of invalid argument. + public event EventHandler EdgeSwipeEventHandler + { + add + { + if (_edgeSwipeEventHandler == null) + { + _edgeSwipeDelegate = (IntPtr userData, int mode, int fingers, int sx, int sy, int edge) => + { + EdgeSwipeEventArgs args = new EdgeSwipeEventArgs(mode, fingers, sx, sy, edge); + Log.Debug(LogTag, "EdgeSwipe Event received. mode: " + mode + ", fingers: " + fingers); + _edgeSwipeEventHandler?.Invoke(null, args); + }; + Interop.InputGesture.ErrorCode res = Interop.InputGesture.SetEdgeSwipeCb(_handler, _edgeSwipeDelegate, IntPtr.Zero); + ErrorCodeThrow(res); + } + + _edgeSwipeEventHandler += value; + } + remove + { + _edgeSwipeEventHandler -= value; + if (_edgeSwipeEventHandler == null) + { + Interop.InputGesture.ErrorCode res = Interop.InputGesture.SetEdgeSwipeCb(_handler, null, IntPtr.Zero); + ErrorCodeThrow(res); + } + } + } + + /// + /// Emits the event when the edge drag event comes + /// + /// Thrown when failed of invalid argument. + public event EventHandler EdgeDragEventHandler + { + add + { + if (_edgeDragEventHandler == null) + { + _edgeDragDelegate = (IntPtr userData, int mode, int fingers, int cx, int cy, int edge) => + { + EdgeDragEventArgs args = new EdgeDragEventArgs(mode, fingers, cx, cy, edge); + Log.Debug(LogTag, "EdgeDrag Event received. mode: " + mode + ", fingers: " + fingers); + _edgeDragEventHandler?.Invoke(null, args); + }; + Interop.InputGesture.ErrorCode res = Interop.InputGesture.SetEdgeDragCb(_handler, _edgeDragDelegate, IntPtr.Zero); + ErrorCodeThrow(res); + } + + _edgeDragEventHandler += value; + } + remove + { + _edgeDragEventHandler -= value; + if (_edgeDragEventHandler == null) + { + Interop.InputGesture.ErrorCode res = Interop.InputGesture.SetEdgeDragCb(_handler, null, IntPtr.Zero); + ErrorCodeThrow(res); + } + } + } + + /// + /// Emits the event when the tap event comes + /// + /// Thrown when failed of invalid argument. + public event EventHandler TapEventHandler + { + add + { + if (_tapEventHandler == null) + { + _tapDelegate = (IntPtr userData, int mode, int fingers, int repeats) => + { + TapEventArgs args = new TapEventArgs(mode, fingers, repeats); + Log.Debug(LogTag, "Tap Event received. mode: " + mode + ", fingers: " + fingers + ", repeats: " + repeats); + _tapEventHandler?.Invoke(null, args); + }; + Interop.InputGesture.ErrorCode res = Interop.InputGesture.SetTapCb(_handler, _tapDelegate, IntPtr.Zero); + ErrorCodeThrow(res); + } + + _tapEventHandler += value; + } + remove + { + _tapEventHandler -= value; + if (_tapEventHandler == null) + { + Interop.InputGesture.ErrorCode res = Interop.InputGesture.SetTapCb(_handler, null, IntPtr.Zero); + ErrorCodeThrow(res); + } + } + } + /// + /// Emits the event when the palm cover event comes + /// + /// Thrown when failed of invalid argument. + public event EventHandler PalmCoverEventHandler + { + add + { + if (_palmCoverEventHandler == null) + { + _palmCoverDelegate = (IntPtr userData, int mode, int duration, int cx, int cy, int size, double pressure) => + { + PalmCoverEventArgs args = new PalmCoverEventArgs(mode, duration, cx, cy, size, pressure); + Log.Debug(LogTag, "PalmCover Event received. mode: " + mode + ", duration: " + duration); + _palmCoverEventHandler?.Invoke(null, args); + }; + Interop.InputGesture.ErrorCode res = Interop.InputGesture.SetPalmCoverCb(_handler, _palmCoverDelegate, IntPtr.Zero); + ErrorCodeThrow(res); + } + _palmCoverEventHandler += value; + } + remove + { + _palmCoverEventHandler -= value; + if (_palmCoverEventHandler == null) + { + Interop.InputGesture.ErrorCode res = Interop.InputGesture.SetPalmCoverCb(_handler, null, IntPtr.Zero); + ErrorCodeThrow(res); + } + } + } + } +} diff --git a/src/Tizen.NUI.WindowSystem/src/public/KVMService.cs b/src/Tizen.NUI.WindowSystem/src/public/KVMService.cs index d9f51310327..1d5e2ce323c 100644 --- a/src/Tizen.NUI.WindowSystem/src/public/KVMService.cs +++ b/src/Tizen.NUI.WindowSystem/src/public/KVMService.cs @@ -18,6 +18,7 @@ using System; using System.ComponentModel; using System.Collections.Generic; +using Tizen.Common; namespace Tizen.NUI.WindowSystem.Shell { @@ -62,7 +63,7 @@ public enum DropTarget /// The TizenShell instance. /// The window to provide service of the quickpanel. /// Thrown when failed of invalid argument. - /// Thrown when a argument is null. + /// Thrown when an argument is null. public KVMService(TizenShell tzShell, Window win) { if (tzShell == null) @@ -80,7 +81,40 @@ public KVMService(TizenShell tzShell, Window win) _tzsh = tzShell; _tzshWin = win.GetNativeId(); - _kvmService = Interop.KVMService.Create(_tzsh.GetNativeHandle(), (IntPtr)_tzshWin); + _kvmService = Interop.KVMService.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); + if (_kvmService == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + _tzsh.ErrorCodeThrow(err); + } + } + + /// + /// Creates a new KVM Service handle. + /// + /// The TizenShell instance. + /// The window provider for the quickpanel service. + /// Thrown when failed of invalid argument. + /// Thrown when an argument is null. + /// 12 + public KVMService(TizenShell tzShell, IWindowProvider win) + { + if (tzShell == null) + { + throw new ArgumentNullException(nameof(tzShell)); + } + if (tzShell.GetNativeHandle() == IntPtr.Zero) + { + throw new ArgumentException("tzShell is not initialized."); + } + if (win == null) + { + throw new ArgumentNullException(nameof(win)); + } + + _tzsh = tzShell; + _tzshWin = WindowSystem.Interop.EcoreWl2.GetWindowId(win.WindowHandle); + _kvmService = Interop.KVMService.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); if (_kvmService == IntPtr.Zero) { int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); diff --git a/src/Tizen.NUI.WindowSystem/src/public/PalmCoverEventArgs.cs b/src/Tizen.NUI.WindowSystem/src/public/PalmCoverEventArgs.cs new file mode 100644 index 00000000000..f24c051b254 --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/src/public/PalmCoverEventArgs.cs @@ -0,0 +1,63 @@ +/* + * Copyright(c) 2024 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.ComponentModel; + +namespace Tizen.NUI.WindowSystem +{ + /// + /// This class contains the data related to the PalmCover event. + /// + /// This class is need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class PalmCoverEventArgs : EventArgs + { + internal PalmCoverEventArgs(int mode, int duration, int cx, int cy, int size, double pressure) + { + Mode = mode; + Duration = duration; + Cx = cx; + Cy = cy; + Size = size; + Pressure = pressure; + } + /// + /// Mode + /// + public int Mode{ get; internal set; } + /// + /// Duration + /// + public int Duration{ get; internal set;} + /// + /// Cx + /// + public int Cx{ get; internal set;} + /// + /// Cy + /// + public int Cy{ get; internal set;} + /// + /// Size + /// + public double Size{ get; internal set;} + /// + /// Pressure + /// + public double Pressure{ get; internal set;} + } +} diff --git a/src/Tizen.NUI.WindowSystem/src/public/QuickPanelClient.cs b/src/Tizen.NUI.WindowSystem/src/public/QuickPanelClient.cs index 4b8dcced27b..40e0c984e57 100644 --- a/src/Tizen.NUI.WindowSystem/src/public/QuickPanelClient.cs +++ b/src/Tizen.NUI.WindowSystem/src/public/QuickPanelClient.cs @@ -20,6 +20,7 @@ using System.Text; using Tizen.Applications.Exceptions; using Tizen.System; +using Tizen.Common; namespace Tizen.NUI.WindowSystem.Shell { @@ -118,6 +119,39 @@ public event EventHandler OrientationChanged } } + private event EventHandler _rotationChanged; + + /// + /// Emits the event when the rotation(orientation) of the quickpanel service window is changed. + /// The value of the event argument represents the rotation angle in degrees. + /// + /// Thrown when failed of invalid argument. + /// 12 + public event EventHandler RotationChanged + { + add + { + if(_rotationChanged == null) + { + OrientationChanged += OnRotationChanged; + } + _rotationChanged += value; + } + remove + { + _rotationChanged -= value; + if(_rotationChanged == null) + { + OrientationChanged -= OnRotationChanged; + } + } + } + + private void OnRotationChanged(object sender, Window.WindowOrientation e) + { + _rotationChanged?.Invoke(sender, (int)e); + } + /// /// Enumeration for type of quickpanel service window. /// @@ -228,7 +262,7 @@ private enum OrientationState /// The type of quickpanel service. /// Thrown when the memory is not enough to allocate. /// Thrown when failed of invalid argument. - /// Thrown when a argument is null. + /// Thrown when an argument is null. /// 8 public QuickPanelClient(TizenShell tzShell, Window win, Types type) { @@ -248,7 +282,7 @@ public QuickPanelClient(TizenShell tzShell, Window win, Types type) _tzsh = tzShell; _tzshWin = win.GetNativeId(); - _tzshQpClient = Interop.QuickPanelClient.CreateWithType(_tzsh.GetNativeHandle(), (IntPtr)_tzshWin, (int)type); + _tzshQpClient = Interop.QuickPanelClient.CreateWithType(_tzsh.GetNativeHandle(), (uint)_tzshWin, (int)type); if (_tzshQpClient == IntPtr.Zero) { int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); @@ -260,6 +294,46 @@ public QuickPanelClient(TizenShell tzShell, Window win, Types type) if (width > height) _screenOrientation = Window.WindowOrientation.Landscape; } + /// + /// Creates a new Quickpanel Client handle. + /// + /// The TizenShell instance. + /// The window provider for the quickpanel service. + /// The type of quickpanel service. + /// Thrown when there is not enough memory (to allocate). + /// Thrown when failed of invalid argument. + /// Thrown when an argument is null. + /// 12 + public QuickPanelClient(TizenShell tzShell, IWindowProvider win, Types type) + { + int width = 0, height = 0; + if (tzShell == null) + { + throw new ArgumentNullException((string)"tzShell"); + } + if (tzShell.GetNativeHandle() == IntPtr.Zero) + { + throw new ArgumentException("tzShell is not initialized."); + } + if (win == null) + { + throw new ArgumentNullException((string)"win"); + } + + _tzsh = tzShell; + _tzshWin = WindowSystem.Interop.EcoreWl2.GetWindowId(win.WindowHandle); + _tzshQpClient = Interop.QuickPanelClient.CreateWithType(_tzsh.GetNativeHandle(), (uint)_tzshWin, (int)type); + if (_tzshQpClient == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + _tzsh.ErrorCodeThrow(err); + } + + Information.TryGetValue("http://tizen.org/feature/screen.width", out width); + Information.TryGetValue("http://tizen.org/feature/screen.height", out height); + if (width > height) _screenOrientation = (Window.WindowOrientation)(90); + } + /// /// Destructor. /// diff --git a/src/Tizen.NUI.WindowSystem/src/public/QuickPanelService.cs b/src/Tizen.NUI.WindowSystem/src/public/QuickPanelService.cs index 99863d916c0..46c99a2ccb0 100644 --- a/src/Tizen.NUI.WindowSystem/src/public/QuickPanelService.cs +++ b/src/Tizen.NUI.WindowSystem/src/public/QuickPanelService.cs @@ -19,6 +19,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Text; +using Tizen.Common; namespace Tizen.NUI.WindowSystem.Shell { @@ -103,7 +104,42 @@ public QuickPanelService(TizenShell tzShell, Window win, Types type) _tzsh = tzShell; _tzshWin = win.GetNativeId(); - _tzshQpService = Interop.QuickPanelService.CreateWithType(_tzsh.GetNativeHandle(), (IntPtr)_tzshWin, (int)type); + _tzshQpService = Interop.QuickPanelService.CreateWithType(_tzsh.GetNativeHandle(), (uint)_tzshWin, (int)type); + if (_tzshQpService == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + _tzsh.ErrorCodeThrow(err); + } + } + + /// + /// Creates a new Quickpanel Service handle. + /// + /// The TzShell instance. + /// The window provider for the quickpanel service. + /// The type of quickpanel service. + /// Thrown when the memory is not enough to allocate. + /// Thrown when failed of invalid argument. + /// Thrown when a argument is null. + /// 12 + public QuickPanelService(TizenShell tzShell, IWindowProvider win, Types type) + { + if (tzShell == null) + { + throw new ArgumentNullException(nameof(tzShell)); + } + if (tzShell.GetNativeHandle() == IntPtr.Zero) + { + throw new ArgumentException("tzShell is not initialized."); + } + if (win == null) + { + throw new ArgumentNullException(nameof(win)); + } + + _tzsh = tzShell; + _tzshWin = WindowSystem.Interop.EcoreWl2.GetWindowId(win.WindowHandle); + _tzshQpService = Interop.QuickPanelService.CreateWithType(_tzsh.GetNativeHandle(), (uint)_tzshWin, (int)type); if (_tzshQpService == IntPtr.Zero) { int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); diff --git a/src/Tizen.NUI.WindowSystem/src/public/ScreensaverService.cs b/src/Tizen.NUI.WindowSystem/src/public/ScreensaverService.cs new file mode 100644 index 00000000000..a31a1015440 --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/src/public/ScreensaverService.cs @@ -0,0 +1,144 @@ +/* + * Copyright(c) 2023 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.ComponentModel; +using System.Collections.Generic; +using Tizen.Common; +using Tizen.Applications; + +namespace Tizen.NUI.WindowSystem.Shell +{ + /// + /// Class for the Tizen screensaver service. + /// + /// This class is need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class ScreensaverService : IDisposable + { + private TizenShell _tzsh; + private IntPtr _screensaverService; + private int _tzshWin; + private bool disposed = false; + private bool isDisposeQueued = false; + + /// + /// Creates a new Screensaver Service handle. + /// + /// The TizenShell instance. + /// The window to provide service of the screensaver. + /// Thrown when failed of invalid argument. + /// Thrown when an argument is null. + public ScreensaverService(TizenShell tzShell, Window win) + { + if (tzShell == null) + { + throw new ArgumentNullException(nameof(tzShell)); + } + if (tzShell.GetNativeHandle() == IntPtr.Zero) + { + throw new ArgumentException("tzShell is not initialized."); + } + if (win == null) + { + throw new ArgumentNullException(nameof(win)); + } + + _tzsh = tzShell; + _tzshWin = win.GetNativeId(); + _screensaverService = Interop.ScreensaverService.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); + if (_screensaverService == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + _tzsh.ErrorCodeThrow(err); + } + } + + /// + /// Creates a new Screensaver Service handle. + /// + /// The TizenShell instance. + /// The window provider for the screensaver service. + /// Thrown when failed of invalid argument. + /// Thrown when an argument is null. + public ScreensaverService(TizenShell tzShell, IWindowProvider win) + { + if (tzShell == null) + { + throw new ArgumentNullException(nameof(tzShell)); + } + if (tzShell.GetNativeHandle() == IntPtr.Zero) + { + throw new ArgumentException("tzShell is not initialized."); + } + if (win == null) + { + throw new ArgumentNullException(nameof(win)); + } + + _tzsh = tzShell; + _tzshWin = WindowSystem.Interop.EcoreWl2.GetWindowId(win.WindowHandle); + _screensaverService = Interop.ScreensaverService.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); + if (_screensaverService == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + _tzsh.ErrorCodeThrow(err); + } + } + + /// + /// Destructor. + /// + ~ScreensaverService() + { + Dispose(disposing: false); + } + /// + /// Dispose. + /// + public void Dispose() + { + if (disposed) + return; + + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + /// + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + ReleaseHandle(_screensaverService); + } + else + { + var handle = _screensaverService; + CoreApplication.Post(() => ReleaseHandle(handle)); + } + disposed = true; + } + } + + private void ReleaseHandle(IntPtr handle) + { + Interop.ScreensaverService.Destroy(handle); + } + } +} diff --git a/src/Tizen.NUI.WindowSystem/src/public/SoftkeyClient.cs b/src/Tizen.NUI.WindowSystem/src/public/SoftkeyClient.cs index f316a12eb07..09edc1002ad 100644 --- a/src/Tizen.NUI.WindowSystem/src/public/SoftkeyClient.cs +++ b/src/Tizen.NUI.WindowSystem/src/public/SoftkeyClient.cs @@ -17,6 +17,7 @@ using System; using System.ComponentModel; +using Tizen.Common; namespace Tizen.NUI.WindowSystem.Shell { @@ -61,7 +62,44 @@ public SoftkeyClient(TizenShell tzShell, Window win) _tzsh = tzShell; _tzshWin = win.GetNativeId(); - _softkeyClient = Interop.SoftkeyClient.Create(_tzsh.GetNativeHandle(), (IntPtr)_tzshWin); + _softkeyClient = Interop.SoftkeyClient.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); + if (_softkeyClient == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + _tzsh.ErrorCodeThrow(err); + } + } + + /// + /// Creates a new Softkey Client handle. + /// + /// The TizenShell instance. + /// The window provider for the quickpanel service. + /// http://tizen.org/privilege/windowsystem.admin + /// Thrown when failed of invalid argument. + /// Thrown when a argument is null. + /// Thrown when failed because of an invalid operation or no service. + /// Thrown when the caller does not have privilege to use this method. + /// Thrown when the feature is not supported. + /// 12 + public SoftkeyClient(TizenShell tzShell, IWindowProvider win) + { + if (tzShell == null) + { + throw new ArgumentNullException(nameof(tzShell)); + } + if (tzShell.GetNativeHandle() == IntPtr.Zero) + { + throw new ArgumentException("tzShell is not initialized."); + } + if (win == null) + { + throw new ArgumentNullException(nameof(win)); + } + + _tzsh = tzShell; + _tzshWin = WindowSystem.Interop.EcoreWl2.GetWindowId(win.WindowHandle); + _softkeyClient = Interop.SoftkeyClient.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); if (_softkeyClient == IntPtr.Zero) { int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); diff --git a/src/Tizen.NUI.WindowSystem/src/public/SoftkeyService.cs b/src/Tizen.NUI.WindowSystem/src/public/SoftkeyService.cs index 22fd7771142..1ebd4cc776c 100644 --- a/src/Tizen.NUI.WindowSystem/src/public/SoftkeyService.cs +++ b/src/Tizen.NUI.WindowSystem/src/public/SoftkeyService.cs @@ -17,6 +17,7 @@ using System; using System.ComponentModel; +using Tizen.Common; namespace Tizen.NUI.WindowSystem.Shell { @@ -65,7 +66,39 @@ public SoftkeyService(TizenShell tzShell, Window win) _tzsh = tzShell; _tzshWin = win.GetNativeId(); - _softkeyService = Interop.SoftkeyService.Create(_tzsh.GetNativeHandle(), (IntPtr)_tzshWin); + _softkeyService = Interop.SoftkeyService.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); + if (_softkeyService == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + _tzsh.ErrorCodeThrow(err); + } + } + + /// + /// Creates a new Softkey Service handle. + /// + /// The TizenShell instance. + /// The window provider for the quickpanel service. + /// Thrown when failed of invalid argument. + /// Thrown when a argument is null. + public SoftkeyService(TizenShell tzShell, IWindowProvider win) + { + if (tzShell == null) + { + throw new ArgumentNullException(nameof(tzShell)); + } + if (tzShell.GetNativeHandle() == IntPtr.Zero) + { + throw new ArgumentException("tzShell is not initialized."); + } + if (win == null) + { + throw new ArgumentNullException(nameof(win)); + } + + _tzsh = tzShell; + _tzshWin = WindowSystem.Interop.EcoreWl2.GetWindowId(win.WindowHandle); + _softkeyService = Interop.SoftkeyService.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); if (_softkeyService == IntPtr.Zero) { int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); diff --git a/src/Tizen.NUI.WindowSystem/src/public/TapEventArgs.cs b/src/Tizen.NUI.WindowSystem/src/public/TapEventArgs.cs new file mode 100644 index 00000000000..4d84557ff87 --- /dev/null +++ b/src/Tizen.NUI.WindowSystem/src/public/TapEventArgs.cs @@ -0,0 +1,48 @@ +/* + * Copyright(c) 2024 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.ComponentModel; + +namespace Tizen.NUI.WindowSystem +{ + /// + /// This class contains the data related to the Tap event. + /// + /// This class is need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class TapEventArgs : EventArgs + { + internal TapEventArgs(int mode, int fingers, int repeats) + { + Mode = mode; + Fingers = fingers; + Repeats = repeats; + } + /// + /// Mode + /// + public int Mode{ get; internal set; } + /// + /// Fingers + /// + public int Fingers{ get; internal set;} + /// + /// Repeats + /// + public int Repeats{ get; internal set;} + } +} diff --git a/src/Tizen.NUI.WindowSystem/src/public/TaskbarService.cs b/src/Tizen.NUI.WindowSystem/src/public/TaskbarService.cs index 50d0eef0176..3e8d41c136f 100755 --- a/src/Tizen.NUI.WindowSystem/src/public/TaskbarService.cs +++ b/src/Tizen.NUI.WindowSystem/src/public/TaskbarService.cs @@ -17,6 +17,7 @@ using System; using System.ComponentModel; +using Tizen.Common; namespace Tizen.NUI.WindowSystem.Shell { @@ -81,7 +82,46 @@ public TaskbarService(TizenShell tzShell, Window win, PlaceType type = PlaceType _tzsh = tzShell; _tzshWin = win.GetNativeId(); - _taskbarService = Interop.TaskbarService.Create(_tzsh.GetNativeHandle(), (IntPtr)_tzshWin); + _taskbarService = Interop.TaskbarService.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); + if (_taskbarService == IntPtr.Zero) + { + int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + _tzsh.ErrorCodeThrow(err); + } + + Interop.TaskbarService.SetPlaceType(_taskbarService, (int)type); + } + + /// + /// Creates a new Taskbar Service handle. + /// + /// The TizenShell instance. + /// The window provider for the taskbar service. + /// The selected, predefined location on the screen the Taskbar should be placed on the screen. + /// Thrown when failed of invalid argument. + /// Thrown when a argument is null. + public TaskbarService(TizenShell tzShell, IWindowProvider win, PlaceType type = PlaceType.Bottom) + { + if (tzShell == null) + { + throw new ArgumentNullException(nameof(tzShell)); + } + if (tzShell.GetNativeHandle() == IntPtr.Zero) + { + throw new ArgumentException("tzShell is not initialized."); + } + if (win == null) + { + throw new ArgumentNullException(nameof(win)); + } + if (!(win is Tizen.NUI.Window)) + { + throw new ArgumentNullException("win should be NUI.Window because this is for NUI.WindowSystem"); + } + + _tzsh = tzShell; + _tzshWin = WindowSystem.Interop.EcoreWl2.GetWindowId(win.WindowHandle); + _taskbarService = Interop.TaskbarService.Create(_tzsh.GetNativeHandle(), (uint)_tzshWin); if (_taskbarService == IntPtr.Zero) { int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult(); diff --git a/src/Tizen.NUI/src/internal/Accessibility/AccessibilityActionSignal.cs b/src/Tizen.NUI/src/internal/Accessibility/AccessibilityActionSignal.cs deleted file mode 100755 index 53b08a4eca0..00000000000 --- a/src/Tizen.NUI/src/internal/Accessibility/AccessibilityActionSignal.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright(c) 2021 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 Tizen.NUI.Accessibility; - -namespace Tizen.NUI -{ - internal class AccessibilityActionSignal : Disposable - { - internal AccessibilityActionSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) - { - } - - protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) - { - Interop.AccessibilityManager.DeleteAccessibilityActionSignal(swigCPtr); - } - - public bool Empty() - { - bool ret = Interop.AccessibilityManager.AccessibilityActionSignalEmpty(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = Interop.AccessibilityManager.AccessibilityActionSignalGetConnectionCount(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - Interop.AccessibilityManager.AccessibilityActionSignalConnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - Interop.AccessibilityManager.AccessibilityActionSignalDisconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public bool Emit(AccessibilityManager arg) - { - bool ret = Interop.AccessibilityManager.AccessibilityActionSignalEmit(SwigCPtr, AccessibilityManager.getCPtr(arg)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public AccessibilityActionSignal() : this(Interop.AccessibilityManager.NewAccessibilityActionSignal(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Accessibility/AccessibilityFocusOvershotSignal.cs b/src/Tizen.NUI/src/internal/Accessibility/AccessibilityFocusOvershotSignal.cs deleted file mode 100755 index 1bd75402efd..00000000000 --- a/src/Tizen.NUI/src/internal/Accessibility/AccessibilityFocusOvershotSignal.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright(c) 2021 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. - * - */ - -namespace Tizen.NUI -{ - using Tizen.NUI.BaseComponents; - using Tizen.NUI.Accessibility; - internal class AccessibilityFocusOvershotSignal : Disposable - { - - internal AccessibilityFocusOvershotSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) - { - } - - protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) - { - Interop.AccessibilityManager.DeleteAccessibilityFocusOvershotSignal(swigCPtr); - } - - public bool Empty() - { - bool ret = Interop.AccessibilityManager.AccessibilityFocusOvershotSignalEmpty(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = Interop.AccessibilityManager.AccessibilityFocusOvershotSignalGetConnectionCount(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - Interop.AccessibilityManager.AccessibilityFocusOvershotSignalConnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - Interop.AccessibilityManager.AccessibilityFocusOvershotSignalDisconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(View arg1, AccessibilityManager.FocusOvershotDirection arg2) - { - Interop.AccessibilityManager.AccessibilityFocusOvershotSignalEmit(SwigCPtr, View.getCPtr(arg1), (int)arg2); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public AccessibilityFocusOvershotSignal() : this(Interop.AccessibilityManager.NewAccessibilityFocusOvershotSignal(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Application/Application.cs b/src/Tizen.NUI/src/internal/Application/Application.cs index 5e406594c70..4d775bc9579 100755 --- a/src/Tizen.NUI/src/internal/Application/Application.cs +++ b/src/Tizen.NUI/src/internal/Application/Application.cs @@ -660,18 +660,25 @@ public event DaliEventHandler Initialized initSignal = this.InitSignal(); initSignal?.Connect(applicationInitEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.Initialized] Only one listener is allowed\n"); + } } remove { if (applicationInitEventHandler != null) { - initSignal?.Disconnect(applicationInitEventCallbackDelegate); - initSignal?.Dispose(); - initSignal = null; + applicationInitEventHandler -= value; + if (applicationInitEventHandler == null) + { + initSignal?.Disconnect(applicationInitEventCallbackDelegate); + initSignal?.Dispose(); + initSignal = null; + applicationInitEventCallbackDelegate = null; + } } - - applicationInitEventHandler -= value; } } @@ -724,23 +731,29 @@ public event DaliEventHandler Termin if (applicationTerminateEventHandler == null) { applicationTerminateEventHandler += value; - applicationTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTerminate); terminateSignal = this.TerminateSignal(); terminateSignal?.Connect(applicationTerminateEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.Terminating] Only one listener is allowed\n"); + } } remove { if (applicationTerminateEventHandler != null) { - terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate); - terminateSignal?.Dispose(); - terminateSignal = null; + applicationTerminateEventHandler -= value; + if (applicationTerminateEventHandler == null) + { + terminateSignal?.Disconnect(applicationTerminateEventCallbackDelegate); + terminateSignal?.Dispose(); + terminateSignal = null; + applicationTerminateEventCallbackDelegate = null; + } } - - applicationTerminateEventHandler -= value; } } @@ -774,23 +787,29 @@ public event DaliEventHandler Paused if (applicationPauseEventHandler == null) { applicationPauseEventHandler += value; - applicationPauseEventCallbackDelegate = new NUIApplicationPauseEventCallbackDelegate(OnNUIApplicationPause); pauseSignal = this.PauseSignal(); pauseSignal?.Connect(applicationPauseEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.Paused] Only one listener is allowed\n"); + } } remove { if (applicationPauseEventHandler != null) { - pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate); - pauseSignal?.Dispose(); - pauseSignal = null; + applicationPauseEventHandler -= value; + if (applicationTerminateEventHandler == null) + { + pauseSignal?.Disconnect(applicationPauseEventCallbackDelegate); + pauseSignal?.Dispose(); + pauseSignal = null; + applicationPauseEventCallbackDelegate = null; + } } - - applicationPauseEventHandler -= value; } } @@ -815,23 +834,29 @@ public event DaliEventHandler Resumed if (applicationResumeEventHandler == null) { applicationResumeEventHandler += value; - applicationResumeEventCallbackDelegate = new NUIApplicationResumeEventCallbackDelegate(OnNUIApplicationResume); resumeSignal = this.ResumeSignal(); resumeSignal?.Connect(applicationResumeEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.Resumed] Only one listener is allowed\n"); + } } remove { if (applicationResumeEventHandler != null) { - resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate); - resumeSignal?.Dispose(); - resumeSignal = null; + applicationResumeEventHandler -= value; + if (applicationResumeEventHandler == null) + { + resumeSignal?.Disconnect(applicationResumeEventCallbackDelegate); + resumeSignal?.Dispose(); + resumeSignal = null; + applicationResumeEventCallbackDelegate = null; + } } - - applicationResumeEventHandler -= value; } } @@ -856,23 +881,29 @@ private void OnNUIApplicationResume(IntPtr data) if (applicationResetEventHandler == null) { applicationResetEventHandler += value; - applicationResetEventCallbackDelegate = new NUIApplicationResetEventCallbackDelegate(OnNUIApplicationReset); resetSignal = this.ResetSignal(); resetSignal?.Connect(applicationResetEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.Reset] Only one listener is allowed\n"); + } } remove { if (applicationResetEventHandler != null) { - resetSignal?.Disconnect(applicationResetEventCallbackDelegate); - resetSignal?.Dispose(); - resetSignal = null; + applicationResetEventHandler -= value; + if (applicationResetEventHandler == null) + { + resetSignal?.Disconnect(applicationResetEventCallbackDelegate); + resetSignal?.Dispose(); + resetSignal = null; + applicationResetEventCallbackDelegate = null; + } } - - applicationResetEventHandler -= value; } } @@ -897,23 +928,29 @@ public event DaliEventHandler La if (applicationLanguageChangedEventHandler == null) { applicationLanguageChangedEventHandler += value; - applicationLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationLanguageChanged); languageChangedSignal = this.LanguageChangedSignal(); languageChangedSignal?.Connect(applicationLanguageChangedEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.LanguageChanged] Only one listener is allowed\n"); + } } remove { if (applicationLanguageChangedEventHandler != null) { - languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate); - languageChangedSignal?.Dispose(); - languageChangedSignal = null; + applicationLanguageChangedEventHandler -= value; + if (applicationLanguageChangedEventHandler == null) + { + languageChangedSignal?.Disconnect(applicationLanguageChangedEventCallbackDelegate); + languageChangedSignal?.Dispose(); + languageChangedSignal = null; + applicationLanguageChangedEventCallbackDelegate = null; + } } - - applicationLanguageChangedEventHandler -= value; } } @@ -938,23 +975,29 @@ public event DaliEventHandler Regi if (applicationRegionChangedEventHandler == null) { applicationRegionChangedEventHandler += value; - applicationRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationRegionChanged); regionChangedSignal = this.RegionChangedSignal(); regionChangedSignal?.Connect(applicationRegionChangedEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.RegionChanged] Only one listener is allowed\n"); + } } remove { if (applicationRegionChangedEventHandler != null) { - regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate); - regionChangedSignal?.Dispose(); - regionChangedSignal = null; + applicationRegionChangedEventHandler -= value; + if (applicationRegionChangedEventHandler == null) + { + regionChangedSignal?.Disconnect(applicationRegionChangedEventCallbackDelegate); + regionChangedSignal?.Dispose(); + regionChangedSignal = null; + applicationRegionChangedEventCallbackDelegate = null; + } } - - applicationRegionChangedEventHandler -= value; } } @@ -979,23 +1022,29 @@ public event DaliEventHandler Battery if (applicationBatteryLowEventHandler == null) { applicationBatteryLowEventHandler += value; - applicationBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationBatteryLow); batteryLowSignal = this.BatteryLowSignal(); batteryLowSignal?.Connect(applicationBatteryLowEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.BatteryLow] Only one listener is allowed\n"); + } } remove { if (applicationBatteryLowEventHandler != null) { - batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate); - batteryLowSignal?.Dispose(); - batteryLowSignal = null; + applicationBatteryLowEventHandler -= value; + if (applicationBatteryLowEventHandler == null) + { + batteryLowSignal?.Disconnect(applicationBatteryLowEventCallbackDelegate); + batteryLowSignal?.Dispose(); + batteryLowSignal = null; + applicationBatteryLowEventCallbackDelegate = null; + } } - - applicationBatteryLowEventHandler -= value; } } @@ -1019,23 +1068,29 @@ public event DaliEventHandler MemoryLo if (applicationMemoryLowEventHandler == null) { applicationMemoryLowEventHandler += value; - applicationMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationMemoryLow); memoryLowSignal = this.MemoryLowSignal(); memoryLowSignal?.Connect(applicationMemoryLowEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.MemoryLow] Only one listener is allowed\n"); + } } remove { if (applicationMemoryLowEventHandler != null) { - memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate); - memoryLowSignal?.Dispose(); - memoryLowSignal = null; + applicationMemoryLowEventHandler -= value; + if (applicationMemoryLowEventHandler == null) + { + memoryLowSignal?.Disconnect(applicationMemoryLowEventCallbackDelegate); + memoryLowSignal?.Dispose(); + memoryLowSignal = null; + applicationMemoryLowEventCallbackDelegate = null; + } } - - applicationMemoryLowEventHandler -= value; } } @@ -1059,23 +1114,29 @@ public event DaliEventHandler AppCont if (applicationAppControlEventHandler == null) { applicationAppControlEventHandler += value; - applicationAppControlEventCallbackDelegate = new NUIApplicationAppControlEventCallbackDelegate(OnNUIApplicationAppControl); appControlSignal = this.AppControlSignal(); appControlSignal?.Connect(applicationAppControlEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.AppControl] Only one listener is allowed\n"); + } } remove { if (applicationAppControlEventHandler != null) { - appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate); - appControlSignal?.Dispose(); - appControlSignal = null; + applicationAppControlEventHandler -= value; + if (applicationAppControlEventHandler == null) + { + appControlSignal?.Disconnect(applicationAppControlEventCallbackDelegate); + appControlSignal?.Dispose(); + appControlSignal = null; + applicationAppControlEventCallbackDelegate = null; + } } - - applicationAppControlEventHandler -= value; } } @@ -1141,24 +1208,30 @@ public event DaliEventHandler TaskInitializ // Restricted to only one listener if (applicationTaskInitEventHandler == null) { - Tizen.Log.Fatal("NUI", "TaskInitialized Property adding"); applicationTaskInitEventHandler += value; applicationTaskInitEventCallbackDelegate = new NUIApplicationInitEventCallbackDelegate(OnApplicationTaskInit); taskInitSignal = this.TaskInitSignal(); taskInitSignal?.Connect(applicationTaskInitEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.TaskInitialized] Only one listener is allowed\n"); + } } remove { if (applicationTaskInitEventHandler != null) { - taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate); - taskInitSignal?.Dispose(); - taskInitSignal = null; + applicationTaskInitEventHandler -= value; + if (applicationTaskInitEventHandler == null) + { + taskInitSignal?.Disconnect(applicationTaskInitEventCallbackDelegate); + taskInitSignal?.Dispose(); + taskInitSignal = null; + applicationTaskInitEventCallbackDelegate = null; + } } - - applicationTaskInitEventHandler -= value; } } @@ -1185,23 +1258,29 @@ public event DaliEventHandler TaskTe if (applicationTaskTerminateEventHandler == null) { applicationTaskTerminateEventHandler += value; - applicationTaskTerminateEventCallbackDelegate = new NUIApplicationTerminateEventCallbackDelegate(OnNUIApplicationTaskTerminate); taskTerminateSignal = this.TaskTerminateSignal(); taskTerminateSignal?.Connect(applicationTaskTerminateEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.TaskTerminating] Only one listener is allowed\n"); + } } remove { if (applicationTaskTerminateEventHandler != null) { - taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate); - taskTerminateSignal?.Dispose(); - taskTerminateSignal = null; + applicationTaskTerminateEventHandler -= value; + if (applicationTaskTerminateEventHandler == null) + { + taskTerminateSignal?.Disconnect(applicationTaskTerminateEventCallbackDelegate); + taskTerminateSignal?.Dispose(); + taskTerminateSignal = null; + applicationTaskTerminateEventCallbackDelegate = null; + } } - - applicationTaskTerminateEventHandler -= value; } } @@ -1227,23 +1306,29 @@ public event DaliEventHandler Ta if (applicationTaskLanguageChangedEventHandler == null) { applicationTaskLanguageChangedEventHandler += value; - applicationTaskLanguageChangedEventCallbackDelegate = new NUIApplicationLanguageChangedEventCallbackDelegate(OnNUIApplicationTaskLanguageChanged); taskLanguageChangedSignal = this.TaskLanguageChangedSignal(); taskLanguageChangedSignal?.Connect(applicationTaskLanguageChangedEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.TaskLanguageChanged] Only one listener is allowed\n"); + } } remove { if (applicationTaskLanguageChangedEventHandler != null) { - taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate); - taskLanguageChangedSignal?.Dispose(); - taskLanguageChangedSignal = null; + applicationTaskLanguageChangedEventHandler -= value; + if (applicationTaskLanguageChangedEventHandler == null) + { + taskLanguageChangedSignal?.Disconnect(applicationTaskLanguageChangedEventCallbackDelegate); + taskLanguageChangedSignal?.Dispose(); + taskLanguageChangedSignal = null; + applicationTaskLanguageChangedEventCallbackDelegate = null; + } } - - applicationTaskLanguageChangedEventHandler -= value; } } @@ -1269,23 +1354,29 @@ public event DaliEventHandler Task if (applicationTaskRegionChangedEventHandler == null) { applicationTaskRegionChangedEventHandler += value; - applicationTaskRegionChangedEventCallbackDelegate = new NUIApplicationRegionChangedEventCallbackDelegate(OnNUIApplicationTaskRegionChanged); taskRegionChangedSignal = this.TaskRegionChangedSignal(); taskRegionChangedSignal?.Connect(applicationTaskRegionChangedEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.TaskRegionChanged] Only one listener is allowed\n"); + } } remove { if (applicationTaskRegionChangedEventHandler != null) { - taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate); - taskRegionChangedSignal?.Dispose(); - taskRegionChangedSignal = null; + applicationTaskRegionChangedEventHandler -= value; + if (applicationTaskRegionChangedEventHandler == null) + { + taskRegionChangedSignal?.Disconnect(applicationTaskRegionChangedEventCallbackDelegate); + taskRegionChangedSignal?.Dispose(); + taskRegionChangedSignal = null; + applicationTaskRegionChangedEventCallbackDelegate = null; + } } - - applicationTaskRegionChangedEventHandler -= value; } } @@ -1311,23 +1402,29 @@ public event DaliEventHandler TaskBat if (applicationTaskBatteryLowEventHandler == null) { applicationTaskBatteryLowEventHandler += value; - applicationTaskBatteryLowEventCallbackDelegate = new NUIApplicationBatteryLowEventCallbackDelegate(OnNUIApplicationTaskBatteryLow); taskBatteryLowSignal = this.TaskBatteryLowSignal(); taskBatteryLowSignal?.Connect(applicationTaskBatteryLowEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.TaskBatteryLow] Only one listener is allowed\n"); + } } remove { if (applicationTaskBatteryLowEventHandler != null) { - taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate); - taskBatteryLowSignal?.Dispose(); - taskBatteryLowSignal = null; + applicationTaskBatteryLowEventHandler -= value; + if (applicationTaskBatteryLowEventHandler == null) + { + taskBatteryLowSignal?.Disconnect(applicationTaskBatteryLowEventCallbackDelegate); + taskBatteryLowSignal?.Dispose(); + taskBatteryLowSignal = null; + applicationTaskBatteryLowEventCallbackDelegate = null; + } } - - applicationTaskBatteryLowEventHandler -= value; } } @@ -1352,23 +1449,29 @@ public event DaliEventHandler TaskMemo if (applicationTaskMemoryLowEventHandler == null) { applicationTaskMemoryLowEventHandler += value; - applicationTaskMemoryLowEventCallbackDelegate = new NUIApplicationMemoryLowEventCallbackDelegate(OnNUIApplicationTaskMemoryLow); taskMemoryLowSignal = this.TaskMemoryLowSignal(); taskMemoryLowSignal?.Connect(applicationTaskMemoryLowEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.TaskMemoryLow] Only one listener is allowed\n"); + } } remove { if (applicationTaskMemoryLowEventHandler != null) { - taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate); - taskMemoryLowSignal?.Dispose(); - taskMemoryLowSignal = null; + applicationTaskMemoryLowEventHandler -= value; + if (applicationTaskMemoryLowEventHandler == null) + { + taskMemoryLowSignal?.Disconnect(applicationTaskMemoryLowEventCallbackDelegate); + taskMemoryLowSignal?.Dispose(); + taskMemoryLowSignal = null; + applicationTaskMemoryLowEventCallbackDelegate = null; + } } - - applicationTaskMemoryLowEventHandler -= value; } } @@ -1392,23 +1495,29 @@ public event DaliEventHandler TaskApp taskAppControlSignal = this.TaskAppControlSignal(); taskAppControlSignal?.Connect(applicationTaskAppControlEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Application.TaskAppControl] Only one listener is allowed\n"); + } } remove { if (applicationTaskAppControlEventHandler != null) { - taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate); - taskAppControlSignal?.Dispose(); - taskAppControlSignal = null; + applicationTaskAppControlEventHandler -= value; + if (applicationTaskAppControlEventHandler == null) + { + taskAppControlSignal?.Disconnect(applicationTaskAppControlEventCallbackDelegate); + taskAppControlSignal?.Dispose(); + taskAppControlSignal = null; + applicationTaskAppControlEventCallbackDelegate = null; + } } - - applicationTaskAppControlEventHandler -= value; } } diff --git a/src/Tizen.NUI/src/internal/Application/ComponentApplication.cs b/src/Tizen.NUI/src/internal/Application/ComponentApplication.cs index fb91e1fac06..c1d8917b68b 100755 --- a/src/Tizen.NUI/src/internal/Application/ComponentApplication.cs +++ b/src/Tizen.NUI/src/internal/Application/ComponentApplication.cs @@ -104,20 +104,26 @@ public event CreateNativeEventHandler CreateNative if (applicationCreateNativeEventHandler == null) { applicationCreateNativeEventHandler += value; - applicationCreateNativeEventCallbackDelegate = new NUIComponentApplicationCreatenativeEventCallbackDelegate(OnApplicationCreateNative); Connect(applicationCreateNativeEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[ComponentApplication.CreateNative] Only one listener is allowed\n"); + } } remove { if (applicationCreateNativeEventHandler != null) { - Disconnect(applicationCreateNativeEventCallbackDelegate); + applicationCreateNativeEventHandler -= value; + if (applicationCreateNativeEventHandler == null) + { + Disconnect(applicationCreateNativeEventCallbackDelegate); + applicationCreateNativeEventCallbackDelegate = null; + } } - - applicationCreateNativeEventHandler -= value; } } diff --git a/src/Tizen.NUI/src/internal/Application/WatchApplication.cs b/src/Tizen.NUI/src/internal/Application/WatchApplication.cs index 8aeef548a8d..8be5ed66f56 100755 --- a/src/Tizen.NUI/src/internal/Application/WatchApplication.cs +++ b/src/Tizen.NUI/src/internal/Application/WatchApplication.cs @@ -153,9 +153,10 @@ public event DaliEventHandler TimeTick { timeTickEventHandler -= value; - if (timeTickEventHandler == null && TimeTickSignal().Empty() == false) + if (timeTickEventHandler == null && timeTickCallback != null) { TimeTickSignal().Disconnect(timeTickCallback); + timeTickCallback = null; } } } @@ -225,9 +226,10 @@ public event DaliEventHandler AmbientTick { ambientTickEventHandler -= value; - if (ambientTickEventHandler == null && AmbientTickSignal().Empty() == false) + if (ambientTickEventHandler == null && ambientTickCallback != null) { AmbientTickSignal().Disconnect(ambientTickCallback); + ambientTickCallback = null; } } } @@ -297,9 +299,10 @@ public event DaliEventHandler AmbientChanged { ambientChangedEventHandler -= value; - if (ambientChangedEventHandler == null && AmbientChangedSignal().Empty() == false) + if (ambientChangedEventHandler == null && ambientChangedCallback != null) { AmbientChangedSignal().Disconnect(ambientChangedCallback); + ambientChangedCallback = null; } } } diff --git a/src/Tizen.NUI/src/internal/Common/AuthenticationSignalType.cs b/src/Tizen.NUI/src/internal/Common/AuthenticationSignalType.cs deleted file mode 100755 index 1d82e1411e7..00000000000 --- a/src/Tizen.NUI/src/internal/Common/AuthenticationSignalType.cs +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright(c) 2021 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.ComponentModel; - -namespace Tizen.NUI -{ - internal class AuthenticationSignalType : Disposable - { - internal AuthenticationSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) - { - } - - /// - /// Dispose - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) - { - Interop.AuthenticationSignalType.DeleteAuthenticationSignalType(swigCPtr); - } - - /// - /// Queries whether there are any connected slots. - /// - /// True if there are any slots connected to the signal - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Empty() - { - bool ret = Interop.AuthenticationSignalType.Empty(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Queries the number of slots. - /// - /// The number of slots connected to this signal - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public uint GetConnectionCount() - { - uint ret = Interop.AuthenticationSignalType.GetConnectionCount(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Connects a member function. - /// - /// The member function to connect - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - Interop.AuthenticationSignalType.Connect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// Disconnects a function. - /// - /// The function to disconnect - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - Interop.AuthenticationSignalType.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// Emits the signal. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void Emit(AutofillContainer arg) - { - Interop.AuthenticationSignalType.Emit(SwigCPtr, AutofillContainer.getCPtr(arg)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The constructor. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public AuthenticationSignalType() : this(Interop.AuthenticationSignalType.NewAuthenticationSignalType(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Common/DefaultItemLayoutProperty.cs b/src/Tizen.NUI/src/internal/Common/DefaultItemLayoutProperty.cs index ffec5b015d3..64cd221d920 100755 --- a/src/Tizen.NUI/src/internal/Common/DefaultItemLayoutProperty.cs +++ b/src/Tizen.NUI/src/internal/Common/DefaultItemLayoutProperty.cs @@ -21,6 +21,7 @@ namespace Tizen.NUI { /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707: Identifiers should not contain underscores")] public enum DefaultItemLayoutProperty { /// diff --git a/src/Tizen.NUI/src/internal/Common/EnumHelper.cs b/src/Tizen.NUI/src/internal/Common/EnumHelper.cs index 7de41f9085c..44554f8b1f8 100755 --- a/src/Tizen.NUI/src/internal/Common/EnumHelper.cs +++ b/src/Tizen.NUI/src/internal/Common/EnumHelper.cs @@ -74,7 +74,7 @@ public static T GetValueByDescription(this string description) where T : stru } } - var value = type.GetFields(BindingFlags.Public | BindingFlags.Static).FirstOrDefault().GetValue(null); + var value = type.GetFields(BindingFlags.Public | BindingFlags.Static).FirstOrDefault()?.GetValue(null); return value != null ? (T)value : default(T); //throw new ArgumentException($"{description} can't be found.", "Description"); } diff --git a/src/Tizen.NUI/src/internal/Common/EventThreadCallback.cs b/src/Tizen.NUI/src/internal/Common/EventThreadCallback.cs index 9115d078f05..8ebd257d4a1 100755 --- a/src/Tizen.NUI/src/internal/Common/EventThreadCallback.cs +++ b/src/Tizen.NUI/src/internal/Common/EventThreadCallback.cs @@ -31,7 +31,8 @@ internal EventThreadCallback(global::System.IntPtr cPtr, bool cMemoryOwn) : base [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { - //NDalicManualPINVOKE.DeleteEventThreadCallback(swigCPtr); + Interop.EventThreadCallback.DeleteEventThreadCallback(swigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); } public EventThreadCallback(CallbackDelegate func) : this(Interop.EventThreadCallback.NewEventThreadCallback(func), true) diff --git a/src/Tizen.NUI/src/internal/Common/ListEventSignalType.cs b/src/Tizen.NUI/src/internal/Common/ListEventSignalType.cs deleted file mode 100755 index 22e1c1e8650..00000000000 --- a/src/Tizen.NUI/src/internal/Common/ListEventSignalType.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright(c) 2021 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.ComponentModel; - -namespace Tizen.NUI -{ - internal class ListEventSignalType : Disposable - { - internal ListEventSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) - { - } - - protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) - { - Interop.ListEventSignalType.DeleteListEventSignalType(swigCPtr); - } - - /// - /// Queries whether there are any connected slots. - /// - /// True if there are any slots connected to the signal - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Empty() - { - bool ret = Interop.ListEventSignalType.Empty(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Queries the number of slots. - /// - /// The number of slots connected to this signal - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public uint GetConnectionCount() - { - uint ret = Interop.ListEventSignalType.GetConnectionCount(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Connects a function. - /// - /// The function to connect - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - Interop.ListEventSignalType.Connect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// Disconnects a function. - /// - /// The function to disconnect - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - Interop.ListEventSignalType.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// Emits the signal. - /// - /// The first value to pass to callbacks - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void Emit(BaseComponents.View arg1) - { - Interop.ListEventSignalType.Emit(SwigCPtr, BaseComponents.View.getCPtr(arg1)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The constructor. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public ListEventSignalType() : this(Interop.ListEventSignalType.NewListEventSignalType(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Common/NUIWindowProxy.cs b/src/Tizen.NUI/src/internal/Common/NUIWindowProxy.cs new file mode 100755 index 00000000000..a323c7e622d --- /dev/null +++ b/src/Tizen.NUI/src/internal/Common/NUIWindowProxy.cs @@ -0,0 +1,94 @@ +/* + * Copyright(c) 2024 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 Tizen.Applications.ComponentBased.Common; + +namespace Tizen.NUI +{ + /// + /// Window information class for ComponentApplication + /// + internal class NUIWindowProxy : IWindowProxy + { + private const string logTag = "Tizen.NUI"; + private Window window; + private int resourceId; + private bool disposed = false; + + /// + /// Initializes the NUI Window class. + /// + /// The window object of component. + internal NUIWindowProxy(Window win) + { + window = win; + } + + /// + /// Gets the resource ID of window + /// + /// The native handle of window + public int ResourceId + { + get + { + if (resourceId == 0) + { + resourceId = window.GetNativeId(); + if (resourceId != 0) + Log.Info(logTag, "Fail to get resource ID"); + } + + return resourceId; + } + } + + public void InitializeWindow(int width, int height) + { + window.WindowSize = new Size(width, height); + } + + /// + /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. + /// + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. + protected virtual void Dispose(bool disposing) + { + if (disposed) + return; + + if (disposing) + { + window.Dispose(); + window = null; + } + disposed = true; + } + + /// + /// Dispose the window resources + /// + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + } +} + diff --git a/src/Tizen.NUI/src/internal/Common/ObjectRegistry.cs b/src/Tizen.NUI/src/internal/Common/ObjectRegistry.cs deleted file mode 100755 index 15f25f7ee62..00000000000 --- a/src/Tizen.NUI/src/internal/Common/ObjectRegistry.cs +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright(c) 2021 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.Runtime.InteropServices; - -namespace Tizen.NUI -{ - internal class ObjectRegistry : BaseHandle - { - internal ObjectRegistry(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn) - { - } - - internal ObjectRegistry(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister) - { - } - - protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) - { - Interop.ObjectRegistry.DeleteObjectRegistry(swigCPtr); - } - - public class ObjectCreatedEventArgs : EventArgs - { - private BaseHandle baseHandle; - - public BaseHandle BaseHandle - { - get - { - return baseHandle; - } - set - { - baseHandle = value; - } - } - } - - public class ObjectDestroyedEventArgs : EventArgs - { - private RefObject refObject; - - public RefObject RefObject - { - get - { - return refObject; - } - set - { - refObject = value; - } - } - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate void ObjectCreatedEventCallbackDelegate(IntPtr baseHandle); - private DaliEventHandler objectRegistryObjectCreatedEventHandler; - private ObjectCreatedEventCallbackDelegate objectRegistryObjectCreatedEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate void ObjectDestroyedEventCallbackDelegate(IntPtr fefObject); - private DaliEventHandler objectRegistryObjectDestroyedEventHandler; - private ObjectDestroyedEventCallbackDelegate objectRegistryObjectDestroyedEventCallbackDelegate; - - public event DaliEventHandler ObjectCreated - { - add - { - // Restricted to only one listener - if (objectRegistryObjectCreatedEventHandler == null) - { - objectRegistryObjectCreatedEventHandler += value; - - objectRegistryObjectCreatedEventCallbackDelegate = new ObjectCreatedEventCallbackDelegate(OnObjectCreated); - this.ObjectCreatedSignal().Connect(objectRegistryObjectCreatedEventCallbackDelegate); - } - } - - remove - { - if (objectRegistryObjectCreatedEventHandler != null) - { - this.ObjectCreatedSignal().Disconnect(objectRegistryObjectCreatedEventCallbackDelegate); - } - - objectRegistryObjectCreatedEventHandler -= value; - } - } - - // Callback for ObjectRegistry ObjectCreatedSignal - private void OnObjectCreated(IntPtr baseHandle) - { - ObjectCreatedEventArgs e = new ObjectCreatedEventArgs(); - - // Populate all members of "e" (ObjectCreatedEventArgs) with real data - //e.BaseHandle = BaseHandle.GetBaseHandleFromPtr(baseHandle); //GetBaseHandleFromPtr() is not present in BaseHandle.cs. Not sure what is the reason? - - if (objectRegistryObjectCreatedEventHandler != null) - { - //here we send all data to user event handlers - objectRegistryObjectCreatedEventHandler(this, e); - } - } - - public event DaliEventHandler ObjectDestroyed - { - add - { - // Restricted to only one listener - if (objectRegistryObjectDestroyedEventHandler == null) - { - objectRegistryObjectDestroyedEventHandler += value; - - objectRegistryObjectDestroyedEventCallbackDelegate = new ObjectDestroyedEventCallbackDelegate(OnObjectDestroyed); - this.ObjectDestroyedSignal().Connect(objectRegistryObjectDestroyedEventCallbackDelegate); - } - } - - remove - { - if (objectRegistryObjectDestroyedEventHandler != null) - { - this.ObjectDestroyedSignal().Disconnect(objectRegistryObjectDestroyedEventCallbackDelegate); - } - - objectRegistryObjectDestroyedEventHandler -= value; - } - } - - // Callback for ObjectRegistry ObjectDestroyedSignal - private void OnObjectDestroyed(IntPtr refObject) - { - ObjectDestroyedEventArgs e = new ObjectDestroyedEventArgs(); - - // Populate all members of "e" (ObjectDestroyedEventArgs) with real data - e.RefObject = RefObject.GetRefObjectFromPtr(refObject); - - if (objectRegistryObjectDestroyedEventHandler != null) - { - //here we send all data to user event handlers - objectRegistryObjectDestroyedEventHandler(this, e); - } - } - - - public ObjectRegistry() : this(Interop.ObjectRegistry.NewObjectRegistry(), true, false) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public ObjectRegistry Assign(ObjectRegistry rhs) - { - ObjectRegistry ret = new ObjectRegistry(Interop.ObjectRegistry.Assign(SwigCPtr, ObjectRegistry.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public ObjectCreatedSignal ObjectCreatedSignal() - { - ObjectCreatedSignal ret = new ObjectCreatedSignal(Interop.ObjectRegistry.ObjectCreatedSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public ObjectDestroyedSignal ObjectDestroyedSignal() - { - ObjectDestroyedSignal ret = new ObjectDestroyedSignal(Interop.ObjectRegistry.ObjectDestroyedSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } -} diff --git a/src/Tizen.NUI/src/internal/Common/ProcessorController.cs b/src/Tizen.NUI/src/internal/Common/ProcessorController.cs index e40e9f72165..f59aea7e1e5 100755 --- a/src/Tizen.NUI/src/internal/Common/ProcessorController.cs +++ b/src/Tizen.NUI/src/internal/Common/ProcessorController.cs @@ -52,6 +52,14 @@ internal ProcessorController(global::System.IntPtr cPtr, bool cMemoryOwn) : base { } + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.ProcessorController.DeleteProcessorController(swigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ProcessorEventHandler(); diff --git a/src/Tizen.NUI/src/internal/Common/PropertyHelper.cs b/src/Tizen.NUI/src/internal/Common/PropertyHelper.cs index 8c5be950dad..2d890516139 100755 --- a/src/Tizen.NUI/src/internal/Common/PropertyHelper.cs +++ b/src/Tizen.NUI/src/internal/Common/PropertyHelper.cs @@ -30,26 +30,29 @@ internal static class PropertyHelper { private static readonly Dictionary visualPropertyTable = new Dictionary() { - { "backgroundColor", new VisualPropertyData(View.Property.BACKGROUND, ColorVisualProperty.MixColor, ObjectColorToVector3, PropertyValueColorToVector3, - new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.Opacity, ObjectColorToAlpha, PropertyValueColorToAlpha)) }, - { "backgroundOpacity", new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.Opacity, ObjectIntToFloat) }, - { "boxShadow.BlurRadius", new VisualPropertyData(View.Property.SHADOW, ColorVisualProperty.BlurRadius) }, - { "boxShadow.Color", new VisualPropertyData(View.Property.SHADOW, ColorVisualProperty.MixColor, ObjectColorToVector3, PropertyValueColorToVector3, - new VisualPropertyData(View.Property.SHADOW, Visual.Property.Opacity, ObjectColorToAlpha, PropertyValueColorToAlpha)) }, - { "boxShadow.CornerRadius", new VisualPropertyData(View.Property.SHADOW, Visual.Property.CornerRadius, ObjectIntToFloat) }, - { "boxShadow.Offset", new VisualPropertyData(View.Property.SHADOW, (int)VisualTransformPropertyType.Offset) }, - { "boxShadow.Opacity", new VisualPropertyData(View.Property.SHADOW, Visual.Property.Opacity, ObjectIntToFloat) }, - { "cornerRadius", new VisualPropertyData(ImageView.Property.IMAGE, Visual.Property.CornerRadius, null, null, - new VisualPropertyData(View.Property.SHADOW, Visual.Property.CornerRadius, null, null, - new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.CornerRadius, null, null))) }, - { "borderlineWidth", new VisualPropertyData(ImageView.Property.IMAGE, Visual.Property.BorderlineWidth, ObjectIntToFloat, null, - new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.BorderlineWidth, ObjectIntToFloat, null)) }, - { "borderlineColor", new VisualPropertyData(ImageView.Property.IMAGE, Visual.Property.BorderlineColor, null, null, - new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.BorderlineColor, null, null)) }, - { "borderlineOffset", new VisualPropertyData(ImageView.Property.IMAGE, Visual.Property.BorderlineOffset, null, null, - new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.BorderlineOffset, null, null)) }, - { "imageShadow.Offset", new VisualPropertyData(View.Property.SHADOW, (int)VisualTransformPropertyType.Offset) }, - { "shadow.CornerRadius", new VisualPropertyData(View.Property.SHADOW, Visual.Property.CornerRadius, ObjectIntToFloat) }, + { "backgroundColor", new VisualPropertyData(View.Property.BACKGROUND, ColorVisualProperty.MixColor, ObjectColorToVector4, PropertyValueColorToVector4) }, + { "backgroundOpacity", new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.Opacity, ObjectIntToFloat) }, + { "boxShadow.BlurRadius", new VisualPropertyData(View.Property.SHADOW, ColorVisualProperty.BlurRadius) }, + { "boxShadow.Color", new VisualPropertyData(View.Property.SHADOW, ColorVisualProperty.MixColor, ObjectColorToVector4, PropertyValueColorToVector4) }, + { "boxShadow.CornerRadius", new VisualPropertyData(View.Property.SHADOW, Visual.Property.CornerRadius, ObjectIntToFloat) }, + { "boxShadow.CornerSquareness", new VisualPropertyData(View.Property.SHADOW, Visual.Property.CornerSquareness, ObjectIntToFloat) }, + { "boxShadow.Offset", new VisualPropertyData(View.Property.SHADOW, (int)VisualTransformPropertyType.Offset) }, + { "boxShadow.Opacity", new VisualPropertyData(View.Property.SHADOW, Visual.Property.Opacity, ObjectIntToFloat) }, + { "cornerRadius", new VisualPropertyData(ImageView.Property.IMAGE, Visual.Property.CornerRadius, null, null, + new VisualPropertyData(View.Property.SHADOW, Visual.Property.CornerRadius, null, null, + new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.CornerRadius, null, null))) }, + { "cornerSquareness", new VisualPropertyData(ImageView.Property.IMAGE, Visual.Property.CornerSquareness, null, null, + new VisualPropertyData(View.Property.SHADOW, Visual.Property.CornerSquareness, null, null, + new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.CornerSquareness, null, null))) }, + { "borderlineWidth", new VisualPropertyData(ImageView.Property.IMAGE, Visual.Property.BorderlineWidth, ObjectIntToFloat, null, + new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.BorderlineWidth, ObjectIntToFloat, null)) }, + { "borderlineColor", new VisualPropertyData(ImageView.Property.IMAGE, Visual.Property.BorderlineColor, null, null, + new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.BorderlineColor, null, null)) }, + { "borderlineOffset", new VisualPropertyData(ImageView.Property.IMAGE, Visual.Property.BorderlineOffset, null, null, + new VisualPropertyData(View.Property.BACKGROUND, Visual.Property.BorderlineOffset, null, null)) }, + { "imageShadow.Offset", new VisualPropertyData(View.Property.SHADOW, (int)VisualTransformPropertyType.Offset) }, + { "shadow.CornerRadius", new VisualPropertyData(View.Property.SHADOW, Visual.Property.CornerRadius, ObjectIntToFloat) }, + { "shadow.CornerSquareness", new VisualPropertyData(View.Property.SHADOW, Visual.Property.CornerSquareness, ObjectIntToFloat) }, }; static PropertyHelper() { } @@ -141,24 +144,24 @@ private static string LowerFirstLetter(string original) return sb.ToString(); } - private static object ObjectColorToVector3(object value) + private static object ObjectColorToVector4(object value) { if (value is Vector4) { var colorValue = value as Vector4; - return new Vector3(colorValue.R, colorValue.G, colorValue.B); + return new Vector4(colorValue.R, colorValue.G, colorValue.B, colorValue.A); } if (value is Color) { var colorValue = value as Color; - return new Vector3(colorValue.R, colorValue.G, colorValue.B); + return new Vector4(colorValue.R, colorValue.G, colorValue.B, colorValue.A); } return null; } - private static PropertyValue PropertyValueColorToVector3(PropertyValue value) + private static PropertyValue PropertyValueColorToVector4(PropertyValue value) { var valueType = value.GetType(); @@ -169,43 +172,10 @@ private static PropertyValue PropertyValueColorToVector3(PropertyValue value) var colorValue = new Vector4(); value.Get(colorValue); - using (var v3 = new Vector3(colorValue.R, colorValue.G, colorValue.B)) + using (var v4 = new Vector4(colorValue.R, colorValue.G, colorValue.B, colorValue.A)) { colorValue.Dispose(); - return new PropertyValue(v3); - } - } - - private static object ObjectColorToAlpha(object value) - { - if (value is Vector4) - { - var colorValue = value as Vector4; - return colorValue.A; - } - - if (value is Color) - { - var colorValue = value as Color; - return colorValue.A; - } - - return null; - } - - private static PropertyValue PropertyValueColorToAlpha(PropertyValue value) - { - var valueType = value.GetType(); - - if (valueType != PropertyType.Vector4) - { - return null; - } - - using (var colorValue = new Vector4()) - { - value.Get(colorValue); - return new PropertyValue(colorValue.A); + return new PropertyValue(v4); } } diff --git a/src/Tizen.NUI/src/internal/Common/RenderTask.cs b/src/Tizen.NUI/src/internal/Common/RenderTask.cs index ac8fbca7986..99e65e28025 100755 --- a/src/Tizen.NUI/src/internal/Common/RenderTask.cs +++ b/src/Tizen.NUI/src/internal/Common/RenderTask.cs @@ -66,6 +66,7 @@ internal class Property internal static readonly int RequiresSync = Interop.RenderTask.RequiresSyncGet(); } +#pragma warning disable CA1707 internal static SWIGTYPE_p_f_r_Dali__Vector2__bool DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION { get @@ -148,6 +149,7 @@ public static uint DEFAULT_REFRESH_RATE return ret; } } +#pragma warning restore CA1707 public RenderTask() : this(Interop.RenderTask.NewRenderTask(), true) { @@ -405,6 +407,7 @@ internal RenderTaskSignal FinishedSignal() } /// 3 + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707: Identifiers should not contain underscores")] public enum RefreshRate { REFRESH_ONCE = 0, diff --git a/src/Tizen.NUI/src/internal/Common/VersionCheck.cs b/src/Tizen.NUI/src/internal/Common/VersionCheck.cs index 6c961fbdbec..540955f8a58 100755 --- a/src/Tizen.NUI/src/internal/Common/VersionCheck.cs +++ b/src/Tizen.NUI/src/internal/Common/VersionCheck.cs @@ -33,9 +33,11 @@ internal static class Version public const int reservedVer2 = 0; [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeVersionCheck")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool NativeVersionCheck(ref int ver1, ref int ver2, ref int ver3); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_NUI_InternalAPIVersionCheck")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool InternalAPIVersionCheck(ref int ver1, ref int ver2, ref int ver3); static internal bool DaliVersionMatchWithNUI() diff --git a/src/Tizen.NUI/src/internal/Common/ViewImpl.cs b/src/Tizen.NUI/src/internal/Common/ViewImpl.cs index c8dc19854cd..e947009e1f1 100755 --- a/src/Tizen.NUI/src/internal/Common/ViewImpl.cs +++ b/src/Tizen.NUI/src/internal/Common/ViewImpl.cs @@ -178,18 +178,6 @@ public bool IsFocusGroup() return ret; } - /// - /// [Obsolete("Do not use this, that will be deprecated.")] - /// - /// Do not use this, that will be deprecated. - [Obsolete("Do not use this, that will be deprecated.")] - [EditorBrowsable(EditorBrowsableState.Never)] - public void AccessibilityActivate() - { - Interop.ViewImpl.AccessibilityActivate(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// [Obsolete("Do not use this, that will be deprecated.")] /// @@ -349,27 +337,6 @@ public virtual bool OnAccessibilityActivated() return ret; } - public virtual bool OnAccessibilityPan(PanGesture gesture) - { - bool ret = (SwigDerivedClassHasMethod("OnAccessibilityPan", swigMethodTypes26) ? Interop.ViewImplSignal.OnAccessibilityPanSwigExplicitViewImpl(SwigCPtr, PanGesture.getCPtr(gesture)) : Interop.ViewImplSignal.OnAccessibilityPan(SwigCPtr, PanGesture.getCPtr(gesture))); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public virtual bool OnAccessibilityValueChange(bool isIncrease) - { - bool ret = (SwigDerivedClassHasMethod("OnAccessibilityValueChange", swigMethodTypes28) ? Interop.ViewImplSignal.OnAccessibilityValueChangeSwigExplicitViewImpl(SwigCPtr, isIncrease) : Interop.ViewImplSignal.OnAccessibilityValueChange(SwigCPtr, isIncrease)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public virtual bool OnAccessibilityZoom() - { - bool ret = (SwigDerivedClassHasMethod("OnAccessibilityZoom", swigMethodTypes29) ? Interop.ViewImplSignal.OnAccessibilityZoomSwigExplicitViewImpl(SwigCPtr) : Interop.ViewImplSignal.OnAccessibilityZoom(SwigCPtr)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public virtual void OnKeyInputFocusGained() { if (SwigDerivedClassHasMethod("OnKeyInputFocusGained", swigMethodTypes30)) Interop.ViewImplSignal.OnKeyInputFocusGainedSwigExplicitViewImpl(SwigCPtr); else Interop.ViewImplSignal.OnKeyInputFocusGained(SwigCPtr); @@ -482,12 +449,6 @@ private void SwigDirectorConnect() swigDelegate24 = new SwigDelegateViewImpl_24(SwigDirectorOnStyleChange); if (SwigDerivedClassHasMethod("OnAccessibilityActivated", swigMethodTypes25)) swigDelegate25 = new SwigDelegateViewImpl_25(SwigDirectorOnAccessibilityActivated); - if (SwigDerivedClassHasMethod("OnAccessibilityPan", swigMethodTypes26)) - swigDelegate26 = new SwigDelegateViewImpl_26(SwigDirectorOnAccessibilityPan); - if (SwigDerivedClassHasMethod("OnAccessibilityValueChange", swigMethodTypes28)) - swigDelegate28 = new SwigDelegateViewImpl_28(SwigDirectorOnAccessibilityValueChange); - if (SwigDerivedClassHasMethod("OnAccessibilityZoom", swigMethodTypes29)) - swigDelegate29 = new SwigDelegateViewImpl_29(SwigDirectorOnAccessibilityZoom); if (SwigDerivedClassHasMethod("OnKeyInputFocusGained", swigMethodTypes30)) swigDelegate30 = new SwigDelegateViewImpl_30(SwigDirectorOnKeyInputFocusGained); if (SwigDerivedClassHasMethod("OnKeyInputFocusLost", swigMethodTypes31)) @@ -510,7 +471,7 @@ private void SwigDirectorConnect() swigDelegate39 = new SwigDelegateViewImpl_39(SwigDirectorSignalConnected); if (SwigDerivedClassHasMethod("SignalDisconnected", swigMethodTypes40)) swigDelegate40 = new SwigDelegateViewImpl_40(SwigDirectorSignalDisconnected); - Interop.ViewImpl.DirectorConnect(SwigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate9, swigDelegate11, swigDelegate12, swigDelegate13, swigDelegate14, swigDelegate15, swigDelegate16, swigDelegate17, swigDelegate18, swigDelegate19, swigDelegate20, swigDelegate21, swigDelegate24, swigDelegate25, swigDelegate26, swigDelegate28, swigDelegate29, swigDelegate30, swigDelegate31, swigDelegate32, swigDelegate33, swigDelegate34, swigDelegate35, swigDelegate36, swigDelegate37, swigDelegate38, swigDelegate39, swigDelegate40); + Interop.ViewImpl.DirectorConnect(SwigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate9, swigDelegate11, swigDelegate12, swigDelegate13, swigDelegate14, swigDelegate15, swigDelegate16, swigDelegate17, swigDelegate18, swigDelegate19, swigDelegate20, swigDelegate21, swigDelegate24, swigDelegate25, swigDelegate30, swigDelegate31, swigDelegate32, swigDelegate33, swigDelegate34, swigDelegate35, swigDelegate36, swigDelegate37, swigDelegate38, swigDelegate39, swigDelegate40); } private void SwigDirectorDisconnect() @@ -536,9 +497,6 @@ private void SwigDirectorDisconnect() swigDelegate21 = null; swigDelegate24 = null; swigDelegate25 = null; - swigDelegate26 = null; - swigDelegate28 = null; - swigDelegate29 = null; swigDelegate30 = null; swigDelegate31 = null; swigDelegate32 = null; @@ -550,7 +508,7 @@ private void SwigDirectorDisconnect() swigDelegate38 = null; swigDelegate39 = null; swigDelegate40 = null; - Interop.ViewImpl.DirectorConnect(SwigCPtr, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + Interop.ViewImpl.DirectorConnect(SwigCPtr, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) @@ -687,21 +645,6 @@ private bool SwigDirectorOnAccessibilityActivated() return OnAccessibilityActivated(); } - private bool SwigDirectorOnAccessibilityPan(global::System.IntPtr gesture) - { - return OnAccessibilityPan(new PanGesture(gesture, false)); - } - - private bool SwigDirectorOnAccessibilityValueChange(bool isIncrease) - { - return OnAccessibilityValueChange(isIncrease); - } - - private bool SwigDirectorOnAccessibilityZoom() - { - return OnAccessibilityZoom(); - } - private void SwigDirectorOnKeyInputFocusGained() { OnKeyInputFocusGained(); @@ -816,9 +759,6 @@ private void SwigDirectorSignalDisconnected(global::System.IntPtr slotObserver, private SwigDelegateViewImpl_21 swigDelegate21; private SwigDelegateViewImpl_24 swigDelegate24; private SwigDelegateViewImpl_25 swigDelegate25; - private SwigDelegateViewImpl_26 swigDelegate26; - private SwigDelegateViewImpl_28 swigDelegate28; - private SwigDelegateViewImpl_29 swigDelegate29; private SwigDelegateViewImpl_30 swigDelegate30; private SwigDelegateViewImpl_31 swigDelegate31; private SwigDelegateViewImpl_32 swigDelegate32; @@ -852,9 +792,6 @@ private void SwigDirectorSignalDisconnected(global::System.IntPtr slotObserver, private static global::System.Type[] swigMethodTypes21 = System.Array.Empty(); private static global::System.Type[] swigMethodTypes24 = new global::System.Type[] { typeof(StyleManager), typeof(StyleChangeType) }; private static global::System.Type[] swigMethodTypes25 = System.Array.Empty(); - private static global::System.Type[] swigMethodTypes26 = new global::System.Type[] { typeof(PanGesture) }; - private static global::System.Type[] swigMethodTypes28 = new global::System.Type[] { typeof(bool) }; - private static global::System.Type[] swigMethodTypes29 = System.Array.Empty(); private static global::System.Type[] swigMethodTypes30 = System.Array.Empty(); private static global::System.Type[] swigMethodTypes31 = System.Array.Empty(); private static global::System.Type[] swigMethodTypes32 = new global::System.Type[] { typeof(View), typeof(View.FocusDirection), typeof(bool) }; diff --git a/src/Tizen.NUI/src/internal/Common/ViewWrapperImpl.cs b/src/Tizen.NUI/src/internal/Common/ViewWrapperImpl.cs index 4697c73c26a..16dba290dcd 100755 --- a/src/Tizen.NUI/src/internal/Common/ViewWrapperImpl.cs +++ b/src/Tizen.NUI/src/internal/Common/ViewWrapperImpl.cs @@ -68,12 +68,6 @@ internal sealed class ViewWrapperImpl : ViewImpl /// 3 public delegate bool OnAccessibilityActivatedDelegate(); /// 3 - public delegate bool OnAccessibilityPanDelegate(PanGesture gestures); - /// 3 - public delegate bool OnAccessibilityValueChangeDelegate(bool isIncrease); - /// 3 - public delegate bool OnAccessibilityZoomDelegate(); - /// 3 public delegate void OnFocusGainedDelegate(); /// 3 public delegate void OnFocusLostDelegate(); @@ -117,9 +111,6 @@ internal sealed class ViewWrapperImpl : ViewImpl public new OnLayoutNegotiatedDelegate OnLayoutNegotiated; public new OnStyleChangeDelegate OnStyleChange; public new OnAccessibilityActivatedDelegate OnAccessibilityActivated; - public new OnAccessibilityPanDelegate OnAccessibilityPan; - public new OnAccessibilityValueChangeDelegate OnAccessibilityValueChange; - public new OnAccessibilityZoomDelegate OnAccessibilityZoom; public OnFocusGainedDelegate OnFocusGained; public OnFocusLostDelegate OnFocusLost; public new GetNextFocusableViewDelegate GetNextFocusableView; @@ -289,9 +280,6 @@ private void DirectorConnect() Delegate21 = new DelegateViewWrapperImpl_21(DirectorOnInitialize); Delegate24 = new DelegateViewWrapperImpl_24(DirectorOnStyleChange); Delegate25 = new DelegateViewWrapperImpl_25(DirectorOnAccessibilityActivated); - Delegate26 = new DelegateViewWrapperImpl_26(DirectorOnAccessibilityPan); - Delegate28 = new DelegateViewWrapperImpl_28(DirectorOnAccessibilityValueChange); - Delegate29 = new DelegateViewWrapperImpl_29(DirectorOnAccessibilityZoom); Delegate30 = new DelegateViewWrapperImpl_30(DirectorOnFocusGained); Delegate31 = new DelegateViewWrapperImpl_31(DirectorOnFocusLost); Delegate32 = new DelegateViewWrapperImpl_32(DirectorGetNextFocusableActor); @@ -301,7 +289,7 @@ private void DirectorConnect() Delegate36 = new DelegateViewWrapperImpl_36(DirectorOnPan); Delegate37 = new DelegateViewWrapperImpl_37(DirectorOnTap); Delegate38 = new DelegateViewWrapperImpl_38(DirectorOnLongPress); - Interop.ViewWrapperImpl.DirectorConnect(SwigCPtr, Delegate0, Delegate1, Delegate2, Delegate3, Delegate4, Delegate5, Delegate6, Delegate9, Delegate11, Delegate12, Delegate13, Delegate14, Delegate15, Delegate16, Delegate17, Delegate18, Delegate19, Delegate20, Delegate21, Delegate24, Delegate25, Delegate26, Delegate28, Delegate29, Delegate30, Delegate31, Delegate32, Delegate33, Delegate34, Delegate35, Delegate36, Delegate37, Delegate38, null, null); + Interop.ViewWrapperImpl.DirectorConnect(SwigCPtr, Delegate0, Delegate1, Delegate2, Delegate3, Delegate4, Delegate5, Delegate6, Delegate9, Delegate11, Delegate12, Delegate13, Delegate14, Delegate15, Delegate16, Delegate17, Delegate18, Delegate19, Delegate20, Delegate21, Delegate24, Delegate25, Delegate30, Delegate31, Delegate32, Delegate33, Delegate34, Delegate35, Delegate36, Delegate37, Delegate38, null, null); } @@ -328,9 +316,6 @@ private void DirectorDisconnect() Delegate21 = null; Delegate24 = null; Delegate25 = null; - Delegate26 = null; - Delegate28 = null; - Delegate29 = null; Delegate30 = null; Delegate31 = null; Delegate32 = null; @@ -340,7 +325,7 @@ private void DirectorDisconnect() Delegate36 = null; Delegate37 = null; Delegate38 = null; - Interop.ViewWrapperImpl.DirectorConnect(SwigCPtr, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + Interop.ViewWrapperImpl.DirectorConnect(SwigCPtr, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } private void DirectorOnSceneConnection(int depth) @@ -509,24 +494,6 @@ private bool DirectorOnAccessibilityActivated() return OnAccessibilityActivated?.Invoke() ?? false; } - private bool DirectorOnAccessibilityPan(global::System.IntPtr gesture) - { - var panGesture = new PanGesture(gesture, false); - var ret = OnAccessibilityPan?.Invoke(panGesture) ?? false; - panGesture.Dispose(); - return ret; - } - - private bool DirectorOnAccessibilityValueChange(bool isIncrease) - { - return OnAccessibilityValueChange?.Invoke(isIncrease) ?? false; - } - - private bool DirectorOnAccessibilityZoom() - { - return OnAccessibilityZoom?.Invoke() ?? false; - } - private void DirectorOnFocusGained() { OnFocusGained?.Invoke(); @@ -686,9 +653,6 @@ private void DirectorOnLongPress(global::System.IntPtr longPress) private DelegateViewWrapperImpl_21 Delegate21; private DelegateViewWrapperImpl_24 Delegate24; private DelegateViewWrapperImpl_25 Delegate25; - private DelegateViewWrapperImpl_26 Delegate26; - private DelegateViewWrapperImpl_28 Delegate28; - private DelegateViewWrapperImpl_29 Delegate29; private DelegateViewWrapperImpl_30 Delegate30; private DelegateViewWrapperImpl_31 Delegate31; private DelegateViewWrapperImpl_32 Delegate32; diff --git a/src/Tizen.NUI/src/internal/Common/VisualObjectsContainer.cs b/src/Tizen.NUI/src/internal/Common/VisualObjectsContainer.cs index 767b2eb882b..2d1a31eeb79 100644 --- a/src/Tizen.NUI/src/internal/Common/VisualObjectsContainer.cs +++ b/src/Tizen.NUI/src/internal/Common/VisualObjectsContainer.cs @@ -159,10 +159,6 @@ private Tizen.NUI.Visuals.VisualBase GetVisualObjectAt(uint index) { Interop.BaseHandle.DeleteBaseHandle(new global::System.Runtime.InteropServices.HandleRef(this, cPtr)); } - else - { - ret = new Visuals.VisualBase(cPtr, true); - } NDalicPINVOKE.ThrowExceptionIfExists(); return ret; } diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/AddToDictionary.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/AddToDictionary.cs index ddd7eee7852..e5f50532089 100755 --- a/src/Tizen.NUI/src/internal/EXaml/Operation/AddToDictionary.cs +++ b/src/Tizen.NUI/src/internal/EXaml/Operation/AddToDictionary.cs @@ -44,7 +44,7 @@ public void Do() var type = dict.GetType(); var method = type.GetMethods().FirstOrDefault(m => m.Name == "Add"); - method.Invoke(dict, new object[] { key, value }); + method?.Invoke(dict, new object[] { key, value }); } private int parentIndex; diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.AccessibilityManager.cs b/src/Tizen.NUI/src/internal/Interop/Interop.AccessibilityManager.cs deleted file mode 100755 index 36f48c4d5e7..00000000000 --- a/src/Tizen.NUI/src/internal/Interop/Interop.AccessibilityManager.cs +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright(c) 2021 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. - * - */ - -namespace Tizen.NUI -{ - internal static partial class Interop - { - internal static partial class AccessibilityManager - { - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AccessibilityManager")] - public static extern global::System.IntPtr NewAccessibilityManager(); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AccessibilityManager")] - public static extern void DeleteAccessibilityManager(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_Get")] - public static extern global::System.IntPtr Get(); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_SetAccessibilityAttribute")] - public static extern void SetAccessibilityAttribute(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, string jarg4); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetAccessibilityAttribute")] - public static extern string GetAccessibilityAttribute(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_SetFocusOrder")] - public static extern void SetFocusOrder(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, uint jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetFocusOrder")] - public static extern uint GetFocusOrder(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GenerateNewFocusOrder")] - public static extern uint GenerateNewFocusOrder(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetActorByFocusOrder")] - public static extern global::System.IntPtr GetActorByFocusOrder(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_SetCurrentFocusActor")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool SetCurrentFocusActor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetCurrentFocusActor")] - public static extern global::System.IntPtr GetCurrentFocusActor(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetCurrentFocusGroup")] - public static extern global::System.IntPtr GetCurrentFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetCurrentFocusOrder")] - public static extern uint GetCurrentFocusOrder(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_MoveFocusForward")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool MoveFocusForward(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_MoveFocusBackward")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool MoveFocusBackward(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ClearFocus")] - public static extern void ClearFocus(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_Reset")] - public static extern void Reset(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_SetFocusGroup")] - public static extern void SetFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, bool jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_IsFocusGroup")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool IsFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_SetGroupMode")] - public static extern void SetGroupMode(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetGroupMode")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool GetGroupMode(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_SetWrapMode")] - public static extern void SetWrapMode(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetWrapMode")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool GetWrapMode(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_SetFocusIndicatorActor")] - public static extern void SetFocusIndicatorActor(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetFocusIndicatorActor")] - public static extern global::System.IntPtr GetFocusIndicatorActor(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetFocusGroup")] - public static extern global::System.IntPtr GetFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_GetReadPosition")] - public static extern global::System.IntPtr GetReadPosition(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_FocusChangedSignal")] - public static extern global::System.IntPtr FocusChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_FocusOvershotSignal")] - public static extern global::System.IntPtr FocusOvershotSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_FocusedActorActivatedSignal_Connect")] - public static extern void FocusedActorActivatedSignalConnect(global::System.Runtime.InteropServices.HandleRef accessibilityManager, global::System.Runtime.InteropServices.HandleRef handler); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_FocusedActorActivatedSignal_Disconnect")] - public static extern void FocusedActorActivatedSignalDisconnect(global::System.Runtime.InteropServices.HandleRef accessibilityManager, global::System.Runtime.InteropServices.HandleRef handler); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_StatusChangedSignal")] - public static extern global::System.IntPtr StatusChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionNextSignal")] - public static extern global::System.IntPtr ActionNextSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionPreviousSignal")] - public static extern global::System.IntPtr ActionPreviousSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionActivateSignal")] - public static extern global::System.IntPtr ActionActivateSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionReadSignal")] - public static extern global::System.IntPtr ActionReadSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionOverSignal")] - public static extern global::System.IntPtr ActionOverSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionReadNextSignal")] - public static extern global::System.IntPtr ActionReadNextSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionReadPreviousSignal")] - public static extern global::System.IntPtr ActionReadPreviousSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionUpSignal")] - public static extern global::System.IntPtr ActionUpSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionDownSignal")] - public static extern global::System.IntPtr ActionDownSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionClearFocusSignal")] - public static extern global::System.IntPtr ActionClearFocusSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionBackSignal")] - public static extern global::System.IntPtr ActionBackSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionScrollUpSignal")] - public static extern global::System.IntPtr ActionScrollUpSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionScrollDownSignal")] - public static extern global::System.IntPtr ActionScrollDownSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionPageLeftSignal")] - public static extern global::System.IntPtr ActionPageLeftSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionPageRightSignal")] - public static extern global::System.IntPtr ActionPageRightSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionPageUpSignal")] - public static extern global::System.IntPtr ActionPageUpSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionPageDownSignal")] - public static extern global::System.IntPtr ActionPageDownSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionMoveToFirstSignal")] - public static extern global::System.IntPtr ActionMoveToFirstSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionMoveToLastSignal")] - public static extern global::System.IntPtr ActionMoveToLastSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionReadFromTopSignal")] - public static extern global::System.IntPtr ActionReadFromTopSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionReadFromNextSignal")] - public static extern global::System.IntPtr ActionReadFromNextSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionZoomSignal")] - public static extern global::System.IntPtr ActionZoomSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionReadPauseResumeSignal")] - public static extern global::System.IntPtr ActionReadPauseResumeSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionStartStopSignal")] - public static extern global::System.IntPtr ActionStartStopSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityManager_ActionScrollSignal")] - public static extern global::System.IntPtr ActionScrollSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityActionSignal_Empty")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool AccessibilityActionSignalEmpty(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityActionSignal_GetConnectionCount")] - public static extern uint AccessibilityActionSignalGetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityActionSignal_Connect")] - public static extern void AccessibilityActionSignalConnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityActionSignal_Disconnect")] - public static extern void AccessibilityActionSignalDisconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityActionSignal_Emit")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool AccessibilityActionSignalEmit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AccessibilityActionSignal")] - public static extern global::System.IntPtr NewAccessibilityActionSignal(); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AccessibilityActionSignal")] - public static extern void DeleteAccessibilityActionSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityFocusOvershotSignal_Empty")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool AccessibilityFocusOvershotSignalEmpty(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityFocusOvershotSignal_GetConnectionCount")] - public static extern uint AccessibilityFocusOvershotSignalGetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityFocusOvershotSignal_Connect")] - public static extern void AccessibilityFocusOvershotSignalConnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityFocusOvershotSignal_Disconnect")] - public static extern void AccessibilityFocusOvershotSignalDisconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AccessibilityFocusOvershotSignal_Emit")] - public static extern void AccessibilityFocusOvershotSignalEmit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AccessibilityFocusOvershotSignal")] - public static extern global::System.IntPtr NewAccessibilityFocusOvershotSignal(); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AccessibilityFocusOvershotSignal")] - public static extern void DeleteAccessibilityFocusOvershotSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Actor.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Actor.cs index 61c56d599f4..0f29b9f361c 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Actor.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Actor.cs @@ -134,6 +134,9 @@ internal static partial class Actor [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_CurrentScreenExtents")] public static extern global::System.IntPtr CurrentScreenExtents(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_GetVisiblityChangedActor")] + public static extern global::System.IntPtr GetVisiblityChangedActor(); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_InternalRetrievingPropertyVector2")] public static extern int InternalRetrievingPropertyVector2(HandleRef actor, int propertyType, HandleRef retrievingVector2); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ActorSignal.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ActorSignal.cs index 97e527c1bd9..ca88e612a3c 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ActorSignal.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ActorSignal.cs @@ -82,6 +82,12 @@ internal static partial class ActorSignal [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_VisibilityChangedSignal_Disconnect")] public static extern void VisibilityChangedDisconnect(HandleRef actor, HandleRef handler); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_InheritedVisibilityChangedSignal_Connect")] + public static extern void AggregatedVisibilityChangedConnect(HandleRef actor, HandleRef handler); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_InheritedVisibilityChangedSignal_Disconnect")] + public static extern void AggregatedVisibilityChangedDisconnect(HandleRef actor, HandleRef handler); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_LayoutDirectionChangedSignal_Connect")] public static extern void LayoutDirectionChangedConnect(HandleRef actor, HandleRef handler); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs index a9654c41a84..a52f199384f 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Application.cs @@ -96,6 +96,13 @@ internal static partial class Application [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GetScreenSize")] public static extern global::System.IntPtr GetScreenSize(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_SetGeometryHittestEnabled")] + public static extern void SetGeometryHittestEnabled(bool enable); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_IsGeometryHittestEnabled")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool IsGeometryHittestEnabled(); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.AuthenticationSignalType.cs b/src/Tizen.NUI/src/internal/Interop/Interop.AuthenticationSignalType.cs deleted file mode 100755 index 4af29196986..00000000000 --- a/src/Tizen.NUI/src/internal/Interop/Interop.AuthenticationSignalType.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright(c) 2021 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. - * - */ - -namespace Tizen.NUI -{ - internal static partial class Interop - { - internal static partial class AuthenticationSignalType - { - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_Empty")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool Empty(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_GetConnectionCount")] - public static extern uint GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_Connect")] - public static extern void Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_Disconnect")] - public static extern void Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AuthenticationSignalType_Emit")] - public static extern void Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AuthenticationSignalType")] - public static extern global::System.IntPtr NewAuthenticationSignalType(); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AuthenticationSignalType")] - public static extern void DeleteAuthenticationSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.AutofillContainer.cs b/src/Tizen.NUI/src/internal/Interop/Interop.AutofillContainer.cs deleted file mode 100755 index 3f7ceed8123..00000000000 --- a/src/Tizen.NUI/src/internal/Interop/Interop.AutofillContainer.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright(c) 2021 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. - * - */ - -namespace Tizen.NUI -{ - internal static partial class Interop - { - internal static partial class AutofillContainer - { - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_New")] - public static extern global::System.IntPtr New(string jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_AutofillContainer__SWIG_1")] - public static extern global::System.IntPtr NewAutofillContainer(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_Assign")] - public static extern global::System.IntPtr Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_AutofillContainer")] - public static extern void DeleteAutofillContainer(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_DownCast")] - public static extern global::System.IntPtr DownCast(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_AddAutofillItem")] - public static extern void AddAutofillView(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, string jarg4, string jarg5, uint jarg6, bool jarg7); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_RemoveAutofillItem")] - public static extern void RemoveAutofillItem(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_SaveAutofillData")] - public static extern void SaveAutofillData(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_RequestFillData")] - public static extern void RequestFillData(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetAutofillServiceName")] - public static extern string GetAutofillServiceName(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetAutofillServiceMessage")] - public static extern string GetAutofillServiceMessage(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetAutofillServiceImagePath")] - public static extern string GetAutofillServiceImagePath(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetListCount")] - public static extern uint GetListItemCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_GetListItem")] - public static extern string GetListItem(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_AutofillContainer_SetSelectedItem")] - public static extern void SetSelectedItem(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_AutofillServiceShownSignal")] - public static extern global::System.IntPtr AutofillServiceEventSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_AutofillContainer_AutofillListShownSignal")] - public static extern global::System.IntPtr AutofillListEventSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.BackgroundBlurEffect.cs b/src/Tizen.NUI/src/internal/Interop/Interop.BackgroundBlurEffect.cs new file mode 100644 index 00000000000..1715ae0f4af --- /dev/null +++ b/src/Tizen.NUI/src/internal/Interop/Interop.BackgroundBlurEffect.cs @@ -0,0 +1,11 @@ +namespace Tizen.NUI +{ + internal static partial class Interop + { + internal static partial class BackgroundBlurEffect + { + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_BackgroundBlurEffect_New__SWIG_1")] + public static extern global::System.IntPtr New(uint pixelRadius); + } + } +} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Capture.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Capture.cs index 180827d63d6..16bcddde8ac 100644 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Capture.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Capture.cs @@ -46,6 +46,13 @@ internal static partial class Capture [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Capture_SetImageQuality")] public static extern void SetImageQuality(HandleRef capture, uint quality); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Capture_SetExclusive")] + public static extern void SetExclusive(HandleRef capture, bool exclusive); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Capture_IsExclusive")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool IsExclusive(HandleRef capture); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Capture_Signal_Empty")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool SignalEmpty(HandleRef jarg1); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.DragAndDrop.cs b/src/Tizen.NUI/src/internal/Interop/Interop.DragAndDrop.cs index 1acf55699be..e921ba3060a 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.DragAndDrop.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.DragAndDrop.cs @@ -33,11 +33,12 @@ internal enum DragType public static extern global::System.IntPtr New(); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragAndDrop_StartDragAndDrop")] - public static extern bool StartDragAndDrop(global::System.Runtime.InteropServices.HandleRef dragAndDrop, global::System.Runtime.InteropServices.HandleRef sourceView, global::System.Runtime.InteropServices.HandleRef shadow, string mimeType, string data, global::System.Runtime.InteropServices.HandleRef callback); + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool StartDragAndDrop(global::System.Runtime.InteropServices.HandleRef dragAndDrop, global::System.Runtime.InteropServices.HandleRef sourceView, global::System.Runtime.InteropServices.HandleRef shadow, string [] mimeTypes, int mimeTypsSize, string [] dataSet, int dataSetSize, global::System.Runtime.InteropServices.HandleRef callback); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragAndDrop_AddListener")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool AddListener(global::System.Runtime.InteropServices.HandleRef dragAndDrop, global::System.Runtime.InteropServices.HandleRef targetView, global::System.Runtime.InteropServices.HandleRef callback); + public static extern bool AddListener(global::System.Runtime.InteropServices.HandleRef dragAndDrop, global::System.Runtime.InteropServices.HandleRef targetView, string mimeType, global::System.Runtime.InteropServices.HandleRef callback); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragAndDrop_RemoveListener")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] @@ -45,7 +46,7 @@ internal enum DragType [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragAndDrop_Window_AddListener")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool WindowAddListener(global::System.Runtime.InteropServices.HandleRef dragAndDrop, global::System.Runtime.InteropServices.HandleRef targetWindow, global::System.Runtime.InteropServices.HandleRef callback); + public static extern bool WindowAddListener(global::System.Runtime.InteropServices.HandleRef dragAndDrop, global::System.Runtime.InteropServices.HandleRef targetWindow, string mimeType, global::System.Runtime.InteropServices.HandleRef callback); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragAndDrop_Window_RemoveListener")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] @@ -57,8 +58,9 @@ internal enum DragType [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragEvent_GetPosition")] public static extern global::System.IntPtr GetPosition(global::System.IntPtr dragAndDrop); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragEvent_GetMimeType")] - public static extern string GetMimeType(global::System.IntPtr dragAndDrop); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragEvent_GetMimeTypes")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool GetMimeTypes(global::System.IntPtr dragAndDrop, out global::System.IntPtr mimeTypes, out int count); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragEvent_GetData")] public static extern string GetData(global::System.IntPtr dragAndDrop); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.EventThreadCallback.cs b/src/Tizen.NUI/src/internal/Interop/Interop.EventThreadCallback.cs index af8a9c272a2..e50919882a4 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.EventThreadCallback.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.EventThreadCallback.cs @@ -24,6 +24,9 @@ internal static partial class EventThreadCallback [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_EventThreadCallback")] public static extern global::System.IntPtr NewEventThreadCallback(Tizen.NUI.EventThreadCallback.CallbackDelegate delegate1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_EventThreadCallback")] + public static extern void DeleteEventThreadCallback(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_EventThreadCallback_Trigger")] public static extern void Trigger(global::System.Runtime.InteropServices.HandleRef jarg1); } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs b/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs index 72f1273c9fe..8a6dbf122bd 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs @@ -24,6 +24,9 @@ internal static partial class FrameUpdateCallbackInterface [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_FrameCallbackInterface")] public static extern global::System.IntPtr newFrameUpdateCallbackInterface(); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_FrameCallbackInterface")] + public static extern void DeleteFrameUpdateCallbackInterface(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_director_connect_with_return")] public static extern void FrameUpdateCallbackInterfaceDirectorConnectV1(global::System.Runtime.InteropServices.HandleRef jarg1, Tizen.NUI.FrameUpdateCallbackInterface.DelegateFrameUpdateCallbackInterfaceV1 delegate1); @@ -39,6 +42,18 @@ internal static partial class FrameUpdateCallbackInterface [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool FrameCallbackInterfaceBakePosition(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_GetOrientation")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool FrameCallbackInterfaceGetOrientation(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef orientation); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_SetOrientation")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool FrameCallbackInterfaceSetOrientation(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef orientation); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_BakeOrientation")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool FrameCallbackInterfaceBakeOrientation(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef orientation); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_GetPositionAndSize")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool FrameCallbackInterfaceGetPositionAndSize(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector, global::System.Runtime.InteropServices.HandleRef vector2); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.GestureDetector.cs b/src/Tizen.NUI/src/internal/Interop/Interop.GestureDetector.cs index d17e752739d..998d426f79f 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.GestureDetector.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.GestureDetector.cs @@ -48,6 +48,14 @@ internal static partial class GestureDetector [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureDetector_GetAttachedActor")] public static extern global::System.IntPtr GetAttachedActor(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureDetector_HandleEvent")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool HandleEvent(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureDetector_CancelAllOtherGestureDetectors")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool CancelAllOtherGestureDetectors(global::System.Runtime.InteropServices.HandleRef jarg1); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ImageUrl.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ImageUrl.cs index adec6aeb37c..7f2d38d13f8 100644 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ImageUrl.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ImageUrl.cs @@ -24,6 +24,10 @@ internal static partial class Interop { internal static partial class ImageUrl { + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ImageUrl_Copy")] + public static extern global::System.IntPtr NewImageUrl(global::System.Runtime.InteropServices.HandleRef csImageUrl); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ImageUrl")] public static extern void Delete(HandleRef jarg1); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ListEventSignalType.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ListEventSignalType.cs deleted file mode 100755 index 43846b2b2b0..00000000000 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ListEventSignalType.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright(c) 2021 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. - * - */ - -namespace Tizen.NUI -{ - internal static partial class Interop - { - internal static partial class ListEventSignalType - { - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_Empty")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool Empty(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_GetConnectionCount")] - public static extern uint GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_Connect")] - public static extern void Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_Disconnect")] - public static extern void Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ListShownSignalType_Emit")] - public static extern void Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ListShownSignalType")] - public static extern global::System.IntPtr NewListEventSignalType(); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ListShownSignalType")] - public static extern void DeleteListEventSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs b/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs index 248ac59158e..56d65ecc979 100644 --- a/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs @@ -33,6 +33,7 @@ internal static partial class NativeImageQueue public static extern void Delete(IntPtr queue); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueue_CanDequeueBuffer")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool CanDequeueBuffer(IntPtr queue); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueue_DequeueBuffer")] @@ -47,6 +48,10 @@ internal static partial class NativeImageQueue [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueue_GenerateUrl")] public static extern IntPtr GenerateUrl(IntPtr queue); + + // Platform dependency methods + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueuePtr_New_Handle_With_TbmQueue")] + public static extern IntPtr NewHandleWithTbmQueue(IntPtr csTbmQueue); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageSource.cs b/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageSource.cs index c7ef3f71a4a..916815e31ed 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageSource.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.NativeImageSource.cs @@ -22,7 +22,6 @@ internal static partial class Interop { internal static partial class NativeImageSource { - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageSource_New")] public static extern IntPtr New(IntPtr handle); @@ -41,6 +40,13 @@ internal static partial class NativeImageSource [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageSource_GenerateUrl")] public static extern IntPtr GenerateUrl(IntPtr handle); + + // Platform dependency methods + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageSource_New_Handle_With_TbmSurface")] + public static extern IntPtr NewHandleWithTbmSurface(IntPtr csTbmSurface); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageSource_SetSource")] + public static extern void SetSource(IntPtr handle, IntPtr csTbmSurface); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ObjectRegistry.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ObjectRegistry.cs deleted file mode 100755 index fb498a3f5a7..00000000000 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ObjectRegistry.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright(c) 2021 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. - * - */ - -namespace Tizen.NUI -{ - internal static partial class Interop - { - internal static partial class ObjectRegistry - { - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ObjectRegistry__SWIG_0")] - public static extern global::System.IntPtr NewObjectRegistry(); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ObjectRegistry")] - public static extern void DeleteObjectRegistry(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ObjectRegistry_Assign")] - public static extern global::System.IntPtr Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ObjectRegistry_ObjectCreatedSignal")] - public static extern global::System.IntPtr ObjectCreatedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ObjectRegistry_ObjectDestroyedSignal")] - public static extern global::System.IntPtr ObjectDestroyedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ProcessorController.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ProcessorController.cs index ce3f97c78f3..bc37d526c30 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ProcessorController.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ProcessorController.cs @@ -25,6 +25,9 @@ internal static partial class ProcessorController [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ProcessorController_Without_Initialize")] public static extern global::System.IntPtr NewWithoutInitialize(); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ProcessorController")] + public static extern void DeleteProcessorController(global::System.Runtime.InteropServices.HandleRef processorController); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ProcessorController_Initialize")] public static extern void Initialize(global::System.Runtime.InteropServices.HandleRef processorController); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Property.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Property.cs index 697a0696ce6..9b7b4535594 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Property.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Property.cs @@ -33,15 +33,9 @@ internal static partial class Property [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property__SWIG_0")] public static extern global::System.IntPtr NewProperty(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property__SWIG_1")] - public static extern global::System.IntPtr NewProperty(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property__SWIG_2")] public static extern global::System.IntPtr NewProperty(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property__SWIG_3")] - public static extern global::System.IntPtr NewProperty(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_Property")] public static extern void DeleteProperty(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -57,12 +51,6 @@ internal static partial class Property [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_propertyIndex_get")] public static extern int PropertyIndexGet(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_componentIndex_set")] - public static extern void ComponentIndexSet(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_componentIndex_get")] - public static extern int ComponentIndexGet(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Property_Array__SWIG_0")] public static extern global::System.IntPtr NewPropertyArray(); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.PropertyMap.cs b/src/Tizen.NUI/src/internal/Interop/Interop.PropertyMap.cs index eaaead83d61..9268f58a66c 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.PropertyMap.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.PropertyMap.cs @@ -50,9 +50,11 @@ internal static partial class PropertyMap public static extern global::System.IntPtr Add(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Remove__SWIG_0")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool Remove(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_Remove__SWIG_1")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool Remove(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Property_Map_GetValue")] diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs index 9d65c051eb5..be9877ab291 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs @@ -43,9 +43,6 @@ static Stage() [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Stage_GetDpi")] public static extern global::System.IntPtr GetDpi(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Stage_GetObjectRegistry")] - public static extern global::System.IntPtr GetObjectRegistry(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Stage_SetRenderingBehavior")] public static extern void SetRenderingBehavior(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs b/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs index 7f6f6757f1d..d0605cb56ac 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs @@ -14,6 +14,7 @@ * limitations under the License. * */ +using System.Runtime.InteropServices; namespace Tizen.NUI { @@ -21,177 +22,219 @@ internal static partial class Interop { internal static partial class TextLabel { - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_TEXT_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_TEXT_get")] public static extern int TextGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_FONT_FAMILY_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_FONT_FAMILY_get")] public static extern int FontFamilyGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_FONT_STYLE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_FONT_STYLE_get")] public static extern int FontStyleGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_POINT_SIZE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_POINT_SIZE_get")] public static extern int PointSizeGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_MULTI_LINE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_MULTI_LINE_get")] public static extern int MultiLineGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_HORIZONTAL_ALIGNMENT_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_HORIZONTAL_ALIGNMENT_get")] public static extern int HorizontalAlignmentGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_VERTICAL_ALIGNMENT_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_VERTICAL_ALIGNMENT_get")] public static extern int VerticalAlignmentGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_TEXT_COLOR_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_TEXT_COLOR_get")] public static extern int TextColorGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ENABLE_MARKUP_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ENABLE_MARKUP_get")] public static extern int EnableMarkupGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ENABLE_AUTO_SCROLL_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ENABLE_AUTO_SCROLL_get")] public static extern int EnableAutoScrollGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_AUTO_SCROLL_SPEED_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_AUTO_SCROLL_SPEED_get")] public static extern int AutoScrollSpeedGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get")] public static extern int AutoScrollLoopCountGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_AUTO_SCROLL_GAP_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_AUTO_SCROLL_GAP_get")] public static extern int AutoScrollGapGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_LINE_SPACING_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_LINE_SPACING_get")] public static extern int LineSpacingGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_RELATIVE_LINE_SIZE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_RELATIVE_LINE_SIZE_get")] public static extern int RelativeLineHeightGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_UNDERLINE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_UNDERLINE_get")] public static extern int UnderlineGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_SHADOW_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_SHADOW_get")] public static extern int ShadowGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_EMBOSS_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_EMBOSS_get")] public static extern int EmbossGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_OUTLINE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_OUTLINE_get")] public static extern int OutlineGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_New__SWIG_0")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_New__SWIG_0")] public static extern global::System.IntPtr New(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_New_With_Style")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_New_With_Style")] public static extern global::System.IntPtr New(bool hasStyle); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_New_With_String_Style")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_New_With_String_Style")] public static extern global::System.IntPtr New(string text, bool hasStyle); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_TextLabel")] - public static extern void DeleteTextLabel(global::System.Runtime.InteropServices.HandleRef jarg1); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_TextLabel")] + public static extern void DeleteTextLabel(HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_PIXEL_SIZE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_PIXEL_SIZE_get")] public static extern int PixelSizeGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_ELLIPSIS_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_ELLIPSIS_get")] public static extern int EllipsisGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_ELLIPSIS_POSITION_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_ELLIPSIS_POSITION_get")] public static extern int EllipsisPositionGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_LINE_COUNT_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_LINE_COUNT_get")] public static extern int LineCountGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_LINE_WRAP_MODE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_LINE_WRAP_MODE_get")] public static extern int LineWrapModeGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_TEXT_DIRECTION_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_TEXT_DIRECTION_get")] public static extern int TextDirectionGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get")] public static extern int VerticalLineAlignmentGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_AUTO_SCROLL_STOP_MODE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_AUTO_SCROLL_STOP_MODE_get")] public static extern int AutoScrollStopModeGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get")] public static extern int AutoScrollLoopDelayGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get")] public static extern int MatchSystemLanguageDirectionGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_TEXT_FIT_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_TEXT_FIT_get")] public static extern int TextFitGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_TextFitChangedSignal")] - public static extern global::System.IntPtr TextFitChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_TextFitChangedSignal")] + public static extern global::System.IntPtr TextFitChangedSignal(HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_MIN_LINE_SIZE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_MIN_LINE_SIZE_get")] public static extern int MinLineSizeGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_FONT_SIZE_SCALE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_FONT_SIZE_SCALE_get")] public static extern int FontSizeScaleGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ENABLE_FONT_SIZE_SCALE_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ENABLE_FONT_SIZE_SCALE_get")] public static extern int EnableFontSizeScaleGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_GetTextSize")] - public static extern global::System.IntPtr GetTextSize(global::System.Runtime.InteropServices.HandleRef textLabelRef, uint start, uint end); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_GetTextSize")] + public static extern global::System.IntPtr GetTextSize(HandleRef textLabelRef, uint start, uint end); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_GetTextPosition")] - public static extern global::System.IntPtr GetTextPosition(global::System.Runtime.InteropServices.HandleRef textLabelRef, uint start, uint end); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_GetTextPosition")] + public static extern global::System.IntPtr GetTextPosition(HandleRef textLabelRef, uint start, uint end); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_SetTextFitArray")] - public static extern void SetTextFitArray(global::System.Runtime.InteropServices.HandleRef textLabel, bool enable, uint arraySize, float[] pointSizeArray, float[] minLineSizeArray); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_SetTextFitArray")] + public static extern void SetTextFitArray(HandleRef textLabel, bool enable, uint arraySize, float[] pointSizeArray, float[] minLineSizeArray); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_GetTextFitArray")] - public static extern global::System.IntPtr GetTextFitArray(global::System.Runtime.InteropServices.HandleRef textLabel); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_GetTextFitArray")] + public static extern global::System.IntPtr GetTextFitArray(HandleRef textLabel); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AnchorClickedSignal")] - public static extern global::System.IntPtr AnchorClickedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AnchorClickedSignal")] + public static extern global::System.IntPtr AnchorClickedSignal(HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_Empty")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool TextLabelSignalEmpty(global::System.Runtime.InteropServices.HandleRef jarg1); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_Empty")] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool TextLabelSignalEmpty(HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_GetConnectionCount")] - public static extern uint TextLabelSignalGetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_GetConnectionCount")] + public static extern uint TextLabelSignalGetConnectionCount(HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_Connect")] - public static extern void TextLabelSignalConnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_Connect")] + public static extern void TextLabelSignalConnect(HandleRef jarg1, HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_Disconnect")] - public static extern void TextLabelSignalDisconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_Disconnect")] + public static extern void TextLabelSignalDisconnect(HandleRef jarg1, HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_Emit")] - public static extern void TextLabelSignalEmit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabelSignal_Emit")] + public static extern void TextLabelSignalEmit(HandleRef jarg1, HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_TextLabelSignal")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_TextLabelSignal")] public static extern global::System.IntPtr NewTextLabelSignal(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_TextLabelSignal")] - public static extern void DeleteTextLabelSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_TextLabelSignal")] + public static extern void DeleteTextLabelSignal(HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_STRIKETHROUGH_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_STRIKETHROUGH_get")] public static extern int StrikethroughGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_CHARACTER_SPACING_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_CHARACTER_SPACING_get")] public static extern int CharacterSpacingGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ANCHOR_COLOR_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ANCHOR_COLOR_get")] public static extern int AnchorColorGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ANCHOR_CLICKED_COLOR_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ANCHOR_CLICKED_COLOR_get")] public static extern int AnchorClickedColorGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_REMOVE_FRONT_INSET_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_REMOVE_FRONT_INSET_get")] public static extern int RemoveFrontInsetGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_REMOVE_BACK_INSET_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_REMOVE_BACK_INSET_get")] public static extern int RemoveBackInsetGet(); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_CUTOUT_get")] + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_CUTOUT_get")] public static extern int CutoutGet(); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_RENDER_MODE_get")] + public static extern int RenderModeGet(); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_MANUAL_RENDERED_get")] + public static extern int ManualRenderedGet(); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_ASYNC_LINE_COUNT_get")] + public static extern int AsyncLineCountGet(); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithFixedSize")] + public static extern void RequestAsyncRenderWithFixedSize(HandleRef textLabelRef, float width, float height); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithFixedWidth")] + public static extern void RequestAsyncRenderWithFixedWidth(HandleRef textLabelRef, float width, float heightConstraint); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithConstraint")] + public static extern void RequestAsyncRenderWithConstraint(HandleRef textLabelRef, float widthConstraint, float heightConstraint); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncNaturalSize")] + public static extern void RequestAsyncNaturalSize(HandleRef textLabelRef); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncHeightForWidth")] + public static extern void RequestAsyncHeightForWidth(HandleRef textLabelRef, float width); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncTextRenderedSignal_Connect")] + public static extern void AsyncTextRenderedConnect(HandleRef textLabelRef, HandleRef handler); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncTextRenderedSignal_Disconnect")] + public static extern void AsyncTextRenderedDisconnect(HandleRef textLabelRef, HandleRef handler); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncNaturalSizeComputedSignal_Connect")] + public static extern void AsyncNaturalSizeComputedConnect(HandleRef textLabelRef, HandleRef handler); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncNaturalSizeComputedSignal_Disconnect")] + public static extern void AsyncNaturalSizeComputedDisconnect(HandleRef textLabelRef, HandleRef handler); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncHeightForWidthComputedSignal_Connect")] + public static extern void AsyncHeightForWidthComputedConnect(HandleRef textLabelRef, HandleRef handler); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncHeightForWidthComputedSignal_Disconnect")] + public static extern void AsyncHeightForWidthComputedDisconnect(HandleRef textLabelRef, HandleRef handler); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.View.cs b/src/Tizen.NUI/src/internal/Interop/Interop.View.cs index 42d62003066..37833458039 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.View.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.View.cs @@ -51,6 +51,12 @@ internal static partial class View [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_ClearBackground")] public static extern void ClearBackground(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_SetRenderEffect")] + public static extern void SetRenderEffect(global::System.Runtime.InteropServices.HandleRef self, global::System.Runtime.InteropServices.HandleRef effectRef); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_ClearRenderEffect")] + public static extern void ClearRenderEffect(global::System.Runtime.InteropServices.HandleRef self); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_View__SWIG_2")] public static extern global::System.IntPtr NewViewInternal(global::System.Runtime.InteropServices.HandleRef jarg1); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ViewImpl.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ViewImpl.cs index cd6b3609f84..04550691a0e 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ViewImpl.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ViewImpl.cs @@ -85,9 +85,6 @@ internal static partial class ViewImpl [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool IsKeyboardFocusGroup(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_AccessibilityActivate")] - public static extern void AccessibilityActivate(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_KeyboardEnter")] public static extern void KeyboardEnter(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -150,8 +147,6 @@ public static extern void DirectorConnect(global::System.Runtime.InteropServices Tizen.NUI.ViewImpl.SwigDelegateViewImpl_18 delegate18, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_19 delegate19, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_20 delegate20, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_21 delegate21, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_24 delegate24, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_25 delegate25, - Tizen.NUI.ViewImpl.SwigDelegateViewImpl_26 delegate26, - Tizen.NUI.ViewImpl.SwigDelegateViewImpl_28 delegate28, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_29 delegate29, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_30 delegate30, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_31 delegate31, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_32 delegate32, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_33 delegate33, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_34 delegate34, Tizen.NUI.ViewImpl.SwigDelegateViewImpl_35 delegate35, diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ViewImplSignal.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ViewImplSignal.cs index 2661f0014f7..3e36415c969 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ViewImplSignal.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ViewImplSignal.cs @@ -115,30 +115,6 @@ internal static partial class ViewImplSignal [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool OnAccessibilityActivatedSwigExplicitViewImpl(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_OnAccessibilityPan")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool OnAccessibilityPan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_OnAccessibilityPanSwigExplicitViewImpl")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool OnAccessibilityPanSwigExplicitViewImpl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_OnAccessibilityValueChange")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool OnAccessibilityValueChange(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_OnAccessibilityValueChangeSwigExplicitViewImpl")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool OnAccessibilityValueChangeSwigExplicitViewImpl(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_OnAccessibilityZoom")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool OnAccessibilityZoom(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_OnAccessibilityZoomSwigExplicitViewImpl")] - [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] - public static extern bool OnAccessibilityZoomSwigExplicitViewImpl(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ViewImpl_OnKeyInputFocusGained")] public static extern void OnKeyInputFocusGained(global::System.Runtime.InteropServices.HandleRef jarg1); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ViewWrapperImpl.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ViewWrapperImpl.cs index 047086318e1..68a7da130dd 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.ViewWrapperImpl.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.ViewWrapperImpl.cs @@ -44,8 +44,6 @@ public static extern void DirectorConnect(global::System.Runtime.InteropServices Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_18 delegate18, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_19 delegate19, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_20 delegate20, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_21 delegate21, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_24 delegate24, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_25 delegate25, - Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_26 delegate26, - Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_28 delegate28, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_29 delegate29, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_30 delegate30, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_31 delegate31, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_32 delegate32, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_33 delegate33, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_34 delegate34, Tizen.NUI.ViewWrapperImpl.DelegateViewWrapperImpl_35 delegate35, diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs b/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs index 988953bf5b7..3db470b1879 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs @@ -31,6 +31,10 @@ internal static partial class VisualFactory [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualFactory_CreateVisual__SWIG_0")] public static extern global::System.IntPtr CreateVisual(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualFactory_AddPrecompileShader")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool AddPrecompileShader(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualFactory_UsePreCompiledShader")] public static extern void UsePreCompiledShader(global::System.Runtime.InteropServices.HandleRef jarg1); } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WebCertificate.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WebCertificate.cs index b92c22bdf71..23e3965db12 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.WebCertificate.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.WebCertificate.cs @@ -37,6 +37,13 @@ internal static partial class WebCertificate [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebCertificate_IsContextSecure")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool IsContextSecure(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebCertificate_GetPolicyDecisionError")] + public static extern int GetPolicyDecisionError(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebCertificate_SuspendPolicyDecision")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool SuspendPolicyDecision(global::System.Runtime.InteropServices.HandleRef jarg1); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WebSettings.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WebSettings.cs index b1013763d2c..6599ead1636 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.WebSettings.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.WebSettings.cs @@ -175,6 +175,12 @@ internal static partial class WebSettings [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool IsTextZoomEnabled(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebSettings_SetImeStyle")] + public static extern void SetImeStyle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebSettings_GetImeStyle")] + public static extern int GetImeStyle(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebSettings_SetExtraFeature")] public static extern void SetExtraFeature(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, bool jarg3); diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WebUserMediaPermissionRequest.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WebUserMediaPermissionRequest.cs new file mode 100755 index 00000000000..93b1d93658b --- /dev/null +++ b/src/Tizen.NUI/src/internal/Interop/Interop.WebUserMediaPermissionRequest.cs @@ -0,0 +1,36 @@ +/* + * Copyright(c) 2024 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. + * + */ + +namespace Tizen.NUI +{ + internal static partial class Interop + { + internal static partial class WebUserMediaPermissionRequest + { + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_UserMediaPermissionRequest")] + public static extern void Delete(global::System.Runtime.InteropServices.HandleRef webPermission); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_UserMediaPermissionRequest_Set")] + public static extern void Set(global::System.Runtime.InteropServices.HandleRef webPermission, bool allowed); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_UserMediaPermissionRequest_Suspend")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool Suspend(global::System.Runtime.InteropServices.HandleRef webPermission); + } + } +} + diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs index 01c7d107672..110f9913931 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.WebView.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * Copyright(c) 2024 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. @@ -32,6 +32,9 @@ internal static partial class WebView [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_New_3")] public static extern global::System.IntPtr New3(int jarg1, string[] jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_New_4")] + public static extern global::System.IntPtr New4(int argc, string[] argv, int type); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_GetContext")] public static extern global::System.IntPtr GetWebContext(); @@ -150,6 +153,9 @@ internal static partial class WebView [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ResumeNetworkLoading")] public static extern void ResumeNetworkLoading(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ChangeOrientation")] + public static extern void ChangeOrientation(global::System.Runtime.InteropServices.HandleRef jarg1, int orientation); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_AddCustomHeader")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool AddCustomHeader(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3); @@ -165,6 +171,13 @@ internal static partial class WebView [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool StopInspectorServer(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_SetImePositionAndAlignment")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool SetImePositionAndAlignment(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_SetCursorThemeName")] + public static extern void SetCursorThemeName(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ScrollBy")] public static extern void ScrollBy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3); @@ -192,6 +205,9 @@ internal static partial class WebView [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_AddJavaScriptMessageHandler")] public static extern void AddJavaScriptMessageHandler(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_AddJavaScriptEntireMessageHandler")] + public static extern void AddJavaScriptEntireMessageHandler(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterJavaScriptAlertCallback")] public static extern void RegisterJavaScriptAlertCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); @@ -216,6 +232,9 @@ internal static partial class WebView [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ClearHistory")] public static extern void ClearHistory(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_ExitFullscreen")] + public static extern void ExitFullscreen(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_SetScaleFactor")] public static extern void SetScaleFactor(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); @@ -292,6 +311,9 @@ internal static partial class WebView [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterNavigationPolicyDecidedCallback")] public static extern void RegisterNavigationPolicyDecidedCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterNewWindowPolicyDecidedCallback")] + public static extern void RegisterNewWindowPolicyDecidedCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterNewWindowCreatedCallback")] public static extern void RegisterNewWindowCreatedCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); @@ -310,8 +332,29 @@ internal static partial class WebView [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterContextMenuHiddenCallback")] public static extern void RegisterContextMenuHiddenCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterFullscreenEnteredCallback")] + public static extern void RegisterFullscreenEnteredCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterFullscreenExitedCallback")] + public static extern void RegisterFullscreenExitedCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterTextFoundCallback")] + public static extern void RegisterTextFoundCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_GetPlainTextAsynchronously")] public static extern void GetPlainTextAsynchronously(global::System.Runtime.InteropServices.HandleRef webViewRef, global::System.Runtime.InteropServices.HandleRef callbackRef); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_WebAuthenticationCancel")] + public static extern void WebAuthenticationCancel(global::System.Runtime.InteropServices.HandleRef webViewRef); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterWebAuthDisplayQRCallback")] + public static extern void RegisterWebAuthDisplayQRCallback(global::System.Runtime.InteropServices.HandleRef webViewRef, global::System.Runtime.InteropServices.HandleRef callbackRef); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterWebAuthResponseCallback")] + public static extern void RegisterWebAuthResponseCallback(global::System.Runtime.InteropServices.HandleRef webViewRef, global::System.Runtime.InteropServices.HandleRef callbackRef); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebView_RegisterUserMediaPermissionRequestCallback")] + public static extern void RegisterUserMediaPermissionRequestCallback(global::System.Runtime.InteropServices.HandleRef webViewRef, global::System.Runtime.InteropServices.HandleRef callbackRef); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs index 22c0a8c7c88..9caff4253d3 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs @@ -323,6 +323,9 @@ internal static partial class Window [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InternalRetrievingLastHoverEvent")] public static extern void InternalRetrievingLastHoverEvent(global::System.Runtime.InteropServices.HandleRef window, global::System.Runtime.InteropServices.HandleRef hover); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InternalRetrievingLastPanGestureState")] + public static extern int InternalRetrievingLastPanGestureState(global::System.Runtime.InteropServices.HandleRef window); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetNeedsRotationCompletedAcknowledgement")] public static extern void SetNeedsRotationCompletedAcknowledgement(global::System.Runtime.InteropServices.HandleRef window, bool needAcknowledgement); @@ -381,6 +384,27 @@ internal static partial class Window [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_IsAlwaysOnTop")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool IsAlwaysOnTop(global::System.Runtime.InteropServices.HandleRef window); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetBottom")] + public static extern void SetBottom(global::System.Runtime.InteropServices.HandleRef window, bool enable); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_IsBottom")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool IsBottom(global::System.Runtime.InteropServices.HandleRef window); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_RelativeMotionGrab")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool RelativeMotionGrab(global::System.Runtime.InteropServices.HandleRef window, uint boundary); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_RelativeMotionUnGrab")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool RelativeMotionUnGrab(global::System.Runtime.InteropServices.HandleRef window); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetBlur")] + public static extern void SetBlur(global::System.Runtime.InteropServices.HandleRef window, global::System.IntPtr blurInfo); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetBlur")] + public static extern global::System.IntPtr GetBlur(global::System.Runtime.InteropServices.HandleRef window); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WindowBlurInfo.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WindowBlurInfo.cs new file mode 100644 index 00000000000..6114c1216e5 --- /dev/null +++ b/src/Tizen.NUI/src/internal/Interop/Interop.WindowBlurInfo.cs @@ -0,0 +1,61 @@ +/* + * Copyright(c) 2024 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.Runtime.InteropServices; + +namespace Tizen.NUI +{ + internal static partial class Interop + { + internal static partial class WindowBlurInfo + { + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_WindowBlurInfo")] + public static extern global::System.IntPtr New(); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_WindowBlurInfo_SWIG_0")] + public static extern global::System.IntPtr New(int nuiBlurType, int nuiBlurRadius, int nuiCornerRadius); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_WindowBlurInfo_SWIG_1")] + public static extern global::System.IntPtr New(int nuiBlurType, int nuiBlurRadius); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_WindowBlurInfo")] + public static extern void DeleteWindowBlurInfo(global::System.IntPtr nuiWindowBlurInfo); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowBlurInfo_EqualTo")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool EqualTo(global::System.IntPtr nuiWindowBlurInfo1, global::System.IntPtr nuiWindowBlurInfo2); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowBlurInfo_SetBlurType")] + public static extern void SetBlurType(global::System.IntPtr nuiWindowBlurInfo, int nuiWindowBlurType); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowBlurInfo_GetBlurType")] + public static extern int GetBlurType(global::System.IntPtr nuiWindowBlurInfo); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowBlurInfo_SetBlurRadius")] + public static extern void SetBlurRadius(global::System.IntPtr nuiWindowBlurInfo, int nuiWindowBlurRadius); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowBlurInfo_GetBlurRadius")] + public static extern int GetBlurRadius(global::System.IntPtr nuiWindowBlurInfo); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowBlurInfo_SetBackgroundCornerRadius")] + public static extern void SetBackgroundCornerRadius(global::System.IntPtr nuiWindowBlurInfo, int nuiCornerRadius); + + [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowBlurInfo_GetBackgroundCornerRadius")] + public static extern int GetBackgroundCornerRadius(global::System.IntPtr nuiWindowBlurInfo); + } + } +} diff --git a/src/Tizen.NUI/src/internal/NativeBinding/SWIGTYPE_p_Dali__SignalT_bool_fDali__Toolkit__AccessibilityManager_R_Dali__TouchEvent_const_RF_t.cs b/src/Tizen.NUI/src/internal/NativeBinding/SWIGTYPE_p_Dali__SignalT_bool_fDali__Toolkit__AccessibilityManager_R_Dali__TouchEvent_const_RF_t.cs deleted file mode 100755 index b926a90de82..00000000000 --- a/src/Tizen.NUI/src/internal/NativeBinding/SWIGTYPE_p_Dali__SignalT_bool_fDali__Toolkit__AccessibilityManager_R_Dali__TouchEvent_const_RF_t.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// -// This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.9 -// -// Do not make changes to this file unless you know what you are doing--modify -// the SWIG interface file instead. -//------------------------------------------------------------------------------ - -namespace Tizen.NUI -{ - internal class SWIGTYPE_p_Dali__SignalT_bool_fDali__Toolkit__AccessibilityManager_R_Dali__TouchEvent_const_RF_t - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal SWIGTYPE_p_Dali__SignalT_bool_fDali__Toolkit__AccessibilityManager_R_Dali__TouchEvent_const_RF_t(global::System.IntPtr cPtr) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - protected SWIGTYPE_p_Dali__SignalT_bool_fDali__Toolkit__AccessibilityManager_R_Dali__TouchEvent_const_RF_t() - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Utility/Builder.cs b/src/Tizen.NUI/src/internal/Utility/Builder.cs index e31516aa9f7..9adb676daf3 100755 --- a/src/Tizen.NUI/src/internal/Utility/Builder.cs +++ b/src/Tizen.NUI/src/internal/Utility/Builder.cs @@ -51,21 +51,27 @@ public event DaliEventHandler Quit if (builderQuitEventHandler == null) { builderQuitEventHandler += value; - builderQuitEventCallbackDelegate = new QuitEventCallbackDelegate(OnQuit); quitSignal = this.QuitSignal(); quitSignal?.Connect(builderQuitEventCallbackDelegate); } + else + { + Tizen.Log.Error("NUI", "[Builder.Quit] Only one listener is allowed\n"); + } } remove { if (builderQuitEventHandler != null) { - quitSignal?.Disconnect(builderQuitEventCallbackDelegate); + builderQuitEventHandler -= value; + if (builderQuitEventHandler == null) + { + quitSignal?.Disconnect(builderQuitEventCallbackDelegate); + builderQuitEventCallbackDelegate = null; + } } - - builderQuitEventHandler -= value; } } diff --git a/src/Tizen.NUI/src/internal/Utility/EnvironmentVariable.cs b/src/Tizen.NUI/src/internal/Utility/EnvironmentVariable.cs index 017d6dfdad0..5fdee022697 100755 --- a/src/Tizen.NUI/src/internal/Utility/EnvironmentVariable.cs +++ b/src/Tizen.NUI/src/internal/Utility/EnvironmentVariable.cs @@ -29,6 +29,7 @@ static public class EnvironmentVariable private static extern string EnvironmentVariable_GetEnvironmentVariable(string jarg1); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_SetEnvironmentVariable")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] private static extern bool EnvironmentVariable_SetEnvironmentVariable(string jarg1, string jarg2); /// diff --git a/src/Tizen.NUI/src/internal/Utility/GaussianBlurView.cs b/src/Tizen.NUI/src/internal/Utility/GaussianBlurView.cs index dc5f12ee030..c0cae03915c 100755 --- a/src/Tizen.NUI/src/internal/Utility/GaussianBlurView.cs +++ b/src/Tizen.NUI/src/internal/Utility/GaussianBlurView.cs @@ -109,12 +109,12 @@ public event DaliEventHandler Finished { add { - // Restricted to only one listener if (finishedEventHandler == null) { finishedCallback = new FinishedCallbackType(OnFinished); FinishedSignal().Connect(finishedCallback); } + finishedEventHandler += value; } @@ -122,9 +122,10 @@ public event DaliEventHandler Finished { finishedEventHandler -= value; - if (finishedEventHandler == null && FinishedSignal().Empty() == false) + if (finishedEventHandler == null && finishedCallback != null) { FinishedSignal().Disconnect(finishedCallback); + finishedCallback = null; } } } diff --git a/src/Tizen.NUI/src/internal/WebView/WebCertificate.cs b/src/Tizen.NUI/src/internal/WebView/WebCertificate.cs index 77670409b7e..06451a371fc 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebCertificate.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebCertificate.cs @@ -90,5 +90,51 @@ public void Allow(bool allowed) Interop.WebCertificate.Allow(SwigCPtr, allowed); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + + /// + /// Get certificate policy decision error. + /// + /// PolicyDecisionErrorType + [EditorBrowsable(EditorBrowsableState.Never)] + public PolicyDecisionErrorType PolicyDecisionError + { + get + { + int result = Interop.WebCertificate.GetPolicyDecisionError(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) return PolicyDecisionErrorType.Unknown; + return (PolicyDecisionErrorType)result; + } + } + + /// + /// Suspend certification policy decision. + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Suspend() + { + bool ret = Interop.WebCertificate.SuspendPolicyDecision(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public enum PolicyDecisionErrorType + { + CommonNameInvalid, //The server responded with a certificate whose common name did not match the host name. + DateInvalid, //The server responded with a certificate that by our clock, appears to either not yet be valid or to have expired. + AuthorityInvalid, // The server responded with a certificate that is signed by an authority we don't trust. + NoRevocationMechanism, // The certificate has no mechanism for determining if it is revoked. In effect, this certificate cannot be revoked. + UnableToCheckRevocation, // Revocation information for the security certificate for this site is not available. + Revoked, // The server responded with a certificate that has been revoked. + Invalid, // The server responded with a certificate that is invalid. + WeakAlgorithm, // The server responded with a certificate that is signed using a weak signature algorithm. + NonUniqueName, // The host name specified in the certificate is not unique. + WeakKey, // The server responded with a certificate that contains a weak key (e.g. a too-small RSA key). + PinnedKeyNotInChain, // The certificate didn't match the public key pins for the host name. + NameViolation, // The certificate claimed DNS names that are in violation of name constraints. + ValidityTooLong, // The certificate's validity period is too long. + Unknown = 1000 // Reported in case of wrong usage of ewk_certificate_policy_decision_error_get API. + } } } diff --git a/src/Tizen.NUI/src/internal/WebView/WebContext.cs b/src/Tizen.NUI/src/internal/WebView/WebContext.cs index c8bad400905..9a4469c7122 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebContext.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebContext.cs @@ -40,6 +40,8 @@ public class WebContext : Disposable private readonly WebContextPasswordDataListAcquiredProxyCallback passwordDataListAcquiredProxyCallback; private HttpRequestInterceptedCallback httpRequestInterceptedCallback; private readonly WebContextHttpRequestInterceptedProxyCallback httpRequestInterceptedProxyCallback; + private DownloadStartedCallback downloadStartedCallback; + private MimeOverriddenCallback mimeOverriddenCallback; internal WebContext(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { @@ -518,10 +520,11 @@ public void GetFormPasswordList(PasswordDataListAcquiredCallback callback) [EditorBrowsable(EditorBrowsableState.Never)] public void RegisterDownloadStartedCallback(DownloadStartedCallback callback) { + downloadStartedCallback = callback; IntPtr ip = IntPtr.Zero; - if (callback != null) + if (downloadStartedCallback != null) { - ip = Marshal.GetFunctionPointerForDelegate(callback); + ip = Marshal.GetFunctionPointerForDelegate(downloadStartedCallback); } Interop.WebContext.RegisterDownloadStartedCallback(SwigCPtr, new HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -534,10 +537,11 @@ public void RegisterDownloadStartedCallback(DownloadStartedCallback callback) [EditorBrowsable(EditorBrowsableState.Never)] public void RegisterMimeOverriddenCallback(MimeOverriddenCallback callback) { + mimeOverriddenCallback = callback; IntPtr ip = IntPtr.Zero; - if (callback != null) + if (mimeOverriddenCallback != null) { - ip = Marshal.GetFunctionPointerForDelegate(callback); + ip = Marshal.GetFunctionPointerForDelegate(mimeOverriddenCallback); } Interop.WebContext.RegisterMimeOverriddenCallback(SwigCPtr, new HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/WebView/WebSettings.cs b/src/Tizen.NUI/src/internal/WebView/WebSettings.cs index 96fc1526d63..b9eceb11289 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebSettings.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebSettings.cs @@ -39,6 +39,31 @@ internal WebSettings(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, c { } + /// + /// Enumeration for style of IME. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum WebImeStyle + { + /// + /// Full IME style + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Full = 0, + + /// + /// Floating IME style + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Floating, + + /// + /// Dynamic IME style + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Dynamic, + } + /// /// Allows mixed contents or not. /// @@ -506,6 +531,23 @@ public bool TextZoomEnabled } } + /// + /// The style of IME. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public WebImeStyle ImeStyle + { + get + { + return (WebImeStyle)Interop.WebSettings.GetImeStyle(SwigCPtr); + } + set + { + Interop.WebSettings.SetImeStyle(SwigCPtr, (int)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + /// /// Enables the given extra feature. /// diff --git a/src/Tizen.NUI/src/internal/WebView/WebUserMediaPermissionRequest.cs b/src/Tizen.NUI/src/internal/WebView/WebUserMediaPermissionRequest.cs new file mode 100755 index 00000000000..16b01c317e6 --- /dev/null +++ b/src/Tizen.NUI/src/internal/WebView/WebUserMediaPermissionRequest.cs @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 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.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// WebUserMediaPermissionRequest. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class WebUserMediaPermissionRequest : Disposable + { + internal WebUserMediaPermissionRequest(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + /// This will not be public opened. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.WebUserMediaPermissionRequest.Delete(swigCPtr); + } + + /// + /// Set allowed. + /// + /// Allowed or not + [EditorBrowsable(EditorBrowsableState.Never)] + public void Set(bool allowed) + { + Interop.WebUserMediaPermissionRequest.Set(SwigCPtr, allowed); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Suspend. + /// + /// true for done, otherwise, false + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Suspend() + { + bool ret = Interop.WebUserMediaPermissionRequest.Suspend(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } +} diff --git a/src/Tizen.NUI/src/internal/WebView/WebViewPolicyDecidedEventArgs.cs b/src/Tizen.NUI/src/internal/WebView/WebViewPolicyDecidedEventArgs.cs index 43e719b6925..43ed244e34a 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebViewPolicyDecidedEventArgs.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebViewPolicyDecidedEventArgs.cs @@ -21,20 +21,33 @@ namespace Tizen.NUI { /// - /// Event arguments that passed via the WebView.ResponsePolicyDecided. + /// Event arguments that passed via the WebView.ResponsePolicyDecided, + /// WebView.NavigationPolicyDecided or WebView.NewWindowPolicyDecided. /// [EditorBrowsable(EditorBrowsableState.Never)] public class WebViewPolicyDecidedEventArgs : EventArgs { internal WebViewPolicyDecidedEventArgs(WebPolicyDecisionMaker maker) { - ResponsePolicyDecisionMaker = maker; + PolicyDecisionMaker = maker; } /// - /// The response policy decision maker. + /// Deprecated. The response policy decision maker. /// [EditorBrowsable(EditorBrowsableState.Never)] - public WebPolicyDecisionMaker ResponsePolicyDecisionMaker { get; } + public WebPolicyDecisionMaker ResponsePolicyDecisionMaker + { + get + { + return PolicyDecisionMaker; + } + } + + /// + /// The policy decision maker. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public WebPolicyDecisionMaker PolicyDecisionMaker { get; } } } diff --git a/src/Tizen.AIAvatar/src/Multimedia/Audio/RecordBufferChangedEventArgs.cs b/src/Tizen.NUI/src/internal/WebView/WebViewTextFoundEventArgs.cs old mode 100644 new mode 100755 similarity index 52% rename from src/Tizen.AIAvatar/src/Multimedia/Audio/RecordBufferChangedEventArgs.cs rename to src/Tizen.NUI/src/internal/WebView/WebViewTextFoundEventArgs.cs index baf723d98bf..8c76f04f901 --- a/src/Tizen.AIAvatar/src/Multimedia/Audio/RecordBufferChangedEventArgs.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebViewTextFoundEventArgs.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -16,19 +16,25 @@ */ using System; +using System.ComponentModel; -namespace Tizen.AIAvatar +namespace Tizen.NUI { - internal class RecordBufferChangedEventArgs : EventArgs + /// + /// Event arguments that passed via the WebView.TextFound. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class WebViewTextFoundEventArgs : EventArgs { - public byte[] RecordedBuffer { get; set; } - public int SampleRate { get; set; } - - public RecordBufferChangedEventArgs(byte[] recordedBuffer, int SampleRate) + internal WebViewTextFoundEventArgs(uint count) { - this.RecordedBuffer = recordedBuffer; - this.SampleRate = SampleRate; + Count = count; } - } + /// + /// The count of text found. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint Count { get; } + } } diff --git a/src/Tizen.NUI/src/internal/WebView/WebViewUserMediaPermissionRequestEventArgs.cs b/src/Tizen.NUI/src/internal/WebView/WebViewUserMediaPermissionRequestEventArgs.cs new file mode 100755 index 00000000000..788cdf4a2be --- /dev/null +++ b/src/Tizen.NUI/src/internal/WebView/WebViewUserMediaPermissionRequestEventArgs.cs @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 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.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Event arguments that WebViewUserMediaPermissionRequest. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class WebViewUserMediaPermissionRequestEventArgs : EventArgs + { + internal WebViewUserMediaPermissionRequestEventArgs(WebUserMediaPermissionRequest permission, string message) + { + UserMediaPermissionRequest = permission; + Message = message; + } + + /// + /// Gets UserMediaPermissionRequest. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public WebUserMediaPermissionRequest UserMediaPermissionRequest { get; } + + /// + /// Gets Message. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Message { get; } + + } +} diff --git a/src/Tizen.NUI/src/internal/WebView/WebViewWebAuthDisplayQREventArgs.cs b/src/Tizen.NUI/src/internal/WebView/WebViewWebAuthDisplayQREventArgs.cs new file mode 100755 index 00000000000..4e7507b08ae --- /dev/null +++ b/src/Tizen.NUI/src/internal/WebView/WebViewWebAuthDisplayQREventArgs.cs @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 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.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// Event arguments that passed via the WebView.WebAuthDisplayQR. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class WebViewWebAuthDisplayQREventArgs : EventArgs + { + internal WebViewWebAuthDisplayQREventArgs(string contents) + { + Contents = contents; + } + + /// + /// The string contents to make QR code image in user side. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string Contents { get; } + } +} diff --git a/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs b/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs index d86a9d27262..2fe5a1e341b 100755 --- a/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs +++ b/src/Tizen.NUI/src/public/Accessibility/Accessibility.cs @@ -25,11 +25,11 @@ namespace Tizen.NUI.Accessibility { /// - /// Accessibility provides Dali-ATSPI interface which has functionality of Screen-Reader and general accessibility + /// Accessibility provides Dali-ATSPI interface which has functionality of Screen-Reader and general accessibility. /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [SuppressMessage("Microsoft.Design", "CA1724: Type names should not match namespaces")] - [SuppressMessage("Microsoft.Design", "CA1001:Types that own disposable fields should be disposable", Justification = "This is a singleton class and is not disposed")] + [SuppressMessage("Microsoft.Design", "CA1001: Types that own disposable fields should be disposable", Justification = "This is a singleton class and is not disposed")] [EditorBrowsable(EditorBrowsableState.Never)] public static class Accessibility { @@ -99,10 +99,10 @@ public static bool IsScreenReaderEnabled #region Method /// - /// Start to speak + /// Start to speak. /// - /// Content to be spoken - /// true to be stopped and discarded when other Say is triggered + /// Content to be spoken. + /// true to be stopped and discarded when other Say is triggered. /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] @@ -113,9 +113,9 @@ public static void Say(string sentence, bool discardable) } /// - /// To make Say be paused or resumed + /// To make Say be paused or resumed. /// - /// true to be paused, false to be resumed + /// true to be paused, false to be resumed. // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] public static void PauseResume(bool pause) @@ -125,9 +125,9 @@ public static void PauseResume(bool pause) } /// - /// Cancels anything screen-reader is reading / has queued to read + /// Cancels anything screen-reader is reading / has queued to read. /// - /// whether to cancel non-discardable readings as well + /// whether to cancel non-discardable readings as well. // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] public static void StopReading(bool alsoNonDiscardable) @@ -137,9 +137,9 @@ public static void StopReading(bool alsoNonDiscardable) } /// - /// Suppress reading of screen-reader + /// Suppress reading of screen-reader. /// - /// whether to suppress reading of screen-reader + /// whether to suppress reading of screen-reader. // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] public static bool SuppressScreenReader(bool suppress) @@ -150,7 +150,7 @@ public static bool SuppressScreenReader(bool suppress) } /// - /// Re-enables auto-initialization of AT-SPI bridge + /// Re-enables auto-initialization of AT-SPI bridge. /// /// /// Normal applications do not have to call this function. The AT-SPI bridge is initialized on demand. @@ -163,7 +163,7 @@ public static void BridgeEnableAutoInit() } /// - /// Blocks auto-initialization of AT-SPI bridge + /// Blocks auto-initialization of AT-SPI bridge. /// /// /// Use this only if your application starts before DBus does, and call it early in Main(). @@ -204,6 +204,7 @@ public static void SetHighlightFrameView(View view) /// /// Get highligted View. /// + /// The currently highlighted view. // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] public static View GetCurrentlyHighlightedView() @@ -218,6 +219,7 @@ public static View GetCurrentlyHighlightedView() /// /// Clear highlight. /// + /// true if the highlight was cleared successfully, otherwise false. // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] public static bool ClearCurrentlyHighlightedView() @@ -243,30 +245,35 @@ public enum SayFinishedState // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] Invalid = -1, + /// /// Cancelled /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] Cancelled = 1, + /// /// Stopped /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] Stopped = 2, + /// /// Skipped /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] Skipped = 3, + /// /// Paused /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] Paused = 4, + /// /// Resumed /// diff --git a/src/Tizen.NUI/src/public/Accessibility/AccessibilityManager.cs b/src/Tizen.NUI/src/public/Accessibility/AccessibilityManager.cs deleted file mode 100755 index c4eb2a905f9..00000000000 --- a/src/Tizen.NUI/src/public/Accessibility/AccessibilityManager.cs +++ /dev/null @@ -1,945 +0,0 @@ -/* - * Copyright(c) 2021 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.ComponentModel; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI.Accessibility -{ - /// - /// AccessibilityManager manages registration of views in an accessibility focus chain and changing the focused view within that chain. - /// This class provides the functionality of registering the focus order and description of views and maintaining the focus chain. - /// It provides functionality of setting the focus and moving the focus forward and backward. - /// It also draws a highlight for the focused view and emits a signal when the focus is changed. - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public partial class AccessibilityManager : BaseHandle - { - private static readonly AccessibilityManager instance = AccessibilityManager.GetInternal(); - - internal AccessibilityManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) - { - } - - /// This will not be public opened. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) - { - Interop.AccessibilityManager.DeleteAccessibilityManager(swigCPtr); - } - - // Callback for AccessibilityManager StatusChangedSignal - private bool OnStatusChanged(IntPtr data) - { - return accessibilityManagerStatusChangedEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionNextSignal - private bool OnActionNext(IntPtr data) - { - return accessibilityManagerActionNextEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionPreviousSignal - private bool OnActionPrevious(IntPtr data) - { - return accessibilityManagerActionPreviousEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionActivateSignal - private bool OnActionActivate(IntPtr data) - { - return accessibilityManagerActionActivateEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionReadSignal - private bool OnActionRead(IntPtr data) - { - return accessibilityManagerActionReadEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionOverSignal - private bool OnActionOver(IntPtr data) - { - return accessibilityManagerActionOverEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionReadNextSignal - private bool OnActionReadNext(IntPtr data) - { - return accessibilityManagerActionReadNextEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionReadPreviousSignal - private bool OnActionReadPrevious(IntPtr data) - { - return accessibilityManagerActionReadPreviousEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionUpSignal - private bool OnActionUp(IntPtr data) - { - return accessibilityManagerActionUpEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionDownSignal - private bool OnActionDown(IntPtr data) - { - return accessibilityManagerActionDownEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionClearFocusSignal - private bool OnActionClearFocus(IntPtr data) - { - return accessibilityManagerActionClearFocusEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionBackSignal - private bool OnActionBack(IntPtr data) - { - return accessibilityManagerActionBackEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionScrollUpSignal - private bool OnActionScrollUp(IntPtr data) - { - return accessibilityManagerActionScrollUpEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionScrollDownSignal - private bool OnActionScrollDown(IntPtr data) - { - return accessibilityManagerActionScrollDownEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionPageLeftSignal - private bool OnActionPageLeft(IntPtr data) - { - return accessibilityManagerActionPageLeftEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionPageRightSignal - private bool OnActionPageRight(IntPtr data) - { - return accessibilityManagerActionPageRightEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionPageUpSignal - private bool OnActionPageUp(IntPtr data) - { - return accessibilityManagerActionPageUpEventHandler?.Invoke(instance, null) ?? false; - } - - - // Callback for AccessibilityManager ActionPageDownSignal - private bool OnActionPageDown(IntPtr data) - { - return accessibilityManagerActionPageDownEventHandler?.Invoke(instance, null) ?? false; - } - - - // Callback for AccessibilityManager ActionMoveToFirstSignal - private bool OnActionMoveToFirst(IntPtr data) - { - return accessibilityManagerActionMoveToFirstEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionMoveToLastSignal - private bool OnActionMoveToLast(IntPtr data) - { - return accessibilityManagerActionMoveToLastEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionReadFromTopSignal - private bool OnActionReadFromTop(IntPtr data) - { - return accessibilityManagerActionReadFromTopEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionReadFromNextSignal - private bool OnActionReadFromNext(IntPtr data) - { - return accessibilityManagerActionReadFromNextEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionZoomSignal - private bool OnActionZoom(IntPtr data) - { - return accessibilityManagerActionZoomEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionReadPauseResumeSignal - private bool OnActionReadPauseResume(IntPtr data) - { - return accessibilityManagerActionReadPauseResumeEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager ActionStartStopSignal - private bool OnActionStartStop(IntPtr data) - { - return accessibilityManagerActionStartStopEventHandler?.Invoke(instance, null) ?? false; - } - - // Callback for AccessibilityManager FocusChangedSignal - private void OnFocusChanged(IntPtr view1, IntPtr view2) - { - if (accessibilityManagerFocusChangedEventHandler != null) - { - FocusChangedEventArgs e = new FocusChangedEventArgs(); - - // Populate all members of "e" (FocusChangedEventArgs) with real data - e.ViewCurrent = Registry.GetManagedBaseHandleFromNativePtr(view1) as View; - e.ViewNext = Registry.GetManagedBaseHandleFromNativePtr(view2) as View; - //here we send all data to user event handlers - accessibilityManagerFocusChangedEventHandler(this, e); - } - } - - // Callback for AccessibilityManager FocusedViewActivatedSignal - private void OnFocusedViewActivated(IntPtr view) - { - if (accessibilityManagerFocusedViewActivatedEventHandler != null) - { - FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs(); - - // Populate all members of "e" (FocusedViewActivatedEventArgs) with real data - e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View; - //here we send all data to user event handlers - accessibilityManagerFocusedViewActivatedEventHandler(this, e); - } - } - - // Callback for AccessibilityManager FocusOvershotSignal - private void OnFocusOvershot(IntPtr currentFocusedView, AccessibilityManager.FocusOvershotDirection direction) - { - if (accessibilityManagerFocusOvershotEventHandler != null) - { - FocusOvershotEventArgs e = new FocusOvershotEventArgs(); - - // Populate all members of "e" (FocusOvershotEventArgs) with real data - e.CurrentFocusedView = Registry.GetManagedBaseHandleFromNativePtr(currentFocusedView) as View; - e.FocusOvershotDirection = direction; - //here we send all data to user event handlers - accessibilityManagerFocusOvershotEventHandler(this, e); - } - } - - /// - /// Enumeration for accessibility that needs four information which will be read by screen-reader. - /// - /// Reading order : Label -> Trait -> Optional (Value and Hint) - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public enum AccessibilityAttribute - { - /// - /// Simple text which contained in components, such as Ok or Cancel in case of a button - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Label = 0, - /// - /// Description of components trait, such as Button in case of a button - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Trait, - /// - /// Current value of components (Optional) - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Value, - /// - /// Hint for action (Optional) - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Hint, - /// - /// The number of attributes - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - AttributeNumber - } - - /// - /// Enumeration for overshoot direction. - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public enum FocusOvershotDirection - { - /// - /// Try to move previous of the first view - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Previous = -1, - /// - /// Try to move next of the last view - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Next = 1 - } - - - /// - /// Creates an AccessibilityManager handle. - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public AccessibilityManager() : this(Interop.AccessibilityManager.NewAccessibilityManager(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the singleton of AccessibilityManager object. - /// - /// A handle to the AccessibilityManager - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static AccessibilityManager Instance - { - get - { - return instance; - } - } - - /// - /// Sets the information of the specified view's accessibility attribute. - /// - /// The view to be set with - /// The attribute type the text to be set with - /// The text for the view's accessibility information - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetAccessibilityAttribute(View view, AccessibilityManager.AccessibilityAttribute type, string text) - { - Interop.AccessibilityManager.SetAccessibilityAttribute(SwigCPtr, View.getCPtr(view), (int)type, text); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the text of the specified view's accessibility attribute. - /// - /// The view to be queried - /// The attribute type to be queried - /// The text of the view's accessibility information - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public string GetAccessibilityAttribute(View view, AccessibilityManager.AccessibilityAttribute type) - { - string ret = Interop.AccessibilityManager.GetAccessibilityAttribute(SwigCPtr, View.getCPtr(view), (int)type); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets the focus order of the view. - /// The focus order of each view in the focus chain is unique. - /// If there is another view assigned with the same focus order already, the new view will be inserted to the focus chain with that focus order, - /// and the focus order of the original view and all the views followed in the focus chain will be increased accordingly. - /// If the focus order assigned to the view is 0, it means that view's focus order is undefined - /// (e.g. the view has a description but with no focus order being set yet) and therefore that view is not focusable. - /// - /// the view to be set with - /// the focus order to be set with - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetFocusOrder(View view, uint order) - { - Interop.AccessibilityManager.SetFocusOrder(SwigCPtr, View.getCPtr(view), order); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the focus order of the view. - /// When the focus order is 0, it means the focus order of the view is undefined. - /// - /// the view to be set with - /// The focus order of the view - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public uint GetFocusOrder(View view) - { - uint ret = Interop.AccessibilityManager.GetFocusOrder(SwigCPtr, View.getCPtr(view)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Generates a new focus order number which can be used to assign to views - /// which need to be appended to the end of the current focus order chain. - /// The new number will be an increment over the very last focus order number in the focus chain. - /// If the focus chain is empty then the function returns 1, - /// else the number returned will be FOLast + 1 where FOLast is the focus order of the very last control in the focus chain. - /// - /// The focus order of the view - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public uint GenerateNewFocusOrder() - { - uint ret = Interop.AccessibilityManager.GenerateNewFocusOrder(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets the view that has the specified focus order. - /// It will return an empty handle if no view in the window has the specified focus order. - /// - /// The focus order of the view - /// The view that has the specified focus order or an empty handle if no view in the stage has the specified focus order - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View GetViewByFocusOrder(uint order) - { - var ptr = Interop.AccessibilityManager.GetActorByFocusOrder(SwigCPtr, order); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return this.GetInstanceSafely(ptr); - } - - /// - /// Moves the focus to the specified view. - /// Only one view can be focused at the same time. The view must have a defined focus order - /// and must be focusable, visible and in the window. - /// - /// the view to be set with - /// Whether the focus is successful or not - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool SetCurrentFocusView(View view) - { - bool ret = Interop.AccessibilityManager.SetCurrentFocusActor(SwigCPtr, View.getCPtr(view)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets the current focused view. - /// - /// A handle to the current focused view or an empty handle if no view is focused - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View GetCurrentFocusView() - { - var ptr = Interop.AccessibilityManager.GetCurrentFocusActor(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return this.GetInstanceSafely(ptr); - } - - /// - /// Gets the focus group of current focused view. - /// - /// A handle to the immediate parent of the current focused view which is also a focus group, or an empty handle if no view is focused - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View GetCurrentFocusGroup() - { - var ptr = Interop.AccessibilityManager.GetCurrentFocusGroup(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return this.GetInstanceSafely(ptr); - } - - /// - /// Gets the focus order of currently focused view. - /// - /// The focus order of the currently focused view or 0 if no view is in focus - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public uint GetCurrentFocusOrder() - { - uint ret = Interop.AccessibilityManager.GetCurrentFocusOrder(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Moves the focus to the next focusable view in the focus chain (according to the focus traversal order). - /// When the focus movement is wrapped around, the focus will be moved to the first focusable view when it reaches the end of the focus chain. - /// - /// True if the moving was successful - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool MoveFocusForward() - { - bool ret = Interop.AccessibilityManager.MoveFocusForward(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Moves the focus to the previous focusable view in the focus chain (according to the focus traversal order). - /// When the focus movement is wrapped around, the focus will be moved to the last focusable view - /// when it reaches the beginning of the focus chain. - /// - /// True if the moving was successful - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool MoveFocusBackward() - { - bool ret = Interop.AccessibilityManager.MoveFocusBackward(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Clears the focus from the current focused view if any, so that no view is focused in the focus chain. - /// It will emit focus changed signal without current focused view. - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void ClearFocus() - { - Interop.AccessibilityManager.ClearFocus(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Clears every registered focusable view from focus-manager. - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public new void Reset() - { - Interop.AccessibilityManager.Reset(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Sets whether an view is a focus group that can limit the scope of focus movement to its child views in the focus chain. - /// - /// the view to be set as a focus group - /// Whether to set the view to be a focus group or not - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetFocusGroup(View view, bool isFocusGroup) - { - Interop.AccessibilityManager.SetFocusGroup(SwigCPtr, View.getCPtr(view), isFocusGroup); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Checks whether the view is set as a focus group or not. - /// - /// the view to be checked - /// Whether the view is set as a focus group - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool IsFocusGroup(View view) - { - bool ret = Interop.AccessibilityManager.IsFocusGroup(SwigCPtr, View.getCPtr(view)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets whether the group mode is enabled or not. - /// When the group mode is enabled, the focus movement will be limited to the child views of the current focus group including the current focus group itself. - /// The current focus group is the closest ancestor of the current focused view that is set as a focus group. - /// - /// Whether the group mode is enabled or not - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetGroupMode(bool enabled) - { - Interop.AccessibilityManager.SetGroupMode(SwigCPtr, enabled); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets whether the group mode is enabled or not. - /// - /// 6 - /// Whether the group mode is enabled or not. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool GetGroupMode() - { - bool ret = Interop.AccessibilityManager.GetGroupMode(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets whether focus will be moved to the beginning of the focus chain when it reaches the end or vice versa. - /// When both the wrap mode and the group mode are enabled, focus will be wrapped within the current focus group. - /// Focus will not be wrapped in default. - /// - /// Whether the focus movement is wrapped around or not - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetWrapMode(bool wrapped) - { - Interop.AccessibilityManager.SetWrapMode(SwigCPtr, wrapped); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets whether the wrap mode is enabled or not. - /// - /// Whether the wrap mode is enabled or not. - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool GetWrapMode() - { - bool ret = Interop.AccessibilityManager.GetWrapMode(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets the focus indicator view. - /// This will replace the default focus indicator view in AccessibilityManager and - /// will be added to the focused view as a highlight. - /// - /// The indicator view to be added - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetFocusIndicatorView(View indicator) - { - Interop.AccessibilityManager.SetFocusIndicatorActor(SwigCPtr, View.getCPtr(indicator)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the focus indicator view. - /// - /// A handle to the focus indicator view - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View GetFocusIndicatorView() - { - var ptr = Interop.AccessibilityManager.GetFocusIndicatorActor(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return this.GetInstanceSafely(ptr); - } - - /// - /// Returns the closest ancestor of the given view that is a focus group. - /// - /// The view to be checked for its focus group - /// The focus group the given view belongs to or an empty handle if the given view doesn't belong to any focus group - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View GetFocusGroup(View view) - { - var ptr = Interop.AccessibilityManager.GetFocusGroup(SwigCPtr, View.getCPtr(view)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return this.GetInstanceSafely(ptr); - } - - /// - /// Returns the current position of the read action. - /// - /// The current event position - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector2 GetReadPosition() - { - Vector2 ret = new Vector2(Interop.AccessibilityManager.GetReadPosition(SwigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - [Obsolete("Do not use this, that will be deprecated. Use AccessibilityManager.Instance instead.")] - internal static AccessibilityManager Get() - { - return AccessibilityManager.Instance; - } - - private static AccessibilityManager GetInternal() - { - global::System.IntPtr cPtr = Interop.AccessibilityManager.Get(); - - if(cPtr == global::System.IntPtr.Zero) - { - NUILog.ErrorBacktrace("AccessibilityManager.Instance called before Application created, or after Application terminated!"); - } - - AccessibilityManager ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as AccessibilityManager; - if (ret != null) - { - NUILog.ErrorBacktrace("AccessibilityManager.GetInternal() Should be called only one time!"); - object dummyObect = new object(); - - global::System.Runtime.InteropServices.HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(dummyObect, cPtr); - Interop.BaseHandle.DeleteBaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - else - { - ret = new AccessibilityManager(cPtr, true); - } - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(bool disposing) - { - if (disposing) - { - NUILog.ErrorBacktrace("We should not manually dispose for singleton class!"); - } - else - { - base.Dispose(disposing); - } - } - - // Signals - AccessibilityManagerEvent.cs - internal FocusChangedSignal FocusChangedSignal() - { - FocusChangedSignal ret = new FocusChangedSignal(Interop.AccessibilityManager.FocusChangedSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityFocusOvershotSignal FocusOvershotSignal() - { - AccessibilityFocusOvershotSignal ret = new AccessibilityFocusOvershotSignal(Interop.AccessibilityManager.FocusOvershotSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal StatusChangedSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.StatusChangedSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionNextSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionNextSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionPreviousSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionPreviousSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionActivateSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionActivateSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionReadSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionReadSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionOverSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionOverSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionReadNextSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionReadNextSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionReadPreviousSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionReadPreviousSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionUpSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionUpSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionDownSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionDownSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionClearFocusSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionClearFocusSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionBackSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionBackSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionScrollUpSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionScrollUpSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionScrollDownSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionScrollDownSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionPageLeftSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionPageLeftSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionPageRightSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionPageRightSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionPageUpSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionPageUpSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionPageDownSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionPageDownSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionMoveToFirstSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionMoveToFirstSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionMoveToLastSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionMoveToLastSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionReadFromTopSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionReadFromTopSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionReadFromNextSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionReadFromNextSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionZoomSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionZoomSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionReadPauseResumeSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionReadPauseResumeSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal AccessibilityActionSignal ActionStartStopSignal() - { - AccessibilityActionSignal ret = new AccessibilityActionSignal(Interop.AccessibilityManager.ActionStartStopSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal SWIGTYPE_p_Dali__SignalT_bool_fDali__Toolkit__AccessibilityManager_R_Dali__TouchEvent_const_RF_t ActionScrollSignal() - { - SWIGTYPE_p_Dali__SignalT_bool_fDali__Toolkit__AccessibilityManager_R_Dali__TouchEvent_const_RF_t ret = new SWIGTYPE_p_Dali__SignalT_bool_fDali__Toolkit__AccessibilityManager_R_Dali__TouchEvent_const_RF_t(Interop.AccessibilityManager.ActionScrollSignal(SwigCPtr)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } -} diff --git a/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEvent.cs b/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEvent.cs deleted file mode 100755 index 200826d2c09..00000000000 --- a/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEvent.cs +++ /dev/null @@ -1,1129 +0,0 @@ -/* - * Copyright(c) 2021 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.ComponentModel; -using System.Runtime.InteropServices; - -namespace Tizen.NUI.Accessibility -{ - public partial class AccessibilityManager - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool StatusChangedEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerStatusChangedEventHandler; - private StatusChangedEventCallbackDelegate accessibilityManagerStatusChangedEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionNextEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionNextEventHandler; - private ActionNextEventCallbackDelegate accessibilityManagerActionNextEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionPreviousEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionPreviousEventHandler; - private ActionPreviousEventCallbackDelegate accessibilityManagerActionPreviousEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionActivateEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionActivateEventHandler; - private ActionActivateEventCallbackDelegate accessibilityManagerActionActivateEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionReadEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionReadEventHandler; - private ActionReadEventCallbackDelegate accessibilityManagerActionReadEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionOverEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionOverEventHandler; - private ActionOverEventCallbackDelegate accessibilityManagerActionOverEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionReadNextEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionReadNextEventHandler; - private ActionReadNextEventCallbackDelegate accessibilityManagerActionReadNextEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionReadPreviousEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionReadPreviousEventHandler; - private ActionReadPreviousEventCallbackDelegate accessibilityManagerActionReadPreviousEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionUpEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionUpEventHandler; - private ActionUpEventCallbackDelegate accessibilityManagerActionUpEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionDownEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionDownEventHandler; - private ActionDownEventCallbackDelegate accessibilityManagerActionDownEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionClearFocusEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionClearFocusEventHandler; - private ActionClearFocusEventCallbackDelegate accessibilityManagerActionClearFocusEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionBackEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionBackEventHandler; - private ActionBackEventCallbackDelegate accessibilityManagerActionBackEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionScrollUpEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionScrollUpEventHandler; - private ActionScrollUpEventCallbackDelegate accessibilityManagerActionScrollUpEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionScrollDownEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionScrollDownEventHandler; - private ActionScrollDownEventCallbackDelegate accessibilityManagerActionScrollDownEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionPageLeftEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionPageLeftEventHandler; - private ActionPageLeftEventCallbackDelegate accessibilityManagerActionPageLeftEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionPageRightEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionPageRightEventHandler; - private ActionPageRightEventCallbackDelegate accessibilityManagerActionPageRightEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionPageUpEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionPageUpEventHandler; - private ActionPageUpEventCallbackDelegate accessibilityManagerActionPageUpEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionPageDownEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionPageDownEventHandler; - private ActionPageDownEventCallbackDelegate accessibilityManagerActionPageDownEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionMoveToFirstEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionMoveToFirstEventHandler; - private ActionMoveToFirstEventCallbackDelegate accessibilityManagerActionMoveToFirstEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionMoveToLastEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionMoveToLastEventHandler; - private ActionMoveToLastEventCallbackDelegate accessibilityManagerActionMoveToLastEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionReadFromTopEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionReadFromTopEventHandler; - private ActionReadFromTopEventCallbackDelegate accessibilityManagerActionReadFromTopEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionReadFromNextEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionReadFromNextEventHandler; - private ActionReadFromNextEventCallbackDelegate accessibilityManagerActionReadFromNextEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionZoomEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionZoomEventHandler; - private ActionZoomEventCallbackDelegate accessibilityManagerActionZoomEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionReadPauseResumeEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionReadPauseResumeEventHandler; - private ActionReadPauseResumeEventCallbackDelegate accessibilityManagerActionReadPauseResumeEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate bool ActionStartStopEventCallbackDelegate(IntPtr accessibilityManager); - private ReturnTypeEventHandler accessibilityManagerActionStartStopEventHandler; - private ActionStartStopEventCallbackDelegate accessibilityManagerActionStartStopEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate void FocusChangedEventCallbackDelegate(IntPtr view1, IntPtr view2); - private EventHandler accessibilityManagerFocusChangedEventHandler; - private FocusChangedEventCallbackDelegate accessibilityManagerFocusChangedEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate void FocusedViewActivatedEventCallbackDelegate(IntPtr view); - private EventHandler accessibilityManagerFocusedViewActivatedEventHandler; - private FocusedViewActivatedEventCallbackDelegate accessibilityManagerFocusedViewActivatedEventCallbackDelegate; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate void FocusOvershotEventCallbackDelegate(IntPtr currentFocusedView, AccessibilityManager.FocusOvershotDirection direction); - private EventHandler accessibilityManagerFocusOvershotEventHandler; - private FocusOvershotEventCallbackDelegate accessibilityManagerFocusOvershotEventCallbackDelegate; - - // Accessibility action signals - - /// - /// This is emitted when accessibility(screen-reader) feature turned on or off. - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler StatusChanged - { - add - { - // Restricted to only one listener - if (accessibilityManagerStatusChangedEventHandler == null) - { - accessibilityManagerStatusChangedEventCallbackDelegate = new StatusChangedEventCallbackDelegate(OnStatusChanged); - this.StatusChangedSignal().Connect(accessibilityManagerStatusChangedEventCallbackDelegate); - } - - accessibilityManagerStatusChangedEventHandler += value; - } - - remove - { - accessibilityManagerStatusChangedEventHandler -= value; - - if (accessibilityManagerStatusChangedEventHandler == null && StatusChangedSignal().Empty() == false) - { - this.StatusChangedSignal().Disconnect(accessibilityManagerStatusChangedEventCallbackDelegate); - } - - } - } - - /// - /// This is emitted when accessibility action is received to move focus to the next focusable view (by one finger flick down). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionNext - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionNextEventHandler == null) - { - accessibilityManagerActionNextEventCallbackDelegate = new ActionNextEventCallbackDelegate(OnActionNext); - this.ActionNextSignal().Connect(accessibilityManagerActionNextEventCallbackDelegate); - } - - accessibilityManagerActionNextEventHandler += value; - } - - remove - { - accessibilityManagerActionNextEventHandler -= value; - - if (accessibilityManagerActionNextEventHandler == null && ActionNextSignal().Empty() == false) - { - this.ActionNextSignal().Disconnect(accessibilityManagerActionNextEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to move focus to the previous focusable view (by one finger flick up). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionPrevious - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionPreviousEventHandler == null) - { - accessibilityManagerActionPreviousEventCallbackDelegate = new ActionPreviousEventCallbackDelegate(OnActionPrevious); - this.ActionPreviousSignal().Connect(accessibilityManagerActionPreviousEventCallbackDelegate); - } - - accessibilityManagerActionPreviousEventHandler += value; - } - - remove - { - accessibilityManagerActionPreviousEventHandler -= value; - - if (accessibilityManagerActionPreviousEventHandler == null && ActionPreviousSignal().Empty() == false) - { - this.ActionPreviousSignal().Disconnect(accessibilityManagerActionPreviousEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to activate the current focused view (by one finger double tap). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionActivate - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionActivateEventHandler == null) - { - accessibilityManagerActionActivateEventCallbackDelegate = new ActionActivateEventCallbackDelegate(OnActionActivate); - this.ActionActivateSignal().Connect(accessibilityManagerActionActivateEventCallbackDelegate); - } - - accessibilityManagerActionActivateEventHandler += value; - } - - remove - { - accessibilityManagerActionActivateEventHandler -= value; - - if (accessibilityManagerActionActivateEventHandler == null && ActionActivateSignal().Empty() == false) - { - this.ActionActivateSignal().Disconnect(accessibilityManagerActionActivateEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to focus and read the view (by one finger tap). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionRead - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionReadEventHandler == null) - { - accessibilityManagerActionReadEventCallbackDelegate = new ActionReadEventCallbackDelegate(OnActionRead); - this.ActionReadSignal().Connect(accessibilityManagerActionReadEventCallbackDelegate); - } - - accessibilityManagerActionReadEventHandler += value; - } - - remove - { - accessibilityManagerActionReadEventHandler -= value; - - if (accessibilityManagerActionReadEventHandler == null && ActionReadSignal().Empty() == false) - { - this.ActionReadSignal().Disconnect(accessibilityManagerActionReadEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to focus and read the view (by one finger move). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionOver - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionOverEventHandler == null) - { - accessibilityManagerActionOverEventCallbackDelegate = new ActionOverEventCallbackDelegate(OnActionOver); - this.ActionOverSignal().Connect(accessibilityManagerActionOverEventCallbackDelegate); - } - - accessibilityManagerActionOverEventHandler += value; - } - - remove - { - accessibilityManagerActionOverEventHandler -= value; - - if (accessibilityManagerActionOverEventHandler == null && ActionOverSignal().Empty() == false) - { - this.ActionOverSignal().Disconnect(accessibilityManagerActionOverEventCallbackDelegate); - } - - } - } - - /// - /// This is emitted when accessibility action is received to move focus to the next focusable view (by one finger flick right). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionReadNext - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionReadNextEventHandler == null) - { - accessibilityManagerActionReadNextEventCallbackDelegate = new ActionReadNextEventCallbackDelegate(OnActionReadNext); - this.ActionReadNextSignal().Connect(accessibilityManagerActionReadNextEventCallbackDelegate); - } - - accessibilityManagerActionReadNextEventHandler += value; - } - - remove - { - accessibilityManagerActionReadNextEventHandler -= value; - - if (accessibilityManagerActionReadNextEventHandler == null && ActionReadNextSignal().Empty() == false) - { - this.ActionReadNextSignal().Disconnect(accessibilityManagerActionReadNextEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to move focus to the previous focusable view (by one finger flick left). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionReadPrevious - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionReadPreviousEventHandler == null) - { - accessibilityManagerActionReadPreviousEventCallbackDelegate = new ActionReadPreviousEventCallbackDelegate(OnActionReadPrevious); - this.ActionReadPreviousSignal().Connect(accessibilityManagerActionReadPreviousEventCallbackDelegate); - } - - accessibilityManagerActionReadPreviousEventHandler += value; - } - - remove - { - accessibilityManagerActionReadPreviousEventHandler -= value; - - if (accessibilityManagerActionReadPreviousEventHandler == null && ActionReadPreviousSignal().Empty() == false) - { - this.ActionReadPreviousSignal().Disconnect(accessibilityManagerActionReadPreviousEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to change the value when the current focused view is a slider - /// (by double finger down and move up and right). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionUp - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionUpEventHandler == null) - { - accessibilityManagerActionUpEventCallbackDelegate = new ActionUpEventCallbackDelegate(OnActionUp); - this.ActionUpSignal().Connect(accessibilityManagerActionUpEventCallbackDelegate); - } - - accessibilityManagerActionUpEventHandler += value; - } - - remove - { - accessibilityManagerActionUpEventHandler -= value; - - if (accessibilityManagerActionUpEventHandler == null && ActionUpSignal().Empty() == false) - { - this.ActionUpSignal().Disconnect(accessibilityManagerActionUpEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to change the value when the current focused view is a slider - /// (by double finger down and move down and left). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionDown - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionDownEventHandler == null) - { - accessibilityManagerActionDownEventCallbackDelegate = new ActionDownEventCallbackDelegate(OnActionDown); - this.ActionDownSignal().Connect(accessibilityManagerActionDownEventCallbackDelegate); - } - - accessibilityManagerActionDownEventHandler += value; - } - - remove - { - accessibilityManagerActionDownEventHandler -= value; - - if (accessibilityManagerActionDownEventHandler == null && ActionDownSignal().Empty() == false) - { - this.ActionDownSignal().Disconnect(accessibilityManagerActionDownEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to clear the focus from the current focused view - /// if any, so that no view is focused in the focus chain. - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionClearFocus - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionClearFocusEventHandler == null) - { - accessibilityManagerActionClearFocusEventCallbackDelegate = new ActionClearFocusEventCallbackDelegate(OnActionClearFocus); - this.ActionClearFocusSignal().Connect(accessibilityManagerActionClearFocusEventCallbackDelegate); - } - - accessibilityManagerActionClearFocusEventHandler += value; - } - - remove - { - accessibilityManagerActionClearFocusEventHandler -= value; - - if (accessibilityManagerActionClearFocusEventHandler == null && ActionClearFocusSignal().Empty() == false) - { - this.ActionClearFocusSignal().Disconnect(accessibilityManagerActionClearFocusEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to navigate back (by two fingers circle draw). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionBack - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionBackEventHandler == null) - { - accessibilityManagerActionBackEventCallbackDelegate = new ActionBackEventCallbackDelegate(OnActionBack); - this.ActionBackSignal().Connect(accessibilityManagerActionBackEventCallbackDelegate); - } - - accessibilityManagerActionBackEventHandler += value; - } - - remove - { - accessibilityManagerActionBackEventHandler -= value; - - if (accessibilityManagerActionBackEventHandler == null && ActionBackSignal().Empty() == false) - { - this.ActionBackSignal().Disconnect(accessibilityManagerActionBackEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to scroll up the list (by two finger swipe up). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionScrollUp - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionScrollUpEventHandler == null) - { - accessibilityManagerActionScrollUpEventCallbackDelegate = new ActionScrollUpEventCallbackDelegate(OnActionScrollUp); - this.ActionScrollUpSignal().Connect(accessibilityManagerActionScrollUpEventCallbackDelegate); - } - - accessibilityManagerActionScrollUpEventHandler += value; - } - - remove - { - accessibilityManagerActionScrollUpEventHandler -= value; - - if (accessibilityManagerActionScrollUpEventHandler == null && ActionScrollUpSignal().Empty() == false) - { - this.ActionScrollUpSignal().Disconnect(accessibilityManagerActionScrollUpEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to scroll down the list (by two finger swipe down). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionScrollDown - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionScrollDownEventHandler == null) - { - accessibilityManagerActionScrollDownEventCallbackDelegate = new ActionScrollDownEventCallbackDelegate(OnActionScrollDown); - this.ActionScrollDownSignal().Connect(accessibilityManagerActionScrollDownEventCallbackDelegate); - } - - accessibilityManagerActionScrollDownEventHandler += value; - } - - remove - { - accessibilityManagerActionScrollDownEventHandler -= value; - - if (accessibilityManagerActionScrollDownEventHandler == null && ActionScrollDownSignal().Empty() == false) - { - this.ActionScrollDownSignal().Disconnect(accessibilityManagerActionScrollDownEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to scroll left to the previous page (by two finger swipe left). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionPageLeft - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionPageLeftEventHandler == null) - { - accessibilityManagerActionPageLeftEventCallbackDelegate = new ActionPageLeftEventCallbackDelegate(OnActionPageLeft); - this.ActionPageLeftSignal().Connect(accessibilityManagerActionPageLeftEventCallbackDelegate); - } - - accessibilityManagerActionPageLeftEventHandler += value; - } - - remove - { - accessibilityManagerActionPageLeftEventHandler -= value; - - if (accessibilityManagerActionPageLeftEventHandler == null && ActionPageLeftSignal().Empty() == false) - { - this.ActionPageLeftSignal().Disconnect(accessibilityManagerActionPageLeftEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to scroll right to the next page (by two finger swipe right). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionPageRight - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionPageRightEventHandler == null) - { - accessibilityManagerActionPageRightEventCallbackDelegate = new ActionPageRightEventCallbackDelegate(OnActionPageRight); - this.ActionPageRightSignal().Connect(accessibilityManagerActionPageRightEventCallbackDelegate); - } - - accessibilityManagerActionPageRightEventHandler += value; - } - - remove - { - accessibilityManagerActionPageRightEventHandler -= value; - - if (accessibilityManagerActionPageRightEventHandler == null && ActionPageRightSignal().Empty() == false) - { - this.ActionPageRightSignal().Disconnect(accessibilityManagerActionPageRightEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to scroll up to the previous page (by one finger swipe left and right). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionPageUp - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionPageUpEventHandler == null) - { - accessibilityManagerActionPageUpEventCallbackDelegate = new ActionPageUpEventCallbackDelegate(OnActionPageUp); - this.ActionPageUpSignal().Connect(accessibilityManagerActionPageUpEventCallbackDelegate); - } - - accessibilityManagerActionPageUpEventHandler += value; - } - - remove - { - accessibilityManagerActionPageUpEventHandler -= value; - - if (accessibilityManagerActionPageUpEventHandler == null && ActionPageUpSignal().Empty() == false) - { - this.ActionPageUpSignal().Disconnect(accessibilityManagerActionPageUpEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to scroll down to the next page (by one finger swipe right and left). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionPageDown - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionPageDownEventHandler == null) - { - accessibilityManagerActionPageDownEventCallbackDelegate = new ActionPageDownEventCallbackDelegate(OnActionPageDown); - this.ActionPageDownSignal().Connect(accessibilityManagerActionPageDownEventCallbackDelegate); - } - - accessibilityManagerActionPageDownEventHandler += value; - } - - remove - { - accessibilityManagerActionPageDownEventHandler -= value; - - if (accessibilityManagerActionPageDownEventHandler == null && ActionPageDownSignal().Empty() == false) - { - this.ActionPageDownSignal().Disconnect(accessibilityManagerActionPageDownEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to move the focus to the first item on the screen - /// (by one finger swipe up and down). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionMoveToFirst - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionMoveToFirstEventHandler == null) - { - accessibilityManagerActionMoveToFirstEventCallbackDelegate = new ActionMoveToFirstEventCallbackDelegate(OnActionMoveToFirst); - this.ActionMoveToFirstSignal().Connect(accessibilityManagerActionMoveToFirstEventCallbackDelegate); - } - - accessibilityManagerActionMoveToFirstEventHandler += value; - } - - remove - { - accessibilityManagerActionMoveToFirstEventHandler -= value; - - if (accessibilityManagerActionMoveToFirstEventHandler == null && ActionMoveToFirstSignal().Empty() == false) - { - this.ActionMoveToFirstSignal().Disconnect(accessibilityManagerActionMoveToFirstEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to move the focus to the last item on the screen - /// (by one finger swipe down and up). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionMoveToLast - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionMoveToLastEventHandler == null) - { - accessibilityManagerActionMoveToLastEventCallbackDelegate = new ActionMoveToLastEventCallbackDelegate(OnActionMoveToLast); - this.ActionMoveToLastSignal().Connect(accessibilityManagerActionMoveToLastEventCallbackDelegate); - } - - accessibilityManagerActionMoveToLastEventHandler += value; - } - - remove - { - accessibilityManagerActionMoveToLastEventHandler -= value; - - if (accessibilityManagerActionMoveToLastEventHandler == null && ActionMoveToLastSignal().Empty() == false) - { - this.ActionMoveToLastSignal().Disconnect(accessibilityManagerActionMoveToLastEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to focus and read from the first item on the top continuously - /// (by three fingers single tap). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionReadFromTop - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionReadFromTopEventHandler == null) - { - accessibilityManagerActionReadFromTopEventCallbackDelegate = new ActionReadFromTopEventCallbackDelegate(OnActionReadFromTop); - this.ActionReadFromTopSignal().Connect(accessibilityManagerActionReadFromTopEventCallbackDelegate); - } - - accessibilityManagerActionReadFromTopEventHandler += value; - } - - remove - { - accessibilityManagerActionReadFromTopEventHandler -= value; - - if (accessibilityManagerActionReadFromTopEventHandler == null && ActionReadFromTopSignal().Empty() == false) - { - this.ActionReadFromTopSignal().Disconnect(accessibilityManagerActionReadFromTopEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to move the focus to and read from the next item continuously - /// (by three fingers double tap). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionReadFromNext - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionReadFromNextEventHandler == null) - { - accessibilityManagerActionReadFromNextEventCallbackDelegate = new ActionReadFromNextEventCallbackDelegate(OnActionReadFromNext); - this.ActionReadFromNextSignal().Connect(accessibilityManagerActionReadFromNextEventCallbackDelegate); - } - - accessibilityManagerActionReadFromNextEventHandler += value; - } - - remove - { - accessibilityManagerActionReadFromNextEventHandler -= value; - - if (accessibilityManagerActionReadFromNextEventHandler == null && ActionReadFromNextSignal().Empty() == false) - { - this.ActionReadFromNextSignal().Disconnect(accessibilityManagerActionReadFromNextEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to zoom (by one finger triple tap) - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionZoom - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionZoomEventHandler == null) - { - accessibilityManagerActionZoomEventCallbackDelegate = new ActionZoomEventCallbackDelegate(OnActionZoom); - this.ActionZoomSignal().Connect(accessibilityManagerActionZoomEventCallbackDelegate); - } - - accessibilityManagerActionZoomEventHandler += value; - } - - remove - { - accessibilityManagerActionZoomEventHandler -= value; - - if (accessibilityManagerActionZoomEventHandler == null && ActionZoomSignal().Empty() == false) - { - this.ActionZoomSignal().Disconnect(accessibilityManagerActionZoomEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to pause/resume the current speech (by two fingers single tap). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionReadPauseResume - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionReadPauseResumeEventHandler == null) - { - accessibilityManagerActionReadPauseResumeEventCallbackDelegate = new ActionReadPauseResumeEventCallbackDelegate(OnActionReadPauseResume); - this.ActionReadPauseResumeSignal().Connect(accessibilityManagerActionReadPauseResumeEventCallbackDelegate); - } - - accessibilityManagerActionReadPauseResumeEventHandler += value; - } - - remove - { - accessibilityManagerActionReadPauseResumeEventHandler -= value; - - if (accessibilityManagerActionReadPauseResumeEventHandler == null && ActionReadPauseResumeSignal().Empty() == false) - { - this.ActionReadPauseResumeSignal().Disconnect(accessibilityManagerActionReadPauseResumeEventCallbackDelegate); - } - } - } - - /// - /// This is emitted when accessibility action is received to start/stop the current action (by two fingers double tap). - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event ReturnTypeEventHandler ActionStartStop - { - add - { - // Restricted to only one listener - if (accessibilityManagerActionStartStopEventHandler == null) - { - accessibilityManagerActionStartStopEventCallbackDelegate = new ActionStartStopEventCallbackDelegate(OnActionStartStop); - this.ActionStartStopSignal().Connect(accessibilityManagerActionStartStopEventCallbackDelegate); - } - - accessibilityManagerActionStartStopEventHandler += value; - } - - remove - { - accessibilityManagerActionStartStopEventHandler -= value; - - if (accessibilityManagerActionStartStopEventHandler == null && ActionStartStopSignal().Empty() == false) - { - this.ActionStartStopSignal().Disconnect(accessibilityManagerActionStartStopEventCallbackDelegate); - } - } - } - - /* - // To be replaced by a new event that takes Touch - public event DaliEventHandlerWithReturnType ActionScroll - { - add - { - lock(this) - { - // Restricted to only one listener - if (_accessibilityManagerActionScrollEventHandler == null) - { - _accessibilityManagerActionScrollEventHandler += value; - - _accessibilityManagerActionScrollEventCallbackDelegate = new ActionScrollEventCallbackDelegate(OnActionScroll); - this.ActionScrollSignal().Connect(_accessibilityManagerActionScrollEventCallbackDelegate); - } - } - } - - remove - { - lock(this) - { - if (_accessibilityManagerActionScrollEventHandler != null) - { - this.ActionScrollSignal().Disconnect(_accessibilityManagerActionScrollEventCallbackDelegate); - } - - _accessibilityManagerActionScrollEventHandler -= value; - } - } - } - - // Callback for AccessibilityManager ActionScrollSignal - private bool OnActionScroll(IntPtr accessibilityManager, IntPtr touchEvent) - { - ActionScrollEventArgs e = new ActionScrollEventArgs(); - - // Populate all members of "e" (ActionScrollEventArgs) with real data - e.AccessibilityManager = AccessibilityManager.GetAccessibilityManagerFromPtr(accessibilityManager); - e.TouchEvent = TouchEvent.GetTouchEventFromPtr(touchEvent); - - if (_accessibilityManagerActionScrollEventHandler != null) - { - //here we send all data to user event handlers - return _accessibilityManagerActionScrollEventHandler(this, e); - } - return false; - } - */ - - // Common Signals - - /// - /// This signal is emitted when the current focused view is changed. - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler FocusChanged - { - add - { - // Restricted to only one listener - if (accessibilityManagerFocusChangedEventHandler == null) - { - accessibilityManagerFocusChangedEventCallbackDelegate = new FocusChangedEventCallbackDelegate(OnFocusChanged); - this.FocusChangedSignal().Connect(accessibilityManagerFocusChangedEventCallbackDelegate); - } - - accessibilityManagerFocusChangedEventHandler += value; - } - - remove - { - accessibilityManagerFocusChangedEventHandler -= value; - - if (accessibilityManagerFocusChangedEventHandler == null && FocusChangedSignal().Empty() == false) - { - this.FocusChangedSignal().Disconnect(accessibilityManagerFocusChangedEventCallbackDelegate); - } - } - } - - /// - /// This signal is emitted when the current focused view is activated. - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler FocusedViewActivated - { - add - { - // Restricted to only one listener - if (accessibilityManagerFocusedViewActivatedEventHandler == null) - { - accessibilityManagerFocusedViewActivatedEventCallbackDelegate = new FocusedViewActivatedEventCallbackDelegate(OnFocusedViewActivated); - Interop.AccessibilityManager.FocusedActorActivatedSignalConnect(SwigCPtr, accessibilityManagerFocusedViewActivatedEventCallbackDelegate.ToHandleRef(this)); - NDalicPINVOKE.ThrowExceptionIfExists(); - } - - accessibilityManagerFocusedViewActivatedEventHandler += value; - } - - remove - { - accessibilityManagerFocusedViewActivatedEventHandler -= value; - - if (accessibilityManagerFocusedViewActivatedEventHandler == null && accessibilityManagerFocusedViewActivatedEventCallbackDelegate != null) - { - Interop.AccessibilityManager.FocusedActorActivatedSignalDisconnect(SwigCPtr, accessibilityManagerFocusedViewActivatedEventCallbackDelegate.ToHandleRef(this)); - NDalicPINVOKE.ThrowExceptionIfExists(); - accessibilityManagerFocusedViewActivatedEventCallbackDelegate = null; - } - } - } - - /// - /// This signal is emitted when there is no way to move focus further. - /// - /// The signal to connect to - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler FocusOvershot - { - add - { - // Restricted to only one listener - if (accessibilityManagerFocusOvershotEventHandler == null) - { - accessibilityManagerFocusOvershotEventCallbackDelegate = new FocusOvershotEventCallbackDelegate(OnFocusOvershot); - this.FocusOvershotSignal().Connect(accessibilityManagerFocusOvershotEventCallbackDelegate); - } - - accessibilityManagerFocusOvershotEventHandler += value; - } - - remove - { - accessibilityManagerFocusOvershotEventHandler -= value; - - if (accessibilityManagerFocusOvershotEventHandler == null && FocusOvershotSignal().Empty() == false) - { - this.FocusOvershotSignal().Disconnect(accessibilityManagerFocusOvershotEventCallbackDelegate); - } - } - } - } -} diff --git a/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEventArgs.cs b/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEventArgs.cs deleted file mode 100755 index 6118cd8771a..00000000000 --- a/src/Tizen.NUI/src/public/Accessibility/AccessibilityManagerEventArgs.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright(c) 2021 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.ComponentModel; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI.Accessibility -{ - public partial class AccessibilityManager - { - /// - /// Event arguments that passed via FocusChangedEvent signal - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public class FocusChangedEventArgs : EventArgs - { - private View viewCurrent; - private View viewNext; - - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View ViewCurrent - { - get - { - return viewCurrent; - } - set - { - viewCurrent = value; - } - } - - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View ViewNext - { - get - { - return viewNext; - } - set - { - viewNext = value; - } - } - } - - /// - /// Event arguments that passed via FocusedViewActivated signal - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public class FocusedViewActivatedEventArgs : EventArgs - { - private View view; - - - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View View - { - get - { - return view; - } - set - { - view = value; - } - } - } - - /// - /// Event arguments that passed via FocusOvershot signal - /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public class FocusOvershotEventArgs : EventArgs - { - private View currentFocusedView; - private AccessibilityManager.FocusOvershotDirection focusOvershotDirection; - - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View CurrentFocusedView - { - get - { - return currentFocusedView; - } - set - { - currentFocusedView = value; - } - } - - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public AccessibilityManager.FocusOvershotDirection FocusOvershotDirection - { - get - { - return focusOvershotDirection; - } - set - { - focusOvershotDirection = value; - } - } - } - } -} diff --git a/src/Tizen.NUI/src/public/Animation/AlphaFunction.cs b/src/Tizen.NUI/src/public/Animation/AlphaFunction.cs index a37e21692f7..227f105d7c1 100755 --- a/src/Tizen.NUI/src/public/Animation/AlphaFunction.cs +++ b/src/Tizen.NUI/src/public/Animation/AlphaFunction.cs @@ -25,6 +25,21 @@ namespace Tizen.NUI /// Understanding an animation as a parametric function over time, the alpha function is applied to the parameter of /// the animation before computing the final animation value. /// + /// + /// View view = new View() + /// { + /// Size2D = new Size2D(100, 100), + /// Position2D = new Position2D(100, 100), + /// BackgroundColor = Color.Red, + /// }; + /// Window.Default.Add(view); + /// Animation animation = new Animation(); + /// const float destinationValue = 300.0f; + /// const int startTime = 0; // animation starts at 0 second point. no delay. + /// const int endTime = 5000; // animation ends at 5 second point. + /// animation.AnimateTo(view, "PositionX", destinationValue, startTime, endTime, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseIn)); + /// animation.Play(); + /// /// 3 public class AlphaFunction : Disposable { @@ -85,24 +100,24 @@ internal AlphaFunction(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, // } /// - /// This specifies the various types of BuiltinFunctions. + /// This specifies the various types of built-in alpha functions available for animations. /// /// 3 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")] public enum BuiltinFunctions { /// - /// Linear. + /// Default alpha function. Linear alpha function. /// [Description("DEFAULT")] Default, /// - /// No transformation. + /// Linear alpha function. (No transformation) /// [Description("LINEAR")] Linear, /// - /// Reverse linear. + /// Reverse linear alpha function. /// [Description("REVERSE")] Reverse, diff --git a/src/Tizen.NUI/src/public/Animation/Animatable.cs b/src/Tizen.NUI/src/public/Animation/Animatable.cs index 31441e057e0..fc2a77cce48 100755 --- a/src/Tizen.NUI/src/public/Animation/Animatable.cs +++ b/src/Tizen.NUI/src/public/Animation/Animatable.cs @@ -21,8 +21,46 @@ namespace Tizen.NUI { /// - /// Animatable. + /// The class that represents an object capable of animation is the parent class of the minimum unit of visual, View. + /// When a property is an animatable property, it means that its value can change continuously as the target of an animation. + /// In this case, if a property notification callback is set, you can receive the callback according to the changing values. + /// Additionally, users can also add their own properties. /// + /// + /// View view = new View() + /// { + /// Size2D = new Size2D(100, 100), + /// Position2D = new Position2D(100, 100), + /// BackgroundColor = Color.Red, + /// }; + /// + /// Window.Default.Add(view); + /// Animation animation = new Animation(); + /// const float destinationValue = 300.0f; + /// const int startTime = 0; // animation starts at 0 second point. no delay. + /// const int endTime = 5000; // animation ends at 5 second point. + /// animation.AnimateTo(view, "PositionX", destinationValue, startTime, endTime, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInSine)); + /// animation.Play(); + /// + /// PropertyNotification propertyNotification = view.AddPropertyNotification("position", PropertyCondition.Step(10.0f)); + /// propertyNotification.Notified += (object source, PropertyNotification.NotifyEventArgs args) => + /// { + /// Animatable target = args.PropertyNotification.GetTarget(); + /// if (target is View viewTarget) + /// { + /// Tizen.Log.Debug("NUI", $"postion changed! ({viewTarget.CurrentPosition.X},{viewTarget.CurrentPosition.Y})"); + /// } + /// }; + /// + /// Animatable animatable = new Animatable(); + /// int myPropertyIndex = animatable.RegisterProperty("myProperty", new PropertyValue(100), PropertyAccessMode.ReadWrite); + /// animatable.GetProperty(myPropertyIndex).Get(out int aValue); + /// Tizen.Log.Debug("NUI", $"myProperty value : {aValue} (should be 100)"); + /// + /// animatable.SetProperty(myPropertyIndex, new PropertyValue(200)); + /// animatable.GetProperty(myPropertyIndex).Get(out aValue); + /// Tizen.Log.Debug("NUI", $"myProperty value : {aValue} (should be 200)"); + /// /// 3 public class Animatable : BaseHandle { diff --git a/src/Tizen.NUI/src/public/Animation/Animation.cs b/src/Tizen.NUI/src/public/Animation/Animation.cs index b8e4d321c9d..308560b121e 100755 --- a/src/Tizen.NUI/src/public/Animation/Animation.cs +++ b/src/Tizen.NUI/src/public/Animation/Animation.cs @@ -35,6 +35,23 @@ namespace Tizen.NUI /// The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.
/// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.
///
+ /// + /// View view = new View() + /// { + /// Size2D = new Size2D(100, 100), + /// Position2D = new Position2D(100, 100), + /// BackgroundColor = Color.Red, + /// }; + /// + /// Window.Default.Add(view); + /// Animation animation = new Animation(); + /// const float destinationValue = 300.0f; + /// const int startTime = 0; // animation starts at 0 second point. no delay. + /// const int endTime = 5000; // animation ends at 5 second point. + /// animation.AnimateTo(view, "PositionX", destinationValue, startTime, endTime); // position x animation. + /// animation.AnimateTo(view, "SizeHeight", destinationValue + 100, startTime + 1000, endTime + 2000); // size height animation. + /// animation.Play(); + /// /// 3 public class Animation : BaseHandle { @@ -1252,6 +1269,10 @@ public Animation() : this(Interop.Animation.New(0.0f), true) /// /// Plays the animation. /// + /// + /// var animation = new Animation(); + /// animation.Play(); + /// /// 3 public void Play() { @@ -1291,6 +1312,11 @@ public void PlayAfter(int delayMilliseconds) /// /// Pauses the animation. /// + /// + /// var animation = new Animation(); + /// animation.Play(); + /// animation.Pause(); + /// /// 3 public void Pause() { @@ -1301,6 +1327,11 @@ public void Pause() /// /// Stops the animation. /// + /// + /// var animation = new Animation(); + /// animation.Play(); + /// animation.Stop(); + /// /// 3 public void Stop() { diff --git a/src/Tizen.NUI/src/public/Animation/KeyFrames.cs b/src/Tizen.NUI/src/public/Animation/KeyFrames.cs index 818e1913ca4..1fd29ec8003 100755 --- a/src/Tizen.NUI/src/public/Animation/KeyFrames.cs +++ b/src/Tizen.NUI/src/public/Animation/KeyFrames.cs @@ -23,6 +23,24 @@ namespace Tizen.NUI /// A set of key frames for a property that can be animated using DALi animation.
/// This allows the generation of key frame objects from individual Property::Values.
///
+ /// + /// View view = new View() + /// { + /// Size2D = new Size2D(100, 100), + /// Position2D = new Position2D(100, 100), + /// BackgroundColor = Color.Red, + /// }; + /// + /// Window.Default.Add(view); + /// Animation animation = new Animation(5000); // 5s duration. + /// KeyFrames keyFrames = new KeyFrames(); + /// keyFrames.Add(0.0f, new Rotation(new Radian(new Degree(-32.0f)), Vector3.ZAxis)); + /// keyFrames.Add(0.3f, new Rotation(new Radian(new Degree(133.0f)), Vector3.ZAxis)); + /// keyFrames.Add(0.75f, new Rotation(new Radian(new Degree(-12.0f)), Vector3.ZAxis)); + /// keyFrames.Add(1.0f, new Rotation(new Radian(new Degree(135.0f)), Vector3.ZAxis)); + /// animation.AnimateBetween(view, "Orientation", keyFrames); + /// animation.Play(); + /// /// 3 public class KeyFrames : BaseHandle { @@ -108,6 +126,7 @@ public void Add(float progress, PropertyValue value, AlphaFunction alpha) /// /// Get the number of added key frame. /// + /// The number of key frames currently added to the KeyFrames object. /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public uint GetKeyFrameCount() diff --git a/src/Tizen.NUI/src/public/Animation/Path.cs b/src/Tizen.NUI/src/public/Animation/Path.cs index 44f760bcf95..6c84cddbd98 100755 --- a/src/Tizen.NUI/src/public/Animation/Path.cs +++ b/src/Tizen.NUI/src/public/Animation/Path.cs @@ -21,14 +21,14 @@ namespace Tizen.NUI { /// - /// A 3D parametric curve.
- /// Paths can be used to animate the position and orientation of actors.
+ /// A 3D parametric curve. + /// Paths can be used to animate the position and orientation of views. ///
/// 3 public class Path : BaseHandle { /// - /// Creates an initialized path handle. + /// The default constructor. Creates an initialized path handle. /// /// 3 public Path() : this(Interop.Path.New(), true) @@ -41,7 +41,8 @@ internal Path(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryO } /// - /// Enumeration for the Points. + /// Gets or sets the array of points defining the path. + /// The property value is a PropertyArray containing the points that define the path. /// /// 3 public PropertyArray Points @@ -63,7 +64,8 @@ public PropertyArray Points } /// - /// Enumeration for the ControlPoints. + /// Gets or sets the control points of the path. + /// The property value represents the array of control points defining the path. /// /// 3 public PropertyArray ControlPoints @@ -96,7 +98,7 @@ public void AddPoint(Position point) } /// - /// Adds a control point. + /// Adds a control point to the path. /// /// The new control point to be added. /// 3 @@ -139,6 +141,7 @@ public void Sample(float progress, Vector3 position, Vector3 tangent) /// An accessor for the interpolation points. ///
/// The index of the interpolation point. + /// The interpolation point at the specified index. /// 3 public Vector3 GetPoint(uint index) { @@ -151,6 +154,7 @@ public Vector3 GetPoint(uint index) /// An accessor for the control points. ///
/// The index of the control point. + /// The control point at the specified index. /// 3 public Vector3 GetControlPoint(uint index) { diff --git a/src/Tizen.NUI/src/public/Animation/TransitionOptions.cs b/src/Tizen.NUI/src/public/Animation/TransitionOptions.cs index 7436842619a..8c0e9152923 100755 --- a/src/Tizen.NUI/src/public/Animation/TransitionOptions.cs +++ b/src/Tizen.NUI/src/public/Animation/TransitionOptions.cs @@ -58,9 +58,9 @@ public TransitionOptions() /// /// Hidden API (Inhouse API). - /// Dispose. + /// Releases unmanaged and optionally managed resources. /// - /// + /// true to release both managed and unmanaged resources. false to release only unmanaged resources. [EditorBrowsable(EditorBrowsableState.Never)] protected virtual void Dispose(bool disposing) { diff --git a/src/Tizen.NUI/src/public/Application/NUIApplication.cs b/src/Tizen.NUI/src/public/Application/NUIApplication.cs index 44e2ebe7df8..ac178056c5f 100755 --- a/src/Tizen.NUI/src/public/Application/NUIApplication.cs +++ b/src/Tizen.NUI/src/public/Application/NUIApplication.cs @@ -34,7 +34,7 @@ namespace Tizen.NUI public class NUIApplication : CoreApplication { /// - /// Set to true if XAML is used. + /// Set to true if XAML is used. /// This must be called before or immediately after the NUIApplication constructor is called. /// The default value is true. /// @@ -70,7 +70,8 @@ static NUIApplication() } /// - /// The default constructor. + /// Initializes a new instance of the class. + /// This is the default constructor that initializes the NUI application using the NUICoreBackend. /// /// 3 [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] @@ -84,8 +85,7 @@ public NUIApplication() : base(new NUICoreBackend()) /// /// The window size. /// The window position. - /// 5 - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened in the future after ACR done. Before ACR, need to be hidden as inhouse API. [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend("", NUIApplication.WindowMode.Opaque, windowSize, windowPosition)) @@ -95,8 +95,9 @@ public NUIApplication(Size2D windowSize, Position2D windowPosition) : base(new N /// /// The constructor with a stylesheet. + /// This constructor initializes a new instance of the Tizen.NUI.NUIApplication class with the specified stylesheet. /// - /// The styleSheet url. + /// The URL of the stylesheet to apply to the application. /// 3 [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] public NUIApplication(string styleSheet) : base(new NUICoreBackend(styleSheet)) @@ -110,8 +111,7 @@ public NUIApplication(string styleSheet) : base(new NUICoreBackend(styleSheet)) /// The styleSheet URL. /// The window size. /// The window position. - /// 5 - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened in the future after ACR done. Before ACR, need to be hidden as inhouse API. [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, WindowMode.Opaque, windowSize, windowPosition)) @@ -121,6 +121,7 @@ public NUIApplication(string styleSheet, Size2D windowSize, Position2D windowPos /// /// The constructor with a stylesheet and window mode. + /// This constructor initializes the NUIApplication with a specified stylesheet and window mode. /// /// The styleSheet url. /// The windowMode. @@ -138,8 +139,7 @@ public NUIApplication(string styleSheet, WindowMode windowMode) : base(new NUICo /// The windowMode. /// The window size. /// The window position. - /// 5 - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened in the future after ACR done. Before ACR, need to be hidden as inhouse API. [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "NUICoreBackend is disposed in the base class when the application is terminated")] [EditorBrowsable(EditorBrowsableState.Never)] public NUIApplication(string styleSheet, WindowMode windowMode, Size2D windowSize, Position2D windowPosition) : base(new NUICoreBackend(styleSheet, windowMode, windowSize, windowPosition)) @@ -309,14 +309,39 @@ public NUIApplication(ThemeOptions option, WindowData windowData) : base(new NUI } /// - /// Occurs whenever the application is resumed. + /// The Resumed event handler. + /// This event is triggered when the application resumes from being paused or stopped. + /// It can be used to perform actions that need to be executed when the application becomes active again. /// + /// + /// + /// NUIApplication app = new NUIApplication(); + /// app.Resumed += OnAppResumed; + /// + /// void OnAppResumed(object sender, EventArgs e) + /// { + /// // Perform actions when the application is resumed + /// } + /// + /// /// 4 public event EventHandler Resumed; /// - /// Occurs whenever the application is paused. + /// The event handler that gets called when the application is paused. + /// This event is triggered when the application transitions to a paused state. /// + /// + /// + /// NUIApplication app = new NUIApplication(); + /// app.Paused += OnAppPaused; + /// + /// void OnAppPaused(object sender, EventArgs e) + /// { + /// // Perform actions when the application is paused + /// } + /// + /// /// 4 public event EventHandler Paused; @@ -393,7 +418,7 @@ public static string CurrentLoadedXaml } /// - /// ResourceManager to handle multilingual. + /// The MultilingualResourceManager property provides access to a System.Resources.ResourceManager instance that can be used to manage resources for different languages. /// /// 4 public static System.Resources.ResourceManager MultilingualResourceManager @@ -470,8 +495,9 @@ internal Application ApplicationHandle } /// - /// Register the assembly to XAML. + /// Registers the specified assembly to XAML, allowing types within the assembly to be used in XAML files. /// + /// The assembly to register. /// 5 public static void RegisterAssembly(Assembly assembly) { @@ -479,9 +505,18 @@ public static void RegisterAssembly(Assembly assembly) } /// - /// Runs the NUIApplication. + /// This method starts the main loop of the application, allowing it to receive events and run its lifecycle. /// - /// Arguments from commandline. + /// Arguments from commandline. These arguments can be used to customize the application behavior at startup. + /// + /// + /// static void Main(string[] args) + /// { + /// NUIApplication app = new NUIApplication(); + /// app.Run(args); + /// } + /// + /// /// 4 public override void Run(string[] args) { @@ -493,6 +528,7 @@ public override void Run(string[] args) /// /// Exits the NUIApplication. + /// This method causes the application to terminate gracefully. /// /// 4 public override void Exit() @@ -557,8 +593,34 @@ static public Size GetScreenSize() } /// + /// Sets the geometry hit-testing enabled or disabled for the application. + /// + /// True to enable geometry hit-testing, false otherwise. + [EditorBrowsable(EditorBrowsableState.Never)] + static public void SetGeometryHittestEnabled(bool enable) + { + Interop.Application.SetGeometryHittestEnabled(enable); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + + /// + /// Checks whether geometry hit-testing is enabled for the application. + /// + /// True if geometry hit-testing is enabled, false otherwise. + [EditorBrowsable(EditorBrowsableState.Never)] + static public bool IsGeometryHittestEnabled() + { + bool ret = Interop.Application.IsGeometryHittestEnabled(); + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + + + /// + /// The OnLocaleChanged method is called when the system locale settings have changed. /// Overrides this method if you want to handle behavior. /// + /// The event arguments containing the new locale information. /// 3 protected override void OnLocaleChanged(LocaleChangedEventArgs e) { @@ -566,8 +628,10 @@ protected override void OnLocaleChanged(LocaleChangedEventArgs e) } /// + /// The OnLowBattery method is called when the system is under Low Battery status. /// Overrides this method if you want to handle behavior. /// + /// The event arguments containing the battery status. /// 3 protected override void OnLowBattery(LowBatteryEventArgs e) { @@ -575,8 +639,10 @@ protected override void OnLowBattery(LowBatteryEventArgs e) } /// + /// The OnLowMemory method is called when the system is under Low Memory status. /// Overrides this method if you want to handle behavior. /// + /// The event arguments containing low memory status information. /// 3 protected override void OnLowMemory(LowMemoryEventArgs e) { @@ -584,8 +650,11 @@ protected override void OnLowMemory(LowMemoryEventArgs e) } /// + /// This method is called when the system's region format settings have changed. + /// It provides an opportunity to handle any necessary adjustments or updates based on the new region format. /// Overrides this method if you want to handle behavior. /// + /// The event arguments containing information about the region format change. /// 3 protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) { @@ -594,7 +663,6 @@ protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) /// /// This method is to handle behavior when the device orientation is changed. - /// /// When device is rotated to ccw or cw, this event occurs. /// In addition, this event is different to window orientation changed event. /// The window orientation event is for per a window and occurs when some flags should be set before. @@ -607,6 +675,7 @@ protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) } /// + /// This method is called when the application is terminated. /// Overrides this method if you want to handle behavior. /// /// 3 @@ -617,7 +686,7 @@ protected override void OnTerminate() } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if you want to handle behavior when the application is paused. /// /// 3 protected virtual void OnPause() @@ -627,7 +696,7 @@ protected virtual void OnPause() } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if you want to handle behavior when the application is resumed. /// /// 3 protected virtual void OnResume() @@ -637,7 +706,8 @@ protected virtual void OnResume() } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if you want to handle behavior before the application is created. + /// This method is guaranteed to be called before is called. /// /// 3 protected virtual void OnPreCreate() @@ -653,8 +723,9 @@ protected virtual void OnPreCreate() } /// - /// Overrides this method if you want to handle behavior. + /// This method is overridden to handle the application control event received. /// + /// The event arguments containing the received application control. /// 3 protected override void OnAppControlReceived(AppControlReceivedEventArgs e) { @@ -667,7 +738,9 @@ protected override void OnAppControlReceived(AppControlReceivedEventArgs e) } /// - /// Overrides this method if you want to handle behavior. + /// The OnCreate method of NUIApplication class. + /// This method is called when the application is created. + /// Override this method to handle custom initialization logic. /// /// 3 protected override void OnCreate() diff --git a/src/Tizen.NUI/src/public/Application/NUIComponentApplication.cs b/src/Tizen.NUI/src/public/Application/NUIComponentApplication.cs index 4280633baaf..4f01ab5da1e 100755 --- a/src/Tizen.NUI/src/public/Application/NUIComponentApplication.cs +++ b/src/Tizen.NUI/src/public/Application/NUIComponentApplication.cs @@ -19,6 +19,7 @@ using System.ComponentModel; using Tizen.Applications; using Tizen.Applications.ComponentBased.Common; +using System.Threading; namespace Tizen.NUI { @@ -40,6 +41,7 @@ public class NUIComponentApplication : CoreApplication [EditorBrowsable(EditorBrowsableState.Never)] public NUIComponentApplication(IDictionary typeInfo) : base(new NUIComponentCoreBackend()) { + Registry.Instance.SavedApplicationThread = Thread.CurrentThread; if (typeInfo != null) { foreach (var component in typeInfo) @@ -72,6 +74,10 @@ public void RegisterComponent(Type compType, string compId) { componentFactories.Add(compType, new ServiceComponentStateManager(compType, compId, null)); } + else if (typeof(WidgetComponent).IsAssignableFrom(compType)) + { + componentFactories.Add(compType, new WidgetComponentStateManager(compType, compId, null)); + } else { throw new ArgumentException("compType must be sub type of FrameComponent or ServiceComponent", nameof(compType)); diff --git a/src/Tizen.NUI/src/public/Application/NUIWidgetApplication.cs b/src/Tizen.NUI/src/public/Application/NUIWidgetApplication.cs index 612fabefcfc..f8a352a2b56 100755 --- a/src/Tizen.NUI/src/public/Application/NUIWidgetApplication.cs +++ b/src/Tizen.NUI/src/public/Application/NUIWidgetApplication.cs @@ -115,7 +115,8 @@ internal WidgetApplication ApplicationHandle } /// - /// Run NUIWidgetApplication. + /// Runs the NUI widget application. + /// This method starts the main loop of the application. /// /// Arguments from commandline. /// 4 @@ -126,8 +127,12 @@ public override void Run(string[] args) } /// - /// Exit NUIWidgetApplication. + /// The Exit method of NUIWidgetApplication. /// + /// + /// Note that calling this method will terminate the entire application. + /// Ensure that all necessary cleanup operations are performed before calling this method. + /// /// 4 public override void Exit() { @@ -150,8 +155,9 @@ public void FlushUpdateMessages() } /// - /// Overrides this method if want to handle OnLocaleChanged behavior. + /// Override this method to implement custom behavior when the system locale changes. /// + /// The event arguments containing the new locale information. /// 4 protected override void OnLocaleChanged(LocaleChangedEventArgs e) { @@ -160,8 +166,10 @@ protected override void OnLocaleChanged(LocaleChangedEventArgs e) } /// - /// Overrides this method if want to handle OnLowBattery behavior. + /// The OnLowBattery method is called when the device's battery level is low. + /// This method can be overridden to implement custom behavior when the device's battery level is low. /// + /// The event arguments containing the battery status. /// 4 protected override void OnLowBattery(LowBatteryEventArgs e) { @@ -170,8 +178,10 @@ protected override void OnLowBattery(LowBatteryEventArgs e) } /// + /// This method is called when the system is running low on memory. /// Overrides this method if want to handle OnLowMemory behavior. /// + /// The event arguments containing the memory status. /// 4 protected override void OnLowMemory(LowMemoryEventArgs e) { @@ -180,8 +190,9 @@ protected override void OnLowMemory(LowMemoryEventArgs e) } /// - /// Overrides this method if want to handle OnRegionFormatChanged behavior. + /// This method can be overridden to implement custom behavior when the region format changes. /// + /// The event arguments containing information about the region format change. /// 4 protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) { @@ -191,7 +202,6 @@ protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) /// /// This method is to handle behavior when the device orientation is changed. - /// /// When device is rotated to ccw or cw, this event occurs. /// In addition, this event is different to window orientation changed event. /// The window orientation event is for per a window and occurs when some flags should be set before. @@ -205,7 +215,8 @@ protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) } /// - /// Overrides this method if want to handle OnTerminate behavior. + /// This method is called when the application is terminated. + /// This method is overridden to perform custom actions when the application terminates. /// /// 4 protected override void OnTerminate() @@ -215,7 +226,8 @@ protected override void OnTerminate() } /// - /// Overrides this method if want to handle OnPreCreate behavior. + /// Overrides this method if you want to handle behavior before the application is created. + /// This method is guaranteed to be called before is called. /// /// 4 protected virtual void OnPreCreate() @@ -224,7 +236,8 @@ protected virtual void OnPreCreate() } /// - /// Overrides this method if want to handle OnCreate behavior. + /// This method is called when the application is created. + /// Override this method to handle custom initialization logic. /// /// 4 protected override void OnCreate() diff --git a/src/Tizen.NUI/src/public/Application/NUIWidgetComponent.cs b/src/Tizen.NUI/src/public/Application/NUIWidgetComponent.cs new file mode 100755 index 00000000000..98f26159071 --- /dev/null +++ b/src/Tizen.NUI/src/public/Application/NUIWidgetComponent.cs @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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.ComponentModel; +using Tizen.Applications; +using Tizen.Applications.ComponentBased.Common; + +namespace Tizen.NUI +{ + /// + /// The class for showing UI module + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class NUIWidgetComponent : WidgetComponent + { + private bool defaultWindowSet = false; + internal NUIWindowProxy NUIWindowProxy + { + get; + set; + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public Window Window + { + get; + set; + } + + /// + /// Overrides this method to create window. It will be called before OnCreate method. + /// + /// Window object to use + [EditorBrowsable(EditorBrowsableState.Never)] + public override IWindowProxy CreateWindowInfo(int width, int height) + { + ComponentApplication instance = ComponentApplication.Instance as ComponentApplication; + if (instance != null) + { + if (!defaultWindowSet) + { + instance.GetWindow().WindowPositionSize = new Rectangle(0, 0, 1, 1); + instance.GetWindow().BackgroundColor = new Color(0, 0, 0, 0); + instance.GetWindow().Hide(); + defaultWindowSet = true; + } + + Window = new Window(new Rectangle(0, 0, width, height), false); + Window.Show(); + } + NUIWindowProxy = new NUIWindowProxy(Window); + return NUIWindowProxy; + } + + /// + /// Overrides this method to handle behavior when the component is launched. + /// + /// True if a service component is successfully created + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool OnCreate(int width, int height) + { + return true; + } + + /// + /// Overrides this method if you want to handle behavior when the component receives the appcontrol message. + /// + /// True if it was restarted + [EditorBrowsable(EditorBrowsableState.Never)] + public override void OnStart(bool restarted) + { + base.OnStart(restarted); + } + + /// + /// Overrides this method if you want to handle the behavior when the component is resumed. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void OnResume() + { + base.OnResume(); + } + + /// + /// Overrides this method if you want to handle the behavior when the component is paused. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void OnPause() + { + base.OnPause(); + } + + /// + /// Overrides this method if you want to handle the behavior when the component is stopped. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void OnStop() + { + base.OnStop(); + } + + /// + /// Overrides this method if want to handle behavior when the component is destroyed. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void OnDestroy(bool permanent) + { + base.OnDestroy(permanent); + } + } +} + diff --git a/src/Tizen.NUI/src/public/ApplicationAnimation/ApplicationTransitionManager.cs b/src/Tizen.NUI/src/public/ApplicationAnimation/ApplicationTransitionManager.cs index c2fb041634b..a443685d4ff 100755 --- a/src/Tizen.NUI/src/public/ApplicationAnimation/ApplicationTransitionManager.cs +++ b/src/Tizen.NUI/src/public/ApplicationAnimation/ApplicationTransitionManager.cs @@ -39,6 +39,7 @@ public class ApplicationTransitionManager : IDisposable /// /// ApplicationTransitionManager Instance for singleton /// + [EditorBrowsable(EditorBrowsableState.Never)] public static ApplicationTransitionManager Instance { get diff --git a/src/Tizen.NUI/src/public/BaseComponents/AnimatedImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/AnimatedImageView.cs index 9f546335f88..3d47a406037 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/AnimatedImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/AnimatedImageView.cs @@ -42,6 +42,7 @@ public partial class AnimatedImageView : ImageView ImageVisualProperty.FrameDelay, ImageVisualProperty.LoopCount, ImageVisualProperty.StopBehavior, + ImageVisualProperty.FrameSpeedFactor, }; private List resourceURLs = new List(); #endregion Private @@ -284,6 +285,50 @@ private StopBehaviorType InternalStopBehavior } } + /// + /// Specifies a speed factor for the animated image frame. + /// + /// + /// The speed factor is a multiplier of the normal velocity of the animation. Values between [0,1] will + /// slow down the animation and values above one will speed up the animation. + /// + /// The range of this value is clamped between [0.01f ~ 100.0f]. + /// + /// Inhouse API. + /// The default is 1.0f. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float FrameSpeedFactor + { + get + { + return InternalFrameSpeedFactor; + } + set + { + InternalFrameSpeedFactor = value; + NotifyPropertyChanged(); + } + } + + private float InternalFrameSpeedFactor + { + get + { + float ret = 1.0f; + + using PropertyValue frameSpeedFactor = GetCachedImageVisualProperty(ImageVisualProperty.FrameSpeedFactor); + frameSpeedFactor?.Get(out ret); + + return ret; + } + set + { + using PropertyValue setValue = new PropertyValue(value); + UpdateImage(ImageVisualProperty.FrameSpeedFactor, setValue); + } + } + /// /// Get the number of total frames /// diff --git a/src/Tizen.NUI/src/public/BaseComponents/CameraView.cs b/src/Tizen.NUI/src/public/BaseComponents/CameraView.cs index 84f85ff96f6..43a6fcf1c03 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/CameraView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/CameraView.cs @@ -26,10 +26,20 @@ namespace Tizen.NUI.BaseComponents /// 9 public class CameraView : View { + /// + /// Enumeration for specifying the display type of the CameraView. + /// /// 9 public enum DisplayType { + /// + /// The camera view will be displayed using hardware overlay. + /// Window = 0, // HW overlay + + /// + /// The camera view will be displayed using texture stream. + /// Image // texture stream }; diff --git a/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs b/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs index 73939b6f5c7..4454995a18f 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI.BaseComponents /// 3 public class CustomView : ViewWrapper { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty FocusNavigationSupportProperty = null; internal static void SetInternalFocusNavigationSupportProperty(BindableObject bindable, object oldValue, object newValue) @@ -43,7 +43,7 @@ internal static object GetInternalFocusNavigationSupportProperty(BindableObject return customView.IsKeyboardNavigationSupported(); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty FocusGroupProperty = null; internal static void SetInternalFocusGroupProperty(BindableObject bindable, object oldValue, object newValue) @@ -550,35 +550,6 @@ protected override bool OnAccessibilityActivated() return OnKeyboardEnter(); } - /// - /// This method should be overridden by deriving classes when they wish to respond the accessibility. - /// - /// The pan gesture. - /// True if the pan gesture has been consumed by this control. - internal virtual bool OnAccessibilityPan(PanGesture gestures) - { - return false; - } - - /// - /// This method should be overridden by deriving classes when they wish to respond the accessibility up and down action (i.e., value change of slider control). - /// - /// Whether the value should be increased or decreased. - /// True if the value changed action has been consumed by this control. - internal virtual bool OnAccessibilityValueChange(bool isIncrease) - { - return false; - } - - /// - /// This method should be overridden by deriving classes when they wish to respond the accessibility zoom action. - /// - /// True if the zoom action has been consumed by this control. - internal virtual bool OnAccessibilityZoom() - { - return false; - } - /// /// Allows deriving classes to disable any of the gesture detectors.
/// Like EnableGestureDetection, this can also be called using bitwise or one at a time.
@@ -833,9 +804,6 @@ private void Initialize() viewWrapperImpl.OnLayoutNegotiated = new ViewWrapperImpl.OnLayoutNegotiatedDelegate(OnLayoutNegotiated); viewWrapperImpl.OnStyleChange = new ViewWrapperImpl.OnStyleChangeDelegate(OnStyleChange); viewWrapperImpl.OnAccessibilityActivated = new ViewWrapperImpl.OnAccessibilityActivatedDelegate(OnAccessibilityActivated); - viewWrapperImpl.OnAccessibilityPan = new ViewWrapperImpl.OnAccessibilityPanDelegate(OnAccessibilityPan); - viewWrapperImpl.OnAccessibilityValueChange = new ViewWrapperImpl.OnAccessibilityValueChangeDelegate(OnAccessibilityValueChange); - viewWrapperImpl.OnAccessibilityZoom = new ViewWrapperImpl.OnAccessibilityZoomDelegate(OnAccessibilityZoom); viewWrapperImpl.OnFocusGained = new ViewWrapperImpl.OnFocusGainedDelegate(OnFocusGained); viewWrapperImpl.OnFocusLost = new ViewWrapperImpl.OnFocusLostDelegate(OnFocusLost); viewWrapperImpl.GetNextFocusableView = new ViewWrapperImpl.GetNextFocusableViewDelegate(GetNextFocusableView); diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index dc18df27ca6..90023161c5a 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -33,7 +33,7 @@ public partial class ImageView : View { static ImageView() { - if(NUIApplication.IsUsingXaml) + if (NUIApplication.IsUsingXaml) { ResourceUrlProperty = BindableProperty.Create(nameof(ImageView.ResourceUrl), typeof(string), typeof(ImageView), string.Empty, propertyChanged: SetInternalResourceUrlProperty, defaultValueCreator: GetInternalResourceUrlProperty); @@ -52,7 +52,7 @@ static ImageView() SynchronousLoadingProperty = BindableProperty.Create(nameof(SynchronousLoading), typeof(bool), typeof(ImageView), false, propertyChanged: SetInternalSynchronousLoadingProperty, defaultValueCreator: GetInternalSynchronousLoadingProperty); OrientationCorrectionProperty = BindableProperty.Create(nameof(OrientationCorrection), typeof(bool), typeof(ImageView), false, propertyChanged: SetInternalOrientationCorrectionProperty, defaultValueCreator: GetInternalOrientationCorrectionProperty); - + MaskingModeProperty = BindableProperty.Create(nameof(MaskingMode), typeof(MaskingModeType), typeof(ImageView), default(MaskingModeType), propertyChanged: SetInternalMaskingModeProperty, defaultValueCreator: GetInternalMaskingModeProperty); FastTrackUploadingProperty = BindableProperty.Create(nameof(FastTrackUploading), typeof(bool), typeof(ImageView), false, propertyChanged: SetInternalFastTrackUploadingProperty, defaultValueCreator: GetInternalFastTrackUploadingProperty); @@ -125,6 +125,7 @@ private static string ConvertResourceUrl(ref string value) ImageVisualProperty.AlphaMaskURL, ImageVisualProperty.CropToMask, Visual.Property.VisualFittingMode, + ImageVisualProperty.SamplingMode, ImageVisualProperty.DesiredWidth, ImageVisualProperty.DesiredHeight, ImageVisualProperty.ReleasePolicy, @@ -136,6 +137,7 @@ private static string ConvertResourceUrl(ref string value) Visual.Property.PremultipliedAlpha, ImageVisualProperty.OrientationCorrection, ImageVisualProperty.FastTrackUploading, + ImageVisualProperty.SynchronousSizing, NpatchImageVisualProperty.Border, NpatchImageVisualProperty.BorderOnly, }; @@ -305,12 +307,12 @@ public event EventHandler ResourceReady { _resourceReadyEventHandler -= value; - ViewResourceReadySignal resourceReadySignal = ResourceReadySignal(this); - if (_resourceReadyEventHandler == null && resourceReadySignal?.Empty() == false) + if (_resourceReadyEventHandler == null && _resourceReadyEventCallback != null) { + using ViewResourceReadySignal resourceReadySignal = ResourceReadySignal(this); resourceReadySignal?.Disconnect(_resourceReadyEventCallback); + _resourceReadyEventCallback = null; } - resourceReadySignal?.Dispose(); } } @@ -331,12 +333,12 @@ internal event EventHandler ResourceLoaded remove { _resourceLoadedEventHandler -= value; - ViewResourceReadySignal resourceReadySignal = this.ResourceReadySignal(this); - if (_resourceLoadedEventHandler == null && resourceReadySignal?.Empty() == false) + if (_resourceLoadedEventHandler == null && _resourceLoadedCallback != null) { + using ViewResourceReadySignal resourceReadySignal = this.ResourceReadySignal(this); resourceReadySignal?.Disconnect(_resourceLoadedCallback); + _resourceLoadedCallback = null; } - resourceReadySignal?.Dispose(); } } @@ -773,6 +775,27 @@ public bool OrientationCorrection } } + /// + /// Gets or sets whether to automatically reload the image as the view size
+ /// If we set this value as true, view size will be works as desired size of image.
+ ///
+ /// + /// If we set this value as true, and will be invalidated. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool SynchronousSizing + { + get + { + return (bool)GetInternalSynchronousSizingProperty(this); + } + set + { + SetInternalSynchronousSizingProperty(this, value); + NotifyPropertyChanged(); + } + } + /// /// Gets or sets whether to apply mask on GPU or not.
///
@@ -1266,6 +1289,32 @@ private FittingModeType InternalFittingMode } } + /// + /// Gets or sets filtering options used when resizing images to the sample original pixels.
+ /// If not supplied, the default is SamplingModeType.BoxThenLinear.
+ /// For normal quad images only.
+ /// Optional. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public SamplingModeType SamplingMode + { + get + { + int ret = (int)SamplingModeType.BoxThenLinear; + + using PropertyValue samplingMode = GetCachedImageVisualProperty(ImageVisualProperty.SamplingMode); + samplingMode?.Get(out ret); + + return (SamplingModeType)ret; + } + set + { + using PropertyValue setValue = new PropertyValue((int)value); + UpdateImage(ImageVisualProperty.SamplingMode, setValue); + NotifyPropertyChanged(); + } + } + /// /// This method allows users to configure the blending of two images(previous and currnet) using alpha values. /// @@ -1874,6 +1923,7 @@ internal ViewResourceReadySignal ResourceReadySignal(View view) return ret; } + [EditorBrowsable(EditorBrowsableState.Never)] internal override void ApplyCornerRadius() { base.ApplyCornerRadius(); @@ -1887,10 +1937,15 @@ internal override void ApplyCornerRadius() { Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius)); } + if (backgroundExtraData.CornerSquareness != null) + { + Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.CornerSquareness, Vector4.getCPtr(backgroundExtraData.CornerSquareness)); + } Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, ImageView.Property.IMAGE, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy); } } + [EditorBrowsable(EditorBrowsableState.Never)] internal override void ApplyBorderline() { base.ApplyBorderline(); @@ -1952,6 +2007,12 @@ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef // Callback for View ResourceReady signal private void OnResourceReady(IntPtr data) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (!CheckResourceReady()) { return; @@ -2085,7 +2146,7 @@ internal void SetImageByPropertyMap(PropertyMap map) /// (Example : if we change SynchronousLoading property from 'true' to 'false', or if we call this function during UpdateImage) ///
[EditorBrowsable(EditorBrowsableState.Never)] - protected virtual void UpdateImage(int key, PropertyValue value, bool requiredVisualCreation = true) + protected void UpdateImage(int key, PropertyValue value, bool requiredVisualCreation = true) { // Update image property map value as inputed value. if (key != 0) @@ -2198,6 +2259,13 @@ protected virtual void UpdateImage() cachedImagePropertyMap[Visual.Property.CornerRadius] = cornerRadius; cachedImagePropertyMap[Visual.Property.CornerRadiusPolicy] = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)); } + if (backgroundExtraData.CornerSquareness != null) + { + using (var cornerSquareness = new PropertyValue(backgroundExtraData.CornerSquareness)) + { + cachedImagePropertyMap[Visual.Property.CornerSquareness] = cornerSquareness; + } + } } if (backgroundExtraData != null && backgroundExtraData.BorderlineWidth > 0.0f) @@ -2319,6 +2387,12 @@ protected override bool CheckResourceReady() private void OnResourceLoaded(IntPtr view) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (!CheckResourceReady()) { return; diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs index 14b121f421b..852d1e0b7d1 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs @@ -360,6 +360,23 @@ internal static object GetInternalOrientationCorrectionProperty(BindableObject b return ret; } + /// + /// SynchronousSizingProperty + /// + internal static void SetInternalSynchronousSizingProperty(ImageView imageView, bool newValue) + { + imageView.UpdateImage(ImageVisualProperty.SynchronousSizing, new PropertyValue(newValue)); + } + + internal static object GetInternalSynchronousSizingProperty(ImageView imageView) + { + bool ret = false; + + imageView.GetCachedImageVisualProperty(ImageVisualProperty.SynchronousSizing)?.Get(out ret); + + return ret; + } + /// /// MaskingModeProperty /// diff --git a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs index 2c8a788ab49..c7b4d45fa65 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs @@ -77,6 +77,7 @@ public LottieAnimationView(float scale = 1.0f, bool shown = true) : base() currentStates.loopCount = 1; currentStates.loopMode = LoopingModeType.Restart; currentStates.stopEndAction = StopBehaviorType.CurrentFrame; + currentStates.frameSpeedFactor = 1.0f; currentStates.framePlayRangeMin = -1; currentStates.framePlayRangeMax = -1; currentStates.totalFrame = -1; @@ -216,6 +217,7 @@ private string InternalURL using PropertyValue synchronousLoading = new PropertyValue(currentStates.synchronousLoading); using PropertyValue enableFrameCache = new PropertyValue(currentStates.enableFrameCache); using PropertyValue notifyAfterRasterization = new PropertyValue(currentStates.notifyAfterRasterization); + using PropertyValue frameSpeedFactor = new PropertyValue(currentStates.frameSpeedFactor); map.Add(Visual.Property.Type, type) .Add(ImageVisualProperty.URL, url) @@ -225,7 +227,8 @@ private string InternalURL .Add(ImageVisualProperty.RedrawInScalingDown, redrawInScalingDown) .Add(ImageVisualProperty.SynchronousLoading, synchronousLoading) .Add(ImageVisualProperty.EnableFrameCache, enableFrameCache) - .Add(ImageVisualProperty.NotifyAfterRasterization, notifyAfterRasterization); + .Add(ImageVisualProperty.NotifyAfterRasterization, notifyAfterRasterization) + .Add(ImageVisualProperty.FrameSpeedFactor, frameSpeedFactor); if (currentStates.desiredWidth > 0) { @@ -242,7 +245,7 @@ private string InternalURL if (backgroundExtraData != null) { - if (backgroundExtraData.CornerRadius != null) + if (backgroundExtraData.CornerRadius != null || backgroundExtraData.CornerSquareness != null) { UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.ContentsCornerRadius); } @@ -323,7 +326,8 @@ private string InternalURL } /// - /// Gets the playing state + /// Gets the playing state of the LottieAnimationView. + /// This property returns the current play state of the LottieAnimationView. /// /// 7 public PlayStateType PlayState @@ -553,7 +557,8 @@ private int InternalLoopCount } /// - /// Sets or gets the stop behavior. + /// Sets or gets the stop behavior of the LottieAnimationView. + /// This property determines how the animation behaves when it stops. /// /// 7 public StopBehaviorType StopBehavior @@ -779,6 +784,53 @@ private bool InternalNotifyAfterRasterization return currentStates.notifyAfterRasterization; } } + + /// + /// Specifies a speed factor for the animated image frame. + /// + /// + /// The speed factor is a multiplier of the normal velocity of the animation. Values between [0,1] will + /// slow down the animation and values above one will speed up the animation. + /// + /// The range of this value is clamped between [0.01f ~ 100.0f]. + /// + /// Inhouse API. + /// The default is 1.0f. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float FrameSpeedFactor + { + get + { + return InternalFrameSpeedFactor; + } + set + { + InternalFrameSpeedFactor = value; + NotifyPropertyChanged(); + } + } + + private float InternalFrameSpeedFactor + { + set + { + if (currentStates.frameSpeedFactor != value) + { + currentStates.changed = true; + currentStates.frameSpeedFactor = value; + + NUILog.Debug($"<[{GetId()}]SET currentStates.FrameSpeedFactor={currentStates.frameSpeedFactor}>"); + + Interop.View.InternalUpdateVisualPropertyFloat(this.SwigCPtr, ImageView.Property.IMAGE, ImageVisualProperty.FrameSpeedFactor, currentStates.frameSpeedFactor); + } + } + get + { + NUILog.Debug($"FrameSpeedFactor get! {currentStates.frameSpeedFactor}"); + return currentStates.frameSpeedFactor; + } + } #endregion Property @@ -809,7 +861,8 @@ public void SetMinMaxFrame(int minFrame, int maxFrame) } /// - /// Play Animation. + /// Plays the Lottie animation. + /// This method starts the playback of the Lottie animation. /// /// 7 public new void Play() @@ -821,7 +874,8 @@ public void SetMinMaxFrame(int minFrame, int maxFrame) } /// - /// Pause Animation. + /// Pauses the Lottie animation. + /// This method pauses the animation without resetting its progress. /// /// 7 public new void Pause() @@ -833,7 +887,8 @@ public void SetMinMaxFrame(int minFrame, int maxFrame) } /// - /// Stop Animation. + /// Stops the Lottie animation. + /// This method stops the currently playing Lottie animation. /// /// 7 public new void Stop() @@ -1103,6 +1158,7 @@ protected override void UpdateImage() UpdateImage(ImageVisualProperty.SynchronousLoading, new PropertyValue(currentStates.synchronousLoading), false); UpdateImage(ImageVisualProperty.EnableFrameCache, new PropertyValue(currentStates.enableFrameCache), false); UpdateImage(ImageVisualProperty.NotifyAfterRasterization, new PropertyValue(currentStates.notifyAfterRasterization), false); + UpdateImage(ImageVisualProperty.FrameSpeedFactor, new PropertyValue(currentStates.frameSpeedFactor), false); // Do not cache PlayRange and TotalFrameNumber into cachedImagePropertyMap. // (To keep legacy implements behaviour) @@ -1143,7 +1199,7 @@ protected override void MergeCachedImageVisualProperty(PropertyMap map) #region Event, Enum, Struct, ETC /// - /// Animation finished event. + /// The event handler for the animation finished event. /// /// 7 public event EventHandler Finished @@ -1166,11 +1222,8 @@ public event EventHandler Finished if (finishedEventHandler == null && visualEventSignalCallback != null) { using VisualEventSignal visualEvent = VisualEventSignal(); - visualEvent.Disconnect(visualEventSignalCallback); - if (visualEvent?.Empty() == true) - { - visualEventSignalCallback = null; - } + visualEvent?.Disconnect(visualEventSignalCallback); + visualEventSignalCallback = null; } } } @@ -1309,7 +1362,19 @@ public enum VectorProperty /// Transform opacity of the Layer and Group object, Type of float ///
[EditorBrowsable(EditorBrowsableState.Never)] - TransformOpacity + TransformOpacity, + + /// + /// Trim Start property of Shape object, Type of float, Value range of [0..100] + /// + [EditorBrowsable(EditorBrowsableState.Never)] + TrimStart, + + /// + /// Trim End property of Shape object, Type of float, Type of , Value range of [0..100] + /// + [EditorBrowsable(EditorBrowsableState.Never)] + TrimEnd }; // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) @@ -1440,6 +1505,7 @@ static internal void RootCallback(int id, int returnType, uint frameNumber, ref case (int)(VectorProperty.TransformAnchor): case (int)(VectorProperty.TransformPosition): case (int)(VectorProperty.TransformScale): + case (int)(VectorProperty.TrimEnd): Vector2 tmpVector2 = new Vector2(-1, -1); if ((ret != null) && ret.Get(tmpVector2)) { @@ -1453,6 +1519,7 @@ static internal void RootCallback(int id, int returnType, uint frameNumber, ref case (int)(VectorProperty.StrokeWidth): case (int)(VectorProperty.TransformRotation): case (int)(VectorProperty.TransformOpacity): + case (int)(VectorProperty.TrimStart): float tmpFloat = -1; if ((ret != null) && ret.Get(out tmpFloat)) { @@ -1463,7 +1530,6 @@ static internal void RootCallback(int id, int returnType, uint frameNumber, ref //do nothing break; } - ret?.Dispose(); } internal void FlushLottieMessages() @@ -1485,6 +1551,7 @@ internal void FlushLottieMessages() ImageVisualProperty.RedrawInScalingDown, ImageVisualProperty.EnableFrameCache, ImageVisualProperty.NotifyAfterRasterization, + ImageVisualProperty.FrameSpeedFactor, }; private struct states @@ -1493,6 +1560,7 @@ private struct states internal int loopCount; internal LoopingModeType loopMode; internal StopBehaviorType stopEndAction; + internal float frameSpeedFactor; internal int framePlayRangeMin; internal int framePlayRangeMax; internal int totalFrame; @@ -1510,7 +1578,6 @@ private struct states }; private states currentStates; - private const string tag = "NUITEST"; private event EventHandler finishedEventHandler; private void OnFinished() diff --git a/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs b/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs index 26156b44bfc..046cd90f995 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs @@ -27,6 +27,7 @@ namespace Tizen.NUI.BaseComponents /// (via touch) or automatically. ///
/// 3 + [Obsolete("This has been deprecated in API12")] public class Scrollable : View { static Scrollable() @@ -58,6 +59,7 @@ static Scrollable() /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty OvershootEffectColorProperty = null; internal static void SetInternalOvershootEffectColorProperty(BindableObject bindable, object oldValue, object newValue) @@ -79,6 +81,7 @@ internal static object GetInternalOvershootEffectColorProperty(BindableObject bi /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty OvershootAnimationSpeedProperty = null; internal static void SetInternalOvershootAnimationSpeedProperty(BindableObject bindable, object oldValue, object newValue) @@ -100,6 +103,7 @@ internal static object GetInternalOvershootAnimationSpeedProperty(BindableObject /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty OvershootEnabledProperty = null; internal static void SetInternalOvershootEnabledProperty(BindableObject bindable, object oldValue, object newValue) @@ -121,6 +125,7 @@ internal static object GetInternalOvershootEnabledProperty(BindableObject bindab /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty OvershootSizeProperty = null; internal static void SetInternalOvershootSizeProperty(BindableObject bindable, object oldValue, object newValue) @@ -142,6 +147,7 @@ internal static object GetInternalOvershootSizeProperty(BindableObject bindable) /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty ScrollToAlphaFunctionProperty = null; internal static void SetInternalScrollToAlphaFunctionProperty(BindableObject bindable, object oldValue, object newValue) @@ -163,6 +169,7 @@ internal static object GetInternalScrollToAlphaFunctionProperty(BindableObject b /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty ScrollRelativePositionProperty = null; internal static void SetInternalScrollRelativePositionProperty(BindableObject bindable, object oldValue, object newValue) @@ -184,6 +191,7 @@ internal static object GetInternalScrollRelativePositionProperty(BindableObject /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty ScrollPositionMinProperty = null; internal static void SetInternalScrollPositionMinProperty(BindableObject bindable, object oldValue, object newValue) @@ -205,6 +213,7 @@ internal static object GetInternalScrollPositionMinProperty(BindableObject binda /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty ScrollPositionMaxProperty = null; internal static void SetInternalScrollPositionMaxProperty(BindableObject bindable, object oldValue, object newValue) @@ -226,6 +235,7 @@ internal static object GetInternalScrollPositionMaxProperty(BindableObject binda /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty CanScrollVerticalProperty = null; internal static void SetInternalCanScrollVerticalProperty(BindableObject bindable, object oldValue, object newValue) @@ -247,6 +257,7 @@ internal static object GetInternalCanScrollVerticalProperty(BindableObject binda /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] public static readonly BindableProperty CanScrollHorizontalProperty = null; internal static void SetInternalCanScrollHorizontalProperty(BindableObject bindable, object oldValue, object newValue) @@ -277,6 +288,7 @@ internal static object GetInternalCanScrollHorizontalProperty(BindableObject bin /// Create an instance of scrollable. /// /// 3 + [Obsolete("This has been deprecated in API12")] public Scrollable() : this(Interop.Scrollable.NewScrollable(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -299,6 +311,7 @@ internal Scrollable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cM /// The ScrollStarted event emitted when the Scrollable has moved (whether by touch or animation). /// /// 3 + [Obsolete("This has been deprecated in API12")] public event DaliEventHandler ScrollStarted { add @@ -328,6 +341,7 @@ public event DaliEventHandler ScrollStarted /// The ScrollUpdated event emitted when the Scrollable has moved (whether by touch or animation). /// /// 3 + [Obsolete("This has been deprecated in API12")] public event DaliEventHandler ScrollUpdated { add @@ -358,6 +372,7 @@ public event DaliEventHandler ScrollUpdated /// (whether by touch or animation). /// /// 3 + [Obsolete("This has been deprecated in API12")] public event DaliEventHandler ScrollCompleted { add @@ -387,6 +402,7 @@ public event DaliEventHandler ScrollCompleted /// Sets and Gets the color of the overshoot effect. /// /// 3 + [Obsolete("This has been deprecated in API12")] public Vector4 OvershootEffectColor { get @@ -418,6 +434,7 @@ public Vector4 OvershootEffectColor /// Sets and Gets the speed of overshoot animation in pixels per second. /// /// 3 + [Obsolete("This has been deprecated in API12")] public float OvershootAnimationSpeed { get @@ -449,6 +466,7 @@ public float OvershootAnimationSpeed /// Checks if scroll overshoot has been enabled or not. /// /// 3 + [Obsolete("This has been deprecated in API12")] public bool OvershootEnabled { get @@ -480,6 +498,7 @@ public bool OvershootEnabled /// Gets and Sets OvershootSize property. /// /// 3 + [Obsolete("This has been deprecated in API12")] public Vector2 OvershootSize { get @@ -511,6 +530,7 @@ public Vector2 OvershootSize /// Gets and Sets ScrollToAlphaFunction property. /// /// 3 + [Obsolete("This has been deprecated in API12")] public int ScrollToAlphaFunction { get @@ -542,6 +562,7 @@ public int ScrollToAlphaFunction /// Gets and Sets ScrollRelativePosition property. /// /// 3 + [Obsolete("This has been deprecated in API12")] public Vector2 ScrollRelativePosition { get @@ -573,6 +594,7 @@ public Vector2 ScrollRelativePosition /// Gets and Sets ScrollPositionMin property. /// /// 3 + [Obsolete("This has been deprecated in API12")] public Vector2 ScrollPositionMin { get @@ -604,6 +626,7 @@ public Vector2 ScrollPositionMin /// Gets and Sets ScrollPositionMax property. /// /// 3 + [Obsolete("This has been deprecated in API12")] public Vector2 ScrollPositionMax { get @@ -635,6 +658,7 @@ public Vector2 ScrollPositionMax /// Gets and Sets CanScrollVertical property. /// /// 3 + [Obsolete("This has been deprecated in API12")] public bool CanScrollVertical { get @@ -666,6 +690,7 @@ public bool CanScrollVertical /// Gets and Sets CanScrollHorizontal property. /// /// 3 + [Obsolete("This has been deprecated in API12")] public bool CanScrollHorizontal { get @@ -719,6 +744,7 @@ internal ScrollableSignal ScrollCompletedSignal() /// /// DisposeTypes /// 3 + [Obsolete("This has been deprecated in API12")] protected override void Dispose(DisposeTypes type) { if (disposed) @@ -739,6 +765,7 @@ protected override void Dispose(DisposeTypes type) /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.Scrollable.DeleteScrollable(swigCPtr); @@ -853,6 +880,7 @@ private float GetOvershootAnimationSpeed() /// The scroll animation started event arguments. /// /// 3 + [Obsolete("This has been deprecated in API12")] public class StartedEventArgs : EventArgs { private Vector2 vector2; @@ -878,6 +906,7 @@ public Vector2 Vector2 /// The scrollable updated event arguments. /// /// 3 + [Obsolete("This has been deprecated in API12")] public class UpdatedEventArgs : EventArgs { private Vector2 vector2; @@ -903,6 +932,7 @@ public Vector2 Vector2 /// The scroll animation completed event arguments. /// /// 3 + [Obsolete("This has been deprecated in API12")] public class CompletedEventArgs : EventArgs { private Vector2 vector2; diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs index d54b9ba34c5..bc0772b14f1 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/Selector.cs @@ -53,6 +53,7 @@ public static implicit operator Selector(T value) /// /// Create an empty selector. + /// This constructor returns an empty selector object which can be used to define various selectors for different states and conditions. /// /// 9 public Selector() @@ -149,9 +150,9 @@ public T DisabledFocused set => Add(ControlState.DisabledFocused, value); } /// - /// SelectedFocused State. + /// Gets or sets the value associated with the SelectedFocused state. /// - /// This is for XAML. Do not ACR this. + /// This property is intended for internal use within XAML files and should not be subject to ACR. public T SelectedFocused { get => GetSafely(x => x.State == ControlState.SelectedFocused); @@ -311,7 +312,7 @@ public void CopyTo(SelectorItem[] items, int startIndex) /// /// Returns an enumerator that iterates through the collection. /// - /// An enumerator that can be used to iterate through the collection. + /// An enumerator that can be used to iterate through the collection. [EditorBrowsable(EditorBrowsableState.Never)] public IEnumerator> GetEnumerator() { @@ -332,9 +333,10 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() /// Get value by State. /// It will traverse from the first item to find proper fit when there is no perfect state match. /// + /// The state to query for the value. + /// The output parameter to store the resulting value if found. /// Thrown when state is null. - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. /// True if the selector has a given state value, false otherwise. [EditorBrowsable(EditorBrowsableState.Never)] public bool GetValue(ControlState state, out T result) @@ -390,7 +392,10 @@ public void Clear() SelectorItems.Clear(); } - /// + /// + /// Converts the Selector object to its string representation. + /// + /// A string that represents the current selector. [EditorBrowsable(EditorBrowsableState.Never)] public override string ToString() { @@ -408,8 +413,8 @@ public override string ToString() /// Clone itself. /// If type T implements ICloneable, it calls Clone() method to clone values, otherwise use operator=. /// - /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// A new Selector T instance that is a clone of the current selector. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Selector Clone() { @@ -466,6 +471,8 @@ private bool EqualsItem(T a, T b) /// /// Determines whether the specified object is equal to the current object. /// + /// The object to compare with the current object. + /// true if the specified object is equal to the current object; otherwise, false. /// 9 public override bool Equals(object other) { @@ -497,6 +504,7 @@ public override bool Equals(object other) /// /// Serves as the default hash function. /// + /// An integer value that specifies the hash code for this instance. [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() { diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs index d7a0b61640d..b1fc21ddd17 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs @@ -23,6 +23,7 @@ namespace Tizen.NUI.BaseComponents { /// /// The base class of style attributes for a view. + /// This class provides a base for defining styles that can be applied to views. /// /// 9 public partial class ViewStyle : BindableObject, IDisposable @@ -69,11 +70,12 @@ static ViewStyle() { } /// /// Create an empty style instance. + /// This constructor initializes an empty style object for a view. /// /// 9 public ViewStyle() { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public ViewStyle(ViewStyle viewAttributes) { @@ -102,7 +104,7 @@ public Selector BackgroundImage set => SetValue(BackgroundImageProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool? Focusable { @@ -133,7 +135,7 @@ public bool? FocusableInTouch set => SetValue(FocusableInTouchProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [Obsolete("This has been deprecated. Use Size instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public Size2D Size2D @@ -144,6 +146,8 @@ public Size2D Size2D /// /// Defines view's opacity value. + /// This property allows you to specify different opacity values for various states of the view, + /// such as normal, pressed, focused, etc. /// /// 9 public Selector Opacity @@ -156,7 +160,7 @@ public Selector Opacity set => SetValue(OpacityProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [Obsolete("This has been deprecated. Use Position instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public Position2D Position2D @@ -232,7 +236,7 @@ public Position Position set => SetValue(PositionProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public float? PositionX { @@ -240,7 +244,7 @@ public float? PositionX set => SetValue(PositionXProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public float? PositionY { @@ -248,7 +252,7 @@ public float? PositionY set => SetValue(PositionYProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Rotation Orientation { @@ -256,7 +260,7 @@ public Rotation Orientation set => SetValue(OrientationProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public DrawModeType? DrawMode { @@ -296,7 +300,7 @@ public ResizePolicyType? HeightResizePolicy set => SetValue(HeightResizePolicyProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool? WidthForHeight { @@ -304,7 +308,7 @@ public bool? WidthForHeight set => SetValue(WidthForHeightProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool? HeightForWidth { @@ -342,7 +346,7 @@ public Size2D MaximumSize set => SetValue(MaximumSizeProperty, value); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public ClippingModeType? ClippingMode { @@ -396,7 +400,7 @@ public Selector Color } /// View BackgroundBorder - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Selector BackgroundImageBorder { @@ -551,7 +555,8 @@ public ViewStyle Clone() } /// - /// Release instance. + /// Releases all resources used by the ViewStyle instance. + /// The Dispose method releases all resources used by the ViewStyle instance. /// /// 9 public void Dispose() @@ -600,9 +605,9 @@ public override void CopyFrom(BindableObject other) } /// - /// Release instance. + /// Releases unmanaged and optionally managed resources. /// - /// If it true, the method has been called by a user's code. Otherwise the method has been called by the finalizer. + /// If it true, the method has been called by a user's code to release both managed and unmanaged resources. Otherwise the method has been called by the finalizer to release only unmanaged resources. /// 9 protected virtual void Dispose(bool disposing) { diff --git a/src/Tizen.NUI/src/public/BaseComponents/TableView.cs b/src/Tizen.NUI/src/public/BaseComponents/TableView.cs index 5c923034a59..72c86b0b77d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TableView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TableView.cs @@ -275,7 +275,8 @@ public int Columns } } /// - /// Padding between cells. + /// Gets or sets the padding between cells in the TableView. + /// The padding vector specifying the horizontal and vertical padding. /// /// 3 public Vector2 CellPadding @@ -306,7 +307,7 @@ public Vector2 CellPadding } /// - /// The number of layout rows. + /// This property allows setting the number of rows in the table view layout, which can affect how child views are arranged within the table. /// /// 3 public PropertyMap LayoutRows @@ -337,7 +338,7 @@ public PropertyMap LayoutRows } /// - /// The number of layout columns. + /// Gets or sets the number of layout columns. /// /// 3 public PropertyMap LayoutColumns @@ -747,6 +748,7 @@ public CellPosition(uint rowIndex) : this(Interop.TableView.NewTableViewCellPosi /// /// The default constructor. + /// Initializes the cell position with default values. /// /// 3 public CellPosition() : this(Interop.TableView.NewTableViewCellPosition(), true) @@ -780,7 +782,7 @@ public uint rowIndex } /// - /// The index or position of a row. + /// Gets or sets the index or position of a row. /// /// 5 public uint RowIndex @@ -795,7 +797,7 @@ public uint RowIndex /// - /// The index of a column. + /// Gets or sets the index of a column. /// /// 3 [Obsolete("Do not use this, that will be deprecated. Use ColumnIndex instead.")] @@ -816,7 +818,7 @@ public uint columnIndex } /// - /// The index or position of a column. + /// Gets or sets the index or position of a column. /// /// 5 public uint ColumnIndex @@ -851,7 +853,7 @@ public uint rowSpan } /// - /// The span of a row. + /// Gets or sets the span of a row. /// /// 5 public uint RowSpan @@ -865,7 +867,7 @@ public uint RowSpan } /// - /// The span of a column. + /// Gets or sets the span of a column. /// /// 3 [Obsolete("Do not use this, that will be deprecated. Use ColumnSpan instead.")] @@ -886,7 +888,7 @@ public uint columnSpan } /// - /// The span of a column. + /// Gets or sets the span of a column. /// /// 5 public uint ColumnSpan diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs b/src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs index 85b0b0d0c3d..db5b93845eb 100644 --- a/src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextConstants.cs @@ -416,6 +416,20 @@ public struct Outline : IEquatable [EditorBrowsable(EditorBrowsableState.Never)] public float? Width { get; set; } + /// + /// The offset in pixels of the offset (if null, the default value is 0, 0).
+ /// If not provided then the offset is not enabled.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 Offset { get; set; } + + /// + /// The radius of blurring effect applied to the outline of the text. A higher value results in a more blurred outline.
+ /// If not specified, the default value is 0 which means no blurring effect will be applied.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public float? BlurRadius { get; set; } + /// /// Determines whether the specified object is equal to the current object. /// @@ -430,7 +444,7 @@ public struct Outline : IEquatable /// The Outline to compare with the current Outline. /// true if equal Outline, else false. [EditorBrowsable(EditorBrowsableState.Never)] - public bool Equals(Outline other) => Color == other.Color && Width == other.Width; + public bool Equals(Outline other) => Color == other.Color && Width == other.Width && Offset == other.Offset && BlurRadius == other.BlurRadius; /// /// The == operator. diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 702230eec7c..de14c9b91f9 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -219,6 +219,7 @@ static TextEditor() /// /// Creates the TextEditor control. + /// This returns a handle to the TextEditor control. /// /// 3 public TextEditor() : this(Interop.TextEditor.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true) @@ -570,7 +571,14 @@ public void SetFontStyle(FontStyle fontStyle) { using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle)) { - SetValue(FontStyleProperty, fontStyleMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(FontStyleProperty, fontStyleMap); + } + else + { + SetInternalFontStyleProperty(this, null, fontStyleMap); + } } } @@ -585,7 +593,7 @@ public void SetFontStyle(FontStyle fontStyle) public FontStyle GetFontStyle() { FontStyle fontStyle; - using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty)) + using (var fontStyleMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(FontStyleProperty) : (PropertyMap)GetInternalFontStyleProperty(this)) { fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap); } @@ -924,7 +932,7 @@ public float CursorBlinkDuration } /// - /// The CursorWidth property. + /// Gets or sets the width of the cursor. /// /// 3 public int CursorWidth @@ -1147,7 +1155,14 @@ public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage) { using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl)) { - SetValue(SelectionHandleImageLeftProperty, leftImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandleImageLeftProperty, leftImageMap); + } + else + { + SetInternalSelectionHandleImageLeftProperty(this, null, leftImageMap); + } } } @@ -1155,7 +1170,14 @@ public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage) { using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl)) { - SetValue(SelectionHandleImageRightProperty, rightImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandleImageRightProperty, rightImageMap); + } + else + { + SetInternalSelectionHandleImageRightProperty(this, null, rightImageMap); + } } } } @@ -1171,8 +1193,8 @@ public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage) public SelectionHandleImage GetSelectionHandleImage() { SelectionHandleImage selectionHandleImage; - using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleImageLeftProperty)) - using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleImageRightProperty)) + using (var leftImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandleImageLeftProperty) : (PropertyMap)GetInternalSelectionHandleImageLeftProperty(this)) + using (var rightImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandleImageRightProperty) : (PropertyMap)GetInternalSelectionHandleImageRightProperty(this)) { selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap); } @@ -1274,7 +1296,14 @@ public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandleP { using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl)) { - SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap); + } + else + { + SetInternalSelectionHandlePressedImageLeftProperty(this, null, leftImageMap); + } } } @@ -1282,7 +1311,14 @@ public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandleP { using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl)) { - SetValue(SelectionHandlePressedImageRightProperty, rightImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandlePressedImageRightProperty, rightImageMap); + } + else + { + SetInternalSelectionHandlePressedImageRightProperty(this, null, rightImageMap); + } } } } @@ -1298,8 +1334,8 @@ public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandleP public SelectionHandleImage GetSelectionHandlePressedImage() { SelectionHandleImage selectionHandleImage; - using (var leftImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty)) - using (var rightImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty)) + using (var leftImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty) : (PropertyMap)GetInternalSelectionHandlePressedImageLeftProperty(this)) + using (var rightImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty) : (PropertyMap)GetInternalSelectionHandlePressedImageRightProperty(this)) { selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap); } @@ -1401,7 +1437,14 @@ public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMa { using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl)) { - SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap); + } + else + { + SetInternalSelectionHandleMarkerImageLeftProperty(this, null, leftImageMap); + } } } @@ -1409,7 +1452,14 @@ public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMa { using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl)) { - SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap); + } + else + { + SetInternalSelectionHandleMarkerImageRightProperty(this, null, rightImageMap); + } } } } @@ -1425,8 +1475,8 @@ public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMa public SelectionHandleImage GetSelectionHandleMarkerImage() { SelectionHandleImage selectionHandleImage; - using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty)) - using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty)) + using (var leftImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty) : (PropertyMap)GetInternalSelectionHandleMarkerImageLeftProperty(this)) + using (var rightImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty) : (PropertyMap)GetInternalSelectionHandleMarkerImageRightProperty(this)) { selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap); } @@ -1669,7 +1719,14 @@ public void SetInputFontStyle(FontStyle fontStyle) { using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle)) { - SetValue(InputFontStyleProperty, fontStyleMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(InputFontStyleProperty, fontStyleMap); + } + else + { + SetInternalInputFontStyleProperty(this, null, fontStyleMap); + } } } @@ -1881,7 +1938,14 @@ public void SetUnderline(Underline underline) { using (var underlineMap = TextMapHelper.GetUnderlineMap(underline)) { - SetValue(UnderlineProperty, underlineMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(UnderlineProperty, underlineMap); + } + else + { + SetInternalUnderlineProperty(this, null, underlineMap); + } } } @@ -1896,7 +1960,7 @@ public void SetUnderline(Underline underline) public Underline GetUnderline() { Underline underline; - using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty)) + using (var underlineMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(UnderlineProperty) : (PropertyMap)GetInternalUnderlineProperty(this)) { underline = TextMapHelper.GetUnderlineStruct(underlineMap); } @@ -1995,7 +2059,14 @@ public void SetShadow(Tizen.NUI.Text.Shadow shadow) { using (var shadowMap = TextMapHelper.GetShadowMap(shadow)) { - SetValue(ShadowProperty, shadowMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(ShadowProperty, shadowMap); + } + else + { + SetInternalShadowProperty(this, null, shadowMap); + } } } @@ -2010,7 +2081,7 @@ public void SetShadow(Tizen.NUI.Text.Shadow shadow) public Tizen.NUI.Text.Shadow GetShadow() { Tizen.NUI.Text.Shadow shadow; - using (var shadowMap = (PropertyMap)GetValue(ShadowProperty)) + using (var shadowMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(ShadowProperty) : (PropertyMap)GetInternalShadowProperty(this)) { shadow = TextMapHelper.GetShadowStruct(shadowMap); } @@ -2172,7 +2243,14 @@ public void SetOutline(Outline outline) { using (var outlineMap = TextMapHelper.GetOutlineMap(outline)) { - SetValue(OutlineProperty, outlineMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(OutlineProperty, outlineMap); + } + else + { + SetInternalOutlineProperty(this, null, outlineMap); + } } } @@ -2187,7 +2265,7 @@ public void SetOutline(Outline outline) public Outline GetOutline() { Outline outline; - using (var outlineMap = (PropertyMap)GetValue(OutlineProperty)) + using (var outlineMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(OutlineProperty) : (PropertyMap)GetInternalOutlineProperty(this)) { outline = TextMapHelper.GetOutlineStruct(outlineMap); } @@ -2420,7 +2498,7 @@ public float PixelSize } /// - /// The line count of the text. + /// Gets the line count of the text. /// /// 3 public int LineCount @@ -3073,7 +3151,14 @@ public void SetPlaceholder(Placeholder placeholder) { using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder)) { - SetValue(PlaceholderProperty, placeholderMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(PlaceholderProperty, placeholderMap); + } + else + { + SetInternalPlaceholderProperty(this, null, placeholderMap); + } } } @@ -3088,7 +3173,7 @@ public void SetPlaceholder(Placeholder placeholder) public Placeholder GetPlaceholder() { Placeholder placeholder; - using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty)) + using (var placeholderMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(PlaceholderProperty) : (PropertyMap)GetInternalPlaceholderProperty(this)) { placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap); } @@ -3474,7 +3559,7 @@ public InputMethodContext GetInputMethodContext() } /// - /// Select the whole text. + /// Selects the entire text within the TextEditor control. /// /// 9 public void SelectWholeText() @@ -3728,7 +3813,12 @@ public bool RemoveBackInset /// /// Dispose. + /// Releases unmanaged and optionally managed resources. /// + /// + /// When overriding this method, you need to distinguish between explicit and implicit conditions. For explicit conditions, release both managed and unmanaged resources. For implicit conditions, only release unmanaged resources. + /// + /// Explicit to release both managed and unmanaged resources. Implicit to release only unmanaged resources. /// 3 protected override void Dispose(DisposeTypes type) { diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs index 9a107f486b9..04a1c8918d4 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI.BaseComponents /// 3 public partial class TextEditor { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TextProperty = null; @@ -49,7 +49,7 @@ internal static object GetInternalTextProperty(BindableObject bindable) return Object.InternalGetPropertyString(textEditor.SwigCPtr, TextEditor.Property.TEXT); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TextColorProperty = null; @@ -75,7 +75,7 @@ internal static object GetInternalTextColorProperty(BindableObject bindable) return textEditor.internalTextColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FontFamilyProperty = null; @@ -94,7 +94,7 @@ internal static object GetInternalFontFamilyProperty(BindableObject bindable) return textEditor.InternalFontFamily; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FontStyleProperty = null; @@ -115,7 +115,7 @@ internal static object GetInternalFontStyleProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PointSizeProperty = null; @@ -136,7 +136,7 @@ internal static object GetInternalPointSizeProperty(BindableObject bindable) return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.PointSize); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty HorizontalAlignmentProperty = null; @@ -181,7 +181,7 @@ internal static object GetInternalVerticalAlignmentProperty(BindableObject binda return temp.GetValueByDescription(); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScrollThresholdProperty = null; @@ -202,7 +202,7 @@ internal static object GetInternalScrollThresholdProperty(BindableObject bindabl return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.ScrollThreshold); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScrollSpeedProperty = null; @@ -223,7 +223,7 @@ internal static object GetInternalScrollSpeedProperty(BindableObject bindable) return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.ScrollSpeed); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PrimaryCursorColorProperty = null; @@ -249,7 +249,7 @@ internal static object GetInternalPrimaryCursorColorProperty(BindableObject bind return textEditor.internalPrimaryCursorColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SecondaryCursorColorProperty = null; @@ -275,7 +275,7 @@ internal static object GetInternalSecondaryCursorColorProperty(BindableObject bi return textEditor.internalSecondaryCursorColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableCursorBlinkProperty = null; @@ -296,7 +296,7 @@ internal static object GetInternalEnableCursorBlinkProperty(BindableObject binda return Object.InternalGetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.EnableCursorBlink); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CursorBlinkIntervalProperty = null; @@ -317,7 +317,7 @@ internal static object GetInternalCursorBlinkIntervalProperty(BindableObject bin return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.CursorBlinkInterval); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CursorBlinkDurationProperty = null; @@ -338,7 +338,7 @@ internal static object GetInternalCursorBlinkDurationProperty(BindableObject bin return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.CursorBlinkDuration); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CursorWidthProperty = null; @@ -359,7 +359,7 @@ internal static object GetInternalCursorWidthProperty(BindableObject bindable) return Object.InternalGetPropertyInt(textEditor.SwigCPtr, TextEditor.Property.CursorWidth); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty GrabHandleImageProperty = null; @@ -380,7 +380,7 @@ internal static object GetInternalGrabHandleImageProperty(BindableObject bindabl return Object.InternalGetPropertyString(textEditor.SwigCPtr, TextEditor.Property.GrabHandleImage); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty GrabHandlePressedImageProperty = null; @@ -421,7 +421,7 @@ internal static object GetInternalSelectionPopupStyleProperty(BindableObject bin return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandleImageLeftProperty = null; @@ -442,7 +442,7 @@ internal static object GetInternalSelectionHandleImageLeftProperty(BindableObjec return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandleImageRightProperty = null; @@ -463,7 +463,7 @@ internal static object GetInternalSelectionHandleImageRightProperty(BindableObje return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandlePressedImageLeftProperty = null; @@ -484,7 +484,7 @@ internal static object GetInternalSelectionHandlePressedImageLeftProperty(Bindab return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandlePressedImageRightProperty = null; @@ -505,7 +505,7 @@ internal static object GetInternalSelectionHandlePressedImageRightProperty(Binda return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandleMarkerImageLeftProperty = null; @@ -526,7 +526,7 @@ internal static object GetInternalSelectionHandleMarkerImageLeftProperty(Bindabl return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandleMarkerImageRightProperty = null; @@ -547,7 +547,7 @@ internal static object GetInternalSelectionHandleMarkerImageRightProperty(Bindab return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHighlightColorProperty = null; @@ -573,7 +573,7 @@ internal static object GetInternalSelectionHighlightColorProperty(BindableObject return textEditor.internalSelectionHighlightColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty DecorationBoundingBoxProperty = null; @@ -594,7 +594,7 @@ internal static object GetInternalDecorationBoundingBoxProperty(BindableObject b return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableMarkupProperty = null; @@ -615,7 +615,7 @@ internal static object GetInternalEnableMarkupProperty(BindableObject bindable) return Object.InternalGetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.EnableMarkup); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputColorProperty = null; @@ -641,7 +641,7 @@ internal static object GetInternalInputColorProperty(BindableObject bindable) return textEditor.internalInputColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputFontFamilyProperty = null; @@ -662,7 +662,7 @@ internal static object GetInternalInputFontFamilyProperty(BindableObject bindabl return Object.InternalGetPropertyString(textEditor.SwigCPtr, TextEditor.Property.InputFontFamily); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputFontStyleProperty = null; @@ -683,7 +683,7 @@ internal static object GetInternalInputFontStyleProperty(BindableObject bindable return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputPointSizeProperty = null; @@ -704,7 +704,7 @@ internal static object GetInternalInputPointSizeProperty(BindableObject bindable return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.InputPointSize); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty LineSpacingProperty = null; @@ -725,7 +725,7 @@ internal static object GetInternalLineSpacingProperty(BindableObject bindable) return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.LineSpacing); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputLineSpacingProperty = null; @@ -766,7 +766,7 @@ internal static object GetInternalRelativeLineHeightProperty(BindableObject bind return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.RelativeLineHeight); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty UnderlineProperty = null; @@ -787,7 +787,7 @@ internal static object GetInternalUnderlineProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputUnderlineProperty = null; @@ -809,7 +809,7 @@ internal static object GetInternalInputUnderlineProperty(BindableObject bindable } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ShadowProperty = null; @@ -830,7 +830,7 @@ internal static object GetInternalShadowProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputShadowProperty = null; @@ -851,7 +851,7 @@ internal static object GetInternalInputShadowProperty(BindableObject bindable) return Object.InternalGetPropertyString(textEditor.SwigCPtr, TextEditor.Property.InputShadow); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EmbossProperty = null; @@ -872,7 +872,7 @@ internal static object GetInternalEmbossProperty(BindableObject bindable) return Object.InternalGetPropertyString(textEditor.SwigCPtr, TextEditor.Property.EMBOSS); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputEmbossProperty = null; @@ -893,7 +893,7 @@ internal static object GetInternalInputEmbossProperty(BindableObject bindable) return Object.InternalGetPropertyString(textEditor.SwigCPtr, TextEditor.Property.InputEmboss); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty OutlineProperty = null; @@ -914,7 +914,7 @@ internal static object GetInternalOutlineProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputOutlineProperty = null; @@ -935,7 +935,7 @@ internal static object GetInternalInputOutlineProperty(BindableObject bindable) return Object.InternalGetPropertyString(textEditor.SwigCPtr, TextEditor.Property.InputOutline); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SmoothScrollProperty = null; @@ -956,7 +956,7 @@ internal static object GetInternalSmoothScrollProperty(BindableObject bindable) return Object.InternalGetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.SmoothScroll); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SmoothScrollDurationProperty = null; @@ -977,7 +977,7 @@ internal static object GetInternalSmoothScrollDurationProperty(BindableObject bi return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.SmoothScrollDuration); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableScrollBarProperty = null; @@ -998,7 +998,7 @@ internal static object GetInternalEnableScrollBarProperty(BindableObject bindabl return Object.InternalGetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.EnableScrollBar); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScrollBarShowDurationProperty = null; @@ -1019,7 +1019,7 @@ internal static object GetInternalScrollBarShowDurationProperty(BindableObject b return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.ScrollBarShowDuration); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScrollBarFadeDurationProperty = null; @@ -1040,7 +1040,7 @@ internal static object GetInternalScrollBarFadeDurationProperty(BindableObject b return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.ScrollBarFadeDuration); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PixelSizeProperty = null; @@ -1061,7 +1061,7 @@ internal static object GetInternalPixelSizeProperty(BindableObject bindable) return Object.InternalGetPropertyFloat(textEditor.SwigCPtr, TextEditor.Property.PixelSize); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PlaceholderTextProperty = null; @@ -1082,7 +1082,7 @@ internal static object GetInternalPlaceholderTextProperty(BindableObject bindabl return Object.InternalGetPropertyString(textEditor.SwigCPtr, TextEditor.Property.PlaceholderText); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PlaceholderTextColorProperty = null; @@ -1108,7 +1108,7 @@ internal static object GetInternalPlaceholderTextColorProperty(BindableObject bi return textEditor.internalPlaceholderTextColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableSelectionProperty = null; @@ -1129,7 +1129,7 @@ internal static object GetInternalEnableSelectionProperty(BindableObject bindabl return Object.InternalGetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.EnableSelection); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PlaceholderProperty = null; @@ -1150,7 +1150,7 @@ internal static object GetInternalPlaceholderProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty LineWrapModeProperty = null; @@ -1171,7 +1171,7 @@ internal static object GetInternalLineWrapModeProperty(BindableObject bindable) return Object.InternalGetPropertyInt(textEditor.SwigCPtr, TextEditor.Property.LineWrapMode); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableShiftSelectionProperty = null; @@ -1193,7 +1193,7 @@ internal static object GetInternalEnableShiftSelectionProperty(BindableObject bi return Object.InternalGetPropertyBool(textEditor.SwigCPtr, TextEditor.Property.EnableShiftSelection); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty MatchSystemLanguageDirectionProperty = null; diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs index 8a37327e047..7e3b554943b 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs @@ -163,7 +163,7 @@ public event EventHandler CursorPositionChanged /// /// The MaxLengthReached event. /// - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public event EventHandler MaxLengthReached { @@ -395,6 +395,12 @@ internal TextEditorSignal InputFilteredSignal() private void OnTextChanged(IntPtr textEditor) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (textEditorTextChangedEventHandler != null && invokeTextChanged) { TextChangedEventArgs e = new TextChangedEventArgs(); @@ -408,18 +414,36 @@ private void OnTextChanged(IntPtr textEditor) private void OnSelectionStarted(IntPtr textEditor) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + //no data to be sent to the user textEditorSelectionStartedEventHandler?.Invoke(this, EventArgs.Empty); } private void OnSelectionCleared(IntPtr textEditor) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + //no data to be sent to the user textEditorSelectionClearedEventHandler?.Invoke(this, EventArgs.Empty); } private void OnScrollStateChanged(IntPtr textEditor, ScrollState state) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (textEditorScrollStateChangedEventHandler != null) { ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs(); @@ -437,12 +461,24 @@ private void OnScrollStateChanged(IntPtr textEditor, ScrollState state) private void OnCursorPositionChanged(IntPtr textEditor, uint oldPosition) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + // no data to be sent to the user, as in NUI there is no event provide old values. textEditorCursorPositionChangedEventHandler?.Invoke(this, EventArgs.Empty); } private void OnMaxLengthReached(IntPtr textEditor) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (textEditorMaxLengthReachedEventHandler != null) { MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs(); @@ -456,6 +492,12 @@ private void OnMaxLengthReached(IntPtr textEditor) private void OnAnchorClicked(IntPtr textEditor, IntPtr href, uint hrefLength) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + // Note: hrefLength is useful for get the length of a const char* (href) in dali-toolkit. // But NUI can get the length of string (href), so hrefLength is not necessary in NUI. AnchorClickedEventArgs e = new AnchorClickedEventArgs(); @@ -468,12 +510,24 @@ private void OnAnchorClicked(IntPtr textEditor, IntPtr href, uint hrefLength) private void OnSelectionChanged(IntPtr textEditor, uint oldStart, uint oldEnd) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + // no data to be sent to the user, as in NUI there is no event provide old values. textEditorSelectionChangedEventHandler?.Invoke(this, EventArgs.Empty); } private void OnInputFiltered(IntPtr textEditor, InputFilterType type) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + InputFilteredEventArgs e = new InputFilteredEventArgs(); // Populate all members of "e" (InputFilteredEventArgs) with real data @@ -552,7 +606,7 @@ public ScrollState ScrollState /// /// The MaxLengthReached event arguments. /// - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class MaxLengthReachedEventArgs : EventArgs { @@ -561,7 +615,7 @@ public class MaxLengthReachedEventArgs : EventArgs /// /// TextEditor. /// - /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public TextEditor TextEditor { diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEvent.cs index f63d4857572..7c0c0594a2c 100644 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEvent.cs @@ -47,4 +47,50 @@ public class InputFilteredEventArgs : EventArgs /// 9 public InputFilterType Type { get; set; } } + + /// + /// AsyncTextRenderedEventArgs is a class to record async text rendered event arguments which will be sent to user. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class AsyncTextRenderedEventArgs : EventArgs + { + public AsyncTextRenderedEventArgs(float width, float height) + { + Width = width; + Height = height; + } + + /// + /// The rendered width. + /// + public float Width { get; } + + /// + /// The rendered height. + /// + public float Height { get; } + } + + /// + /// AsyncTextSizeComputedEventArgs is a class to record async text size computed event arguments which will be sent to user. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class AsyncTextSizeComputedEventArgs : EventArgs + { + public AsyncTextSizeComputedEventArgs(float width, float height) + { + Width = width; + Height = height; + } + + /// + /// The computed width. + /// + public float Width { get; } + + /// + /// The computed height. + /// + public float Height { get; } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 75865f343cf..638115f9838 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -256,6 +256,12 @@ static TextField() CharacterSpacingProperty = BindableProperty.Create(nameof(CharacterSpacing), typeof(float), typeof(TextField), default(float), propertyChanged: SetInternalCharacterSpacingProperty, defaultValueCreator: GetInternalCharacterSpacingProperty); + + RemoveFrontInsetProperty = BindableProperty.Create(nameof(RemoveFrontInset), typeof(bool), typeof(TextField), false, + propertyChanged: SetInternalRemoveFrontInsetProperty, defaultValueCreator: GetInternalRemoveFrontInsetProperty); + + RemoveBackInsetProperty = BindableProperty.Create(nameof(RemoveBackInset), typeof(bool), typeof(TextField), false, + propertyChanged: SetInternalRemoveBackInsetProperty, defaultValueCreator: GetInternalRemoveBackInsetProperty); } } @@ -280,7 +286,7 @@ public TextField() : this(Interop.TextField.New(ThemeManager.GetStyle(defaultSty /// Creates the TextField with setting the status of shown or hidden. /// /// false : Not displayed (hidden), true : displayed (shown) - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public TextField(bool shown) : this(Interop.TextField.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true) { @@ -715,7 +721,14 @@ public void SetFontStyle(FontStyle fontStyle) { using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle)) { - SetValue(FontStyleProperty, fontStyleMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(FontStyleProperty, fontStyleMap); + } + else + { + SetInternalFontStyleProperty(this, null, fontStyleMap); + } } } @@ -730,7 +743,7 @@ public void SetFontStyle(FontStyle fontStyle) public FontStyle GetFontStyle() { FontStyle fontStyle; - using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty)) + using (var fontStyleMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(FontStyleProperty) : (PropertyMap)GetInternalFontStyleProperty(this)) { fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap); } @@ -895,7 +908,6 @@ public VerticalAlignment VerticalAlignment SetInternalVerticalAlignmentProperty(this, null, value); } NotifyPropertyChanged(); - NotifyPropertyChanged(); } } @@ -1031,7 +1043,14 @@ private Vector2 InternalShadowOffset map.Add("offset", value); var shadowMap = Shadow; shadowMap.Merge(map); - SetValue(ShadowProperty, shadowMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(ShadowProperty, shadowMap); + } + else + { + SetInternalShadowProperty(this, null, shadowMap); + } NotifyPropertyChanged(); } } @@ -1098,7 +1117,14 @@ private Vector4 InternalShadowColor map.Add("color", value); var shadowMap = Shadow; shadowMap.Merge(map); - SetValue(ShadowProperty, shadowMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(ShadowProperty, shadowMap); + } + else + { + SetInternalShadowProperty(this, null, shadowMap); + } NotifyPropertyChanged(); } } @@ -1275,7 +1301,7 @@ public float CursorBlinkDuration } /// - /// The CursorWidth property. + /// Gets or sets the width of the cursor. /// /// 3 public int CursorWidth @@ -1560,7 +1586,14 @@ public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage) { using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.LeftImageUrl)) { - SetValue(SelectionHandleImageLeftProperty, leftImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandleImageLeftProperty, leftImageMap); + } + else + { + SetInternalSelectionHandleImageLeftProperty(this, null, leftImageMap); + } } } @@ -1568,7 +1601,14 @@ public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage) { using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleImage.RightImageUrl)) { - SetValue(SelectionHandleImageRightProperty, rightImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandleImageRightProperty, rightImageMap); + } + else + { + SetInternalSelectionHandleImageRightProperty(this, null, rightImageMap); + } } } } @@ -1584,8 +1624,8 @@ public void SetSelectionHandleImage(SelectionHandleImage selectionHandleImage) public SelectionHandleImage GetSelectionHandleImage() { SelectionHandleImage selectionHandleImage; - using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleImageLeftProperty)) - using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleImageRightProperty)) + using (var leftImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandleImageLeftProperty) : (PropertyMap)GetInternalSelectionHandleImageLeftProperty(this)) + using (var rightImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandleImageRightProperty) : (PropertyMap)GetInternalSelectionHandleImageRightProperty(this)) { selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap); } @@ -1687,7 +1727,14 @@ public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandleP { using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.LeftImageUrl)) { - SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandlePressedImageLeftProperty, leftImageMap); + } + else + { + SetInternalSelectionHandlePressedImageLeftProperty(this, null, leftImageMap); + } } } @@ -1695,7 +1742,14 @@ public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandleP { using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandlePressedImage.RightImageUrl)) { - SetValue(SelectionHandlePressedImageRightProperty, rightImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandlePressedImageRightProperty, rightImageMap); + } + else + { + SetInternalSelectionHandlePressedImageRightProperty(this, null, rightImageMap); + } } } } @@ -1711,8 +1765,8 @@ public void SetSelectionHandlePressedImage(SelectionHandleImage selectionHandleP public SelectionHandleImage GetSelectionHandlePressedImage() { SelectionHandleImage selectionHandleImage; - using (var leftImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty)) - using (var rightImageMap = (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty)) + using (var leftImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandlePressedImageLeftProperty) : (PropertyMap)GetInternalSelectionHandlePressedImageLeftProperty(this)) + using (var rightImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandlePressedImageRightProperty) : (PropertyMap)GetInternalSelectionHandlePressedImageRightProperty(this)) { selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap); } @@ -1814,7 +1868,14 @@ public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMa { using (var leftImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.LeftImageUrl)) { - SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandleMarkerImageLeftProperty, leftImageMap); + } + else + { + SetInternalSelectionHandleMarkerImageLeftProperty(this, null, leftImageMap); + } } } @@ -1822,7 +1883,14 @@ public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMa { using (var rightImageMap = TextMapHelper.GetFileNameMap(selectionHandleMarkerImage.RightImageUrl)) { - SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(SelectionHandleMarkerImageRightProperty, rightImageMap); + } + else + { + SetInternalSelectionHandleMarkerImageRightProperty(this, null, rightImageMap); + } } } } @@ -1838,8 +1906,8 @@ public void SetSelectionHandleMarkerImage(SelectionHandleImage selectionHandleMa public SelectionHandleImage GetSelectionHandleMarkerImage() { SelectionHandleImage selectionHandleImage; - using (var leftImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty)) - using (var rightImageMap = (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty)) + using (var leftImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandleMarkerImageLeftProperty) : (PropertyMap)GetInternalSelectionHandleMarkerImageLeftProperty(this)) + using (var rightImageMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(SelectionHandleMarkerImageRightProperty) : (PropertyMap)GetInternalSelectionHandleMarkerImageRightProperty(this)) { selectionHandleImage = TextMapHelper.GetSelectionHandleImageStruct(leftImageMap, rightImageMap); } @@ -2128,9 +2196,16 @@ public void SetInputFontStyle(FontStyle fontStyle) { using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle)) { - SetValue(InputFontStyleProperty, fontStyleMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(InputFontStyleProperty, fontStyleMap); + } + else + { + SetInternalInputFontStyleProperty(this, null, fontStyleMap); + } } - } + } /// /// Get InputFontStyle from TextField.
@@ -2143,7 +2218,7 @@ public void SetInputFontStyle(FontStyle fontStyle) public FontStyle GetInputFontStyle() { FontStyle fontStyle; - using (var fontStyleMap = (PropertyMap)GetValue(InputFontStyleProperty)) + using (var fontStyleMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(InputFontStyleProperty) : (PropertyMap)GetInternalInputFontStyleProperty(this)) { fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap); } @@ -2244,7 +2319,14 @@ public void SetUnderline(Underline underline) { using (var underlineMap = TextMapHelper.GetUnderlineMap(underline)) { - SetValue(UnderlineProperty, underlineMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(UnderlineProperty, underlineMap); + } + else + { + SetInternalUnderlineProperty(this, null, underlineMap); + } } } @@ -2259,7 +2341,7 @@ public void SetUnderline(Underline underline) public Underline GetUnderline() { Underline underline; - using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty)) + using (var underlineMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(UnderlineProperty) : (PropertyMap)GetInternalUnderlineProperty(this)) { underline = TextMapHelper.GetUnderlineStruct(underlineMap); } @@ -2320,7 +2402,7 @@ public PropertyMap Shadow } else { - return (PropertyMap)GetInternalShadowColorProperty(this); + return (PropertyMap)GetInternalShadowProperty(this); } } set @@ -2358,7 +2440,14 @@ public void SetShadow(Tizen.NUI.Text.Shadow shadow) { using (var shadowMap = TextMapHelper.GetShadowMap(shadow)) { - SetValue(ShadowProperty, shadowMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(ShadowProperty, shadowMap); + } + else + { + SetInternalShadowProperty(this, null, shadowMap); + } } } @@ -2373,7 +2462,7 @@ public void SetShadow(Tizen.NUI.Text.Shadow shadow) public Tizen.NUI.Text.Shadow GetShadow() { Tizen.NUI.Text.Shadow shadow; - using (var shadowMap = (PropertyMap)GetValue(ShadowProperty)) + using (var shadowMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(ShadowProperty) : (PropertyMap)GetInternalShadowProperty(this)) { shadow = TextMapHelper.GetShadowStruct(shadowMap); } @@ -2535,7 +2624,14 @@ public void SetOutline(Outline outline) { using (var outlineMap = TextMapHelper.GetOutlineMap(outline)) { - SetValue(OutlineProperty, outlineMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(OutlineProperty, outlineMap); + } + else + { + SetInternalOutlineProperty(this, null, outlineMap); + } } } @@ -2550,7 +2646,7 @@ public void SetOutline(Outline outline) public Outline GetOutline() { Outline outline; - using (var outlineMap = (PropertyMap)GetValue(OutlineProperty)) + using (var outlineMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(OutlineProperty) : (PropertyMap)GetInternalOutlineProperty(this)) { outline = TextMapHelper.GetOutlineStruct(outlineMap); } @@ -2664,8 +2760,16 @@ public void SetHiddenInput(HiddenInput hiddenInput) { using (var hiddenInputMap = TextMapHelper.GetHiddenInputMap(hiddenInput)) { - SetValue(HiddenInputSettingsProperty, hiddenInputMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(HiddenInputSettingsProperty, hiddenInputMap); + } + else + { + SetInternalHiddenInputSettingsProperty(this, null, hiddenInputMap); + } } + } /// @@ -2679,7 +2783,7 @@ public void SetHiddenInput(HiddenInput hiddenInput) public HiddenInput GetHiddenInput() { HiddenInput hiddenInput; - using (var hiddenInputMap = (PropertyMap)GetValue(HiddenInputSettingsProperty)) + using (var hiddenInputMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(HiddenInputSettingsProperty) : (PropertyMap)GetInternalHiddenInputSettingsProperty(this)) { hiddenInput = TextMapHelper.GetHiddenInputStruct(hiddenInputMap); } @@ -2756,7 +2860,7 @@ public bool EnableSelection /// Enables the grab handles for text selection.
/// The default value is true, which means the grab handles are enabled by default.
///
- /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public bool EnableGrabHandle { @@ -2790,7 +2894,7 @@ public bool EnableGrabHandle /// Enables the grab handle popup for text selection.
/// The default value is true, which means the grab handle popup is enabled by default.
///
- /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public bool EnableGrabHandlePopup { @@ -2882,7 +2986,7 @@ public int SelectedTextEnd /// /// Enable editing in text control. /// - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public bool EnableEditing { @@ -3322,7 +3426,14 @@ public void SetPlaceholder(Placeholder placeholder) { using (var placeholderMap = TextMapHelper.GetPlaceholderMap(placeholder)) { - SetValue(PlaceholderProperty, placeholderMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(PlaceholderProperty, placeholderMap); + } + else + { + SetInternalPlaceholderProperty(this, null, placeholderMap); + } } } @@ -3337,7 +3448,7 @@ public void SetPlaceholder(Placeholder placeholder) public Placeholder GetPlaceholder() { Placeholder placeholder; - using (var placeholderMap = (PropertyMap)GetValue(PlaceholderProperty)) + using (var placeholderMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(PlaceholderProperty) : (PropertyMap)GetInternalPlaceholderProperty(this)) { placeholder = TextMapHelper.GetPlaceholderStruct(placeholderMap); } @@ -3380,7 +3491,7 @@ public bool Ellipsis /// /// Enables selection of the text using the Shift key. /// - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public bool EnableShiftSelection { @@ -3569,7 +3680,7 @@ public InputMethodContext GetInputMethodContext() } /// - /// Select the whole text. + /// Selects the entire text within the TextField. /// /// 9 public void SelectWholeText() @@ -3629,11 +3740,25 @@ public bool RemoveFrontInset { get { - return (bool)GetValue(RemoveFrontInsetProperty); + if (NUIApplication.IsUsingXaml) + { + return (bool)GetValue(RemoveFrontInsetProperty); + } + else + { + return (bool)GetInternalRemoveFrontInsetProperty(this); + } } set { - SetValue(RemoveFrontInsetProperty, value); + if (NUIApplication.IsUsingXaml) + { + SetValue(RemoveFrontInsetProperty, value); + } + else + { + SetInternalRemoveFrontInsetProperty(this, null, value); + } NotifyPropertyChanged(); } } @@ -3650,18 +3775,37 @@ public bool RemoveBackInset { get { - return (bool)GetValue(RemoveBackInsetProperty); + if (NUIApplication.IsUsingXaml) + { + return (bool)GetValue(RemoveBackInsetProperty); + } + else + { + return (bool)GetInternalRemoveBackInsetProperty(this); + } } set { - SetValue(RemoveBackInsetProperty, value); + if (NUIApplication.IsUsingXaml) + { + SetValue(RemoveBackInsetProperty, value); + } + else + { + SetInternalRemoveBackInsetProperty(this, null, value); + } NotifyPropertyChanged(); } } /// /// Dispose. + /// Releases unmanaged and optionally managed resources. /// + /// + /// When overriding this method, you need to distinguish between explicit and implicit conditions. For explicit conditions, release both managed and unmanaged resources. For implicit conditions, only release unmanaged resources. + /// + /// Explicit to release both managed and unmanaged resources. Implicit to release only unmanaged resources. /// 3 protected override void Dispose(DisposeTypes type) { diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs index 492fb958e6e..20ff6ad6f2c 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs @@ -83,7 +83,7 @@ internal static object GetInternalTranslatablePlaceholderTextFocusedProperty(Bin return textField.translatablePlaceholderTextFocused; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TextProperty = null; internal static void SetInternalTextProperty(BindableObject bindable, object oldValue, object newValue) @@ -104,7 +104,7 @@ internal static object GetInternalTextProperty(BindableObject bindable) return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.TEXT); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PlaceholderTextProperty = null; internal static void SetInternalPlaceholderTextProperty(BindableObject bindable, object oldValue, object newValue) @@ -123,7 +123,7 @@ internal static object GetInternalPlaceholderTextProperty(BindableObject bindabl return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.PlaceholderText); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PlaceholderTextFocusedProperty = null; internal static void SetInternalPlaceholderTextFocusedProperty(BindableObject bindable, object oldValue, object newValue) @@ -142,7 +142,7 @@ internal static object GetInternalPlaceholderTextFocusedProperty(BindableObject return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.PlaceholderTextFocused); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FontFamilyProperty = null; internal static void SetInternalFontFamilyProperty(BindableObject bindable, object oldValue, object newValue) @@ -159,7 +159,7 @@ internal static object GetInternalFontFamilyProperty(BindableObject bindable) return textField.InternalFontFamily; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FontStyleProperty = null; internal static void SetInternalFontStyleProperty(BindableObject bindable, object oldValue, object newValue) @@ -178,7 +178,7 @@ internal static object GetInternalFontStyleProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PointSizeProperty = null; internal static void SetInternalPointSizeProperty(BindableObject bindable, object oldValue, object newValue) @@ -197,7 +197,7 @@ internal static object GetInternalPointSizeProperty(BindableObject bindable) return Object.InternalGetPropertyFloat(textField.SwigCPtr, TextField.Property.PointSize); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty MaxLengthProperty = null; internal static void SetInternalMaxLengthProperty(BindableObject bindable, object oldValue, object newValue) @@ -216,7 +216,7 @@ internal static object GetInternalMaxLengthProperty(BindableObject bindable) return Object.InternalGetPropertyInt(textField.SwigCPtr, TextField.Property.MaxLength); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ExceedPolicyProperty = null; internal static void SetInternalExceedPolicyProperty(BindableObject bindable, object oldValue, object newValue) @@ -235,7 +235,7 @@ internal static object GetInternalExceedPolicyProperty(BindableObject bindable) return Object.InternalGetPropertyInt(textField.SwigCPtr, TextField.Property.ExceedPolicy); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty HorizontalAlignmentProperty = null; internal static void SetInternalHorizontalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) @@ -256,7 +256,7 @@ internal static object GetInternalHorizontalAlignmentProperty(BindableObject bin return temp.GetValueByDescription(); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty VerticalAlignmentProperty = null; internal static void SetInternalVerticalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) @@ -277,7 +277,7 @@ internal static object GetInternalVerticalAlignmentProperty(BindableObject binda return temp.GetValueByDescription(); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TextColorProperty = null; internal static void SetInternalTextColorProperty(BindableObject bindable, object oldValue, object newValue) @@ -301,7 +301,7 @@ internal static object GetInternalTextColorProperty(BindableObject bindable) return textField.internalTextColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PlaceholderTextColorProperty = null; internal static void SetInternalPlaceholderTextColorProperty(BindableObject bindable, object oldValue, object newValue) @@ -363,7 +363,7 @@ internal static object GetInternalEnableGrabHandlePopupProperty(BindableObject b return Object.InternalGetPropertyBool(textField.SwigCPtr, TextField.Property.EnableGrabHandlePopup); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PrimaryCursorColorProperty = null; internal static void SetInternalPrimaryCursorColorProperty(BindableObject bindable, object oldValue, object newValue) @@ -387,7 +387,7 @@ internal static object GetInternalPrimaryCursorColorProperty(BindableObject bind return textField.internalPrimaryCursorColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SecondaryCursorColorProperty = null; internal static void SetInternalSecondaryCursorColorProperty(BindableObject bindable, object oldValue, object newValue) @@ -411,7 +411,7 @@ internal static object GetInternalSecondaryCursorColorProperty(BindableObject bi return textField.internalSecondaryCursorColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableCursorBlinkProperty = null; internal static void SetInternalEnableCursorBlinkProperty(BindableObject bindable, object oldValue, object newValue) @@ -430,7 +430,7 @@ internal static object GetInternalEnableCursorBlinkProperty(BindableObject binda return Object.InternalGetPropertyBool(textField.SwigCPtr, TextField.Property.EnableCursorBlink); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CursorBlinkIntervalProperty = null; internal static void SetInternalCursorBlinkIntervalProperty(BindableObject bindable, object oldValue, object newValue) @@ -449,7 +449,7 @@ internal static object GetInternalCursorBlinkIntervalProperty(BindableObject bin return Object.InternalGetPropertyFloat(textField.SwigCPtr, TextField.Property.CursorBlinkInterval); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CursorBlinkDurationProperty = null; internal static void SetInternalCursorBlinkDurationProperty(BindableObject bindable, object oldValue, object newValue) @@ -468,7 +468,7 @@ internal static object GetInternalCursorBlinkDurationProperty(BindableObject bin return Object.InternalGetPropertyFloat(textField.SwigCPtr, TextField.Property.CursorBlinkDuration); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CursorWidthProperty = null; internal static void SetInternalCursorWidthProperty(BindableObject bindable, object oldValue, object newValue) @@ -487,7 +487,7 @@ internal static object GetInternalCursorWidthProperty(BindableObject bindable) return Object.InternalGetPropertyInt(textField.SwigCPtr, TextField.Property.CursorWidth); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty GrabHandleImageProperty = null; internal static void SetInternalGrabHandleImageProperty(BindableObject bindable, object oldValue, object newValue) @@ -506,7 +506,7 @@ internal static object GetInternalGrabHandleImageProperty(BindableObject bindabl return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.GrabHandleImage); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty GrabHandlePressedImageProperty = null; internal static void SetInternalGrabHandlePressedImageProperty(BindableObject bindable, object oldValue, object newValue) @@ -525,7 +525,7 @@ internal static object GetInternalGrabHandlePressedImageProperty(BindableObject return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.GrabHandlePressedImage); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScrollThresholdProperty = null; internal static void SetInternalScrollThresholdProperty(BindableObject bindable, object oldValue, object newValue) @@ -544,7 +544,7 @@ internal static object GetInternalScrollThresholdProperty(BindableObject bindabl return Object.InternalGetPropertyFloat(textField.SwigCPtr, TextField.Property.ScrollThreshold); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ScrollSpeedProperty = null; internal static void SetInternalScrollSpeedProperty(BindableObject bindable, object oldValue, object newValue) @@ -581,7 +581,7 @@ internal static object GetInternalSelectionPopupStyleProperty(BindableObject bin return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandleImageLeftProperty = null; internal static void SetInternalSelectionHandleImageLeftProperty(BindableObject bindable, object oldValue, object newValue) @@ -600,7 +600,7 @@ internal static object GetInternalSelectionHandleImageLeftProperty(BindableObjec return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandleImageRightProperty = null; internal static void SetInternalSelectionHandleImageRightProperty(BindableObject bindable, object oldValue, object newValue) @@ -619,7 +619,7 @@ internal static object GetInternalSelectionHandleImageRightProperty(BindableObje return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandlePressedImageLeftProperty = null; internal static void SetInternalSelectionHandlePressedImageLeftProperty(BindableObject bindable, object oldValue, object newValue) @@ -638,7 +638,7 @@ internal static object GetInternalSelectionHandlePressedImageLeftProperty(Bindab return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandlePressedImageRightProperty = null; internal static void SetInternalSelectionHandlePressedImageRightProperty(BindableObject bindable, object oldValue, object newValue) @@ -657,7 +657,7 @@ internal static object GetInternalSelectionHandlePressedImageRightProperty(Binda return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandleMarkerImageLeftProperty = null; internal static void SetInternalSelectionHandleMarkerImageLeftProperty(BindableObject bindable, object oldValue, object newValue) @@ -676,7 +676,7 @@ internal static object GetInternalSelectionHandleMarkerImageLeftProperty(Bindabl return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHandleMarkerImageRightProperty = null; internal static void SetInternalSelectionHandleMarkerImageRightProperty(BindableObject bindable, object oldValue, object newValue) @@ -695,7 +695,7 @@ internal static object GetInternalSelectionHandleMarkerImageRightProperty(Bindab return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SelectionHighlightColorProperty = null; internal static void SetInternalSelectionHighlightColorProperty(BindableObject bindable, object oldValue, object newValue) @@ -719,7 +719,7 @@ internal static object GetInternalSelectionHighlightColorProperty(BindableObject return textField.internalSelectionHighlightColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty DecorationBoundingBoxProperty = null; internal static void SetInternalDecorationBoundingBoxProperty(BindableObject bindable, object oldValue, object newValue) @@ -738,7 +738,7 @@ internal static object GetInternalDecorationBoundingBoxProperty(BindableObject b return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputMethodSettingsProperty = null; internal static void SetInternalInputMethodSettingsProperty(BindableObject bindable, object oldValue, object newValue) @@ -757,7 +757,7 @@ internal static object GetInternalInputMethodSettingsProperty(BindableObject bin return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputColorProperty = null; internal static void SetInternalInputColorProperty(BindableObject bindable, object oldValue, object newValue) @@ -781,7 +781,7 @@ internal static object GetInternalInputColorProperty(BindableObject bindable) return textField.internalInputColor; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableMarkupProperty = null; internal static void SetInternalEnableMarkupProperty(BindableObject bindable, object oldValue, object newValue) @@ -800,7 +800,7 @@ internal static object GetInternalEnableMarkupProperty(BindableObject bindable) return Object.InternalGetPropertyBool(textField.SwigCPtr, TextField.Property.EnableMarkup); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputFontFamilyProperty = null; internal static void SetInternalInputFontFamilyProperty(BindableObject bindable, object oldValue, object newValue) @@ -819,7 +819,7 @@ internal static object GetInternalInputFontFamilyProperty(BindableObject bindabl return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.InputFontFamily); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputFontStyleProperty = null; internal static void SetInternalInputFontStyleProperty(BindableObject bindable, object oldValue, object newValue) @@ -838,7 +838,7 @@ internal static object GetInternalInputFontStyleProperty(BindableObject bindable return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputPointSizeProperty = null; internal static void SetInternalInputPointSizeProperty(BindableObject bindable, object oldValue, object newValue) @@ -857,7 +857,7 @@ internal static object GetInternalInputPointSizeProperty(BindableObject bindable return Object.InternalGetPropertyFloat(textField.SwigCPtr, TextField.Property.InputPointSize); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty UnderlineProperty = null; internal static void SetInternalUnderlineProperty(BindableObject bindable, object oldValue, object newValue) @@ -876,7 +876,7 @@ internal static object GetInternalUnderlineProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputUnderlineProperty = null; internal static void SetInternalInputUnderlineProperty(BindableObject bindable, object oldValue, object newValue) @@ -895,7 +895,7 @@ internal static object GetInternalInputUnderlineProperty(BindableObject bindable return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.InputUnderline); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ShadowProperty = null; internal static void SetInternalShadowProperty(BindableObject bindable, object oldValue, object newValue) @@ -914,7 +914,7 @@ internal static object GetInternalShadowProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputShadowProperty = null; internal static void SetInternalInputShadowProperty(BindableObject bindable, object oldValue, object newValue) @@ -933,7 +933,7 @@ internal static object GetInternalInputShadowProperty(BindableObject bindable) return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.InputShadow); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EmbossProperty = null; internal static void SetInternalEmbossProperty(BindableObject bindable, object oldValue, object newValue) @@ -952,7 +952,7 @@ internal static object GetInternalEmbossProperty(BindableObject bindable) return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.EMBOSS); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputEmbossProperty = null; internal static void SetInternalInputEmbossProperty(BindableObject bindable, object oldValue, object newValue) @@ -971,7 +971,7 @@ internal static object GetInternalInputEmbossProperty(BindableObject bindable) return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.InputEmboss); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty OutlineProperty = null; internal static void SetInternalOutlineProperty(BindableObject bindable, object oldValue, object newValue) @@ -990,7 +990,7 @@ internal static object GetInternalOutlineProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty InputOutlineProperty = null; internal static void SetInternalInputOutlineProperty(BindableObject bindable, object oldValue, object newValue) @@ -1009,7 +1009,7 @@ internal static object GetInternalInputOutlineProperty(BindableObject bindable) return Object.InternalGetPropertyString(textField.SwigCPtr, TextField.Property.InputOutline); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty HiddenInputSettingsProperty = null; internal static void SetInternalHiddenInputSettingsProperty(BindableObject bindable, object oldValue, object newValue) @@ -1028,7 +1028,7 @@ internal static object GetInternalHiddenInputSettingsProperty(BindableObject bin return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PixelSizeProperty = null; internal static void SetInternalPixelSizeProperty(BindableObject bindable, object oldValue, object newValue) @@ -1047,7 +1047,7 @@ internal static object GetInternalPixelSizeProperty(BindableObject bindable) return Object.InternalGetPropertyFloat(textField.SwigCPtr, TextField.Property.PixelSize); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableSelectionProperty = null; internal static void SetInternalEnableSelectionProperty(BindableObject bindable, object oldValue, object newValue) @@ -1066,7 +1066,7 @@ internal static object GetInternalEnableSelectionProperty(BindableObject bindabl return Object.InternalGetPropertyBool(textField.SwigCPtr, TextField.Property.EnableSelection); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PlaceholderProperty = null; internal static void SetInternalPlaceholderProperty(BindableObject bindable, object oldValue, object newValue) @@ -1085,7 +1085,7 @@ internal static object GetInternalPlaceholderProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EllipsisProperty = null; internal static void SetInternalEllipsisProperty(BindableObject bindable, object oldValue, object newValue) @@ -1123,7 +1123,7 @@ internal static object GetInternalEllipsisPositionProperty(BindableObject bindab return Object.InternalGetPropertyInt(textField.SwigCPtr, TextField.Property.EllipsisPosition); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableShiftSelectionProperty = null; internal static void SetInternalEnableShiftSelectionProperty(BindableObject bindable, object oldValue, object newValue) @@ -1142,7 +1142,7 @@ internal static object GetInternalEnableShiftSelectionProperty(BindableObject bi return Object.InternalGetPropertyBool(textField.SwigCPtr, TextField.Property.EnableShiftSelection); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty MatchSystemLanguageDirectionProperty = null; internal static void SetInternalMatchSystemLanguageDirectionProperty(BindableObject bindable, object oldValue, object newValue) @@ -1318,36 +1318,40 @@ internal static object GetInternalCharacterSpacingProperty(BindableObject bindab /// RemoveFrontInsetProperty /// [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty RemoveFrontInsetProperty = BindableProperty.Create(nameof(RemoveFrontInset), typeof(bool), typeof(TextLabel), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + public static readonly BindableProperty RemoveFrontInsetProperty = null; + internal static void SetInternalRemoveFrontInsetProperty(BindableObject bindable, object oldValue, object newValue) { var textField = (TextField)bindable; if (newValue != null) { - Object.InternalSetPropertyBool(textField.SwigCPtr, TextField.Property.RemoveFrontInset, (bool)newValue); + Object.InternalSetPropertyBool(textField.SwigCPtr, TextField.Property.RemoveFrontInset, (bool)newValue); } - }), - defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + } + internal static object GetInternalRemoveFrontInsetProperty(BindableObject bindable) { var textField = (TextField)bindable; + return Object.InternalGetPropertyBool(textField.SwigCPtr, TextField.Property.RemoveFrontInset); - })); + } /// /// RemoveBackInsetProperty /// [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty RemoveBackInsetProperty = BindableProperty.Create(nameof(RemoveBackInset), typeof(bool), typeof(TextLabel), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + public static readonly BindableProperty RemoveBackInsetProperty = null; + internal static void SetInternalRemoveBackInsetProperty(BindableObject bindable, object oldValue, object newValue) { var textField = (TextField)bindable; if (newValue != null) { Object.InternalSetPropertyBool(textField.SwigCPtr, TextField.Property.RemoveBackInset, (bool)newValue); } - }), - defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + } + internal static object GetInternalRemoveBackInsetProperty(BindableObject bindable) { var textField = (TextField)bindable; + return Object.InternalGetPropertyBool(textField.SwigCPtr, TextField.Property.RemoveBackInset); - })); + } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs index 2999f1f8e83..9d5ff072d75 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs @@ -74,7 +74,7 @@ public partial class TextField private bool invokeTextChanged = true; /// - /// The TextChanged event. + /// The TextChanged event is triggered whenever the text in the TextField changes. /// /// 3 public event EventHandler TextChanged @@ -124,7 +124,7 @@ public event EventHandler CursorPositionChanged } /// - /// The MaxLengthReached event. + /// The MaxLengthReached event is triggered when the text entered in the TextField exceeds its maximum allowed length. /// /// 3 public event EventHandler MaxLengthReached @@ -350,18 +350,36 @@ internal TextFieldSignal InputFilteredSignal() private void OnSelectionStarted(IntPtr textField) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + //no data to be sent to the user textFieldSelectionStartedEventHandler?.Invoke(this, EventArgs.Empty); } private void OnSelectionCleared(IntPtr textField) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + //no data to be sent to the user textFieldSelectionClearedEventHandler?.Invoke(this, EventArgs.Empty); } private void OnTextChanged(IntPtr textField) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (textFieldTextChangedEventHandler != null && invokeTextChanged) { TextChangedEventArgs e = new TextChangedEventArgs(); @@ -375,12 +393,24 @@ private void OnTextChanged(IntPtr textField) private void OnCursorPositionChanged(IntPtr textField, uint oldPosition) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + // no data to be sent to the user, as in NUI there is no event provide old values. textFieldCursorPositionChangedEventHandler?.Invoke(this, EventArgs.Empty); } private void OnMaxLengthReached(IntPtr textField) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (textFieldMaxLengthReachedEventHandler != null) { MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs(); @@ -394,6 +424,12 @@ private void OnMaxLengthReached(IntPtr textField) private void OnAnchorClicked(IntPtr textField, IntPtr href, uint hrefLength) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + // Note: hrefLength is useful for get the length of a const char* (href) in dali-toolkit. // But NUI can get the length of string (href), so hrefLength is not necessary in NUI. AnchorClickedEventArgs e = new AnchorClickedEventArgs(); @@ -406,12 +442,24 @@ private void OnAnchorClicked(IntPtr textField, IntPtr href, uint hrefLength) private void OnSelectionChanged(IntPtr textField, uint oldStart, uint oldEnd) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + // no data to be sent to the user, as in NUI there is no event provide old values. textFieldSelectionChangedEventHandler?.Invoke(this, EventArgs.Empty); } private void OnInputFiltered(IntPtr textField, InputFilterType type) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + InputFilteredEventArgs e = new InputFilteredEventArgs(); // Populate all members of "e" (InputFilteredEventArgs) with real data @@ -429,7 +477,7 @@ public class TextChangedEventArgs : EventArgs private TextField textField; /// - /// TextField. + /// Gets or sets TextField. /// /// 3 public TextField TextField @@ -454,7 +502,7 @@ public class MaxLengthReachedEventArgs : EventArgs private TextField textField; /// - /// TextField. + /// Gets or sets TextField. /// /// 3 public TextField TextField diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 8a86f8c2287..d1e033ecd49 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -256,7 +256,7 @@ public TextLabel() : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultSty if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true, viewStyle) { @@ -266,7 +266,7 @@ public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.New(ThemeMan /// Creates the TextLabel with setting the status of shown or hidden. /// /// false : Not displayed (hidden), true : displayed (shown) - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public TextLabel(bool shown) : this(Interop.TextLabel.New(ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true) { @@ -290,7 +290,7 @@ public TextLabel(string text) : this(Interop.TextLabel.New(text, ThemeManager.Ge /// /// The text to display /// false : Not displayed (hidden), true : displayed (shown) - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public TextLabel(string text, bool shown) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true) { @@ -320,6 +320,92 @@ private bool HasStyle() return ThemeManager.GetStyle(this.GetType()) == null ? false : true; } + /// + /// Requests asynchronous rendering of text with a fixed size. + /// + /// The width of text to render. + /// The height of text to render. + /// + /// Only works when AsyncAuto and AsyncManual.
+ /// If another request occurs before the requested render is completed, the previous request will be canceled.
+ /// In AsyncAuto, the manual request is not canceled by an auto request caused by OnRealyout. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public void RequestAsyncRenderWithFixedSize(float width, float height) + { + Interop.TextLabel.RequestAsyncRenderWithFixedSize(SwigCPtr, width, height); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Requests asynchronous text rendering with a fixed width. + /// + /// The width of text to render. + /// The maximum available height of text to render. + /// + /// Only works when AsyncAuto and AsyncManual.
+ /// The height is determined by the content of the text when rendered with the given width.
+ /// The result will be the same as the height returned by GetHeightForWidth.
+ /// If the heightConstraint is given, the maximum height will be the heightConstraint.
+ /// If another request occurs before the requested render is completed, the previous request will be canceled.
+ /// In AsyncAuto, the manual request is not canceled by an auto request caused by OnRealyout. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public void RequestAsyncRenderWithFixedWidth(float width, float heightConstraint = float.PositiveInfinity) + { + Interop.TextLabel.RequestAsyncRenderWithFixedWidth(SwigCPtr, width, heightConstraint); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Requests asynchronous rendering with the maximum available width using the given widthConstraint. + /// + /// The maximum available width of text to render. + /// The maximum available height of text to render. + /// + /// Only works when AsyncAuto and AsyncManual.
+ /// If the width of the text content is smaller than the widthConstraint, the width will be determined by the width of the text.
+ /// If the width of the text content is larger than the widthConstraint, the width will be determined by the widthConstraint.
+ /// The height is determined by the content of the text when rendered with the given width.
+ /// In this case, the result will be the same as the height returned by GetHeightForWidth.
+ /// If the heightConstraint is given, the maximum height will be the heightConstraint.
+ /// If another request occurs before the requested render is completed, the previous request will be canceled.
+ /// In AsyncAuto, the manual request is not canceled by an auto request caused by OnRealyout. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public void RequestAsyncRenderWithConstraint(float widthConstraint, float heightConstraint = float.PositiveInfinity) + { + Interop.TextLabel.RequestAsyncRenderWithConstraint(SwigCPtr, widthConstraint, heightConstraint); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Requests asynchronous text natural size computation. + /// + /// + /// If another request occurs before the requested natural size computation is completed, the previous request will be canceled. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void RequestAsyncNaturalSize() + { + Interop.TextLabel.RequestAsyncNaturalSize(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Requests asynchronous computation of the height of the text based on the given width. + /// + /// The width of text to compute. + /// + /// If another request occurs before the requested height for width computation is completed, the previous request will be canceled. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void RequestAsyncHeightForWidth(float width) + { + Interop.TextLabel.RequestAsyncHeightForWidth(SwigCPtr, width); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// /// The TranslatableText property.
/// The text can set the SID value.
@@ -555,7 +641,14 @@ public void SetFontStyle(FontStyle fontStyle) { using (var fontStyleMap = TextMapHelper.GetFontStyleMap(fontStyle)) { - SetValue(FontStyleProperty, fontStyleMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(FontStyleProperty, fontStyleMap); + } + else + { + SetInternalFontStyleProperty(this, null, fontStyleMap); + } } } @@ -570,7 +663,7 @@ public void SetFontStyle(FontStyle fontStyle) public FontStyle GetFontStyle() { FontStyle fontStyle; - using (var fontStyleMap = (PropertyMap)GetValue(FontStyleProperty)) + using (var fontStyleMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(FontStyleProperty) : (PropertyMap)GetInternalFontStyleProperty(this)) { fontStyle = TextMapHelper.GetFontStyleStruct(fontStyleMap); } @@ -803,11 +896,16 @@ private Vector2 InternalShadowOffset using (var map = new PropertyMap()) { map.Add("offset", value); - var shadowMap = Shadow; shadowMap.Merge(map); - - SetValue(ShadowProperty, shadowMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(ShadowProperty, shadowMap); + } + else + { + SetInternalShadowProperty(this, null, shadowMap); + } NotifyPropertyChanged(); } } @@ -875,7 +973,14 @@ private Vector4 InternalShadowColor map.Add("color", value); var shadowMap = Shadow; shadowMap.Merge(map); - SetValue(ShadowProperty, shadowMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(ShadowProperty, shadowMap); + } + else + { + SetInternalShadowProperty(this, null, shadowMap); + } NotifyPropertyChanged(); } } @@ -935,9 +1040,16 @@ private bool InternalUnderlineEnabled using (var map = new PropertyMap()) { map.Add("enable", value); - var undelineMap = Underline; - undelineMap.Merge(map); - SetValue(UnderlineProperty, undelineMap); + var underlineMap = Underline; + underlineMap.Merge(map); + if (NUIApplication.IsUsingXaml) + { + SetValue(UnderlineProperty, underlineMap); + } + else + { + SetInternalUnderlineProperty(this, null, underlineMap); + } NotifyPropertyChanged(); } } @@ -1003,9 +1115,16 @@ private Vector4 InternalUnderlineColor using (var map = new PropertyMap()) { map.Add("color", value); - var undelineMap = Underline; - undelineMap.Merge(map); - SetValue(UnderlineProperty, undelineMap); + var underlineMap = Underline; + underlineMap.Merge(map); + if (NUIApplication.IsUsingXaml) + { + SetValue(UnderlineProperty, underlineMap); + } + else + { + SetInternalUnderlineProperty(this, null, underlineMap); + } NotifyPropertyChanged(); } } @@ -1065,9 +1184,17 @@ private float InternalUnderlineHeight using (var map = new PropertyMap()) { map.Add("height", value); - var undelineMap = Underline; - undelineMap.Merge(map); - SetValue(UnderlineProperty, undelineMap); + var underlineMap = Underline; + underlineMap.Merge(map); + if (NUIApplication.IsUsingXaml) + { + SetValue(UnderlineProperty, underlineMap); + } + else + { + SetInternalUnderlineProperty(this, null, underlineMap); + } + NotifyPropertyChanged(); } } @@ -1358,7 +1485,14 @@ public void SetUnderline(Underline underline) { using (var underlineMap = TextMapHelper.GetUnderlineMap(underline)) { - SetValue(UnderlineProperty, underlineMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(UnderlineProperty, underlineMap); + } + else + { + SetInternalUnderlineProperty(this, null, underlineMap); + } } } @@ -1373,7 +1507,7 @@ public void SetUnderline(Underline underline) public Underline GetUnderline() { Underline underline; - using (var underlineMap = (PropertyMap)GetValue(UnderlineProperty)) + using (var underlineMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(UnderlineProperty) : (PropertyMap)GetInternalUnderlineProperty(this)) { underline = TextMapHelper.GetUnderlineStruct(underlineMap); } @@ -1441,7 +1575,14 @@ public void SetShadow(Tizen.NUI.Text.Shadow shadow) { using (var shadowMap = TextMapHelper.GetShadowMap(shadow)) { - SetValue(ShadowProperty, shadowMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(ShadowProperty, shadowMap); + } + else + { + SetInternalShadowProperty(this, null, shadowMap); + } } } @@ -1456,7 +1597,7 @@ public void SetShadow(Tizen.NUI.Text.Shadow shadow) public Tizen.NUI.Text.Shadow GetShadow() { Tizen.NUI.Text.Shadow shadow; - using (var shadowMap = (PropertyMap)GetValue(ShadowProperty)) + using (var shadowMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(ShadowProperty) : (PropertyMap)GetInternalShadowProperty(this)) { shadow = TextMapHelper.GetShadowStruct(shadowMap); } @@ -1586,7 +1727,14 @@ public void SetOutline(Outline outline) { using (var outlineMap = TextMapHelper.GetOutlineMap(outline)) { - SetValue(OutlineProperty, outlineMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(OutlineProperty, outlineMap); + } + else + { + SetInternalOutlineProperty(this, null, outlineMap); + } } } @@ -1601,7 +1749,7 @@ public void SetOutline(Outline outline) public Outline GetOutline() { Outline outline; - using (var outlineMap = (PropertyMap)GetValue(OutlineProperty)) + using (var outlineMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(OutlineProperty) : (PropertyMap)GetInternalOutlineProperty(this)) { outline = TextMapHelper.GetOutlineStruct(outlineMap); } @@ -1818,7 +1966,7 @@ public AutoScrollStopMode AutoScrollStopMode } /// - /// The line count of the text. + /// Gets the line count of the text. /// /// 3 public int LineCount @@ -1869,7 +2017,7 @@ public LineWrapMode LineWrapMode /// /// The direction of the text such as left to right or right to left. /// - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public TextDirection TextDirection { @@ -1887,7 +2035,7 @@ public TextDirection TextDirection /// /// The vertical line alignment of the text. /// - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public VerticalLineAlignment VerticalLineAlignment { @@ -1958,7 +2106,7 @@ public bool MatchSystemLanguageDirection /// fontSize (string)The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize") /// ///
- /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1721: Property names should not match get methods")] public PropertyMap TextFit @@ -2012,7 +2160,14 @@ public void SetTextFit(TextFit textFit) { using (var textFitMap = TextMapHelper.GetTextFitMap(textFit)) { - SetValue(TextFitProperty, textFitMap); + if (NUIApplication.IsUsingXaml) + { + SetValue(TextFitProperty, textFitMap); + } + else + { + SetInternalTextFitProperty(this, null, textFitMap); + } } } @@ -2029,7 +2184,7 @@ public void SetTextFit(TextFit textFit) public TextFit GetTextFit() { TextFit textFit; - using (var textFitMap = (PropertyMap)GetValue(TextFitProperty)) + using (var textFitMap = NUIApplication.IsUsingXaml ? (PropertyMap)GetValue(TextFitProperty) : (PropertyMap)GetInternalTextFitProperty(this)) { textFit = TextMapHelper.GetTextFitStruct(textFitMap); } @@ -2140,7 +2295,7 @@ public TextFitArray GetTextFitArray() /// The height of the line in points.
/// If the font size is larger than the line size, it works with the font size.
/// - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public float MinLineSize { @@ -2511,6 +2666,74 @@ public bool Cutout } } + /// + /// The RenderMode property. + /// + /// + /// Sync : default, synchronous text loading.
+ /// AsyncAuto : automatically requests an asynchronous text load in OnRelayout.
+ /// AsyncManual : users should manually request rendering using the async text method.
+ /// All text rendering processes (update/layout/render) are performed asynchronously in AsyncAuto and AsyncManual. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public TextRenderMode RenderMode + { + get + { + return (TextRenderMode)Object.InternalGetPropertyInt(this.SwigCPtr, TextLabel.Property.RenderMode); + } + set + { + Object.InternalSetPropertyInt(this.SwigCPtr, TextLabel.Property.RenderMode, (int)value); + NotifyPropertyChanged(); + } + } + + /// + /// Whether the last async rendering result is a manual render.
+ /// If it's false, the render result was automatically requested by OnRelayout. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public bool ManualRendered + { + get + { + bool manualRendered = false; + using (var propertyValue = GetProperty(TextLabel.Property.ManualRendered)) + { + propertyValue.Get(out manualRendered); + } + return manualRendered; + } + } + + /// + /// Number of lines after latest asynchronous computing or rendering of text. + /// + /// + /// The following example demonstrates how to obtain the LineCount asynchronously. + /// + /// label.RequestAsyncHeightForWidth(label.Size.Width); + /// label.AsyncHeightForWidthComputed += (s, e) => + /// { + /// int lineCount = label.AsyncLineCount; + /// }; + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int AsyncLineCount + { + get + { + int asyncLineCount = 0; + using (var propertyValue = GetProperty(TextLabel.Property.AsyncLineCount)) + { + propertyValue.Get(out asyncLineCount); + } + return asyncLineCount; + } + } + private TextLabelSelectorData EnsureSelectorData() => selectorData ?? (selectorData = new TextLabelSelectorData()); /// @@ -2568,10 +2791,33 @@ protected override void Dispose(DisposeTypes type) if (this.HasBody()) { + if (textLabelAnchorClickedCallbackDelegate != null) + { + AnchorClickedSignal().Disconnect(textLabelAnchorClickedCallbackDelegate); + } + if (textLabelTextFitChangedCallbackDelegate != null) { TextFitChangedSignal().Disconnect(textLabelTextFitChangedCallbackDelegate); } + + if (textLabelAsyncTextRenderedCallbackDelegate != null) + { + Interop.TextLabel.AsyncTextRenderedDisconnect(this.SwigCPtr, textLabelAsyncTextRenderedCallbackDelegate.ToHandleRef(this)); + textLabelAsyncTextRenderedCallbackDelegate = null; + } + + if (textLabelAsyncNaturalSizeComputedCallbackDelegate != null) + { + Interop.TextLabel.AsyncNaturalSizeComputedDisconnect(this.SwigCPtr, textLabelAsyncNaturalSizeComputedCallbackDelegate.ToHandleRef(this)); + textLabelAsyncNaturalSizeComputedCallbackDelegate = null; + } + + if (textLabelAsyncHeightForWidthComputedCallbackDelegate != null) + { + Interop.TextLabel.AsyncHeightForWidthComputedDisconnect(this.SwigCPtr, textLabelAsyncHeightForWidthComputedCallbackDelegate.ToHandleRef(this)); + textLabelAsyncHeightForWidthComputedCallbackDelegate = null; + } } base.Dispose(type); @@ -2737,6 +2983,9 @@ private void RequestLayout() internal static readonly int RemoveFrontInset = Interop.TextLabel.RemoveFrontInsetGet(); internal static readonly int RemoveBackInset = Interop.TextLabel.RemoveBackInsetGet(); internal static readonly int Cutout = Interop.TextLabel.CutoutGet(); + internal static readonly int RenderMode = Interop.TextLabel.RenderModeGet(); + internal static readonly int ManualRendered = Interop.TextLabel.ManualRenderedGet(); + internal static readonly int AsyncLineCount = Interop.TextLabel.AsyncLineCountGet(); internal static void Preload() diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs index 7fa40904c24..1f34d22c221 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs @@ -53,7 +53,7 @@ internal static object GetInternalTranslatableTextProperty(BindableObject bindab return textLabel.translatableText; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TextProperty = null; internal static void SetInternalTextProperty(BindableObject bindable, object oldValue, object newValue) @@ -78,7 +78,7 @@ internal static object GetInternalTextProperty(BindableObject bindable) return textLabel.textIsEmpty ? "" : Object.InternalGetPropertyString(textLabel.SwigCPtr, TextLabel.Property.TEXT); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FontFamilyProperty = null; internal static void SetInternalFontFamilyProperty(BindableObject bindable, object oldValue, object newValue) @@ -101,7 +101,7 @@ internal static object GetInternalFontFamilyProperty(BindableObject bindable) return textLabel.InternalFontFamily; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FontStyleProperty = null; internal static void SetInternalFontStyleProperty(BindableObject bindable, object oldValue, object newValue) @@ -121,7 +121,7 @@ internal static object GetInternalFontStyleProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PointSizeProperty = null; internal static void SetInternalPointSizeProperty(BindableObject bindable, object oldValue, object newValue) @@ -145,7 +145,7 @@ internal static object GetInternalPointSizeProperty(BindableObject bindable) return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.PointSize); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty MultiLineProperty = null; internal static void SetInternalMultiLineProperty(BindableObject bindable, object oldValue, object newValue) @@ -165,7 +165,7 @@ internal static object GetInternalMultiLineProperty(BindableObject bindable) return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.MultiLine); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty HorizontalAlignmentProperty = null; internal static void SetInternalHorizontalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) @@ -202,7 +202,7 @@ internal static object GetInternalHorizontalAlignmentProperty(BindableObject bin } } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty VerticalAlignmentProperty = null; internal static void SetInternalVerticalAlignmentProperty(BindableObject bindable, object oldValue, object newValue) @@ -239,7 +239,7 @@ internal static object GetInternalVerticalAlignmentProperty(BindableObject binda } } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TextColorProperty = null; internal static void SetInternalTextColorProperty(BindableObject bindable, object oldValue, object newValue) @@ -352,7 +352,7 @@ internal static object GetInternalRemoveBackInsetProperty(BindableObject bindabl return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.RemoveBackInset); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableMarkupProperty = null; internal static void SetInternalEnableMarkupProperty(BindableObject bindable, object oldValue, object newValue) @@ -371,7 +371,7 @@ internal static object GetInternalEnableMarkupProperty(BindableObject bindable) return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.EnableMarkup); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableAutoScrollProperty = null; internal static void SetInternalEnableAutoScrollProperty(BindableObject bindable, object oldValue, object newValue) @@ -390,7 +390,7 @@ internal static object GetInternalEnableAutoScrollProperty(BindableObject bindab return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.EnableAutoScroll); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty AutoScrollSpeedProperty = null; internal static void SetInternalAutoScrollSpeedProperty(BindableObject bindable, object oldValue, object newValue) @@ -409,7 +409,7 @@ internal static object GetInternalAutoScrollSpeedProperty(BindableObject bindabl return Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.AutoScrollSpeed); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty AutoScrollLoopCountProperty = null; internal static void SetInternalAutoScrollLoopCountProperty(BindableObject bindable, object oldValue, object newValue) @@ -428,7 +428,7 @@ internal static object GetInternalAutoScrollLoopCountProperty(BindableObject bin return Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.AutoScrollLoopCount); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty AutoScrollGapProperty = null; internal static void SetInternalAutoScrollGapProperty(BindableObject bindable, object oldValue, object newValue) @@ -447,7 +447,7 @@ internal static object GetInternalAutoScrollGapProperty(BindableObject bindable) return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.AutoScrollGap); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty LineSpacingProperty = null; internal static void SetInternalLineSpacingProperty(BindableObject bindable, object oldValue, object newValue) @@ -485,7 +485,7 @@ internal static object GetInternalRelativeLineHeightProperty(BindableObject bind return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.RelativeLineHeight); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty UnderlineProperty = null; internal static void SetInternalUnderlineProperty(BindableObject bindable, object oldValue, object newValue) @@ -504,7 +504,7 @@ internal static object GetInternalUnderlineProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ShadowProperty = null; internal static void SetInternalShadowProperty(BindableObject bindable, object oldValue, object newValue) @@ -523,7 +523,7 @@ internal static object GetInternalShadowProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TextShadowProperty = null; internal static void SetInternalTextShadowProperty(BindableObject bindable, object oldValue, object newValue) @@ -548,7 +548,7 @@ internal static object GetInternalTextShadowProperty(BindableObject bindable) return temp.Empty() ? null : new TextShadow(temp); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EmbossProperty = null; internal static void SetInternalEmbossProperty(BindableObject bindable, object oldValue, object newValue) @@ -567,7 +567,7 @@ internal static object GetInternalEmbossProperty(BindableObject bindable) return Object.InternalGetPropertyString(textLabel.SwigCPtr, TextLabel.Property.EMBOSS); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty OutlineProperty = null; internal static void SetInternalOutlineProperty(BindableObject bindable, object oldValue, object newValue) @@ -586,7 +586,7 @@ internal static object GetInternalOutlineProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PixelSizeProperty = null; internal static void SetInternalPixelSizeProperty(BindableObject bindable, object oldValue, object newValue) @@ -610,7 +610,7 @@ internal static object GetInternalPixelSizeProperty(BindableObject bindable) return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.PixelSize); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EllipsisProperty = null; internal static void SetInternalEllipsisProperty(BindableObject bindable, object oldValue, object newValue) @@ -648,7 +648,7 @@ internal static object GetInternalEllipsisPositionProperty(BindableObject bindab return (EllipsisPosition)Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.EllipsisPosition); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty AutoScrollLoopDelayProperty = null; internal static void SetInternalAutoScrollLoopDelayProperty(BindableObject bindable, object oldValue, object newValue) @@ -667,7 +667,7 @@ internal static object GetInternalAutoScrollLoopDelayProperty(BindableObject bin return Object.InternalGetPropertyFloat(textLabel.SwigCPtr, TextLabel.Property.AutoScrollLoopDelay); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty AutoScrollStopModeProperty = null; internal static void SetInternalAutoScrollStopModeProperty(BindableObject bindable, object oldValue, object newValue) @@ -688,7 +688,7 @@ internal static object GetInternalAutoScrollStopModeProperty(BindableObject bind return temp.GetValueByDescription(); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty LineWrapModeProperty = null; internal static void SetInternalLineWrapModeProperty(BindableObject bindable, object oldValue, object newValue) @@ -707,7 +707,7 @@ internal static object GetInternalLineWrapModeProperty(BindableObject bindable) return (LineWrapMode)Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.LineWrapMode); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty VerticalLineAlignmentProperty = null; internal static void SetInternalVerticalLineAlignmentProperty(BindableObject bindable, object oldValue, object newValue) @@ -726,7 +726,7 @@ internal static object GetInternalVerticalLineAlignmentProperty(BindableObject b return (VerticalLineAlignment)Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.VerticalLineAlignment); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty MatchSystemLanguageDirectionProperty = null; internal static void SetInternalMatchSystemLanguageDirectionProperty(BindableObject bindable, object oldValue, object newValue) diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabelEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabelEvent.cs index 94a7ed71c45..86ad557d528 100644 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabelEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabelEvent.cs @@ -35,12 +35,163 @@ public partial class TextLabel private EventHandler textLabelTextFitChangedEventHandler; private TextFitChangedCallbackDelegate textLabelTextFitChangedCallbackDelegate; + private EventHandler textLabelAsyncTextRenderedEventHandler; + private AsyncTextRenderedCallbackDelegate textLabelAsyncTextRenderedCallbackDelegate; + + private EventHandler textLabelAsyncNaturalSizeComputedEventHandler; + private AsyncNaturalSizeComputedCallbackDelegate textLabelAsyncNaturalSizeComputedCallbackDelegate; + + private EventHandler textLabelAsyncHeightForWidthComputedEventHandler; + private AsyncHeightForWidthComputedCallbackDelegate textLabelAsyncHeightForWidthComputedCallbackDelegate; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void AnchorClickedCallbackDelegate(IntPtr textLabel, IntPtr href, uint hrefLength); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void TextFitChangedCallbackDelegate(IntPtr textLabel); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void AsyncTextRenderedCallbackDelegate(IntPtr textLabel, float width, float height); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void AsyncNaturalSizeComputedCallbackDelegate(IntPtr textLabel, float width, float height); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void AsyncHeightForWidthComputedCallbackDelegate(IntPtr textLabel, float width, float height); + + + /// + /// The AsyncHeightForWidthComputed signal is emitted when the async natural size computed. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler AsyncHeightForWidthComputed + { + add + { + if (textLabelAsyncHeightForWidthComputedEventHandler == null) + { + textLabelAsyncHeightForWidthComputedCallbackDelegate = OnAsyncHeightForWidthComputed; + Interop.TextLabel.AsyncHeightForWidthComputedConnect(SwigCPtr, textLabelAsyncHeightForWidthComputedCallbackDelegate.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + textLabelAsyncHeightForWidthComputedEventHandler += value; + } + remove + { + textLabelAsyncHeightForWidthComputedEventHandler -= value; + if (textLabelAsyncHeightForWidthComputedEventHandler == null && textLabelAsyncHeightForWidthComputedCallbackDelegate != null) + { + Interop.TextLabel.AsyncHeightForWidthComputedDisconnect(SwigCPtr, textLabelAsyncHeightForWidthComputedCallbackDelegate.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + textLabelAsyncHeightForWidthComputedCallbackDelegate = null; + } + } + } + + private void OnAsyncHeightForWidthComputed(IntPtr textLabel, float width, float height) + { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + + AsyncTextSizeComputedEventArgs e = new AsyncTextSizeComputedEventArgs(width, height); + + if (textLabelAsyncHeightForWidthComputedEventHandler != null) + { + textLabelAsyncHeightForWidthComputedEventHandler(this, e); + } + } + + /// + /// The AsyncNaturalSizeComputed signal is emitted when the async natural size computed. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler AsyncNaturalSizeComputed + { + add + { + if (textLabelAsyncNaturalSizeComputedEventHandler == null) + { + textLabelAsyncNaturalSizeComputedCallbackDelegate = OnAsyncNaturalSizeComputed; + Interop.TextLabel.AsyncNaturalSizeComputedConnect(SwigCPtr, textLabelAsyncNaturalSizeComputedCallbackDelegate.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + textLabelAsyncNaturalSizeComputedEventHandler += value; + } + remove + { + textLabelAsyncNaturalSizeComputedEventHandler -= value; + if (textLabelAsyncNaturalSizeComputedEventHandler == null && textLabelAsyncNaturalSizeComputedCallbackDelegate != null) + { + Interop.TextLabel.AsyncNaturalSizeComputedDisconnect(SwigCPtr, textLabelAsyncNaturalSizeComputedCallbackDelegate.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + textLabelAsyncNaturalSizeComputedCallbackDelegate = null; + } + } + } + + private void OnAsyncNaturalSizeComputed(IntPtr textLabel, float width, float height) + { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + + AsyncTextSizeComputedEventArgs e = new AsyncTextSizeComputedEventArgs(width, height); + + if (textLabelAsyncNaturalSizeComputedEventHandler != null) + { + textLabelAsyncNaturalSizeComputedEventHandler(this, e); + } + } + + /// + /// The AsyncTextRendered signal is emitted when the async text rendered. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler AsyncTextRendered + { + add + { + if (textLabelAsyncTextRenderedEventHandler == null) + { + textLabelAsyncTextRenderedCallbackDelegate = OnAsyncTextRendered; + Interop.TextLabel.AsyncTextRenderedConnect(SwigCPtr, textLabelAsyncTextRenderedCallbackDelegate.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + textLabelAsyncTextRenderedEventHandler += value; + } + remove + { + textLabelAsyncTextRenderedEventHandler -= value; + if (textLabelAsyncTextRenderedEventHandler == null && textLabelAsyncTextRenderedCallbackDelegate != null) + { + Interop.TextLabel.AsyncTextRenderedDisconnect(SwigCPtr, textLabelAsyncTextRenderedCallbackDelegate.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + textLabelAsyncTextRenderedCallbackDelegate = null; + } + } + } + + private void OnAsyncTextRendered(IntPtr textLabel, float width, float height) + { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + + AsyncTextRenderedEventArgs e = new AsyncTextRenderedEventArgs(width, height); + + if (textLabelAsyncTextRenderedEventHandler != null) + { + textLabelAsyncTextRenderedEventHandler(this, e); + } + } + /// /// The AnchorClicked signal is emitted when the anchor is clicked. /// @@ -75,6 +226,12 @@ internal TextLabelSignal AnchorClickedSignal() private void OnAnchorClicked(IntPtr textLabel, IntPtr href, uint hrefLength) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + // Note: hrefLength is useful for get the length of a const char* (href) in dali-toolkit. // But NUI can get the length of string (href), so hrefLength is not necessary in NUI. AnchorClickedEventArgs e = new AnchorClickedEventArgs(); @@ -120,6 +277,12 @@ internal TextLabelSignal TextFitChangedSignal() private void OnTextFitChanged(IntPtr textLabel) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + // no data to be sent to the user, as in NUI there is no event provide old values. textLabelTextFitChangedEventHandler?.Invoke(this, EventArgs.Empty); } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs b/src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs index cf0454940f1..7683ab462d4 100644 --- a/src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextMapHelper.cs @@ -384,6 +384,12 @@ public static PropertyMap GetOutlineMap(Outline outline) if (outline.Width != null) map.Add("width", (float)outline.Width); + if (outline.Offset != null) + map.Add("offset", outline.Offset); + + if (outline.BlurRadius != null) + map.Add("blurRadius", (float)outline.BlurRadius); + return map; } @@ -401,6 +407,8 @@ public static Outline GetOutlineStruct(PropertyMap map) { outline.Color = GetColorFromMap(map, "color"); outline.Width = GetFloatFromMap(map, "width", 0.0f); + outline.Offset = GetVector2FromMap(map, "offset"); + outline.BlurRadius = GetFloatFromMap(map, "blurRadius", 0.0f); } return outline; diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs b/src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs index b1255b01418..e7deb1ed7c7 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextUtils.cs @@ -1214,11 +1214,16 @@ public static float GetFontSizeScale(SystemSettingsFontSize systemSettingsFontSi /// /// Copy the previously selected text from the text control into the clipboard. /// + /// Thrown when argument is null. /// The textEditor control from which the text is copied. /// The copied text. /// 9 public static string CopyToClipboard(TextEditor textEditor) { + if (textEditor == null) + { + throw new ArgumentNullException(nameof(textEditor), "TextEditor should not be null."); + } string copiedText = Interop.TextEditor.CopyText(textEditor.SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return copiedText; @@ -1227,11 +1232,16 @@ public static string CopyToClipboard(TextEditor textEditor) /// /// Copy the previously selected text from the text control into the clipboard. /// + /// Thrown when argument is null. /// The textField control from which the text is copied. /// The copied text. /// 9 public static string CopyToClipboard(TextField textField) { + if (textField == null) + { + throw new ArgumentNullException(nameof(textField), "TextField should not be null."); + } string copiedText = Interop.TextField.CopyText(textField.SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return copiedText; @@ -1240,11 +1250,16 @@ public static string CopyToClipboard(TextField textField) /// /// Cut the previously selected text from the text control into the clipboard. /// + /// Thrown when argument is null. /// The textEditor control from which the text is cut. /// The cut text. /// 9 public static string CutToClipboard(TextEditor textEditor) { + if (textEditor == null) + { + throw new ArgumentNullException(nameof(textEditor), "TextEditor should not be null."); + } string cutText = Interop.TextEditor.CutText(textEditor.SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return cutText; @@ -1253,11 +1268,16 @@ public static string CutToClipboard(TextEditor textEditor) /// /// Cut the previously selected text from the text control into the clipboard. /// + /// Thrown when argument is null. /// The textField control from which the text is cut. /// The cut text. /// 9 public static string CutToClipboard(TextField textField) { + if (textField == null) + { + throw new ArgumentNullException(nameof(textField), "TextField should not be null."); + } string cutText = Interop.TextField.CutText(textField.SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return cutText; @@ -1271,10 +1291,15 @@ public static string CutToClipboard(TextField textField) /// the text will be appended to the last cursor position and the text control will gain focus. /// If some text inside the text control is selected, it will be replaced by the pasted text. /// + /// Thrown when argument is null. /// The textEditor control into which the text is pasted. /// 9 public static void PasteTo(TextEditor textEditor) { + if (textEditor == null) + { + throw new ArgumentNullException(nameof(textEditor), "TextEditor should not be null."); + } Interop.TextEditor.PasteText(textEditor.SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -1287,10 +1312,15 @@ public static void PasteTo(TextEditor textEditor) /// the text will be appended to the last cursor position and the text control will gain focus. /// If some text inside the text control is selected, it will be replaced by the pasted text. /// + /// Thrown when argument is null. /// The textField control into which the text is pasted. /// 9 public static void PasteTo(TextField textField) { + if (textField == null) + { + throw new ArgumentNullException(nameof(textField), "TextEditor should not be null."); + } Interop.TextField.PasteText(textField.SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } diff --git a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/ColorStop.cs b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/ColorStop.cs index 7dfb793d867..11d0ff592b5 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/ColorStop.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/ColorStop.cs @@ -29,8 +29,10 @@ public class ColorStop private Color color; //The color value. /// - /// Initialize ColorStop. + /// Initializes a new instance of the ColorStop class with the specified offset and color. /// + /// The offset at which the color stop applies. + /// The color to apply at the specified offset. /// 9 public ColorStop(float offset, Color color) { @@ -39,7 +41,7 @@ public ColorStop(float offset, Color color) } /// - /// The relative position of the color. + /// Gets or sets the relative position of the color stop along the gradient line. /// /// 9 public float Offset @@ -55,7 +57,7 @@ public float Offset } /// - /// The color value. + /// Gets or sets the color value of the gradient stop. /// /// 9 public Color Color diff --git a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/PathCommands.cs b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/PathCommands.cs index 8ac8df3bd60..4e0f98e0d63 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/PathCommands.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/PathCommands.cs @@ -54,6 +54,7 @@ public PathCommands(IEnumerable commands, IEnumerable po /// /// The commands array. + /// This property returns an enumerable collection of PathCommandType representing the path commands. /// /// Thrown when commands is null. /// 9 @@ -75,6 +76,7 @@ public IEnumerable Commands /// /// The points array + /// This returns an enumerable collection of floating-point numbers representing the points. /// /// Thrown when points is null. /// 9 diff --git a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/Picture.cs b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/Picture.cs index 90735a3a500..09260325371 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/Picture.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/Picture.cs @@ -29,6 +29,7 @@ public class Picture : Drawable { /// /// Creates an initialized Picture. + /// This constructor initializes a new instance of the Picture class. /// /// 9 public Picture() : this(Interop.Picture.New(), true) diff --git a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/Shape.cs b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/Shape.cs index 56f9941621a..0a28f205d97 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/Shape.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VectorGraphics/Shape.cs @@ -35,6 +35,7 @@ public class Shape : Drawable /// /// Creates an initialized Shape. + /// This constructor initializes a new instance of the Shape class. /// /// 9 public Shape() : this(Interop.Shape.New(), true) @@ -100,7 +101,8 @@ public Gradient FillGradient } /// - /// The current fill rule of the shape. + /// Gets or sets the fill rule type for the shape. + /// The fill rule type which determines how the interior of a shape is determined. /// /// 9 public FillRuleType FillRule diff --git a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs index 3546a45c144..42534a02006 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI.BaseComponents /// 3 public class VideoView : View { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty VideoProperty = null; internal static void SetInternalVideoProperty(BindableObject bindable, object oldValue, object newValue) @@ -46,7 +46,7 @@ internal static object GetInternalVideoProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty LoopingProperty = null; internal static void SetInternalLoopingProperty(BindableObject bindable, object oldValue, object newValue) @@ -65,7 +65,7 @@ internal static object GetInternalLoopingProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty MutedProperty = null; internal static void SetInternalMutedProperty(BindableObject bindable, object oldValue, object newValue) @@ -84,7 +84,7 @@ internal static object GetInternalMutedProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty VolumeProperty = null; internal static void SetInternalVolumeProperty(BindableObject bindable, object oldValue, object newValue) @@ -103,7 +103,7 @@ internal static object GetInternalVolumeProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty UnderlayProperty = null; internal static void SetInternalUnderlayProperty(BindableObject bindable, object oldValue, object newValue) @@ -122,7 +122,7 @@ internal static object GetInternalUnderlayProperty(BindableObject bindable) return temp; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static BindableProperty ResourceUrlProperty = null; internal static void SetInternalResourceUrlProperty(BindableObject bindable, object oldValue, object newValue) @@ -533,8 +533,12 @@ internal VideoViewSignal FinishedSignal() /// /// Dispose. + /// Releases unmanaged and optionally managed resources. /// - /// DisposeTypes + /// + /// When overriding this method, you need to distinguish between explicit and implicit conditions. For explicit conditions, release both managed and unmanaged resources. For implicit conditions, only release unmanaged resources. + /// + /// Explicit to release both managed and unmanaged resources. Implicit to release only unmanaged resources. /// 3 protected override void Dispose(DisposeTypes type) { diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 59740e6cce4..422bf00d9ba 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -493,6 +493,7 @@ private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibili /// /// Creates a new instance of a view. + /// The default constructor for the View class. /// /// 3 public View() : this(ViewAccessibilityMode.Default) @@ -505,7 +506,7 @@ public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibility if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle) { @@ -515,7 +516,7 @@ public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle) /// Create a new instance of a View with setting the status of shown or hidden. /// /// false : Not displayed (hidden), true : displayed (shown) - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). + /// This will be public opened after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] public View(bool shown) : this(Interop.View.New(), true) { @@ -571,7 +572,7 @@ internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.Ne /// /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout. /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool LayoutSet { @@ -586,7 +587,7 @@ public bool LayoutSet /// Once a View has a Layout set then any children added to Views from then on will receive /// automatic Layouts. /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static bool LayoutingDisabled { get; set; } = true; @@ -637,7 +638,8 @@ protected ViewStyle ViewStyle /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system, /// please set to true. /// - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// Thrown when set null. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public ControlState ControlState { @@ -651,6 +653,10 @@ protected set { return; } + if (value == null) + { + throw new ArgumentNullException(nameof(value), "ControlState should not be null."); + } var prevState = ControlState; @@ -761,7 +767,7 @@ protected set /// /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not. /// - /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool ExcludeLayouting { @@ -975,7 +981,7 @@ public string BackgroundImage /// /// Get or set the border of background image. /// - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Rectangle BackgroundImageBorder { @@ -1005,7 +1011,8 @@ public Rectangle BackgroundImageBorder } /// - /// The background of view. + /// Gets or sets the background of the view. + /// This property value is the PropertyMap representing the background. /// /// 3 public Tizen.NUI.PropertyMap Background @@ -1217,6 +1224,49 @@ internal VisualTransformPolicyType GetInternalCornerRadiusPolicy() return backgroundExtraData == null ? VisualTransformPolicyType.Absolute : backgroundExtraData.CornerRadiusPolicy; } + /// + /// The squareness for the rounded corners of the View. + /// This will make squircle background and shadow edges. + /// The values in Vector4 are used in clockwise order from top-left to bottom-left : Vector4(top-left-corner, top-right-corner, bottom-right-corner, bottom-left-corner). + /// + /// Each squareness will clamp internally to the [0.0f to 1.0f]. + /// If 0.0f, rounded corner applied. + /// If 1.0f, View will be rendered like a square. + /// + /// + /// This property only be available when the CornerRadius property used. Otherwise, it will be ignored. + /// + /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// animation.AnimateTo(view, "CornerSquareness", new Vector4(0.6f, 0.6f, 0.0f, 0.0f)); + /// + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector4 CornerSquareness + { + get + { + return GetInternalCornerSqurenessProperty(); + } + set + { + SetInternalCornerSqurenessProperty(value); + NotifyPropertyChanged(); + } + } + internal void SetInternalCornerSqurenessProperty(Vector4 cornerSquareness) + { + (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).CornerSquareness = cornerSquareness; + UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius); + } + internal Vector4 GetInternalCornerSqurenessProperty() + { + return backgroundExtraData == null ? Vector4.Zero : backgroundExtraData.CornerSquareness; + } + /// /// The width for the borderline of the View. /// @@ -1393,7 +1443,7 @@ internal float GetInternalBorderlineOffset() } /// - /// The current state of the view. + /// Gets or sets the current state of the view. /// /// 3 public States State @@ -1483,6 +1533,7 @@ internal States GetInternalSubState() /// /// Displays a tooltip + /// This property allows setting the tooltip properties such as text. /// /// 3 public Tizen.NUI.PropertyMap Tooltip @@ -3487,8 +3538,7 @@ public string Name } /// - /// Gets the view's ID. - /// Read-only + /// Gets The unique identifier of the view. (Read-only) /// /// 3 public uint ID @@ -3994,7 +4044,7 @@ internal SizeScalePolicyType GetInternalSizeScalePolicy() } /// - /// Gets or sets the status of whether the width size is dependent on the height size. + /// Gets or sets the status of whether the width size is dependent on the height size. /// /// 3 public bool WidthForHeight @@ -5214,7 +5264,7 @@ public float Weight /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously. /// Note: For Normal Quad images only. /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool BackgroundImageSynchronosLoading { @@ -5269,7 +5319,7 @@ private bool InternalBackgroundImageSynchronosLoading /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously. /// Note: For Normal Quad images only. /// - /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool BackgroundImageSynchronousLoading { @@ -5331,7 +5381,7 @@ private bool InternalBackgroundImageSynchronousLoading } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 UpdateAreaHint { @@ -5633,7 +5683,7 @@ private bool InternalAllowOnlyOwnTouch /// Determines which blend equation will be used to render renderers of this actor. /// /// blend equation enum currently assigned - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public BlendEquationType BlendEquation { diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEvent.cs index b0a84472228..0409033d109 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewAccessibilityEvent.cs @@ -305,6 +305,7 @@ public event EventHandler AccessibilityGestureInfoReceived gestureInfoSignal?.Disconnect(gestureInfoCallback); gestureInfoSignal?.Dispose(); gestureInfoSignal = null; + gestureInfoCallback = null; } } } @@ -367,6 +368,7 @@ public event EventHandler AccessibilityDescriptionReque getDescriptionSignal?.Disconnect(getDescriptionCallback); getDescriptionSignal?.Dispose(); getDescriptionSignal = null; + getDescriptionCallback = null; } } } @@ -429,6 +431,7 @@ public event EventHandler AccessibilityNameRequested getNameSignal?.Disconnect(getNameCallback); getNameSignal?.Dispose(); getNameSignal = null; + getNameCallback = null; } } } @@ -491,6 +494,7 @@ public event EventHandler AccessibilityActivated ActivateSignal?.Disconnect(activateCallback); ActivateSignal?.Dispose(); ActivateSignal = null; + activateCallback = null; } } } @@ -540,6 +544,7 @@ public event EventHandler AccessibilityReadingSkipped ReadingSkippedSignal?.Disconnect(readingSkippedCallback); ReadingSkippedSignal?.Dispose(); ReadingSkippedSignal = null; + readingSkippedCallback = null; } } } @@ -589,6 +594,7 @@ public event EventHandler AccessibilityReadingPaused ReadingPausedSignal?.Disconnect(readingPausedCallback); ReadingPausedSignal?.Dispose(); ReadingPausedSignal = null; + readingPausedCallback = null; } } } @@ -638,6 +644,7 @@ public event EventHandler AccessibilityReadingResumed ReadingResumedSignal?.Disconnect(readingResumedCallback); ReadingResumedSignal?.Dispose(); ReadingResumedSignal = null; + readingResumedCallback = null; } } } @@ -687,6 +694,7 @@ public event EventHandler AccessibilityReadingCancelled ReadingCancelledSignal?.Disconnect(readingCancelledCallback); ReadingCancelledSignal?.Dispose(); ReadingCancelledSignal = null; + readingCancelledCallback = null; } } } @@ -736,6 +744,7 @@ public event EventHandler AccessibilityReadingStopped ReadingStoppedSignal?.Disconnect(readingStoppedCallback); ReadingStoppedSignal?.Dispose(); ReadingStoppedSignal = null; + readingStoppedCallback = null; } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs index c5fc4a8b9d6..5df090a34ec 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs @@ -1900,7 +1900,7 @@ internal static void SetInternalCornerRadiusProperty(BindableObject bindable, ob internal static object GetInternalCornerRadiusProperty(BindableObject bindable) { var view = (View)bindable; - return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.CornerRadius; + return view.backgroundExtraData == null ? Vector4.Zero : view.backgroundExtraData.CornerRadius; } /// @@ -2660,6 +2660,8 @@ private void SetBackgroundImage(string value) { using var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius); using var cornerRadius = new PropertyValue(cornerRadiusValue); + using var cornerSquarenessValue = backgroundExtraData.CornerSquareness == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerSquareness); + using var cornerSquareness = new PropertyValue(cornerSquarenessValue); using var cornerRadiusPolicy = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)); using var borderlineWidth = new PropertyValue(backgroundExtraData.BorderlineWidth); using var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor); @@ -2667,6 +2669,7 @@ private void SetBackgroundImage(string value) using var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset); map.Add(Visual.Property.CornerRadius, cornerRadius) + .Add(Visual.Property.CornerSquareness, cornerSquareness) .Add(Visual.Property.CornerRadiusPolicy, cornerRadiusPolicy) .Add(Visual.Property.BorderlineWidth, borderlineWidth) .Add(Visual.Property.BorderlineColor, borderlineColor) @@ -2744,20 +2747,23 @@ private void SetBackgroundColor(Color value) return; } - var map = new PropertyMap(); - var colorType = new PropertyValue((int)Visual.Type.Color); - var mixColor = new PropertyValue(value); - var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius); - var cornerRadius = new PropertyValue(cornerRadiusValue); - var cornerRadiusPolicy = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)); - var borderlineWidth = new PropertyValue(backgroundExtraData.BorderlineWidth); - var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor); - var borderlineColor = new PropertyValue(borderlineColorValue); - var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset); + using var map = new PropertyMap(); + using var colorType = new PropertyValue((int)Visual.Type.Color); + using var mixColor = new PropertyValue(value); + using var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius); + using var cornerRadius = new PropertyValue(cornerRadiusValue); + using var cornerSquarenessValue = backgroundExtraData.CornerSquareness == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerSquareness); + using var cornerSquareness = new PropertyValue(cornerSquarenessValue); + using var cornerRadiusPolicy = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)); + using var borderlineWidth = new PropertyValue(backgroundExtraData.BorderlineWidth); + using var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor); + using var borderlineColor = new PropertyValue(borderlineColorValue); + using var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset); map.Add(Visual.Property.Type, colorType) .Add(ColorVisualProperty.MixColor, mixColor) .Add(Visual.Property.CornerRadius, cornerRadius) + .Add(Visual.Property.CornerSquareness, cornerSquareness) .Add(Visual.Property.CornerRadiusPolicy, cornerRadiusPolicy) .Add(Visual.Property.BorderlineWidth, borderlineWidth) .Add(Visual.Property.BorderlineColor, borderlineColor) @@ -2768,17 +2774,6 @@ private void SetBackgroundColor(Color value) var mapValue = new PropertyValue(map); Object.SetProperty(SwigCPtr, Property.BACKGROUND, mapValue); - borderlineOffset?.Dispose(); - borderlineColor?.Dispose(); - borderlineColorValue?.Dispose(); - borderlineWidth?.Dispose(); - cornerRadiusPolicy?.Dispose(); - cornerRadius?.Dispose(); - cornerRadiusValue?.Dispose(); - mixColor?.Dispose(); - colorType?.Dispose(); - map?.Dispose(); - mapValue?.Dispose(); } private void SetColor(Color value) diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs index 0b082de31f7..d635edb9f84 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs @@ -43,11 +43,12 @@ public partial class View private HoverEventCallbackType hoverEventCallback; private EventHandler visibilityChangedEventHandler; private VisibilityChangedEventCallbackType visibilityChangedEventCallback; + private EventHandler aggregatedVisibilityChangedEventHandler; + private AggregatedVisibilityChangedEventCallbackType aggregatedVisibilityChangedEventCallback; private EventHandler keyInputFocusGainedEventHandler; - private KeyInputFocusGainedCallbackType keyInputFocusGainedCallback; - private EventHandler keyInputFocusLostEventHandler; + private EventHandler keyInputFocusLostEventHandler; private KeyInputFocusLostCallbackType keyInputFocusLostCallback; private EventHandler onRelayoutEventHandler; private OnRelayoutEventCallbackType onRelayoutEventCallback; @@ -64,30 +65,43 @@ public partial class View [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void OffWindowEventCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate bool KeyCallbackType(IntPtr control, IntPtr keyEvent); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate bool TouchDataCallbackType(IntPtr view, IntPtr touchData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate bool HoverEventCallbackType(IntPtr view, IntPtr hoverEvent); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void VisibilityChangedEventCallbackType(IntPtr data, bool visibility, VisibilityChangeType type); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void AggregatedVisibilityChangedEventCallbackType(IntPtr data, bool visibility); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void ResourcesLoadedCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void _backgroundResourceLoadedCallbackType(IntPtr view); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void KeyInputFocusGainedCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void KeyInputFocusLostCallbackType(IntPtr control); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void OnRelayoutEventCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void OnWindowEventCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type); @@ -477,6 +491,7 @@ public event EventHandler RemovedFromWindow } } } + /// /// An event for visibility change which can be used to subscribe or unsubscribe the event handler.
/// This event is sent when the visibility of this or a parent view is changed.
@@ -517,6 +532,43 @@ public event EventHandler VisibilityChanged } } } + /// + /// An event for aggregated visibility change which can be used to subscribe or unsubscribe the event handler.
+ /// This event is sent when visible property of this View, any of its parents (right up to the root layer) or Window changes.
+ ///
+ /// + /// + /// This event is NOT sent if the view becomes transparent (or the reverse), it's ONLY linked with Show() and Hide() of View and Window. + /// For reference, a view is only shown if the view, its parents (up to the root view) and Window are also visible, + /// they are not transparent, and the view has a non-zero size. + /// So if its parent is not visible, the view is not shown. + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler AggregatedVisibilityChanged + { + add + { + if (aggregatedVisibilityChangedEventHandler == null) + { + aggregatedVisibilityChangedEventCallback = OnAggregatedVisibilityChanged; + Interop.ActorSignal.AggregatedVisibilityChangedConnect(SwigCPtr, aggregatedVisibilityChangedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + aggregatedVisibilityChangedEventHandler += value; + } + + remove + { + aggregatedVisibilityChangedEventHandler -= value; + if (aggregatedVisibilityChangedEventHandler == null && aggregatedVisibilityChangedEventCallback != null) + { + Interop.ActorSignal.AggregatedVisibilityChangedDisconnect(SwigCPtr, aggregatedVisibilityChangedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + aggregatedVisibilityChangedEventCallback = null; + } + } + } /// /// Event for layout direction change which can be used to subscribe/unsubscribe the event handler.
@@ -699,6 +751,12 @@ private void OnBackgroundImageBorderChanged(int left, int right, int bottom, int private void OnKeyInputFocusGained(IntPtr view) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (IsNativeHandleInvalid()) { if (this.Disposed) @@ -737,6 +795,12 @@ private void OnKeyInputFocusGained(IntPtr view) private void OnKeyInputFocusLost(IntPtr view) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (IsNativeHandleInvalid()) { if (this.Disposed) @@ -775,6 +839,12 @@ private void OnKeyInputFocusLost(IntPtr view) private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return false; + } + if (keyEvent == global::System.IntPtr.Zero) { NUILog.Error("keyEvent should not be null!"); @@ -804,6 +874,12 @@ private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) // Callback for View OnRelayout signal private void OnRelayout(IntPtr data) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (onRelayoutEventHandler != null) { onRelayoutEventHandler(this, null); @@ -813,6 +889,12 @@ private void OnRelayout(IntPtr data) // Callback for View HitTestResultSignal private bool OnHitTestResult(IntPtr view, IntPtr touchData) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return false; + } + if (touchData == global::System.IntPtr.Zero) { NUILog.Error("touchData should not be null!"); @@ -827,6 +909,12 @@ private bool OnHitTestResult(IntPtr view, IntPtr touchData) // Callback for View TouchSignal private bool OnInterceptTouch(IntPtr view, IntPtr touchData) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return false; + } + if (touchData == global::System.IntPtr.Zero) { NUILog.Error("touchData should not be null!"); @@ -846,7 +934,19 @@ private bool OnInterceptTouch(IntPtr view, IntPtr touchData) if (interceptTouchDataEventHandler != null) { - consumed = interceptTouchDataEventHandler(this, e); + if(NUIApplication.IsGeometryHittestEnabled()) + { + Delegate[] delegateList = interceptTouchDataEventHandler.GetInvocationList(); + // Oring the result of each callback. + foreach (EventHandlerWithReturnType del in delegateList) + { + consumed |= del(this, e); + } + } + else + { + consumed = interceptTouchDataEventHandler(this, e); + } } return consumed; @@ -855,6 +955,12 @@ private bool OnInterceptTouch(IntPtr view, IntPtr touchData) // Callback for View TouchSignal private bool OnTouch(IntPtr view, IntPtr touchData) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return false; + } + if (touchData == global::System.IntPtr.Zero) { NUILog.Error("touchData should not be null!"); @@ -874,7 +980,19 @@ private bool OnTouch(IntPtr view, IntPtr touchData) if (touchDataEventHandler != null) { - consumed = touchDataEventHandler(this, e); + if(NUIApplication.IsGeometryHittestEnabled()) + { + Delegate[] delegateList = touchDataEventHandler.GetInvocationList(); + // Oring the result of each callback. + foreach (EventHandlerWithReturnType del in delegateList) + { + consumed |= del(this, e); + } + } + else + { + consumed = touchDataEventHandler(this, e); + } } if (enableControlState && !consumed) @@ -894,6 +1012,12 @@ private bool OnTouch(IntPtr view, IntPtr touchData) // Callback for View Hover signal private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return false; + } + if (hoverEvent == global::System.IntPtr.Zero) { NUILog.Error("hoverEvent should not be null!"); @@ -928,6 +1052,12 @@ private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent) // Callback for View InterceptWheel signal private bool OnInterceptWheel(IntPtr view, IntPtr wheelEvent) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return false; + } + if (wheelEvent == global::System.IntPtr.Zero) { NUILog.Error("wheelEvent should not be null!"); @@ -957,6 +1087,12 @@ private bool OnInterceptWheel(IntPtr view, IntPtr wheelEvent) // Callback for View Wheel signal private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return false; + } + if (wheelEvent == global::System.IntPtr.Zero) { NUILog.Error("wheelEvent should not be null!"); @@ -992,6 +1128,12 @@ private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) // Callback for View OnWindow signal private void OnWindow(IntPtr data) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (onWindowEventHandler != null) { onWindowEventHandler(this, null); @@ -1001,6 +1143,12 @@ private void OnWindow(IntPtr data) // Callback for View OffWindow signal private void OffWindow(IntPtr data) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (offWindowEventHandler != null) { offWindowEventHandler(this, null); @@ -1010,10 +1158,25 @@ private void OffWindow(IntPtr data) // Callback for View visibility change signal private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + VisibilityChangedEventArgs e = new VisibilityChangedEventArgs(); - if (data != IntPtr.Zero) + IntPtr changedViewCPtr = Interop.Actor.GetVisiblityChangedActor(); + if (changedViewCPtr != IntPtr.Zero) { - e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + e.View = Registry.GetManagedBaseHandleFromNativePtr(changedViewCPtr) as View; + if(e.View != null) + { + Interop.BaseHandle.DeleteBaseHandle(new global::System.Runtime.InteropServices.HandleRef(this, changedViewCPtr)); + } + else + { + e.View = new View(changedViewCPtr, true); + } } e.Visibility = visibility; e.Type = type; @@ -1024,9 +1187,33 @@ private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeT } } + // Callback for View aggregated visibility change signal + private void OnAggregatedVisibilityChanged(IntPtr data, bool visibility) + { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + + AggregatedVisibilityChangedEventArgs e = new AggregatedVisibilityChangedEventArgs(); + e.Visibility = visibility; + + if (aggregatedVisibilityChangedEventHandler != null) + { + aggregatedVisibilityChangedEventHandler(this, e); + } + } + // Callback for View layout direction change signal private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs(); if (data != IntPtr.Zero) { @@ -1042,6 +1229,12 @@ private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type) private void OnResourcesLoaded(IntPtr view) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + if (!CheckResourceReady()) { return; @@ -1055,6 +1248,12 @@ private void OnResourcesLoaded(IntPtr view) private void OnBackgroundResourceLoaded(IntPtr view) { + if (Disposed || IsDisposeQueued) + { + // Ignore native callback if the view is disposed or queued for disposal. + return; + } + BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs(); e.Status = (ResourceLoadingStatusType)Interop.View.GetVisualResourceStatus(this.SwigCPtr, Property.BACKGROUND); @@ -1201,7 +1400,7 @@ public class VisibilityChangedEventArgs : EventArgs private VisibilityChangeType _type; /// - /// The view, or child of view, whose visibility has changed. + /// The view, whose visibility has changed. /// /// 3 public View View diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs index 34e7735bf3a..95b0b85131a 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs @@ -496,7 +496,7 @@ internal void SetParentOrigin(Position origin) internal Position GetCurrentParentOrigin() { - if(internalCurrentParentOrigin == null) + if (internalCurrentParentOrigin == null) { internalCurrentParentOrigin = new Position(0, 0, 0); } @@ -520,7 +520,7 @@ internal void SetAnchorPoint(Position anchorPoint) internal Position GetCurrentAnchorPoint() { - if(internalCurrentAnchorPoint == null) + if (internalCurrentAnchorPoint == null) { internalCurrentAnchorPoint = new Position(0, 0, 0); } @@ -565,7 +565,7 @@ internal void SetSize(Vector3 size) internal Vector3 GetTargetSize() { - if(internalTargetSize == null) + if (internalTargetSize == null) { internalTargetSize = new Vector3(0, 0, 0); } @@ -582,7 +582,7 @@ internal Vector3 GetTargetSize() internal Size2D GetCurrentSize() { - if(internalCurrentSize == null) + if (internalCurrentSize == null) { internalCurrentSize = new Size2D(0, 0); } @@ -647,7 +647,7 @@ internal void TranslateBy(Vector3 distance) internal Position GetCurrentPosition() { - if(internalCurrentPosition == null) + if (internalCurrentPosition == null) { internalCurrentPosition = new Position(0, 0, 0); } @@ -663,7 +663,7 @@ internal Position GetCurrentPosition() internal Vector3 GetCurrentWorldPosition() { - if(internalCurrentWorldPosition == null) + if (internalCurrentWorldPosition == null) { internalCurrentWorldPosition = new Vector3(0, 0, 0); } @@ -680,7 +680,7 @@ internal Vector3 GetCurrentWorldPosition() internal Vector2 GetCurrentScreenPosition() { - if(internalCurrentScreenPosition == null) + if (internalCurrentScreenPosition == null) { internalCurrentScreenPosition = new Vector2(0, 0); } @@ -792,7 +792,7 @@ internal void SetScale(Vector3 scale) internal Vector3 GetCurrentScale() { - if(internalCurrentScale == null) + if (internalCurrentScale == null) { internalCurrentScale = new Vector3(0, 0, 0); } @@ -809,7 +809,7 @@ internal Vector3 GetCurrentScale() internal Vector3 GetCurrentWorldScale() { - if(internalCurrentWorldScale == null) + if (internalCurrentWorldScale == null) { internalCurrentWorldScale = new Vector3(0, 0, 0); } @@ -886,7 +886,7 @@ internal float GetCurrentOpacity() internal Vector4 GetCurrentColor() { - if(internalCurrentColor == null) + if (internalCurrentColor == null) { internalCurrentColor = new Vector4(0, 0, 0, 0); } @@ -910,7 +910,7 @@ internal ColorMode GetColorMode() internal Vector4 GetCurrentWorldColor() { - if(internalCurrentWorldColor == null) + if (internalCurrentWorldColor == null) { internalCurrentWorldColor = new Vector4(0, 0, 0, 0); } @@ -1002,12 +1002,12 @@ internal ResizePolicyType GetResizePolicy(DimensionType dimension) internal Vector3 GetSizeModeFactor() { - if (internalSizeModeFactor == null) - { - internalSizeModeFactor = new Vector3(OnSizeModeFactorChanged, 0, 0, 0); - } - Object.InternalRetrievingPropertyVector3(SwigCPtr, View.Property.SizeModeFactor, internalSizeModeFactor.SwigCPtr); - return internalSizeModeFactor; + if (internalSizeModeFactor == null) + { + internalSizeModeFactor = new Vector3(OnSizeModeFactorChanged, 0, 0, 0); + } + Object.InternalRetrievingPropertyVector3(SwigCPtr, View.Property.SizeModeFactor, internalSizeModeFactor.SwigCPtr); + return internalSizeModeFactor; } internal void SetMinimumSize(Vector2 size) @@ -1144,12 +1144,6 @@ internal IntPtr GetPtrfromView() internal void RemoveChild(View child) { - // If the view had focus, it clears focus. - if (child == FocusManager.Instance.GetCurrentFocusView()) - { - Tizen.Log.Debug("NUI", $"ClearFocus due to View id:({child.ID}) removed from scene\n"); - FocusManager.Instance.ClearFocus(); - } // Do actual child removal Interop.Actor.Remove(SwigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) @@ -1264,7 +1258,7 @@ internal virtual void UpdateBackgroundExtraData() backgroundExtraDataUpdatedFlag = BackgroundExtraDataUpdatedFlag.None; } - /// TODO open as a protected level + [EditorBrowsable(EditorBrowsableState.Never)] internal virtual void ApplyCornerRadius() { if (backgroundExtraData == null) return; @@ -1276,6 +1270,10 @@ internal virtual void ApplyCornerRadius() { Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius)); } + if (backgroundExtraData.CornerSquareness != null) + { + Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerSquareness, Vector4.getCPtr(backgroundExtraData.CornerSquareness)); + } Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy); } if (backgroundExtraDataUpdatedFlag.HasFlag(BackgroundExtraDataUpdatedFlag.ShadowCornerRadius)) @@ -1284,11 +1282,15 @@ internal virtual void ApplyCornerRadius() { Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius)); } + if (backgroundExtraData.CornerSquareness != null) + { + Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerSquareness, Vector4.getCPtr(backgroundExtraData.CornerSquareness)); + } Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy); } } - /// TODO open as a protected level + [EditorBrowsable(EditorBrowsableState.Never)] internal virtual void ApplyBorderline() { if (backgroundExtraData == null) return; @@ -1362,85 +1364,93 @@ protected override void Dispose(DisposeTypes type) //_mergedStyle = null; - internalMaximumSize?.Dispose(); - internalMaximumSize = null; - internalMinimumSize?.Dispose(); - internalMinimumSize = null; - internalMargin?.Dispose(); - internalMargin = null; - internalPadding?.Dispose(); - internalPadding = null; - internalSizeModeFactor?.Dispose(); - internalSizeModeFactor = null; - internalCellIndex?.Dispose(); - internalCellIndex = null; - internalBackgroundColor?.Dispose(); - internalBackgroundColor = null; - internalColor?.Dispose(); - internalColor = null; - internalPivotPoint?.Dispose(); - internalPivotPoint = null; - internalPosition?.Dispose(); - internalPosition = null; - internalPosition2D?.Dispose(); - internalPosition2D = null; - internalScale?.Dispose(); - internalScale = null; - internalSize?.Dispose(); - internalSize = null; - internalSize2D?.Dispose(); - internalSize2D = null; - - panGestureDetector?.Dispose(); - panGestureDetector = null; - longGestureDetector?.Dispose(); - longGestureDetector = null; - pinchGestureDetector?.Dispose(); - pinchGestureDetector = null; - tapGestureDetector?.Dispose(); - tapGestureDetector = null; - rotationGestureDetector?.Dispose(); - rotationGestureDetector = null; - - internalCurrentParentOrigin?.Dispose(); - internalCurrentParentOrigin = null; - internalCurrentAnchorPoint?.Dispose(); - internalCurrentAnchorPoint = null; - internalTargetSize?.Dispose(); - internalTargetSize = null; - internalCurrentSize?.Dispose(); - internalCurrentSize = null; - internalCurrentPosition?.Dispose(); - internalCurrentPosition = null; - internalCurrentWorldPosition?.Dispose(); - internalCurrentWorldPosition = null; - internalCurrentScale?.Dispose(); - internalCurrentScale = null; - internalCurrentWorldScale?.Dispose(); - internalCurrentWorldScale = null; - internalCurrentColor?.Dispose(); - internalCurrentColor = null; - internalCurrentWorldColor?.Dispose(); - internalCurrentWorldColor = null; - internalSizeModeFactor?.Dispose(); - internalSizeModeFactor = null; - internalCurrentScreenPosition?.Dispose(); - internalCurrentScreenPosition = null; - - if (visualContainers != null) - { - foreach (var visualContainer in visualContainers) - { - visualContainer?.Dispose(); - } - visualContainers = null; - } - if (type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. //You should release all of your own disposable objects here. + internalMaximumSize?.Dispose(); + internalMaximumSize = null; + internalMinimumSize?.Dispose(); + internalMinimumSize = null; + internalMargin?.Dispose(); + internalMargin = null; + internalPadding?.Dispose(); + internalPadding = null; + internalSizeModeFactor?.Dispose(); + internalSizeModeFactor = null; + internalCellIndex?.Dispose(); + internalCellIndex = null; + internalBackgroundColor?.Dispose(); + internalBackgroundColor = null; + internalColor?.Dispose(); + internalColor = null; + internalPivotPoint?.Dispose(); + internalPivotPoint = null; + internalPosition?.Dispose(); + internalPosition = null; + internalPosition2D?.Dispose(); + internalPosition2D = null; + internalScale?.Dispose(); + internalScale = null; + internalSize?.Dispose(); + internalSize = null; + internalSize2D?.Dispose(); + internalSize2D = null; + + panGestureDetector?.Dispose(); + panGestureDetector = null; + longGestureDetector?.Dispose(); + longGestureDetector = null; + pinchGestureDetector?.Dispose(); + pinchGestureDetector = null; + tapGestureDetector?.Dispose(); + tapGestureDetector = null; + rotationGestureDetector?.Dispose(); + rotationGestureDetector = null; + + internalCurrentParentOrigin?.Dispose(); + internalCurrentParentOrigin = null; + internalCurrentAnchorPoint?.Dispose(); + internalCurrentAnchorPoint = null; + internalTargetSize?.Dispose(); + internalTargetSize = null; + internalCurrentSize?.Dispose(); + internalCurrentSize = null; + internalCurrentPosition?.Dispose(); + internalCurrentPosition = null; + internalCurrentWorldPosition?.Dispose(); + internalCurrentWorldPosition = null; + internalCurrentScale?.Dispose(); + internalCurrentScale = null; + internalCurrentWorldScale?.Dispose(); + internalCurrentWorldScale = null; + internalCurrentColor?.Dispose(); + internalCurrentColor = null; + internalCurrentWorldColor?.Dispose(); + internalCurrentWorldColor = null; + internalSizeModeFactor?.Dispose(); + internalSizeModeFactor = null; + internalCurrentScreenPosition?.Dispose(); + internalCurrentScreenPosition = null; + + if (visualContainers != null) + { + foreach (var visualContainer in visualContainers) + { + visualContainer?.Dispose(); + } + visualContainers = null; + } + + foreach (View view in Children) + { + if (view != null) + { + view.InternalParent = null; + } + } + if (themeData != null) { themeData.selectorData?.Reset(this); @@ -1467,11 +1477,6 @@ protected override void Dispose(DisposeTypes type) DisConnectFromSignals(); - foreach (View view in Children) - { - view.InternalParent = null; - } - backgroundExtraDataUpdatedFlag = BackgroundExtraDataUpdatedFlag.None; LayoutCount = 0; @@ -1625,6 +1630,14 @@ private void DisConnectFromSignals() hitTestResultDataCallback = null; } + if (visibilityChangedEventCallback != null) + { + NUILog.Debug($"[Dispose] visibilityChangedEventCallback"); + + Interop.ActorSignal.VisibilityChangedDisconnect(SwigCPtr, visibilityChangedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + visibilityChangedEventCallback = null; + } if (interceptTouchDataCallback != null) { @@ -1635,6 +1648,15 @@ private void DisConnectFromSignals() interceptTouchDataCallback = null; } + if (layoutDirectionChangedEventCallback != null) + { + NUILog.Debug($"[Dispose] layoutDirectionChangedEventCallback"); + + Interop.ActorSignal.LayoutDirectionChangedDisconnect(SwigCPtr, layoutDirectionChangedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + layoutDirectionChangedEventCallback = null; + } + if (touchDataCallback != null) { NUILog.Debug($"[Dispose] touchDataCallback"); @@ -1691,6 +1713,97 @@ private void DisConnectFromSignals() backgroundResourceLoadedCallback = null; } + // For ViewAccessibility + if (gestureInfoCallback != null) + { + NUILog.Debug($"[Dispose] gestureInfoCallback"); + + gestureInfoSignal?.Disconnect(gestureInfoCallback); + gestureInfoSignal?.Dispose(); + gestureInfoSignal = null; + gestureInfoCallback = null; + } + + if (getDescriptionCallback != null) + { + NUILog.Debug($"[Dispose] getDescriptionCallback"); + + getDescriptionSignal?.Disconnect(getDescriptionCallback); + getDescriptionSignal?.Dispose(); + getDescriptionSignal = null; + getDescriptionCallback = null; + } + + if (getNameCallback != null) + { + NUILog.Debug($"[Dispose] getNameCallback"); + + getNameSignal?.Disconnect(getNameCallback); + getNameSignal?.Dispose(); + getNameSignal = null; + getNameCallback = null; + } + + if (activateCallback != null) + { + NUILog.Debug($"[Dispose] activateCallback"); + + ActivateSignal?.Disconnect(activateCallback); + ActivateSignal?.Dispose(); + ActivateSignal = null; + activateCallback = null; + } + + if (readingSkippedCallback != null) + { + NUILog.Debug($"[Dispose] readingSkippedCallback"); + + ReadingSkippedSignal?.Disconnect(readingSkippedCallback); + ReadingSkippedSignal?.Dispose(); + ReadingSkippedSignal = null; + readingSkippedCallback = null; + } + + if (readingPausedCallback != null) + { + NUILog.Debug($"[Dispose] readingPausedCallback"); + + ReadingPausedSignal?.Disconnect(readingPausedCallback); + ReadingPausedSignal?.Dispose(); + ReadingPausedSignal = null; + readingPausedCallback = null; + } + + if (readingResumedCallback != null) + { + NUILog.Debug($"[Dispose] readingResumedCallback"); + + ReadingResumedSignal?.Disconnect(readingResumedCallback); + ReadingResumedSignal?.Dispose(); + ReadingResumedSignal = null; + readingResumedCallback = null; + } + + if (readingCancelledCallback != null) + { + NUILog.Debug($"[Dispose] readingCancelledCallback"); + + ReadingCancelledSignal?.Disconnect(readingCancelledCallback); + ReadingCancelledSignal?.Dispose(); + ReadingCancelledSignal = null; + readingCancelledCallback = null; + } + + if (readingStoppedCallback != null) + { + NUILog.Debug($"[Dispose] readingStoppedCallback"); + + ReadingStoppedSignal?.Disconnect(readingStoppedCallback); + ReadingStoppedSignal?.Dispose(); + ReadingStoppedSignal = null; + readingStoppedCallback = null; + } + NDalicPINVOKE.ThrowExceptionIfExists(); NUILog.Debug($"[Dispose] DisConnectFromSignals END"); } @@ -1699,7 +1812,7 @@ private void DisConnectFromSignals() /// Apply initial style to the view. ///
[EditorBrowsable(EditorBrowsableState.Never)] - protected virtual void InitializeStyle(ViewStyle style = null) + protected void InitializeStyle(ViewStyle style = null) { if (style == null && ThemeManager.InitialThemeDisabled) { diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs index 5da4b3bb996..aa9392309cd 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs @@ -303,6 +303,7 @@ public string GetStyleName() /// /// Clears the background. + /// This method removes any background properties set on the view, such as color or image. /// /// 3 public void ClearBackground() @@ -311,6 +312,28 @@ public void ClearBackground() if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Sets render effect to the view. The effect is applied to at most one view. + /// + /// A render effect to set. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetRenderEffect(RenderEffect effect) + { + Interop.View.SetRenderEffect(SwigCPtr, RenderEffect.getCPtr(effect)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Clears render effect. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void ClearRenderEffect() + { + Interop.View.ClearRenderEffect(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + /// /// Shows the view. /// @@ -415,6 +438,7 @@ public void LowerToBottom() ///
/// Most resources are only loaded when the control is placed on the stage. /// + /// True if all resources are ready, otherwise false. /// 3 public bool IsResourceReady() { @@ -601,6 +625,11 @@ public void GetPadding(PaddingType paddingOut) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Adds a renderer to the view. + /// + /// The renderer to add. + /// The index of the Renderer that was added to the view. /// 3 public uint AddRenderer(Renderer renderer) { @@ -610,6 +639,14 @@ public uint AddRenderer(Renderer renderer) return ret; } + /// + /// Retrieves the renderer at the specified index. + /// + /// The index of the renderer to retrieve. + /// A Renderer object at the specified index. + /// + /// The index must be between 0 and GetRendererCount()-1 + /// /// 3 public Renderer GetRendererAt(uint index) { @@ -627,6 +664,10 @@ public Renderer GetRendererAt(uint index) return ret; } + /// + /// Removes the specified renderer from the view. + /// + /// The renderer to remove. /// 3 public void RemoveRenderer(Renderer renderer) { @@ -635,6 +676,10 @@ public void RemoveRenderer(Renderer renderer) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Removes a renderer at the specified index from the view. + /// + /// The index of the renderer to remove. /// 3 public void RemoveRenderer(uint index) { @@ -643,7 +688,7 @@ public void RemoveRenderer(uint index) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void RotateBy(Degree angle, Vector3 axis) { @@ -652,7 +697,7 @@ public void RotateBy(Degree angle, Vector3 axis) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void RotateBy(Radian angle, Vector3 axis) { @@ -661,7 +706,7 @@ public void RotateBy(Radian angle, Vector3 axis) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void RotateBy(Rotation relativeRotation) { @@ -670,7 +715,7 @@ public void RotateBy(Rotation relativeRotation) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void ScaleBy(Vector3 relativeScale) { @@ -688,7 +733,7 @@ public void ScaleBy(Vector3 relativeScale) /// The up vector after target look at. If it is null, up vector become +Y axis /// The forward vector of view when it's orientation is not applied. If it is null, localForward vector become +Z axis /// The up vector of view when it's orientation is not applied. If it is null, localUp vector become +Y axis - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void LookAt(Vector3 target, Vector3 up = null, Vector3 localForward = null, Vector3 localUp = null) { @@ -697,7 +742,7 @@ public void LookAt(Vector3 target, Vector3 up = null, Vector3 localForward = nul throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void SetColorMode(ColorMode colorMode) { @@ -706,7 +751,7 @@ public void SetColorMode(ColorMode colorMode) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void ObjectDump() { diff --git a/src/Tizen.NUI/src/public/BaseComponents/VisibilityChangeType.cs b/src/Tizen.NUI/src/public/BaseComponents/VisibilityChangeType.cs index e700b444791..cba1079e63d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VisibilityChangeType.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VisibilityChangeType.cs @@ -34,5 +34,4 @@ public enum VisibilityChangeType /// 3 PARENT } - } diff --git a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs index 7657a9a0b52..41f6813a5f8 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs @@ -49,13 +49,14 @@ public class VisualView : CustomView /// /// Constructor. + /// This constructor initializes the VisualView with default behavior and support for touch events. /// /// 3 public VisualView() : this(CustomViewBehaviour.ViewBehaviourDefault | CustomViewBehaviour.RequiresTouchEventsSupport) { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public VisualView(ViewStyle viewStyle) : this(CustomViewBehaviour.ViewBehaviourDefault | CustomViewBehaviour.RequiresTouchEventsSupport, viewStyle) { @@ -99,6 +100,7 @@ public int NumberOfVisuals /// /// Overrides the parent method. + /// This method is called by the framework when the instance is created. /// /// 3 public override void OnInitialize() @@ -187,7 +189,7 @@ public void RemoveVisual(string visualName) } /// - /// Removes all visuals of the visual view. + /// This method removes all visuals associated with the VisualView instance. /// /// 3 public void RemoveAll() @@ -410,7 +412,7 @@ public Animation AnimateVisualAddFinish() } /// - /// temporary fix to pass TCT. + /// Applies an animation to the specified visual map properties. /// /// Thrown when visualMap is null. /// 3 diff --git a/src/Tizen.NUI/src/public/Clipboard/Clipboard.cs b/src/Tizen.NUI/src/public/Clipboard/Clipboard.cs index c0f84f8bed1..ddb1b7e38d0 100755 --- a/src/Tizen.NUI/src/public/Clipboard/Clipboard.cs +++ b/src/Tizen.NUI/src/public/Clipboard/Clipboard.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI { /// - /// Clipboard. + /// This class provides methods to interact with the system clipboard, allowing users to get and set clipboard content. /// [EditorBrowsable(EditorBrowsableState.Never)] public partial class Clipboard : BaseHandle @@ -195,7 +195,13 @@ private void OnClipboardDataReceived(object sender, ClipboardEventArgs e) /// /// Dispose. + /// Releases unmanaged and optionally managed resources. /// + /// + /// When overriding this method, you need to distinguish between explicit and implicit conditions. For explicit conditions, release both managed and unmanaged resources. For implicit conditions, only release unmanaged resources. + /// + /// Explicit to release both managed and unmanaged resources. Implicit to release only unmanaged resources. + [EditorBrowsable(EditorBrowsableState.Never)] protected override void Dispose(DisposeTypes type) { if (disposed) @@ -214,11 +220,13 @@ protected override void Dispose(DisposeTypes type) if (clipboardDataReceivedCallback != null) { this.ClipboardDataReceivedSignal().Disconnect(clipboardDataReceivedCallback); + clipboardDataReceivedCallback = null; } if (clipboardDataSelectedCallback != null) { this.ClipboardDataSelectedSignal().Disconnect(clipboardDataSelectedCallback); + clipboardDataSelectedCallback = null; } } diff --git a/src/Tizen.NUI/src/public/Clipboard/ClipboardEvent.cs b/src/Tizen.NUI/src/public/Clipboard/ClipboardEvent.cs index bbf0bb3d3cc..c8583347d27 100755 --- a/src/Tizen.NUI/src/public/Clipboard/ClipboardEvent.cs +++ b/src/Tizen.NUI/src/public/Clipboard/ClipboardEvent.cs @@ -121,9 +121,10 @@ public event EventHandler DataSelected remove { clipboardDataSelectedEventHandler -= value; - if (clipboardDataSelectedEventHandler == null && ClipboardDataSelectedSignal().Empty() == false) + if (clipboardDataSelectedEventHandler == null && clipboardDataSelectedCallback != null) { ClipboardDataSelectedSignal().Disconnect(clipboardDataSelectedCallback); + clipboardDataSelectedCallback = null; } } } @@ -142,9 +143,10 @@ private event EventHandler ClipboardDataReceived remove { clipboardDataReceivedEventHandler -= value; - if (clipboardDataReceivedEventHandler == null && ClipboardDataReceivedSignal().Empty() == false) + if (clipboardDataReceivedEventHandler == null && clipboardDataReceivedCallback != null) { ClipboardDataReceivedSignal().Disconnect(clipboardDataReceivedCallback); + clipboardDataReceivedCallback = null; } } } diff --git a/src/Tizen.AIAvatar/src/RestClient/RestClientFactory.cs b/src/Tizen.NUI/src/public/Common/AggregatedVisibilityChangedEventArgs.cs similarity index 58% rename from src/Tizen.AIAvatar/src/RestClient/RestClientFactory.cs rename to src/Tizen.NUI/src/public/Common/AggregatedVisibilityChangedEventArgs.cs index 07b7fa1f99c..3edad7d9000 100644 --- a/src/Tizen.AIAvatar/src/RestClient/RestClientFactory.cs +++ b/src/Tizen.NUI/src/public/Common/AggregatedVisibilityChangedEventArgs.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright(c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,16 +15,24 @@ * */ -using System.Net.Http; using System; +using System.ComponentModel; -namespace Tizen.AIAvatar +namespace Tizen.NUI { - internal class RestClientFactory + /// + /// Event arguments of aggregated visibility changed. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class AggregatedVisibilityChangedEventArgs : EventArgs { - internal IRestClient CreateClient(string baseUrl) + /// + /// Whether the view is now visible or not. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Visibility { - return new RestClient(new HttpClient { BaseAddress = new Uri(baseUrl) }); + get; set; } } } diff --git a/src/Tizen.NUI/src/public/Common/BaseHandle.cs b/src/Tizen.NUI/src/public/Common/BaseHandle.cs index 9ffb8568d16..b724019f8bc 100755 --- a/src/Tizen.NUI/src/public/Common/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/Common/BaseHandle.cs @@ -156,7 +156,8 @@ internal BaseHandle(global::System.IntPtr cPtr) } /// - /// Dispose. + /// Finalizes the instance of the BaseHandle class. + /// This method implements the finalization pattern for proper disposal of resources. /// /// 3 // following this guide: https://docs.microsoft.com/ko-kr/dotnet/fundamentals/code-analysis/quality-rules/ca1063?view=vs-2019 (CA1063) @@ -225,6 +226,9 @@ public static explicit operator bool(BaseHandle handle) /// /// Equality operator /// + /// The first BaseHandle instance to compare. + /// The second BaseHandle instance to compare. + /// true if both instances are equal; otherwise false. /// 3 public static bool operator ==(BaseHandle x, BaseHandle y) { @@ -254,8 +258,11 @@ public static explicit operator bool(BaseHandle handle) } /// - /// Inequality operator. Returns Null if either operand is Null + /// Inequality operator. Returns true if the operands are not equal, false otherwise. Returns true if either operand is null. /// + /// The first BaseHandle instance to compare. + /// The second BaseHandle instance to compare. + /// True if the operands are not equal, false otherwise. Returns true if either operand is null. /// 3 public static bool operator !=(BaseHandle x, BaseHandle y) { @@ -263,9 +270,12 @@ public static explicit operator bool(BaseHandle handle) } /// - /// Logical AND operator.
- /// It's possible when doing a operator this function (opBitwiseAnd) is never called due to short circuiting.
+ /// Logical AND operator. + /// It's possible when doing a logical AND operation, this function (opBitwiseAnd) might never be called due to short circuiting. ///
+ /// The first BaseHandle instance. + /// The second BaseHandle instance. + /// Returns the first BaseHandle instance if both instances are equal; otherwise, returns null. /// 3 public static BaseHandle operator &(BaseHandle x, BaseHandle y) { @@ -277,9 +287,12 @@ public static explicit operator bool(BaseHandle handle) } /// - /// Logical OR operator for ||.
- /// It's possible when doing a || this function (opBitwiseOr) is never called due to short circuiting.
+ /// Logical OR operator for ||. + /// It's possible when doing a || this function (opBitwiseOr) is never called due to short circuiting. ///
+ /// The first BaseHandle to be compared. + /// The second BaseHandle to be compared. + /// A BaseHandle that contains either of the non-null bodies of the two operands. /// 3 public static BaseHandle operator |(BaseHandle x, BaseHandle y) { @@ -299,8 +312,10 @@ public static explicit operator bool(BaseHandle handle) } /// - /// Logical ! operator + /// Logical ! operator for BaseHandle class. /// + /// The BaseHandle instance to check. + /// True if the handle is null or has no body; otherwise, false. /// 3 public static bool operator !(BaseHandle x) { @@ -317,10 +332,10 @@ public static explicit operator bool(BaseHandle handle) } /// - /// Equals + /// Compares the current instance with another object of the same type and returns true if they represent the same handle. /// - /// The object should be compared. - /// True if equal. + /// The object to compare with the current instance. + /// true if the specified object is equal to the current object; otherwise, false. /// 5 public override bool Equals(object o) { @@ -361,12 +376,13 @@ public void Dispose() /// /// Hidden API (Inhouse API). /// Dispose. + /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. /// /// /// Following the guide of https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose. /// This will replace "protected virtual void Dispose(DisposeTypes type)" which is exactly same in functionality. /// - /// true in order to free managed objects + /// If true, disposes any disposable objects. If false, does not dispose disposable objects. // Protected implementation of Dispose pattern. [EditorBrowsable(EditorBrowsableState.Never)] protected virtual void Dispose(bool disposing) @@ -570,7 +586,12 @@ internal void UnregisterFromRegistry() /// /// Dispose. + /// Releases unmanaged and optionally managed resources. /// + /// + /// When overriding this method, you need to distinguish between explicit and implicit conditions. For explicit conditions, release both managed and unmanaged resources. For implicit conditions, only release unmanaged resources. + /// + /// Explicit to release both managed and unmanaged resources. Implicit to release only unmanaged resources. /// 3 protected virtual void Dispose(DisposeTypes type) { diff --git a/src/Tizen.NUI/src/public/Common/Color.cs b/src/Tizen.NUI/src/public/Common/Color.cs index 8e09d8ca7c7..dc843bb7118 100755 --- a/src/Tizen.NUI/src/public/Common/Color.cs +++ b/src/Tizen.NUI/src/public/Common/Color.cs @@ -24,6 +24,8 @@ namespace Tizen.NUI { /// /// The Color class. + /// This class represents a color using red, green, blue, and alpha components. + /// It provides methods to create and manipulate colors. /// [Tizen.NUI.Binding.TypeConverter(typeof(ColorTypeConverter))] public class Color : Disposable, ICloneable diff --git a/src/Tizen.NUI/src/public/Common/Container.cs b/src/Tizen.NUI/src/public/Common/Container.cs index fa07385377d..1cd6b835206 100755 --- a/src/Tizen.NUI/src/public/Common/Container.cs +++ b/src/Tizen.NUI/src/public/Common/Container.cs @@ -142,7 +142,7 @@ internal MergedStyle MergedStyle } /// - /// List of children of Container. + /// Gets the list of children of Container. /// /// 4 public List Children diff --git a/src/Tizen.NUI/src/public/Common/Degree.cs b/src/Tizen.NUI/src/public/Common/Degree.cs index 85e1c37a408..b91d2558c17 100755 --- a/src/Tizen.NUI/src/public/Common/Degree.cs +++ b/src/Tizen.NUI/src/public/Common/Degree.cs @@ -28,7 +28,7 @@ public class Degree : Disposable { /// - /// The constructor. + /// Default constructor of Degree class. /// /// 3 public Degree() : this(Interop.Degree.NewDegree(), true) @@ -61,7 +61,8 @@ internal Degree(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemor } /// - /// The value of degree. + /// Gets or sets the value of the degree. + /// This property value is the angle in degrees. /// /// 3 public float Value diff --git a/src/Tizen.NUI/src/public/Common/Extents.cs b/src/Tizen.NUI/src/public/Common/Extents.cs index 1c1e9cea4cd..8515e04f6c0 100755 --- a/src/Tizen.NUI/src/public/Common/Extents.cs +++ b/src/Tizen.NUI/src/public/Common/Extents.cs @@ -31,7 +31,7 @@ public class Extents : Disposable, ICloneable /// - /// Constructor. + /// Default constructor of Extents class. /// /// 4 public Extents() : this(Interop.Extents.NewExtents(), true) @@ -62,10 +62,10 @@ public static implicit operator Extents(ushort value) /// /// Constructor. - /// Start extent. - /// End extent. - /// Top extent. - /// Bottom extent. + /// The start extent value horizontally. + /// The end extent value horizontally. + /// The top extent value vertically. + /// The bottom extent value vertically. /// /// 4 public Extents(ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.NewExtents(start, end, top, bottom), true) @@ -81,10 +81,10 @@ internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemo /// Constructor ///
/// - /// - /// - /// - /// + /// The start extent value horizontally. + /// The end extent value horizontally. + /// The top extent value vertically. + /// The bottom extent value vertically. /// Only used by Tizen.NUI.Components, will not be opened [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.NewExtents(start, end, top, bottom), true) @@ -115,10 +115,10 @@ public void CopyFrom(Extents that) /// /// Constructor /// - /// - /// - /// - /// + /// The start extent value horizontally. + /// The end extent value horizontally. + /// The top extent value vertically. + /// The bottom extent value vertically. /// Only used by Tizen.NUI.Components, will not be opened [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom); diff --git a/src/Tizen.NUI/src/public/Common/FrameUpdateCallbackInterface.cs b/src/Tizen.NUI/src/public/Common/FrameUpdateCallbackInterface.cs index a066a823cbd..6f8de7ff9e7 100755 --- a/src/Tizen.NUI/src/public/Common/FrameUpdateCallbackInterface.cs +++ b/src/Tizen.NUI/src/public/Common/FrameUpdateCallbackInterface.cs @@ -21,26 +21,26 @@ namespace Tizen.NUI { - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class FrameUpdateCallbackInterface : Disposable { private uint onUpdateCallbackVersion = 0u; - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] internal FrameUpdateCallbackInterface(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public FrameUpdateCallbackInterface() : this(0u) { } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public FrameUpdateCallbackInterface(uint updateCallbackVersion) : this(Interop.FrameUpdateCallbackInterface.newFrameUpdateCallbackInterface(), true) { @@ -49,7 +49,15 @@ public FrameUpdateCallbackInterface(uint updateCallbackVersion) : this(Interop.F if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.FrameUpdateCallbackInterface.DeleteFrameUpdateCallbackInterface(swigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public uint UpdateCallbackVersion => onUpdateCallbackVersion; @@ -82,13 +90,13 @@ private bool DirectorOnUpdate(global::System.IntPtr proxy, float elapsedSeconds) internal delegate bool DelegateFrameUpdateCallbackInterfaceV1(global::System.IntPtr proxy, float elapsedSeconds); private DelegateFrameUpdateCallbackInterfaceV1 Delegate1; - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public virtual void OnUpdate(float elapsedSeconds) { } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public virtual bool OnUpdate(FrameUpdateCallbackInterface obj, float elapsedSeconds) { @@ -97,7 +105,7 @@ public virtual bool OnUpdate(FrameUpdateCallbackInterface obj, float elapsedSeco return false; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool GetPosition(uint id, Vector3 position) { @@ -110,7 +118,7 @@ protected bool GetPosition(uint id, Vector3 position) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool SetPosition(uint id, Vector3 position) { @@ -123,7 +131,7 @@ protected bool SetPosition(uint id, Vector3 position) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool BakePosition(uint id, Vector3 position) { @@ -136,7 +144,46 @@ protected bool BakePosition(uint id, Vector3 position) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool GetOrientation(uint id, Rotation rotation) + { + if (proxyIntPtr == IntPtr.Zero) + { + return false; + } + bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceGetOrientation(proxyIntPtr, id, Rotation.getCPtr(rotation)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool SetOrientation(uint id, Rotation rotation) + { + if (proxyIntPtr == IntPtr.Zero) + { + return false; + } + bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceSetOrientation(proxyIntPtr, id, Rotation.getCPtr(rotation)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool BakeOrientation(uint id, Rotation rotation) + { + if (proxyIntPtr == IntPtr.Zero) + { + return false; + } + bool ret = Interop.FrameUpdateCallbackInterface.FrameCallbackInterfaceBakeOrientation(proxyIntPtr, id, Rotation.getCPtr(rotation)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool GetSize(uint id, Vector3 size) { @@ -149,7 +196,7 @@ protected bool GetSize(uint id, Vector3 size) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool SetSize(uint id, Vector3 size) { @@ -162,7 +209,7 @@ protected bool SetSize(uint id, Vector3 size) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool BakeSize(uint id, Vector3 size) { @@ -175,7 +222,7 @@ protected bool BakeSize(uint id, Vector3 size) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool GetScale(uint id, Vector3 scale) { @@ -188,7 +235,7 @@ protected bool GetScale(uint id, Vector3 scale) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool SetScale(uint id, Vector3 scale) { @@ -201,7 +248,7 @@ protected bool SetScale(uint id, Vector3 scale) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool BakeScale(uint id, Vector3 scale) { @@ -214,7 +261,7 @@ protected bool BakeScale(uint id, Vector3 scale) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool GetColor(uint id, Vector4 color) { @@ -227,7 +274,7 @@ protected bool GetColor(uint id, Vector4 color) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool SetColor(uint id, Vector4 color) { @@ -240,7 +287,7 @@ protected bool SetColor(uint id, Vector4 color) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool BakeColor(uint id, Vector4 color) { @@ -253,7 +300,7 @@ protected bool BakeColor(uint id, Vector4 color) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool GetPositionAndSize(uint id, Vector3 Position, Vector3 Size) { @@ -266,7 +313,7 @@ protected bool GetPositionAndSize(uint id, Vector3 Position, Vector3 Size) return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool GetWorldPositionScaleAndSize(uint id, Vector3 Position, Vector3 Scale, Vector3 Size) { @@ -279,7 +326,7 @@ protected bool GetWorldPositionScaleAndSize(uint id, Vector3 Position, Vector3 S return ret; } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected bool GetWorldTransformAndSize(uint id, Vector3 Position, Vector3 Scale, Rotation Orientation, Vector3 Size) { diff --git a/src/Tizen.NUI/src/public/Common/Layer.cs b/src/Tizen.NUI/src/public/Common/Layer.cs index 828ba478474..00771c934d0 100755 --- a/src/Tizen.NUI/src/public/Common/Layer.cs +++ b/src/Tizen.NUI/src/public/Common/Layer.cs @@ -29,13 +29,21 @@ public class Layer : Container { private Window window; private int layoutCount = 0; + private EventHandler visibilityChangedEventHandler; private VisibilityChangedEventCallbackType visibilityChangedEventCallback; + + private EventHandler aggregatedVisibilityChangedEventHandler; + private AggregatedVisibilityChangedEventCallbackType aggregatedVisibilityChangedEventCallback; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void VisibilityChangedEventCallbackType(IntPtr data, bool visibility, VisibilityChangeType type); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void AggregatedVisibilityChangedEventCallbackType(IntPtr data, bool visibility); + /// - /// Creates a Layer object. + /// Default constructor of Layer class to create a Layer object. /// /// 3 public Layer() : this(Interop.Layer.New(), true) @@ -50,8 +58,13 @@ internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemory } /// - /// Dispose Explicit or Implicit + /// Dispose. + /// Releases unmanaged and optionally managed resources. /// + /// + /// When overriding this method, you need to distinguish between explicit and implicit conditions. For explicit conditions, release both managed and unmanaged resources. For implicit conditions, only release unmanaged resources. + /// + /// Explicit to release both managed and unmanaged resources. Implicit to release only unmanaged resources. [EditorBrowsable(EditorBrowsableState.Never)] protected override void Dispose(DisposeTypes type) { @@ -69,6 +82,15 @@ protected override void Dispose(DisposeTypes type) visibilityChangedEventCallback = null; } + if (aggregatedVisibilityChangedEventCallback != null) + { + NUILog.Debug($"[Dispose] aggregatedVisibilityChangedEventCallback"); + + Interop.ActorSignal.AggregatedVisibilityChangedDisconnect(GetBaseHandleCPtrHandleRef, aggregatedVisibilityChangedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExistsDebug(); + aggregatedVisibilityChangedEventCallback = null; + } + LayoutCount = 0; base.Dispose(type); @@ -348,12 +370,6 @@ public override void Remove(View child) Tizen.Log.Error("NUI", "You have deleted a view that is not a child of this layer."); return; } - // If the view had focus, it clears focus. - if (child == FocusManager.Instance.GetCurrentFocusView()) - { - FocusManager.Instance.ClearFocus(); - } - Interop.Actor.Remove(SwigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -561,7 +577,7 @@ public void MoveBelow(Layer target) LowerBelow(target); } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void SetAnchorPoint(Vector3 anchorPoint) { @@ -570,7 +586,7 @@ public void SetAnchorPoint(Vector3 anchorPoint) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void SetSize(float width, float height) { @@ -579,7 +595,7 @@ public void SetSize(float width, float height) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void SetParentOrigin(Vector3 parentOrigin) { @@ -588,7 +604,7 @@ public void SetParentOrigin(Vector3 parentOrigin) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void SetResizePolicy(ResizePolicyType policy, DimensionType dimension) { @@ -652,6 +668,35 @@ public event EventHandler VisibilityChanged } } } + /// + /// An event for aggregated visibility change which can be used to subscribe or unsubscribe the event handler.
+ /// This event is sent when visible property of this or any of its parents (right up to the root) and Window changes.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler AggregatedVisibilityChanged + { + add + { + if (aggregatedVisibilityChangedEventHandler == null) + { + aggregatedVisibilityChangedEventCallback = OnAggregatedVisibilityChanged; + Interop.ActorSignal.AggregatedVisibilityChangedConnect(SwigCPtr, aggregatedVisibilityChangedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + aggregatedVisibilityChangedEventHandler += value; + } + + remove + { + aggregatedVisibilityChangedEventHandler -= value; + if (aggregatedVisibilityChangedEventHandler == null && aggregatedVisibilityChangedEventCallback != null) + { + Interop.ActorSignal.AggregatedVisibilityChangedDisconnect(SwigCPtr, aggregatedVisibilityChangedEventCallback.ToHandleRef(this)); + NDalicPINVOKE.ThrowExceptionIfExists(); + aggregatedVisibilityChangedEventCallback = null; + } + } + } ///
/// Event arguments of visibility changed. @@ -900,5 +945,17 @@ private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeT visibilityChangedEventHandler(this, e); } } + + // Callback for Layer aggregated visibility change signal + private void OnAggregatedVisibilityChanged(IntPtr data, bool visibility) + { + AggregatedVisibilityChangedEventArgs e = new AggregatedVisibilityChangedEventArgs(); + e.Visibility = visibility; + + if (aggregatedVisibilityChangedEventHandler != null) + { + aggregatedVisibilityChangedEventHandler(this, e); + } + } } } diff --git a/src/Tizen.NUI/src/public/Common/Matrix.cs b/src/Tizen.NUI/src/public/Common/Matrix.cs index 55e67607fd4..6b28fe08bf4 100755 --- a/src/Tizen.NUI/src/public/Common/Matrix.cs +++ b/src/Tizen.NUI/src/public/Common/Matrix.cs @@ -128,6 +128,7 @@ internal Matrix Assign(Matrix rhs) /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1065: Do not raise exceptions in unexpected locations")] public static Matrix Identity { get diff --git a/src/Tizen.NUI/src/public/Common/Matrix3.cs b/src/Tizen.NUI/src/public/Common/Matrix3.cs index ffba8b569e7..2adeeb2e079 100755 --- a/src/Tizen.NUI/src/public/Common/Matrix3.cs +++ b/src/Tizen.NUI/src/public/Common/Matrix3.cs @@ -135,6 +135,7 @@ internal Matrix3 Assign(Matrix rhs) /// /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1065: Do not raise exceptions in unexpected locations")] public static Matrix3 Identity { get diff --git a/src/Tizen.NUI/src/public/Common/NUIConstants.cs b/src/Tizen.NUI/src/public/Common/NUIConstants.cs index 0ece9f70b8f..c32a9c5dbeb 100755 --- a/src/Tizen.NUI/src/public/Common/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/Common/NUIConstants.cs @@ -783,7 +783,7 @@ public enum WindowType /// This is a desktop type. No other windows can be placed below this type of window. /// [EditorBrowsable(EditorBrowsableState.Never)] - Desktop + Desktop } /// @@ -2207,6 +2207,28 @@ public enum FontSizeType PixelSize } + /// + /// Enumeration for the render mode of text. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum TextRenderMode + { + /// + /// default, synchronous text loading. + /// + Sync, + + /// + /// automatically requests an asynchronous text load in OnRelayout. + /// + AsyncAuto, + + /// + /// users should manually request rendering using the async text method. + /// + AsyncManual + } + /// /// Pre-defined SlideTransition Direction /// @@ -2272,4 +2294,29 @@ public static Vector2 Left } } } + + /// + /// Enumeration of window blur type. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum WindowBlurType + { + /// + /// None type. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + None = 0, + /// + /// background blur for the window. + /// It has a blur effect ot th background area of the window, making it appear blurred. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Background = 1, + /// + /// behind blur for the window. + /// It has a blur effect ot th beind area of except the window background. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Behind = 2, + } } diff --git a/src/Tizen.NUI/src/public/Common/Property.cs b/src/Tizen.NUI/src/public/Common/Property.cs index 50a210a0b71..437f06313ea 100755 --- a/src/Tizen.NUI/src/public/Common/Property.cs +++ b/src/Tizen.NUI/src/public/Common/Property.cs @@ -29,17 +29,6 @@ public Property(Animatable animatable, int propertyIndex) : this(Interop.Propert if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// This constructor creates a property instance. - /// - /// A valid handle to the target object. - /// The index of a property. - /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for the main property (default is -1). - public Property(Animatable animatable, int propertyIndex, int componentIndex) : this(Interop.Property.NewProperty(Animatable.getCPtr(animatable), propertyIndex, componentIndex), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// This constructor creates a property instance.
/// This performs a property index query and is therefore slower than constructing a property directly with the index.
@@ -51,18 +40,6 @@ public Property(Animatable animatable, string propertyName) : this(Interop.Prope if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// This constructor creates a property instance.
- /// This performs a property index query and is therefore slower than constructing a property directly with the index.
- ///
- /// A valid handle to the target object. - /// The property name. - /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1). - public Property(Animatable animatable, string propertyName, int componentIndex) : this(Interop.Property.NewProperty(Animatable.getCPtr(animatable), propertyName, componentIndex), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { } @@ -85,24 +62,6 @@ public int PropertyIndex } } - /// - /// Gets or sets the component index of the property. - /// - public int ComponentIndex - { - set - { - Interop.Property.ComponentIndexSet(SwigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = Interop.Property.ComponentIndexGet(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - internal static int InvalidIndex { get diff --git a/src/Tizen.NUI/src/public/Common/PropertyArray.cs b/src/Tizen.NUI/src/public/Common/PropertyArray.cs index f4d5f35e27b..b499d38e97b 100755 --- a/src/Tizen.NUI/src/public/Common/PropertyArray.cs +++ b/src/Tizen.NUI/src/public/Common/PropertyArray.cs @@ -25,7 +25,7 @@ namespace Tizen.NUI public class PropertyArray : Disposable { /// - /// The constructor. + /// Default constructor of PropertyArray class. /// /// 3 public PropertyArray() : this(Interop.Property.NewPropertyArray(), true) @@ -94,6 +94,7 @@ public bool Empty() /// /// Clears the array. + /// This method removes all elements from the PropertyArray, resulting in an empty array. /// /// 3 public void Clear() diff --git a/src/Tizen.NUI/src/public/Common/PropertyKey.cs b/src/Tizen.NUI/src/public/Common/PropertyKey.cs index 0779b75235e..5e5277cdd5b 100755 --- a/src/Tizen.NUI/src/public/Common/PropertyKey.cs +++ b/src/Tizen.NUI/src/public/Common/PropertyKey.cs @@ -51,7 +51,7 @@ internal PropertyKey(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, c } /// - /// The type of key. + /// Represents the type of key used in property-related operations. /// /// 3 /// Can't fix because it's already used by other GBM. @@ -72,6 +72,7 @@ public enum KeyType /// /// The type of the key. + /// This property returns the type of the key, which can be PropertyMap, PropertyArray, or PropertyValue. /// /// 3 public PropertyKey.KeyType Type @@ -90,7 +91,8 @@ public PropertyKey.KeyType Type } /// - /// The index key. + /// Gets the index key. + /// The integer value representing the index key. /// /// 3 public int IndexKey @@ -109,7 +111,7 @@ public int IndexKey } /// - /// The string key. + /// Returns the string key. /// /// 3 public string StringKey diff --git a/src/Tizen.NUI/src/public/Common/PropertyMap.cs b/src/Tizen.NUI/src/public/Common/PropertyMap.cs index b37e30b483d..bd96e0ddd7f 100755 --- a/src/Tizen.NUI/src/public/Common/PropertyMap.cs +++ b/src/Tizen.NUI/src/public/Common/PropertyMap.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI public class PropertyMap : Disposable { /// - /// The constructor. + /// Default constructor of PropertyMap class. /// /// 3 public PropertyMap() : this(Interop.PropertyMap.NewPropertyMap(), true) @@ -363,6 +363,7 @@ public PropertyValue Find(int indexKey, string stringKey) /// /// Clears the map. + /// This method removes all key-value pairs from the PropertyMap. /// /// 3 public void Clear() diff --git a/src/Tizen.NUI/src/public/Common/PropertyValue.cs b/src/Tizen.NUI/src/public/Common/PropertyValue.cs index 267f86172dc..6f1199322ad 100755 --- a/src/Tizen.NUI/src/public/Common/PropertyValue.cs +++ b/src/Tizen.NUI/src/public/Common/PropertyValue.cs @@ -68,7 +68,7 @@ public PropertyValue(Color vectorValue) : this(Interop.PropertyValue.NewProperty } /// - /// The default constructor. + /// The default constructor of PropertyValue class. /// /// 3 public PropertyValue() : this(Interop.PropertyValue.NewPropertyValue(), true) diff --git a/src/Tizen.NUI/src/public/Common/Radian.cs b/src/Tizen.NUI/src/public/Common/Radian.cs index a4a14b39796..e4e38ca6c4c 100755 --- a/src/Tizen.NUI/src/public/Common/Radian.cs +++ b/src/Tizen.NUI/src/public/Common/Radian.cs @@ -20,7 +20,7 @@ namespace Tizen.NUI { /// - /// An angle in radians. + /// This class represents an angle in radians. /// /// 3 public class Radian : Disposable @@ -61,6 +61,7 @@ internal Radian(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemor /// /// The value in radians. + /// The float value representing the angle in radians. /// /// 3 public float Value diff --git a/src/Tizen.NUI/src/public/Common/Rectangle.cs b/src/Tizen.NUI/src/public/Common/Rectangle.cs index 77caf5a2bd4..ef7ef81b621 100755 --- a/src/Tizen.NUI/src/public/Common/Rectangle.cs +++ b/src/Tizen.NUI/src/public/Common/Rectangle.cs @@ -22,13 +22,15 @@ namespace Tizen.NUI { /// /// The Rectangle class. + /// This class is used to define and manipulate rectangular areas in graphics or UI components. + /// It manages the position (x, y coordinates) and size (width, height) of the rectangle, and provides various methods to set or inspect the properties of the rectangle. /// /// 3 [Binding.TypeConverter(typeof(RectangleTypeConverter))] public class Rectangle : Disposable, ICloneable { /// - /// The constructor. + /// The default constructor of Rectangle class. /// /// 3 public Rectangle() : this(Interop.Rectangle.NewRectangle(), true) diff --git a/src/Tizen.NUI/src/public/Common/RelativeVector2.cs b/src/Tizen.NUI/src/public/Common/RelativeVector2.cs index 84885959c42..f927c550db0 100755 --- a/src/Tizen.NUI/src/public/Common/RelativeVector2.cs +++ b/src/Tizen.NUI/src/public/Common/RelativeVector2.cs @@ -29,7 +29,7 @@ namespace Tizen.NUI public class RelativeVector2 : Disposable { /// - /// The constructor. + /// The Default constructor of RelativeVector2 class. /// /// 3 public RelativeVector2() : this(Interop.Vector2.NewVector2(), true) @@ -213,6 +213,7 @@ public float Y } /// + /// Implicitly converts a RelativeVector2 instance to a Vector2 instance. /// /// 3 public static implicit operator Vector2(RelativeVector2 relativeVector2) @@ -225,6 +226,7 @@ public static implicit operator Vector2(RelativeVector2 relativeVector2) } /// + /// Implicitly converts a Vector2 object to a RelativeVector2 object. /// /// 3 public static implicit operator RelativeVector2(Vector2 vec) @@ -303,6 +305,8 @@ public bool NotEqualTo(RelativeVector2 rhs) } /// + /// Retrieves a RelativeVector2 object from a given pointer. + /// This method creates a new RelativeVector2 instance using the provided pointer. /// internal static RelativeVector2 GetRelativeVector2FromPtr(global::System.IntPtr cPtr) { diff --git a/src/Tizen.NUI/src/public/Common/RelativeVector3.cs b/src/Tizen.NUI/src/public/Common/RelativeVector3.cs index 744632f3bc6..d2e5e97a5a9 100755 --- a/src/Tizen.NUI/src/public/Common/RelativeVector3.cs +++ b/src/Tizen.NUI/src/public/Common/RelativeVector3.cs @@ -30,7 +30,7 @@ public class RelativeVector3 : Disposable { /// - /// The constructor. + /// The default constructor of RelativeVector3 class. /// /// 3 public RelativeVector3() : this(Interop.Vector3.NewVector3(), true) @@ -242,18 +242,22 @@ public float Z } /// + /// Implicitly converts a RelativeVector3 instance to a Vector3 instance. /// /// 3 public static implicit operator Vector3(RelativeVector3 relativeVector3) { + if (relativeVector3 == null) return null; return new Vector3(relativeVector3.X, relativeVector3.Y, relativeVector3.Z); } /// + /// Implicitly converts a Vector3 instance to a RelativeVector3 instance. /// /// 3 public static implicit operator RelativeVector3(Vector3 vec) { + if (vec == null) return null; return new RelativeVector3(vec.X, vec.Y, vec.Z); } @@ -323,8 +327,6 @@ public bool NotEqualTo(RelativeVector3 rhs) return ret; } - /// - /// internal static RelativeVector3 GetRelativeVector3FromPtr(global::System.IntPtr cPtr) { RelativeVector3 ret = new RelativeVector3(cPtr, false); diff --git a/src/Tizen.NUI/src/public/Common/RelativeVector4.cs b/src/Tizen.NUI/src/public/Common/RelativeVector4.cs index 6981ad0404b..ad2e2cb87d6 100755 --- a/src/Tizen.NUI/src/public/Common/RelativeVector4.cs +++ b/src/Tizen.NUI/src/public/Common/RelativeVector4.cs @@ -30,7 +30,7 @@ public class RelativeVector4 : Disposable { /// - /// The constructor. + /// The default constructor of RelativeVector4 class. /// /// 3 public RelativeVector4() : this(Interop.Vector4.NewVector4(), true) @@ -290,6 +290,7 @@ public float W } /// + /// Implicitly converts a RelativeVector4 instance to a Vector4 instance. /// /// 3 public static implicit operator Vector4(RelativeVector4 relativeVector4) @@ -302,6 +303,7 @@ public static implicit operator Vector4(RelativeVector4 relativeVector4) } /// + /// Implicitly converts a Vector4 instance to a RelativeVector4 instance. /// /// 3 public static implicit operator RelativeVector4(Vector4 vec) @@ -379,8 +381,6 @@ public bool NotEqualTo(RelativeVector4 rhs) return ret; } - /// - /// internal static RelativeVector4 GetRelativeVector4FromPtr(global::System.IntPtr cPtr) { RelativeVector4 ret = new RelativeVector4(cPtr, false); diff --git a/src/Tizen.NUI/src/public/Common/Rotation.cs b/src/Tizen.NUI/src/public/Common/Rotation.cs index 3eac9a41ed3..559d3b4fe8c 100755 --- a/src/Tizen.NUI/src/public/Common/Rotation.cs +++ b/src/Tizen.NUI/src/public/Common/Rotation.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI { /// - /// The Rotation class. + /// The Rotation class represents a rotation of a UI Component. /// /// 3 [Binding.TypeConverter(typeof(RotationTypeConverter))] @@ -29,7 +29,7 @@ public class Rotation : Disposable { /// - /// The default constructor. + /// The default constructor of Rotation class. /// /// 3 public Rotation() : this(Interop.Rotation.NewRotation(), true) @@ -85,7 +85,7 @@ public Rotation(Vector4 vector) : this(Interop.Rotation.NewRotation4(Vector4.get } /// - /// (0.0f,0.0f,0.0f,1.0f). + /// The identity rotation, which represents no rotation. Actual value is (0.0f,0.0f,0.0f,1.0f). /// /// 3 public static Rotation IDENTITY @@ -414,6 +414,7 @@ public Rotation Normalized() /// /// Conjugates this rotation. + /// This method computes the conjugate of the current rotation. /// /// 3 public void Conjugate() @@ -424,6 +425,7 @@ public void Conjugate() /// /// Inverts this rotation. + /// This method computes the invert of the current rotation. /// /// 3 public void Invert() diff --git a/src/Tizen.NUI/src/public/Common/TimePeriod.cs b/src/Tizen.NUI/src/public/Common/TimePeriod.cs index 028eb925fc7..0e1add1d044 100755 --- a/src/Tizen.NUI/src/public/Common/TimePeriod.cs +++ b/src/Tizen.NUI/src/public/Common/TimePeriod.cs @@ -55,6 +55,7 @@ public TimePeriod(int delayMilliSeconds, int durationMilliSeconds) : this(Intero /// A delay before the time period in milliseconds ///
/// 9 + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1065: Do not raise exceptions in unexpected locations")] public int DelayMilliseconds { set @@ -74,6 +75,7 @@ public int DelayMilliseconds /// The duration of the time period in milliseconds ///
/// 9 + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1065: Do not raise exceptions in unexpected locations")] public int DurationMilliseconds { set diff --git a/src/Tizen.NUI/src/public/Common/TypeInfo.cs b/src/Tizen.NUI/src/public/Common/TypeInfo.cs index 23f50200902..160a53bc553 100755 --- a/src/Tizen.NUI/src/public/Common/TypeInfo.cs +++ b/src/Tizen.NUI/src/public/Common/TypeInfo.cs @@ -27,7 +27,7 @@ public class TypeInfo : BaseHandle { /// - /// Creates TypeInfo object. + /// Default constructor which creates TypeInfo object. /// /// 3 public TypeInfo() : this(Interop.TypeInfo.NewTypeInfo(), true, false) diff --git a/src/Tizen.NUI/src/public/Common/Vector2.cs b/src/Tizen.NUI/src/public/Common/Vector2.cs index 68115d8762f..bb76d1ebd15 100755 --- a/src/Tizen.NUI/src/public/Common/Vector2.cs +++ b/src/Tizen.NUI/src/public/Common/Vector2.cs @@ -107,7 +107,8 @@ internal Vector2(Vector2ChangedCallback cb, Vector2 other) : this(cb, other.X, o private Vector2ChangedCallback callback = null; /// - /// (1.0f,1.0f). + /// Returns a Vector2 instance where both the x and y components are set to 1.0f. + /// Actual value is (1.0f,1.0f). /// /// 3 public static Vector2 One @@ -182,7 +183,8 @@ public static Vector2 NegativeYAxis } /// - /// (0.0f, 0.0f). + /// A Vector2 object representing the zero vector. + /// Actual value is (0.0f, 0.0f). /// /// 3 public static Vector2 Zero diff --git a/src/Tizen.NUI/src/public/Common/Vector3.cs b/src/Tizen.NUI/src/public/Common/Vector3.cs index 5271bf1ce0f..6cf28940be8 100755 --- a/src/Tizen.NUI/src/public/Common/Vector3.cs +++ b/src/Tizen.NUI/src/public/Common/Vector3.cs @@ -29,7 +29,7 @@ namespace Tizen.NUI public class Vector3 : Disposable, ICloneable { /// - /// The constructor. + /// The default constructor of Vector3 class. /// /// 3 public Vector3() : this(Interop.Vector3.NewVector3(), true) @@ -92,7 +92,8 @@ internal Vector3(Vector3ChangedCallback cb, float x, float y, float z) : this(In private Vector3ChangedCallback callback = null; /// - /// (1.0f,1.0f,1.0f). + /// Returns a Vector2 instance where both the x and y components are set to 1.0f. + /// Actual value is (1.0f,1.0f,1.0f). /// /// 3 public static Vector3 One @@ -197,7 +198,8 @@ public static Vector3 NegativeZAxis } /// - /// (0.0f, 0.0f, 0.0f). + /// A Vector2 object representing the zero vector. + /// Actual value is (0.0f, 0.0f, 0.0f). /// /// 3 public static Vector3 Zero diff --git a/src/Tizen.NUI/src/public/Common/Vector4.cs b/src/Tizen.NUI/src/public/Common/Vector4.cs index 7893562b6bc..325a46332e3 100755 --- a/src/Tizen.NUI/src/public/Common/Vector4.cs +++ b/src/Tizen.NUI/src/public/Common/Vector4.cs @@ -94,7 +94,8 @@ internal Vector4(Vector4ChangedCallback cb, float x, float y, float z, float w) private Vector4ChangedCallback callback = null; /// - /// (1.0f,1.0f,1.0f,1.0f). + /// Returns a Vector2 instance where both the x and y components are set to 1.0f. + /// Actual value is (1.0f,1.0f,1.0f,1.0f). /// /// 3 public static Vector4 One @@ -109,7 +110,8 @@ public static Vector4 One } /// - /// (1.0f,0.0f,0.0f,0.0f). + /// The vector representing the x-axis. + /// Actual value is (1.0f,0.0f,0.0f,0.0f). /// /// 3 public static Vector4 XAxis @@ -124,7 +126,8 @@ public static Vector4 XAxis } /// - /// (0.0f,1.0f,0.0f,0.0f). + /// The vector representing the y-axis. + /// Actual value is (0.0f,1.0f,0.0f,0.0f). /// /// 3 public static Vector4 YAxis @@ -139,7 +142,8 @@ public static Vector4 YAxis } /// - /// (0.0f,0.0f,1.0f,0.0f). + /// The vector representing the z-axis. + /// Actual value is (0.0f,0.0f,1.0f,0.0f). /// /// 3 public static Vector4 ZAxis @@ -154,7 +158,8 @@ public static Vector4 ZAxis } /// - /// (0.0f, 0.0f, 0.0f, 0.0f). + /// A Vector2 object representing the zero vector. + /// Actual value is (0.0f, 0.0f, 0.0f, 0.0f). /// /// 3 public static Vector4 Zero diff --git a/src/Tizen.NUI/src/public/Common/WeakEvent.cs b/src/Tizen.NUI/src/public/Common/WeakEvent.cs index 1a24c9c8cdf..2ae7ce92af7 100755 --- a/src/Tizen.NUI/src/public/Common/WeakEvent.cs +++ b/src/Tizen.NUI/src/public/Common/WeakEvent.cs @@ -40,11 +40,16 @@ public class WeakEvent where T : Delegate protected int Count => handlers.Count; /// - /// Add an event handler. + /// Adds an event handler to the list of weak references. /// /// 12 public virtual void Add(T handler) { + if (handler == null) + { + // Do nothing. + return; + } handlers.Add(new WeakHandler(handler)); OnCountIncreased(); @@ -54,9 +59,16 @@ public virtual void Add(T handler) /// /// Remove last stored event handler equal to . /// + /// The event handler to remove. /// 12 public virtual void Remove(T handler) { + if (handler == null) + { + // Do nothing. + return; + } + int lastIndex = handlers.FindLastIndex(item => item.Equals(handler)); if (lastIndex >= 0) @@ -69,6 +81,8 @@ public virtual void Remove(T handler) /// /// Invoke event handlers. /// + /// The source of the event. + /// An object that contains event data. /// 12 public void Invoke(object sender, object args) { diff --git a/src/Tizen.NUI/src/public/CustomView/CustomViewRegistry.cs b/src/Tizen.NUI/src/public/CustomView/CustomViewRegistry.cs index 506250057a5..02f51201c85 100755 --- a/src/Tizen.NUI/src/public/CustomView/CustomViewRegistry.cs +++ b/src/Tizen.NUI/src/public/CustomView/CustomViewRegistry.cs @@ -97,6 +97,11 @@ public class ScriptableProperty : System.Attribute [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "")] public readonly ScriptableType type; + + /// + /// Initializes a new instance of the class. + /// + /// The type of the scriptable property. /// 3 public ScriptableProperty(ScriptableType type = ScriptableType.Default) { @@ -114,7 +119,7 @@ public enum ScriptableType /// /// 3 Default, // Read Writable, non-animatable property, event thread only - // Animatable // Animatable property, Currently disabled, UK + // Animatable // Animatable property, Currently disabled, UK } /// @@ -165,22 +170,21 @@ public sealed class CustomViewRegistry /// /// Lookup table to match C# types to DALi types, used for the automatic property registration. /// - private static readonly Dictionary daliPropertyTypeLookup - = new Dictionary + private static readonly Dictionary daliPropertyTypeLookup = new Dictionary { - { "float", PropertyType.Float }, - { "int", PropertyType.Integer }, - { "Int32", PropertyType.Integer }, - { "Boolean", PropertyType.Boolean }, - { "string", PropertyType.String }, - { "Vector2", PropertyType.Vector2 }, - { "Vector3", PropertyType.Vector3 }, - { "Vector4", PropertyType.Vector4 }, - { "Size", PropertyType.Vector2 }, - { "Position",PropertyType.Vector3 }, - { "Color", PropertyType.Vector4 }, - { "PropertyArray", PropertyType.Array }, - { "PropertyMap", PropertyType.Map }, + { "float", PropertyType.Float }, + { "int", PropertyType.Integer }, + { "Int32", PropertyType.Integer }, + { "Boolean", PropertyType.Boolean }, + { "string", PropertyType.String }, + { "Vector2", PropertyType.Vector2 }, + { "Vector3", PropertyType.Vector3 }, + { "Vector4", PropertyType.Vector4 }, + { "Size", PropertyType.Vector2 }, + { "Position",PropertyType.Vector3 }, + { "Color", PropertyType.Vector4 }, + { "PropertyArray", PropertyType.Array }, + { "PropertyMap", PropertyType.Map }, // { "Matrix3", PropertyType.MATRIX3 }, commented out until we need to use Matrices from JSON // { "Matrix", PropertyType.MATRIX }, }; @@ -220,6 +224,9 @@ private CustomViewRegistry() [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void SetPropertyDelegate(IntPtr controlPtr, IntPtr propertyName, IntPtr propertyValue); + /// + /// Gets the singleton instance of the CustomViewRegistry. + /// /// 3 public static CustomViewRegistry Instance { @@ -399,7 +406,7 @@ private void SetPropertyValue(IntPtr refObjectPtr, string propertyName, IntPtr p View view = Registry.GetManagedBaseHandleFromRefObject(refObjectPtr) as View; if (view != null) { - System.Reflection.PropertyInfo propertyInfo = view.GetType().GetProperty(propertyName); + System.Reflection.PropertyInfo propertyInfo = view.GetType().GetProperty(propertyName) ?? throw new global::System.InvalidOperationException("propertyInfo is null! can not set any value!"); // We know the property name, we know it's type, we just need to convert from a DALi property value to native C# type System.Type type = propertyInfo?.PropertyType; bool ok = false; diff --git a/src/Tizen.NUI/src/public/CustomView/ViewWrapper.cs b/src/Tizen.NUI/src/public/CustomView/ViewWrapper.cs index 5192c670983..d5dc3992ee3 100755 --- a/src/Tizen.NUI/src/public/CustomView/ViewWrapper.cs +++ b/src/Tizen.NUI/src/public/CustomView/ViewWrapper.cs @@ -20,8 +20,9 @@ namespace Tizen.NUI { /// - /// ViewWrapper. - /// + /// ViewWrapper provides a way to wrap a custom view implementation within the Tizen NUI framework. + /// This class is intended for advanced users who need to extend the functionality of the View class by implementing their own rendering logic. + /// /// 3 public class ViewWrapper : View { @@ -82,9 +83,6 @@ protected override void Dispose(DisposeTypes type) viewWrapperImpl.OnLayoutNegotiated = null; viewWrapperImpl.OnStyleChange = null; viewWrapperImpl.OnAccessibilityActivated = null; - viewWrapperImpl.OnAccessibilityPan = null; - viewWrapperImpl.OnAccessibilityValueChange = null; - viewWrapperImpl.OnAccessibilityZoom = null; viewWrapperImpl.OnFocusGained = null; viewWrapperImpl.OnFocusLost = null; viewWrapperImpl.GetNextFocusableView = null; diff --git a/src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs b/src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs index c2ad8a358a5..64192d4fd55 100755 --- a/src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs +++ b/src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs @@ -18,6 +18,7 @@ using System.ComponentModel; using System.Runtime.InteropServices; using System.Collections.Generic; +using System.Linq; using System.Diagnostics.CodeAnalysis; using Tizen.NUI.BaseComponents; @@ -30,12 +31,23 @@ namespace Tizen.NUI [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000: Dispose objects before losing scope", Justification = "It does not have ownership.")] public class DragAndDrop : BaseHandle { + /// + /// A delegate representing the method that will handle the drag source event. + /// + /// The type of the drag source event. public delegate void SourceEventHandler(DragSourceEventType sourceEventType); + private delegate void InternalSourceEventHandler(int sourceEventType); - public delegate void DragAndDropEventHandler(View targetView, DragEvent dragEvent); + + /// + /// Delegate representing the method that will handle drag and drop events. + /// + /// The view where the drag event occurred. + /// The native drag event containing details about the drag operation. + public delegate void DragAndDropEventHandler(View targetView, DragEvent nativeDragEvent); [EditorBrowsable(EditorBrowsableState.Never)] - public delegate void DragAndDropWindowEventHandler(Window targetWindow, DragEvent dragEvent); - private delegate void InternalDragAndDropEventHandler(global::System.IntPtr dragEvent); + public delegate void DragAndDropWindowEventHandler(Window targetWindow, DragEvent nativeDragEvent); + private delegate void InternalDragAndDropEventHandler(global::System.IntPtr nativeDragEvent); private InternalSourceEventHandler sourceEventCb; private Dictionary targetEventDictionary = new Dictionary(); private Dictionary targetWindowEventDictionary = new Dictionary(); @@ -46,11 +58,107 @@ public class DragAndDrop : BaseHandle private int dragWindowOffsetX = 0; private int dragWindowOffsetY = 0; - private bool initDrag = false; - private const int MinDragWindowWidth = 100; private const int MinDragWindowHeight = 100; + private void ProcessDragEventTargetCallback(IntPtr nativeDragEvent, View targetView, DragAndDropEventHandler callback) + { + DragType type = (DragType)Interop.DragAndDrop.GetAction(nativeDragEvent); + DragEvent dragEvent = new DragEvent(); + global::System.IntPtr cPtr = Interop.DragAndDrop.GetPosition(nativeDragEvent); + dragEvent.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, true); + + IntPtr nativeMimeTypes; + int count; + Interop.DragAndDrop.GetMimeTypes(nativeDragEvent, out nativeMimeTypes, out count); + if (count > 0) + { + IntPtr [] nativeMimeTypesArrary = new IntPtr[count]; + Marshal.Copy(nativeMimeTypes, nativeMimeTypesArrary, 0, count); + + string [] managedMimeTypes = new string[count]; + + for (int iterator = 0; iterator < count; iterator++) + { + managedMimeTypes[iterator] = Marshal.PtrToStringAnsi(nativeMimeTypesArrary[iterator]); + } + + dragEvent.MimeType = managedMimeTypes[0]; + dragEvent.MimeTypes = managedMimeTypes; + } + + if (type == DragType.Enter) + { + dragEvent.DragType = type; + callback(targetView, dragEvent); + } + else if (type == DragType.Leave) + { + dragEvent.DragType = type; + callback(targetView, dragEvent); + } + else if (type == DragType.Move) + { + dragEvent.DragType = type; + callback(targetView, dragEvent); + } + else if (type == DragType.Drop) + { + dragEvent.DragType = type; + dragEvent.Data = Interop.DragAndDrop.GetData(nativeDragEvent); + callback(targetView, dragEvent); + } + } + + private void ProcessDragEventWindowCallback(IntPtr nativeDragEvent, Window targetWindow, DragAndDropWindowEventHandler callback) + { + DragType type = (DragType)Interop.DragAndDrop.GetAction(nativeDragEvent); + DragEvent dragEvent = new DragEvent(); + global::System.IntPtr cPtr = Interop.DragAndDrop.GetPosition(nativeDragEvent); + dragEvent.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + + IntPtr nativeMimeTypes; + int count; + Interop.DragAndDrop.GetMimeTypes(nativeDragEvent, out nativeMimeTypes, out count); + if (count > 0) + { + IntPtr [] nativeMimeTypesArrary = new IntPtr[count]; + Marshal.Copy(nativeMimeTypes, nativeMimeTypesArrary, 0, count); + + string [] managedMimeTypes = new string[count]; + + for (int iterator = 0; iterator < count; iterator++) + { + managedMimeTypes[iterator] = Marshal.PtrToStringAnsi(nativeMimeTypesArrary[iterator]); + } + + dragEvent.MimeType = managedMimeTypes[0]; + dragEvent.MimeTypes = managedMimeTypes; + } + + if (type == DragType.Enter) + { + dragEvent.DragType = type; + callback(targetWindow, dragEvent); + } + else if (type == DragType.Leave) + { + dragEvent.DragType = type; + callback(targetWindow, dragEvent); + } + else if (type == DragType.Move) + { + dragEvent.DragType = type; + callback(targetWindow, dragEvent); + } + else if (type == DragType.Drop) + { + dragEvent.DragType = type; + dragEvent.Data = Interop.DragAndDrop.GetData(nativeDragEvent); + callback(targetWindow, dragEvent); + } + } + private DragAndDrop() : this(Interop.DragAndDrop.New(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -92,14 +200,7 @@ private void ReleaseDragWindow() /// The source event callback /// 10 public void StartDragAndDrop(View sourceView, View shadowView, DragData dragData, SourceEventHandler callback) - { - if (initDrag) - { - Tizen.Log.Fatal("NUI", "Start Drag And Drop Initializing..."); - return; - } - initDrag = true; - + { if (Window.IsSupportedMultiWindow() == false) { throw new NotSupportedException("This device does not support surfaceless_context. So Window cannot be created."); @@ -155,7 +256,7 @@ public void StartDragAndDrop(View sourceView, View shadowView, DragData dragData { if ((DragSourceEventType)sourceEventType != DragSourceEventType.Start) { - Tizen.Log.Fatal("NUI", "DnD Source Event is Called"); + Tizen.Log.Fatal("NUI", "DnD Source Event is Called"); ReleaseDragWindow(); } @@ -165,15 +266,29 @@ public void StartDragAndDrop(View sourceView, View shadowView, DragData dragData //Show Drag Window before StartDragAndDrop mDragWindow.Show(); - if (!Interop.DragAndDrop.StartDragAndDrop(SwigCPtr, View.getCPtr(sourceView), Window.getCPtr(mDragWindow), dragData.MimeType, dragData.Data, + string [] mimeTypes; + string [] dataSet; + + if (string.IsNullOrEmpty(dragData.MimeType) && dragData.DataMap != null) + { + mimeTypes = dragData.DataMap.Keys.ToArray(); + dataSet = dragData.DataMap.Values.ToArray(); + } + else + { + mimeTypes = new string[1]; + mimeTypes[0] = dragData.MimeType; + + dataSet = new string[1]; + dataSet[0] = dragData.Data; + } + + if (!Interop.DragAndDrop.StartDragAndDrop(SwigCPtr, View.getCPtr(sourceView), Window.getCPtr(mDragWindow), mimeTypes, mimeTypes.Length, dataSet, dataSet.Length, new global::System.Runtime.InteropServices.HandleRef(this, Marshal.GetFunctionPointerForDelegate(sourceEventCb)))) { throw new InvalidOperationException("Fail to StartDragAndDrop"); } - - } - - initDrag = false; + } } /// @@ -184,42 +299,23 @@ public void StartDragAndDrop(View sourceView, View shadowView, DragData dragData /// 10 public void AddListener(View targetView, DragAndDropEventHandler callback) { - InternalDragAndDropEventHandler cb = (dragEvent) => - { - DragType type = (DragType)Interop.DragAndDrop.GetAction(dragEvent); - DragEvent ev = new DragEvent(); - global::System.IntPtr cPtr = Interop.DragAndDrop.GetPosition(dragEvent); - ev.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, true); + AddListener(targetView, "*/*", callback); + } - if (type == DragType.Enter) - { - ev.DragType = type; - ev.MimeType = Interop.DragAndDrop.GetMimeType(dragEvent); - callback(targetView, ev); - } - else if (type == DragType.Leave) - { - ev.DragType = type; - callback(targetView, ev); - } - else if (type == DragType.Move) - { - ev.DragType = type; - ev.MimeType = Interop.DragAndDrop.GetMimeType(dragEvent); - callback(targetView, ev); - } - else if (type == DragType.Drop) - { - ev.DragType = type; - ev.MimeType = Interop.DragAndDrop.GetMimeType(dragEvent); - ev.Data = Interop.DragAndDrop.GetData(dragEvent); - callback(targetView, ev); - } - }; + /// + /// Adds listener for drop targets + /// + /// The target view + /// The mime type for target view + /// The callback function to get drag event when the drag source enters, moves, leaves and drops on the drop target + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddListener(View targetView, string mimeType, DragAndDropEventHandler callback) + { + InternalDragAndDropEventHandler cb = (nativeDragEvent) => ProcessDragEventTargetCallback(nativeDragEvent, targetView, callback); targetEventDictionary.Add(targetView, cb); - if (!Interop.DragAndDrop.AddListener(SwigCPtr, View.getCPtr(targetView), + if (!Interop.DragAndDrop.AddListener(SwigCPtr, View.getCPtr(targetView), mimeType, new global::System.Runtime.InteropServices.HandleRef(this, Marshal.GetFunctionPointerForDelegate(cb)))) { throw new InvalidOperationException("Fail to AddListener for View"); @@ -230,9 +326,9 @@ public void AddListener(View targetView, DragAndDropEventHandler callback) /// Removes listener for drop targets /// /// The target view - /// The callback function to remove + /// The callback function to remove(Not used) /// 10 - public void RemoveListener(View targetView, DragAndDropEventHandler callback) + public void RemoveListener(View targetView, DragAndDropEventHandler _) { if (!targetEventDictionary.ContainsKey(targetView)) { @@ -256,40 +352,23 @@ public void RemoveListener(View targetView, DragAndDropEventHandler callback) [EditorBrowsable(EditorBrowsableState.Never)] public void AddListener(Window targetWindow, DragAndDropWindowEventHandler callback) { - InternalDragAndDropEventHandler cb = (dragEvent) => - { - DragType type = (DragType)Interop.DragAndDrop.GetAction(dragEvent); - DragEvent ev = new DragEvent(); - global::System.IntPtr cPtr = Interop.DragAndDrop.GetPosition(dragEvent); - ev.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + AddListener(targetWindow, "*/*", callback); + } - if (type == DragType.Enter) - { - ev.DragType = type; - callback(targetWindow, ev); - } - else if (type == DragType.Leave) - { - ev.DragType = type; - callback(targetWindow, ev); - } - else if (type == DragType.Move) - { - ev.DragType = type; - callback(targetWindow, ev); - } - else if (type == DragType.Drop) - { - ev.DragType = type; - ev.MimeType = Interop.DragAndDrop.GetMimeType(dragEvent); - ev.Data = Interop.DragAndDrop.GetData(dragEvent); - callback(targetWindow, ev); - } - }; + /// + /// Adds listener for drop targets + /// + /// The target Window + /// The mime type for target view + /// The callback function to get drag event when the drag source enters, moves, leaves and drops on the drop target + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddListener(Window targetWindow, string mimeType, DragAndDropWindowEventHandler callback) + { + InternalDragAndDropEventHandler cb = (nativeDragEvent) => ProcessDragEventWindowCallback(nativeDragEvent, targetWindow, callback); targetWindowEventDictionary.Add(targetWindow, cb); - if (!Interop.DragAndDrop.WindowAddListener(SwigCPtr, Window.getCPtr(targetWindow), + if (!Interop.DragAndDrop.WindowAddListener(SwigCPtr, Window.getCPtr(targetWindow), mimeType, new global::System.Runtime.InteropServices.HandleRef(this, Marshal.GetFunctionPointerForDelegate(cb)))) { throw new InvalidOperationException("Fail to AddListener for Window"); @@ -300,9 +379,9 @@ public void AddListener(Window targetWindow, DragAndDropWindowEventHandler callb /// Removes listener for drop targets /// /// The target window - /// The callback function to remove + /// The callback function to remove(Not used) [EditorBrowsable(EditorBrowsableState.Never)] - public void RemoveListener(Window targetWindow, DragAndDropWindowEventHandler callback) + public void RemoveListener(Window targetWindow, DragAndDropWindowEventHandler _) { if (!targetWindowEventDictionary.ContainsKey(targetWindow)) { diff --git a/src/Tizen.NUI/src/public/DragAndDrop/DragEvent.cs b/src/Tizen.NUI/src/public/DragAndDrop/DragEvent.cs index 6c705b90d3d..dd2f80cca2f 100755 --- a/src/Tizen.NUI/src/public/DragAndDrop/DragEvent.cs +++ b/src/Tizen.NUI/src/public/DragAndDrop/DragEvent.cs @@ -16,30 +16,31 @@ */ using System; using System.ComponentModel; +using System.Collections.Generic; using Tizen.NUI.Binding; namespace Tizen.NUI { /// - /// Drag source event type. + /// Enumeration for the drag source event types. /// /// 10 public enum DragSourceEventType { /// - /// Drag and drop is started. + /// Indicates that the drag and drop operation has started. /// Start, /// - /// Drag and drop is cancelled. + /// Indicates that the drag and drop operation has been cancelled. /// Cancel, /// - /// Drag and drop is accepted. + /// Indicates that the drag and drop operation has been accepted by the target. /// Accept, /// - /// Drag and drop is finished. + /// Indicates that the drag and drop operation has finished. /// Finish } @@ -60,10 +61,16 @@ public struct DragData /// The drag data to send /// public string Data { get; set; } + + /// + /// The mime types and drag data set + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Dictionary DataMap; } /// - /// Drag event type. + /// This enumeration defines the different types of drag events that can occur when a drag-and-drop operation is performed on a target view. /// /// 10 public enum DragType @@ -106,6 +113,13 @@ public struct DragEvent /// The mime type of drag object /// public string MimeType { get; set; } + + /// + /// The mime types of drag object + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public string [] MimeTypes { get; set; } + /// /// The drag data to receive /// diff --git a/src/Tizen.NUI/src/public/Events/Gesture.cs b/src/Tizen.NUI/src/public/Events/Gesture.cs index 7488c899206..0cdff93d8df 100755 --- a/src/Tizen.NUI/src/public/Events/Gesture.cs +++ b/src/Tizen.NUI/src/public/Events/Gesture.cs @@ -163,7 +163,7 @@ public enum SourceDataType } /// - /// The gesture type. + /// Gets the type of gesture. /// /// 3 public Gesture.GestureType Type @@ -175,7 +175,7 @@ public Gesture.GestureType Type } /// - /// The gesture state. + /// Gets the state of gesture. /// /// 3 public Gesture.StateType State @@ -187,7 +187,7 @@ public Gesture.StateType State } /// - /// The time the gesture took place. + /// Get the time when the gesture took place. /// /// 3 public uint Time diff --git a/src/Tizen.NUI/src/public/Events/GestureDetector.cs b/src/Tizen.NUI/src/public/Events/GestureDetector.cs index fa15c6fe0ca..d9cdbf8eaed 100755 --- a/src/Tizen.NUI/src/public/Events/GestureDetector.cs +++ b/src/Tizen.NUI/src/public/Events/GestureDetector.cs @@ -121,6 +121,32 @@ public View GetAttachedView(uint index) return ret; } + /// + /// Handles the event for a given view and touch input. + /// This method should only be called when SetGeometryHittestEnabled is set to true. + /// It processes the touch input and attempts to recognize gestures based on the provided view and touch data. + /// + /// The view associated with the gesture detector. + /// The touch input data to analyze for gestures. + /// True if the event was handled successfully, otherwise false. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool HandleEvent(View view, Touch touch) + { + bool ret = Interop.GestureDetector.HandleEvent(SwigCPtr, View.getCPtr(view), Touch.getCPtr(touch)); + NDalicPINVOKE.ThrowExceptionIfExists(); + return ret; + } + + /// + /// Cancels all other gesture detectors that are currently recognizing gestures by HandleEvent(View view, Touch touch) api + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void CancelAllOtherGestureDetectors() + { + Interop.GestureDetector.CancelAllOtherGestureDetectors(SwigCPtr); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + internal GestureDetector Assign(GestureDetector rhs) { GestureDetector ret = new GestureDetector(Interop.GestureDetector.Assign(SwigCPtr, GestureDetector.getCPtr(rhs)), false); diff --git a/src/Tizen.NUI/src/public/Events/Hover.cs b/src/Tizen.NUI/src/public/Events/Hover.cs index b202e84b9ca..cbbbff86d13 100755 --- a/src/Tizen.NUI/src/public/Events/Hover.cs +++ b/src/Tizen.NUI/src/public/Events/Hover.cs @@ -30,7 +30,7 @@ public class Hover : BaseHandle { /// - /// The default constructor. + /// The default constructor of Hover class. /// /// 3 public Hover() : this(Interop.Hover.New(0u), true) diff --git a/src/Tizen.NUI/src/public/Events/PanGesture.cs b/src/Tizen.NUI/src/public/Events/PanGesture.cs index 8587a69af1b..88c6875933f 100755 --- a/src/Tizen.NUI/src/public/Events/PanGesture.cs +++ b/src/Tizen.NUI/src/public/Events/PanGesture.cs @@ -32,7 +32,7 @@ public class PanGesture : Gesture { /// - /// The default constructor. + /// The default constructor of PanGesture class. /// /// 3 public PanGesture() : this(Interop.PanGestureDetector.PanGestureNew(0), true) diff --git a/src/Tizen.NUI/src/public/Events/TapGesture.cs b/src/Tizen.NUI/src/public/Events/TapGesture.cs index f9fe9818147..8818627ebde 100755 --- a/src/Tizen.NUI/src/public/Events/TapGesture.cs +++ b/src/Tizen.NUI/src/public/Events/TapGesture.cs @@ -28,7 +28,7 @@ public class TapGesture : Gesture { /// - /// Creates a TapGesture. + /// Default constructor to creates a TapGesture. /// /// 3 public TapGesture() : this(Interop.TapGesture.New(0), true) diff --git a/src/Tizen.NUI/src/public/Events/Touch.cs b/src/Tizen.NUI/src/public/Events/Touch.cs index 69168ff356d..535d7a06931 100755 --- a/src/Tizen.NUI/src/public/Events/Touch.cs +++ b/src/Tizen.NUI/src/public/Events/Touch.cs @@ -253,7 +253,7 @@ internal static Touch GetTouchFromPtr(global::System.IntPtr cPtr) return ret; } - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Degree GetAngle(uint point) { diff --git a/src/Tizen.NUI/src/public/Events/Wheel.cs b/src/Tizen.NUI/src/public/Events/Wheel.cs index ab2d3be73d4..a07b7b67220 100755 --- a/src/Tizen.NUI/src/public/Events/Wheel.cs +++ b/src/Tizen.NUI/src/public/Events/Wheel.cs @@ -30,7 +30,7 @@ public class Wheel : BaseHandle { /// - /// The default constructor. + /// The default constructor of Wheel class. /// /// 3 public Wheel() : this(Interop.Wheel.New(0, 0, 0u, Vector2.getCPtr(new Vector2(0.0f, 0.0f)), 0, 0u), true) diff --git a/src/Tizen.NUI/src/public/Images/ImageUrl.cs b/src/Tizen.NUI/src/public/Images/ImageUrl.cs index 120803c30c6..e68c713800b 100644 --- a/src/Tizen.NUI/src/public/Images/ImageUrl.cs +++ b/src/Tizen.NUI/src/public/Images/ImageUrl.cs @@ -66,6 +66,7 @@ protected override void ReleaseSwigCPtr(HandleRef swigCPtr) } [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1065: Do not raise exceptions in unexpected locations")] public override string ToString() { string ret = Interop.ImageUrl.GetUrl(SwigCPtr); diff --git a/src/Tizen.NUI/src/public/Images/NativeImageQueue.cs b/src/Tizen.NUI/src/public/Images/NativeImageQueue.cs index 2146259fc31..378cf154ed1 100644 --- a/src/Tizen.NUI/src/public/Images/NativeImageQueue.cs +++ b/src/Tizen.NUI/src/public/Images/NativeImageQueue.cs @@ -26,15 +26,18 @@ namespace Tizen.NUI /// /// /// - /// NativeImageQueue queue = new NativeImageQueue(width,height,ColorFormat.RGBA8888); + /// NativeImageQueue queue = new NativeImageQueue(width, height, ColorFormat.BGRA8888); /// if(queue.CanDequeueBuffer()) /// { - /// var buffer = queue.DequeueBuffer(ref bufferWidth,ref bufferHeight,ref bufferStride); + /// var buffer = queue.DequeueBuffer(ref bufferWidth, ref bufferHeight, ref bufferStride); /// /// /* Use buffer */ /// /// queue.EnqueueBuffer(buffer); /// } + /// + /// ImageUrl imageUrl = queue.GenerateUrl(); + /// ImageView view = new ImageView(imageUrl.ToString()); /// /// [EditorBrowsable(EditorBrowsableState.Never)] @@ -63,20 +66,17 @@ public enum ColorFormat /// /// 8 red bits, 8 green bits, 8 blue bits /// - [System.ObsoleteAttribute("This property is obsolete. It's behavior could be changed in a future version. Currently it is same as BGR888", false)] - RGB888 = 0, + RGB888 = 3, /// /// 8 red bits, 8 green bits, 8 blue bits, alpha 8 bits /// - [System.ObsoleteAttribute("This property is obsolete. It's behavior could be changed in a future version. Currently it is same as BGRA8888", false)] - RGBA8888 = 1, + RGBA8888 = 4, /// /// 8 red bits, 8 green bits, 8 blue bits, and 8 ignored bits /// - [System.ObsoleteAttribute("This property is obsolete. It's behavior could be changed in a future version. Currently it is same as BGRX8888", false)] - RGBX8888 = 2, + RGBX8888 = 5, } /// diff --git a/src/Tizen.NUI/src/public/Images/NativeImageSource.cs b/src/Tizen.NUI/src/public/Images/NativeImageSource.cs index ea4df308e41..54c40089c5d 100644 --- a/src/Tizen.NUI/src/public/Images/NativeImageSource.cs +++ b/src/Tizen.NUI/src/public/Images/NativeImageSource.cs @@ -21,6 +21,23 @@ namespace Tizen.NUI { using global::System; + /// + /// NativeImageSource is a class for displaying an native image resource. + /// + /// + /// + /// NativeImageSource surface = new NativeImageSource(width, height, ColorDepth.Default); + /// + /// var buffer = surface.AcquireBuffer(ref bufferWidth, ref bufferHeight, ref bufferStride); + /// + /// /* Use buffer */ + /// + /// surface.ReleaseBuffer(); + /// + /// ImageUrl imageUrl = surface.GenerateUrl(); + /// ImageView view = new ImageView(imageUrl.ToString()); + /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public class NativeImageSource : NativeImageInterface { diff --git a/src/Tizen.NUI/src/public/Images/PixelData.cs b/src/Tizen.NUI/src/public/Images/PixelData.cs index 9f915ad4b2a..fc824ab82e7 100755 --- a/src/Tizen.NUI/src/public/Images/PixelData.cs +++ b/src/Tizen.NUI/src/public/Images/PixelData.cs @@ -45,11 +45,12 @@ public class PixelData : BaseHandle /// Buffer width in pixels. /// Buffer height in pixels. /// The pixel format. - /// The function used to release the memory. + /// Not used parameter. /// 5 /// This will be deprecated after API level 9. ReleaseFunction is not useful in C#. [EditorBrowsable(EditorBrowsableState.Never)] - public PixelData(byte[] buffer, uint bufferSize, uint width, uint height, PixelFormat pixelFormat, PixelData.ReleaseFunction releaseFunction) : this(Interop.PixelData.New(buffer, bufferSize, width, height, (int)pixelFormat), true) + [Obsolete("Do not use this constructor. Use PixelData(byte[], uint, uint, uint, PixelFormat).")] + public PixelData(byte[] buffer, uint bufferSize, uint width, uint height, PixelFormat pixelFormat, PixelData.ReleaseFunction _) : this(Interop.PixelData.New(buffer, bufferSize, width, height, (int)pixelFormat), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/Images/PixelFormat.cs b/src/Tizen.NUI/src/public/Images/PixelFormat.cs index d9392cd872c..9e2754c68de 100755 --- a/src/Tizen.NUI/src/public/Images/PixelFormat.cs +++ b/src/Tizen.NUI/src/public/Images/PixelFormat.cs @@ -21,7 +21,8 @@ namespace Tizen.NUI /// Enumeration for Pixel formats.
/// Pixel format, default color depth is RGBA 32 bit with alpha. ///
- /// /// 3 + /// 3 + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707: Identifiers should not contain underscores")] public enum PixelFormat { /// diff --git a/src/Tizen.NUI/src/public/Images/TbmQueueImageSource.cs b/src/Tizen.NUI/src/public/Images/TbmQueueImageSource.cs new file mode 100644 index 00000000000..2a5a9286ad3 --- /dev/null +++ b/src/Tizen.NUI/src/public/Images/TbmQueueImageSource.cs @@ -0,0 +1,55 @@ +/* + * Copyright(c) 2021 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.ComponentModel; + +namespace Tizen.NUI +{ + using global::System; + + /// + /// NativeImageQueue with external tbm_queue_h handle, which comes from Native. + /// + /// + /// This class could be used on for Tizen platform. + /// This class only be used for advanced Tizen developer. + /// + /// + /// + /// IntPtr dangerousTbmQueueHandle = SomeDangerousFunction(); // It will return tbm_queue_h, convert as IntPtr. + /// + /// TbmQueueImageSource queue = new TbmQueueImageSource(dangerousTbmQueueHandle); + /// if(queue.CanDequeueBuffer()) + /// { + /// var buffer = queue.DequeueBuffer(ref bufferWidth,ref bufferHeight,ref bufferStride); + /// + /// /* Use buffer */ + /// + /// queue.EnqueueBuffer(buffer); + /// } + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class TbmQueueImageSource : NativeImageQueue + { + [EditorBrowsable(EditorBrowsableState.Never)] + public TbmQueueImageSource(IntPtr dangerousTbmQueueHandle) : base(Interop.NativeImageQueue.NewHandleWithTbmQueue(dangerousTbmQueueHandle), true) + { + NDalicPINVOKE.ThrowExceptionIfExists(); + } + } +} diff --git a/src/Tizen.NUI/src/public/Images/TbmSurfaceImageSource.cs b/src/Tizen.NUI/src/public/Images/TbmSurfaceImageSource.cs new file mode 100644 index 00000000000..c05c78a21d5 --- /dev/null +++ b/src/Tizen.NUI/src/public/Images/TbmSurfaceImageSource.cs @@ -0,0 +1,62 @@ +using System; +/* + * Copyright(c) 2021 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.ComponentModel; + +namespace Tizen.NUI +{ + using global::System; + + /// + /// NativeImageSource with external tbm_surface_h handle, which comes from Native. + /// + /// + /// This class could be used on for Tizen platform. + /// This class only be used for advanced Tizen developer. + /// + /// + /// + /// IntPtr dangerousTbmSurfaceHandle = SomeDangerousFunction(); // It will return tbm_surface_h, convert as IntPtr. + /// + /// TbmSurfaceImageSource surface = new TbmSurfaceImageSource(dangerousTbmSurfaceHandle); + /// + /// ImageUrl imageUrl = surface.GenerateUrl(); + /// ImageView view = new ImageView(imageUrl.ToString()); + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class TbmSurfaceImageSource : NativeImageSource + { + [EditorBrowsable(EditorBrowsableState.Never)] + public TbmSurfaceImageSource(IntPtr dangerousTbmSurfaceHandle) : base(Interop.NativeImageSource.NewHandleWithTbmSurface(dangerousTbmSurfaceHandle), true) + { + NDalicPINVOKE.ThrowExceptionIfExists(); + } + + /// + /// Sets the TBM surface for the native image source. + /// + /// The TBM surface to set. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetTbmSurface(IntPtr tbmSurface) + { + Interop.NativeImageSource.SetSource(this.SwigCPtr.Handle, tbmSurface); + NDalicPINVOKE.ThrowExceptionIfExists(); + } + } +} diff --git a/src/Tizen.NUI/src/public/Input/AutofillContainer.cs b/src/Tizen.NUI/src/public/Input/AutofillContainer.cs deleted file mode 100755 index 3068a5c4d0b..00000000000 --- a/src/Tizen.NUI/src/public/Input/AutofillContainer.cs +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Copyright(c) 2021 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.Runtime.InteropServices; -using System.ComponentModel; - -namespace Tizen.NUI -{ - /// - /// AutofillContainer controls several text input boxes. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public class AutofillContainer : BaseHandle - { - private AuthenticationEventCallbackType authenticationCallback; - private ListEventCallbackType listCallback; - - private event EventHandler authenticationEventHandler; - private event EventHandler listEventHandler; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - private delegate void AuthenticationEventCallbackType(IntPtr autofillContainer); - private delegate void ListEventCallbackType(IntPtr control); - - /// - /// AutofillContainer Authentication Service Event. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler ServiceEvent - { - add - { - if (authenticationEventHandler == null) - { - authenticationCallback = OnServiceEvent; - AutofillServiceEventSignal().Connect(authenticationCallback); - } - - authenticationEventHandler += value; - } - remove - { - authenticationEventHandler -= value; - - if (authenticationEventHandler == null && authenticationCallback != null) - { - AutofillServiceEventSignal().Disconnect(authenticationCallback); - } - } - } - - /// - /// AutofillContainer Fill List Event. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler ListEvent - { - add - { - if (listEventHandler == null) - { - listCallback = OnListEvent; - AutofillListEventSignal().Connect(listCallback); - } - - listEventHandler += value; - } - remove - { - listEventHandler -= value; - - if (listEventHandler == null && listCallback != null) - { - AutofillListEventSignal().Disconnect(listCallback); - } - } - } - - /// - /// Constructor. - /// - /// The AutofillContainer name - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public AutofillContainer(string name) : this(Interop.AutofillContainer.New(name), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal AutofillContainer(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn) - { - } - - internal AutofillContainer(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister) - { - } - - internal AutofillContainer(AutofillContainer autofillContainer) : this(Interop.AutofillContainer.NewAutofillContainer(AutofillContainer.getCPtr(autofillContainer)), true, false) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal AutofillContainer Assign(AutofillContainer autofillContainer) - { - AutofillContainer ret = new AutofillContainer(Interop.AutofillContainer.Assign(SwigCPtr, AutofillContainer.getCPtr(autofillContainer)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static AutofillContainer DownCast(BaseHandle handle) - { - AutofillContainer ret = new AutofillContainer(Interop.AutofillContainer.DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Adds View and its Autofill item information to Autofill Container. - /// - /// The view to be added to Autofill Container - /// The Property to be filled automatically of each View - /// A unique ID that does not always change on each launching - /// An auxiliary means to guess heuristically what data is - /// The Hint - id (username), name, password, phone, credit card number, organization, and so on - /// Whether this information is a sensitive data or not - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void AddAutofillView(BaseComponents.View view, int propertyIndex, string id, string label, AutofillContainer.ItemHint hint, bool isSensitive) - { - Interop.AutofillContainer.AddAutofillView(SwigCPtr, BaseComponents.View.getCPtr(view), propertyIndex, id, label, (uint)hint, isSensitive); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Removes View and its AutofillItem information to Autofill Container. - /// - /// The view to be removed to Autofill Container - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void RemoveAutofillItem(BaseComponents.View view) - { - Interop.AutofillContainer.RemoveAutofillItem(SwigCPtr, BaseComponents.View.getCPtr(view)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Stores autofill data. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SaveAutofillData() - { - Interop.AutofillContainer.SaveAutofillData(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Sends a request for filling the data. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void RequestFillData() - { - Interop.AutofillContainer.RequestFillData(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the Autofill Service Name. - /// - /// Autofill Service Name - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public string GetAutofillServiceName() - { - string ret = Interop.AutofillContainer.GetAutofillServiceName(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets the Autofill Service Message. - /// - /// Autofill Service Message - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public string GetAutofillServiceMessage() - { - string ret = Interop.AutofillContainer.GetAutofillServiceMessage(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets the Autofill Service Image Path. - /// - /// Autofill Service Image Path - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public string GetAutofillServiceImagePath() - { - string ret = Interop.AutofillContainer.GetAutofillServiceImagePath(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets the number of list items. (The presentation text of Autofill) - /// - /// The number of list items - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public uint GetListItemCount() - { - uint ret = Interop.AutofillContainer.GetListItemCount(SwigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets the list item of the index. - /// - /// The index for the list - /// The list item of the index - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public string GetListItem(uint index) - { - string ret = Interop.AutofillContainer.GetListItem(SwigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets the selected item to fill out. - /// - /// The selected item - /// 5 - public void SetSelectedItem(string selected) - { - Interop.AutofillContainer.SetSelectedItem(SwigCPtr, selected); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal AuthenticationSignalType AutofillServiceEventSignal() - { - - AuthenticationSignalType ret = new AuthenticationSignalType(Interop.AutofillContainer.AutofillServiceEventSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ListEventSignalType AutofillListEventSignal() - { - ListEventSignalType ret = new ListEventSignalType(Interop.AutofillContainer.AutofillListEventSignal(SwigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Dispose. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (this != null) - { - if (authenticationCallback != null) - { - AutofillServiceEventSignal().Disconnect(authenticationCallback); - } - - if (listCallback != null) - { - AutofillListEventSignal().Disconnect(listCallback); - } - } - - base.Dispose(type); - } - - /// This will not be public opened. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) - { - Interop.AutofillContainer.DeleteAutofillContainer(swigCPtr); - } - - private void OnServiceEvent(IntPtr autofillContainer) - { - AuthenticationEventArgs e = new AuthenticationEventArgs(); - e.AutofillContainer = Registry.GetManagedBaseHandleFromNativePtr(autofillContainer) as AutofillContainer; - - if (authenticationEventHandler != null) - { - authenticationEventHandler(this, e); - } - } - - private void OnListEvent(IntPtr control) - { - ListEventArgs e = new ListEventArgs(); - e.Control = Registry.GetManagedBaseHandleFromNativePtr(control) as BaseComponents.View; - - if (listEventHandler != null) - { - listEventHandler(this, e); - } - } - - /// - /// Event arguments that passed via the Authentication event. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public class AuthenticationEventArgs : EventArgs - { - /// - /// The instance of AutofillContainer - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public AutofillContainer AutofillContainer - { - get; - set; - } - } - - /// - /// AutofillContainer list event arguments. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public class ListEventArgs : EventArgs - { - /// - /// The instance of AutofillContainer - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public BaseComponents.View Control - { - get; - set; - } - - } - - /// - /// Enumeration for hint of the autofill item. - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public enum ItemHint - { - /// - /// Autofill hint for a credit card expiration date - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - CreditCardExpirationData, - /// - /// Autofill hint for a credit card expiration day - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - CreditCardExpirationDay, - /// - /// Autofill hint for a credit card expiration month - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - CreditCardExpirationMonth, - /// - /// Autofill hint for a credit card expiration year - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - CreditCardExpirationYear, - /// - /// Autofill hint for a credit card number - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - CreditCardNumber, - /// - /// Autofill hint for an email address - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - EmailAddress, - /// - /// Autofill hint for a user's real name - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Name, - /// - /// Autofill hint for a phone number - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Phone, - /// - /// Autofill hint for a postal address - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - PostalAddress, - /// - /// Autofill hint for a postal code - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - PostalCode, - /// - /// Autofill hint for a user's ID - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Id, - /// - /// Autofill hint for password - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - Password, - /// - /// Autofill hint for a credit card security code - /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - CreditCardSecurityCode - } - } -} diff --git a/src/Tizen.NUI/src/public/Input/FocusManagerArgs.cs b/src/Tizen.NUI/src/public/Input/FocusManagerArgs.cs index 8bf48609b70..ea2cc977f70 100755 --- a/src/Tizen.NUI/src/public/Input/FocusManagerArgs.cs +++ b/src/Tizen.NUI/src/public/Input/FocusManagerArgs.cs @@ -31,7 +31,7 @@ public class FocusChangingEventArgs : EventArgs private View.FocusDirection direction; /// - /// The view which is currently focused. + /// Gets or sets the view which is currently focused. /// /// 10 public View Current @@ -47,7 +47,7 @@ public View Current } /// - /// The proposed view. + /// Gets or sets the proposed view for focus change. /// /// 10 public View Proposed @@ -63,7 +63,7 @@ public View Proposed } /// - /// The focus move direction. + /// Gets or sets the focus move direction. /// /// 10 public View.FocusDirection Direction diff --git a/src/Tizen.NUI/src/public/Input/InputMethod.cs b/src/Tizen.NUI/src/public/Input/InputMethod.cs index bfe555d75b4..eaf00a6f2cf 100755 --- a/src/Tizen.NUI/src/public/Input/InputMethod.cs +++ b/src/Tizen.NUI/src/public/Input/InputMethod.cs @@ -28,7 +28,7 @@ public class InputMethod private int? variation = null; /// - /// The default constructor. + /// The default constructor of InputMethod. /// /// 3 public InputMethod() diff --git a/src/Tizen.NUI/src/public/Input/InputMethodContext.cs b/src/Tizen.NUI/src/public/Input/InputMethodContext.cs index c188e3006e5..faffaacac80 100755 --- a/src/Tizen.NUI/src/public/Input/InputMethodContext.cs +++ b/src/Tizen.NUI/src/public/Input/InputMethodContext.cs @@ -68,7 +68,7 @@ internal InputMethodContext(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOw private event EventHandler contentReceivedEventHandler; /// - /// InputMethodContext activated. + /// Event handler for the activation of the InputMethodContext. /// /// 5 public event EventHandler Activated @@ -95,7 +95,7 @@ public event EventHandler Activated } /// - /// InputMethodContext event received. + /// This event handler is used to receive events related to the InputMethodContext. /// /// 5 public event EventHandlerWithReturnType EventReceived @@ -122,7 +122,7 @@ public event EventHandlerWithReturnType - /// InputMethodContext status changed. + /// The StatusChanged event is triggered when the input method context status changes. /// /// 5 public event EventHandler StatusChanged @@ -149,7 +149,7 @@ public event EventHandler StatusChanged } /// - /// InputMethodContext resized. + /// Event handler for the InputMethodContext resized event. /// /// 5 public event EventHandler Resized @@ -176,7 +176,7 @@ public event EventHandler Resized } /// - /// InputMethodContext language changed. + /// This event is triggered when the language of the InputMethodContext changes. /// /// 5 public event EventHandler LanguageChanged @@ -203,7 +203,7 @@ public event EventHandler LanguageChanged } /// - /// InputMethodContext keyboard type changed. + /// Event handler for InputMethodContext keyboard type changed. /// /// 5 public event EventHandler KeyboardTypeChanged @@ -232,7 +232,7 @@ public event EventHandler KeyboardTypeChanged /// /// InputMethodContext content received. /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public event EventHandler ContentReceived { @@ -258,7 +258,7 @@ public event EventHandler ContentReceived } /// - /// The direction of the text. + /// Enumeration for the direction of the text. /// /// 5 public enum TextDirection @@ -274,7 +274,7 @@ public enum TextDirection } /// - /// Events that are generated by the IMF. + /// Enumeration for the events that are generated by the IMF. /// /// 5 public enum EventType @@ -667,6 +667,7 @@ public void ShowInputPanel() /// /// Hides the input panel. + /// This method hides the on-screen keyboard or input panel associated with the current InputMethodContext instance. /// /// 5 public void HideInputPanel() @@ -1013,7 +1014,7 @@ public class EventData : Disposable private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// - /// The default constructor. + /// The default constructor of EventData class. /// /// 5 public EventData() : this(Interop.InputMethodContext.NewInputMethodContextEventData(), true) @@ -1173,7 +1174,7 @@ public class CallbackData : Disposable private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// - /// The default constructor. + /// The default constructor of CallbackData class. /// /// 5 public CallbackData() : this(Interop.InputMethodContext.NewInputMethodContextCallbackData(), true) diff --git a/src/Tizen.NUI/src/public/Input/Key.cs b/src/Tizen.NUI/src/public/Input/Key.cs index ab703231200..c473935a3ab 100755 --- a/src/Tizen.NUI/src/public/Input/Key.cs +++ b/src/Tizen.NUI/src/public/Input/Key.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI public class Key : BaseHandle { /// - /// The default constructor. + /// The default constructor of Key class. /// /// 3 public Key() : this(Interop.Key.New("","",0,0,0u,0), true) @@ -81,7 +81,7 @@ public enum StateType } /// - /// Device name + /// Gets the device name /// /// 3 public string DeviceName @@ -95,7 +95,7 @@ public string DeviceName } /// - /// Name given to the key pressed. + /// Gets or sets the name given to the key pressed. /// /// 3 public string KeyPressedName @@ -223,7 +223,7 @@ public uint Time } /// - /// State of the key event. + /// Gests or sets the state of the key event. /// /// 3 public Key.StateType State diff --git a/src/Tizen.NUI/src/public/Input/KeyValue.cs b/src/Tizen.NUI/src/public/Input/KeyValue.cs index 24cf408ea4d..28821455284 100755 --- a/src/Tizen.NUI/src/public/Input/KeyValue.cs +++ b/src/Tizen.NUI/src/public/Input/KeyValue.cs @@ -23,7 +23,7 @@ namespace Tizen.NUI { /// - /// KeyValue class. + /// The KeyValue class provides functionality for managing key-value pairs. /// public class KeyValue : IDisposable { @@ -57,13 +57,13 @@ public class KeyValue : IDisposable private object originalKey = null; /// - /// Default Constructor. + /// The default Constructor of KeyValue class. /// public KeyValue() { } /// - /// Key property. + /// Gets or sets the key value. /// public string Key { @@ -79,7 +79,7 @@ public string Key } /// - /// OriginalKey property. + /// Gets or sets the original key associated with the KeyValue object. /// /// Thrown when value is null. public object OriginalKey @@ -116,7 +116,7 @@ public object OriginalKey } /// - /// Value property. + /// Gets or sets the value associated with the key. /// public object Value { @@ -181,7 +181,7 @@ public PropertyValue PropertyValue } /// - /// IntergerValue property. + /// Gets or sets the integer value associated with the key. /// public int IntergerValue { @@ -201,7 +201,7 @@ public int IntergerValue } /// - /// BooleanValue property. + /// Gets or sets the boolean value associated with the key. /// public bool BooleanValue { @@ -221,7 +221,7 @@ public bool BooleanValue } /// - /// SingleValue property. + /// Gets or sets the Single(float) value associated with the key. /// public float SingleValue { @@ -241,7 +241,7 @@ public float SingleValue } /// - /// StringValue property. + /// Gets or sets the string value associated with the key. /// public string StringValue { @@ -261,7 +261,7 @@ public string StringValue } /// - /// Vector2Value property. + /// Gets or sets the value associated with the key. /// public Vector2 Vector2Value { @@ -282,7 +282,7 @@ public Vector2 Vector2Value } /// - /// Vector3Value property. + /// Gets or sets the value associated with the key. /// public Vector3 Vector3Value { @@ -303,7 +303,7 @@ public Vector3 Vector3Value } /// - /// Vector4Value property. + /// Gets or sets the value associated with the key. /// public Vector4 Vector4Value { @@ -324,7 +324,7 @@ public Vector4 Vector4Value } /// - /// PositionValue property. + /// Gets or sets the value associated with the key. /// public Position PositionValue { @@ -345,7 +345,7 @@ public Position PositionValue } /// - /// Position2DValue property. + /// Gets or sets the value associated with the key. /// public Position2D Position2DValue { @@ -366,7 +366,7 @@ public Position2D Position2DValue } /// - /// SizeValue property. + /// Gets or sets the value associated with the key. /// public Size SizeValue { @@ -387,7 +387,7 @@ public Size SizeValue } /// - /// Size2DValue property. + /// Gets or sets the value associated with the key. /// public Size2D Size2DValue { @@ -408,7 +408,7 @@ public Size2D Size2DValue } /// - /// ColorValue property. + /// Gets or sets the value associated with the key. /// public Color ColorValue { @@ -429,7 +429,7 @@ public Color ColorValue } /// - /// RectangleValue property. + /// Gets or sets the value associated with the key. /// public Rectangle RectangleValue { @@ -450,7 +450,7 @@ public Rectangle RectangleValue } /// - /// RotationValue property. + /// Gets or sets the value associated with the key. /// public Rotation RotationValue { @@ -471,7 +471,7 @@ public Rotation RotationValue } /// - /// RelativeVector2Value property. + /// Gets or sets the value associated with the key. /// public RelativeVector2 RelativeVector2Value { @@ -492,7 +492,7 @@ public RelativeVector2 RelativeVector2Value } /// - /// RelativeVector3Value property. + /// Gets or sets the value associated with the key. /// public RelativeVector3 RelativeVector3Value { @@ -513,7 +513,7 @@ public RelativeVector3 RelativeVector3Value } /// - /// RelativeVector4Value property. + /// Gets or sets the value associated with the key. /// public RelativeVector4 RelativeVector4Value { @@ -534,7 +534,7 @@ public RelativeVector4 RelativeVector4Value } /// - /// ExtentsValue property. + /// Gets or sets the value associated with the key. /// public Extents ExtentsValue { @@ -555,7 +555,7 @@ public Extents ExtentsValue } /// - /// PropertyArrayValue property. + /// Gets or sets the value associated with the key. /// public PropertyArray PropertyArrayValue { @@ -576,7 +576,7 @@ public PropertyArray PropertyArrayValue } /// - /// PropertyMapValue property. + /// Gets or sets the value associated with the key. /// public PropertyMap PropertyMapValue { diff --git a/src/Tizen.NUI/src/public/Layouting/AbsoluteLayout.cs b/src/Tizen.NUI/src/public/Layouting/AbsoluteLayout.cs index d6675dfd65c..2ab9b409683 100755 --- a/src/Tizen.NUI/src/public/Layouting/AbsoluteLayout.cs +++ b/src/Tizen.NUI/src/public/Layouting/AbsoluteLayout.cs @@ -17,13 +17,13 @@ namespace Tizen.NUI { /// - /// [Draft] This class implements a absolute layout, allowing explicit positioning of children. - /// Positions are from the top left of the layout and can be set using the View.Position and alike. + /// This class implements a absolute layout, allowing explicit positioning of children. + /// Positions are from the top left of the layout and can be set using the View.Position and alike. /// public class AbsoluteLayout : LayoutGroup { /// - /// [Draft] Constructor + /// The default constructor of AbsoluteLayout class /// /// 6 public AbsoluteLayout() diff --git a/src/Tizen.NUI/src/public/Layouting/GridLayout.cs b/src/Tizen.NUI/src/public/Layouting/GridLayout.cs index 87a22904df7..6f6272801c8 100755 --- a/src/Tizen.NUI/src/public/Layouting/GridLayout.cs +++ b/src/Tizen.NUI/src/public/Layouting/GridLayout.cs @@ -418,8 +418,8 @@ protected override void OnLayout(bool changed, LayoutLength left, LayoutLength t int row = child.Row.Start; int columnEnd = child.Column.End; int rowEnd = child.Row.End; - float l = hLocations[column] + Padding.Start + view.Margin.Start; - float t = vLocations[row] + Padding.Top + view.Margin.Top; + float childLeft = hLocations[column] + Padding.Start + view.Margin.Start; + float childTop = vLocations[row] + Padding.Top + view.Margin.Top; float width = hLocations[columnEnd] - hLocations[column] - ColumnSpacing - view.Margin.Start - view.Margin.End; float height = vLocations[rowEnd] - vLocations[row] - RowSpacing - view.Margin.Top - view.Margin.Bottom; bool needMeasuredWidth = false; @@ -431,7 +431,7 @@ protected override void OnLayout(bool changed, LayoutLength left, LayoutLength t } else { - l += (width - child.LayoutItem.MeasuredWidth.Size.AsDecimal()) * halign.ToFloat(); + childLeft += (width - child.LayoutItem.MeasuredWidth.Size.AsDecimal()) * halign.ToFloat(); width = child.LayoutItem.MeasuredWidth.Size.AsDecimal(); } @@ -441,7 +441,7 @@ protected override void OnLayout(bool changed, LayoutLength left, LayoutLength t } else { - t += (height - child.LayoutItem.MeasuredHeight.Size.AsDecimal()) * valign.ToFloat(); + childTop += (height - child.LayoutItem.MeasuredHeight.Size.AsDecimal()) * valign.ToFloat(); height = child.LayoutItem.MeasuredHeight.Size.AsDecimal(); } @@ -489,7 +489,7 @@ protected override void OnLayout(bool changed, LayoutLength left, LayoutLength t } } - child.LayoutItem.Layout(new LayoutLength(l), new LayoutLength(t), new LayoutLength(l + width), new LayoutLength(t + height)); + child.LayoutItem.Layout(new LayoutLength(childLeft), new LayoutLength(childTop), new LayoutLength(childLeft + width), new LayoutLength(childTop + height)); } } diff --git a/src/Tizen.NUI/src/public/Layouting/ILayoutParent.cs b/src/Tizen.NUI/src/public/Layouting/ILayoutParent.cs index 34108235c95..e3f21dfe19e 100755 --- a/src/Tizen.NUI/src/public/Layouting/ILayoutParent.cs +++ b/src/Tizen.NUI/src/public/Layouting/ILayoutParent.cs @@ -18,7 +18,6 @@ namespace Tizen.NUI { /// - /// [Draft] /// Interface that defines a layout Parent. Enables a layout child to access methods on its parent, e.g. Remove (during unparenting) /// public interface ILayoutParent diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs index a6768ad498d..754ed1e8f00 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs @@ -26,18 +26,18 @@ namespace Tizen.NUI { /// - /// [Draft] LayoutGroup class providing container functionality. + /// LayoutGroup class providing container functionality. /// public class LayoutGroup : LayoutItem, ILayoutParent { /// - /// [Draft] List of child layouts in this container. + /// List of child layouts in this container. /// /// 6 protected List LayoutChildren { get; } // Children of this LayoutGroup /// - /// [Draft] Constructor + /// Default constructor of LayoutGroup class. /// /// 6 public LayoutGroup() @@ -110,29 +110,29 @@ public virtual void Remove(LayoutItem layoutItem) if (LayoutWithTransition) { - var win = Window.Get(Owner); + var currentWindow = Window.Get(Owner); if (!childLayout.IsReplaceFlag()) { - if (win == null) + if (currentWindow == null) { NUIApplication.GetDefaultWindow().LayoutController.AddToRemovalStack(childLayout); } else { - win.LayoutController.AddToRemovalStack(childLayout); + currentWindow.LayoutController.AddToRemovalStack(childLayout); } } childLayout.ConditionForAnimation = childLayout.ConditionForAnimation | TransitionCondition.Remove; // Add LayoutItem to the transition stack so can animate it out. - if (win == null) + if (currentWindow == null) { NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0)); } else { - win.LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0)); + currentWindow.LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0)); } } @@ -696,8 +696,8 @@ internal static Binding.BindableProperty.ValidateValueDelegate ValidateEnum(int { return (Binding.BindableObject bindable, object value) => { - int @enum = (int)value; - return enumMin <= @enum && @enum <= enumMax; + int validEnum = (int)value; + return enumMin <= validEnum && validEnum <= enumMax; }; } } diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs b/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs index 7f9e69a9fea..b512e849d71 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs @@ -34,7 +34,7 @@ enum LayoutFlags : short }; /// - /// [Draft] Base class for layouts. It is used to layout a View + /// Base class for layouts. It is used to layout a View /// It can be laid out by a LayoutGroup. /// public class LayoutItem : IDisposable @@ -56,18 +56,18 @@ public class LayoutItem : IDisposable private bool setPositionByLayout = true; /// - /// [Draft] Condition event that is causing this Layout to transition. + /// Condition event that is causing this Layout to transition. /// internal TransitionCondition ConditionForAnimation { get; set; } /// - /// [Draft] The View that this Layout has been assigned to. + /// The View that this Layout has been assigned to. /// /// 6 public View Owner { get; set; } // Should not keep a View alive. /// - /// [Draft] Use transition for layouting child + /// Use transition for layouting child /// /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -75,7 +75,7 @@ public class LayoutItem : IDisposable public bool LayoutWithTransition { get; set; } /// - /// [Draft] Set position by layouting result + /// Set position by layouting result /// [EditorBrowsable(EditorBrowsableState.Never)] public bool SetPositionByLayout @@ -95,7 +95,7 @@ public bool SetPositionByLayout } /// - /// [Draft] Margin for this LayoutItem + /// Margin for this LayoutItem /// /// 6 public Extents Margin @@ -112,7 +112,7 @@ public Extents Margin } /// - /// [Draft] Padding for this LayoutItem + /// Padding for this LayoutItem /// /// 6 public Extents Padding @@ -129,7 +129,7 @@ public Extents Padding } /// - /// [Draft] Constructor + /// Default constructor of LayoutItem class. /// /// 6 public LayoutItem() @@ -138,7 +138,7 @@ public LayoutItem() } /// - /// [Draft] Set parent to this layout. + /// Set parent to this layout. /// /// Parent to set on this Layout. internal void SetParent(ILayoutParent parent) @@ -370,7 +370,6 @@ public void RequestLayout() /// /// Predicate to determine if this layout has been requested to re-layout.
///
- internal bool LayoutRequested { get diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutLength.cs b/src/Tizen.NUI/src/public/Layouting/LayoutLength.cs index a412195f1ac..9ec4290c6d5 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutLength.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutLength.cs @@ -20,14 +20,14 @@ namespace Tizen.NUI { /// - /// [Draft] A type that represents a layout length. Currently, this implies pixels, but could be extended to handle device dependant sizes, etc. + /// A type that represents a layout length. Currently, this implies pixels, but could be extended to handle device dependant sizes, etc. /// public struct LayoutLength : IEquatable { private float value; /// - /// [Draft] Constructor from an int + /// Constructor from an int /// /// Int to initialize with. /// 6 @@ -37,7 +37,7 @@ public LayoutLength(int value) } /// - /// [Draft] Constructor from a float + /// Constructor from a float /// /// Float to initialize with. /// 6 @@ -47,7 +47,7 @@ public LayoutLength(float value) } /// - /// [Draft] Constructor from a LayoutLength + /// Constructor from a LayoutLength /// /// LayoutLength object to initialize with. /// 6 @@ -57,7 +57,7 @@ public LayoutLength(LayoutLength layoutLength) } /// - /// [Draft] Return value as rounded value (whole number), best used as final output + /// Return value as rounded value (whole number), best used as final output /// /// The layout length value as a rounded whole number. /// 6 @@ -67,7 +67,7 @@ public float AsRoundedValue() } /// - /// [Draft] Return value as the raw decimal value, best used for calculations + /// Return value as the raw decimal value, best used for calculations /// /// The layout length value as the raw decimal value. /// 6 @@ -77,7 +77,7 @@ public float AsDecimal() } /// - /// [Draft] The == operator. + /// The == operator. /// /// The first value. /// The second value @@ -89,7 +89,7 @@ public float AsDecimal() } /// - /// [Draft] The != operator. + /// The != operator. /// /// The first value. /// The second value diff --git a/src/Tizen.NUI/src/public/Layouting/LinearLayout.cs b/src/Tizen.NUI/src/public/Layouting/LinearLayout.cs index 3450182e90d..5a5db22d201 100755 --- a/src/Tizen.NUI/src/public/Layouting/LinearLayout.cs +++ b/src/Tizen.NUI/src/public/Layouting/LinearLayout.cs @@ -23,14 +23,14 @@ namespace Tizen.NUI { /// - /// [Draft] This class implements a linear box layout, automatically handling right to left or left to right direction change. + /// This class implements a linear box layout, automatically handling right to left or left to right direction change. /// public class LinearLayout : LayoutGroup { private Alignment linearAlignment = Alignment.Top; /// - /// [Draft] Enumeration for the direction in which the content is laid out + /// Enumeration for the direction in which the content is laid out /// /// 6 public enum Orientation @@ -46,7 +46,7 @@ public enum Orientation } /// - /// [Draft] Enumeration for the alignment of the linear layout items + /// Enumeration for the alignment of the linear layout items /// /// 6 [Obsolete("This has been deprecated in API9 and will be removed in API11. Use HorizontalAlignment and VerticalAlignment instead.")] @@ -95,7 +95,7 @@ public HeightAndWidthState(MeasuredSize.StateType width, MeasuredSize.StateType } /// - /// [Draft] Get/Set the orientation in the layout + /// Get/Set the orientation in the layout /// /// 6 public LinearLayout.Orientation LinearOrientation @@ -112,7 +112,7 @@ public LinearLayout.Orientation LinearOrientation } /// - /// [Draft] Get/Set the padding between cells in the layout + /// Get/Set the padding between cells in the layout /// /// 6 public Size2D CellPadding @@ -135,7 +135,7 @@ public Size2D CellPadding /// - /// [Draft] Get/Set the alignment in the layout + /// Get/Set the alignment in the layout /// /// 6 [Obsolete("This has been deprecated in API9 and will be removed in API11. Use HorizontalAlignment and VerticalAlignment properties instead.")] @@ -202,7 +202,7 @@ public LinearLayout.Alignment LinearAlignment private Orientation linearOrientation = Orientation.Horizontal; /// - /// [Draft] Constructor + /// Default constructor of LinearLayout class. /// /// 6 public LinearLayout() diff --git a/src/Tizen.NUI/src/public/Layouting/MeasureSpecification.cs b/src/Tizen.NUI/src/public/Layouting/MeasureSpecification.cs index f58f4f77c8d..50cf621e176 100755 --- a/src/Tizen.NUI/src/public/Layouting/MeasureSpecification.cs +++ b/src/Tizen.NUI/src/public/Layouting/MeasureSpecification.cs @@ -22,7 +22,7 @@ namespace Tizen.NUI { /// - /// [Draft] A MeasureSpecification is used during the Measure pass by a LayoutGroup to inform it's children how to be measured. + /// A MeasureSpecification is used during the Measure pass by a LayoutGroup to inform it's children how to be measured. /// For instance, it may measure a child with an exact width and an unspecified height in order to determine height for width. /// public struct MeasureSpecification diff --git a/src/Tizen.NUI/src/public/Layouting/MeasuredSize.cs b/src/Tizen.NUI/src/public/Layouting/MeasuredSize.cs index ca464a1b6c1..381dd35fe58 100755 --- a/src/Tizen.NUI/src/public/Layouting/MeasuredSize.cs +++ b/src/Tizen.NUI/src/public/Layouting/MeasuredSize.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI { /// - /// [Draft] Class that encodes a measurement and a measure state, which is set if the measured size is too small. + /// Class that encodes a measurement and a measure state, which is set if the measured size is too small. /// public struct MeasuredSize { diff --git a/src/Tizen.NUI/src/public/Layouting/PaddingType.cs b/src/Tizen.NUI/src/public/Layouting/PaddingType.cs index 6cdc71df37c..e324d375b9d 100755 --- a/src/Tizen.NUI/src/public/Layouting/PaddingType.cs +++ b/src/Tizen.NUI/src/public/Layouting/PaddingType.cs @@ -20,7 +20,7 @@ namespace Tizen.NUI using System.ComponentModel; /// - /// The gesture state. + /// The PaddingType class represents padding properties used in layouting. /// /// 3 public class PaddingType : Disposable @@ -53,7 +53,7 @@ internal PaddingType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, c } /// - /// The Start value. + /// The Start value horizontally. /// /// 4 public float Start @@ -69,7 +69,7 @@ public float Start } /// - /// The End value. + /// The End value horizontally. /// /// 4 public float End @@ -85,7 +85,7 @@ public float End } /// - /// The Top value. + /// The Top value vertically. /// /// 3 public float Top @@ -101,7 +101,7 @@ public float Top } /// - /// The Bottom value. + /// The Bottom value vertically. /// /// 3 public float Bottom diff --git a/src/Tizen.NUI/src/public/RenderEffects/RenderEffect.cs b/src/Tizen.NUI/src/public/RenderEffects/RenderEffect.cs new file mode 100644 index 00000000000..f45a9b2d912 --- /dev/null +++ b/src/Tizen.NUI/src/public/RenderEffects/RenderEffect.cs @@ -0,0 +1,54 @@ +/* + * Copyright(c) 2024 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.ComponentModel; +using System; + +namespace Tizen.NUI +{ + /// + /// View's optional render effect. + /// Applications can apply RenderEffect as the example below : + /// + /// + /// view.SetRenderEffect(RenderEffect.CreateBackgroundBlurEffect(20)); + /// view.ClearRenderEffect(); + /// + /// + /// Note that a view owns at most one render effect. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class RenderEffect : BaseHandle + { + internal RenderEffect(global::System.IntPtr cPtr) : base(cPtr) + { + } + + /// + /// Create a background blur effect + /// + /// + /// Created RenderEffect is immutable. + /// + /// The blur radius value. The unit is pixel for standard cases. + /// Background blur effect with given blur radius. + [EditorBrowsable(EditorBrowsableState.Never)] + public static RenderEffect CreateBackgroundBlurEffect(float blurRadius) + { + return new RenderEffect(Interop.BackgroundBlurEffect.New((uint)Math.Round(blurRadius, 0))); + } + } +} diff --git a/src/Tizen.NUI/src/public/Rendering/FilterModeType.cs b/src/Tizen.NUI/src/public/Rendering/FilterModeType.cs index 945a4bd6e29..e645b259f30 100755 --- a/src/Tizen.NUI/src/public/Rendering/FilterModeType.cs +++ b/src/Tizen.NUI/src/public/Rendering/FilterModeType.cs @@ -18,7 +18,7 @@ namespace Tizen.NUI { /// - /// The filter mode type. + /// Enumeration of the type of possible filter modes. /// /// 3 public enum FilterModeType diff --git a/src/Tizen.NUI/src/public/Rendering/Renderer.cs b/src/Tizen.NUI/src/public/Rendering/Renderer.cs index fbc4b3f26bf..f6a6441e808 100755 --- a/src/Tizen.NUI/src/public/Rendering/Renderer.cs +++ b/src/Tizen.NUI/src/public/Rendering/Renderer.cs @@ -812,33 +812,27 @@ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef Interop.Renderer.DeleteRenderer(swigCPtr); } - /// 6.0 - /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Ranges { - /// 6.0 - /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int BackgroundEffect = Interop.Renderer.RangesBackgroundEffectGet(); - /// 6.0 - /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int BACKGROUND = Interop.Renderer.RangesBackgroundGet(); - /// 6.0 - /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int CONTENT = Interop.Renderer.RangesContentGet(); - /// 6.0 - /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int DECORATION = Interop.Renderer.RangesDecorationGet(); - /// 6.0 - /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be opened API after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int ForegroundEffect = Interop.Renderer.RangesForegroundEffectGet(); diff --git a/src/Tizen.NUI/src/public/Rendering/Shader.cs b/src/Tizen.NUI/src/public/Rendering/Shader.cs index ccbb4d95e5b..b3e090a920a 100755 --- a/src/Tizen.NUI/src/public/Rendering/Shader.cs +++ b/src/Tizen.NUI/src/public/Rendering/Shader.cs @@ -20,7 +20,7 @@ namespace Tizen.NUI { /// - /// Shader. + /// Shader allows custom vertex and color transformations in the GPU. /// /// 3 public class Shader : Animatable @@ -83,7 +83,7 @@ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef } /// - /// Hint. + /// The Hint class is used to provide additional information to the shader. /// /// 3 public sealed class Hint diff --git a/src/Tizen.NUI/src/public/Rendering/TextureType.cs b/src/Tizen.NUI/src/public/Rendering/TextureType.cs index 3982e9b190c..8ad423d1b10 100755 --- a/src/Tizen.NUI/src/public/Rendering/TextureType.cs +++ b/src/Tizen.NUI/src/public/Rendering/TextureType.cs @@ -18,7 +18,7 @@ namespace Tizen.NUI { /// - /// The texture type. + /// The TextureType enumeration defines the types of textures. /// /// 3 public enum TextureType diff --git a/src/Tizen.NUI/src/public/Rendering/VertexBuffer.cs b/src/Tizen.NUI/src/public/Rendering/VertexBuffer.cs index 25dd5d2d1cd..ed16450f2d7 100755 --- a/src/Tizen.NUI/src/public/Rendering/VertexBuffer.cs +++ b/src/Tizen.NUI/src/public/Rendering/VertexBuffer.cs @@ -30,7 +30,7 @@ public class VertexBuffer : BaseHandle { /// - /// Creates a VertexBuffer. + /// The constructor to creates a VertexBuffer. /// /// The map of names and types that describes the components of the buffer. /// 8 @@ -52,7 +52,7 @@ internal VertexBuffer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, /// Thrown when vertices is null or length of the vertices is 0. /// Thrown when length of the vertices is overflow. /// 8 - + [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1715: Identifiers should have correct prefix")] public void SetData(VertexType[] vertices) where VertexType : struct { if (null == vertices || vertices.Length == 0) diff --git a/src/Tizen.NUI/src/public/Template/DataTemplate.cs b/src/Tizen.NUI/src/public/Template/DataTemplate.cs index 54664da18f6..bed1d05af5c 100755 --- a/src/Tizen.NUI/src/public/Template/DataTemplate.cs +++ b/src/Tizen.NUI/src/public/Template/DataTemplate.cs @@ -28,7 +28,7 @@ namespace Tizen.NUI.Binding public class DataTemplate : ElementTemplate { /// - /// Base constructor. + /// The default constructor of DataTemplate class. /// /// 9 public DataTemplate() diff --git a/src/Tizen.NUI/src/public/Theme/Theme.cs b/src/Tizen.NUI/src/public/Theme/Theme.cs index b4379bc5074..48852b62437 100755 --- a/src/Tizen.NUI/src/public/Theme/Theme.cs +++ b/src/Tizen.NUI/src/public/Theme/Theme.cs @@ -46,7 +46,7 @@ public class Theme : BindableObject, IResourcesProvider ResourceDictionary resources; /// - /// Create an empty theme. + /// The default constructor to create an empty theme. /// /// 9 public Theme() diff --git a/src/Tizen.NUI/src/public/Theme/ThemeChangedEventArgs.cs b/src/Tizen.NUI/src/public/Theme/ThemeChangedEventArgs.cs index 368c22dc0d8..d5db7f7b6c0 100755 --- a/src/Tizen.NUI/src/public/Theme/ThemeChangedEventArgs.cs +++ b/src/Tizen.NUI/src/public/Theme/ThemeChangedEventArgs.cs @@ -36,19 +36,20 @@ public ThemeChangedEventArgs(string themeId, string platformThemeId, bool isPlat } /// - /// The new theme's Id. + /// Gets the new theme's Id. /// /// 9 public string ThemeId { get; } /// - /// The platform theme's Id. + /// Gets the platform theme's Id. /// [EditorBrowsable(EditorBrowsableState.Never)] public string PlatformThemeId { get; } /// - /// Whether this event is trigger by platform theme change. + /// Returns whether the event was triggered by a platform theme change. + /// The value is true if the event is triggered by a platform theme change, otherwise false. /// /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/src/Tizen.NUI/src/public/Theme/ThemeManager.cs b/src/Tizen.NUI/src/public/Theme/ThemeManager.cs index 9c3ae1201b2..df6cddfa935 100755 --- a/src/Tizen.NUI/src/public/Theme/ThemeManager.cs +++ b/src/Tizen.NUI/src/public/Theme/ThemeManager.cs @@ -36,7 +36,9 @@ namespace Tizen.NUI ///
/// /// 9 +#pragma warning disable CA1724 public static class ThemeManager +#pragma warning restore CA1724 { /// /// The default light theme name preloaded in platform. diff --git a/src/Tizen.NUI/src/public/Transition/Transition.cs b/src/Tizen.NUI/src/public/Transition/Transition.cs index 37a78cf7736..77bacaa5d68 100644 --- a/src/Tizen.NUI/src/public/Transition/Transition.cs +++ b/src/Tizen.NUI/src/public/Transition/Transition.cs @@ -28,7 +28,7 @@ namespace Tizen.NUI public class Transition : TransitionBase { /// - /// Create a Transition for the View pair. + /// Default constructor to create a Transition for the View pair. /// /// 9 public Transition() diff --git a/src/Tizen.NUI/src/public/Transition/TransitionBase.cs b/src/Tizen.NUI/src/public/Transition/TransitionBase.cs index de7c251e597..3ed937787a3 100644 --- a/src/Tizen.NUI/src/public/Transition/TransitionBase.cs +++ b/src/Tizen.NUI/src/public/Transition/TransitionBase.cs @@ -35,7 +35,7 @@ public class TransitionBase : Disposable private TimePeriod timePeriod = null; /// - /// Create a TransitionBase + /// Default constructor to create a TransitionBase /// /// 9 public TransitionBase() diff --git a/src/Tizen.NUI/src/public/Utility/Capture.cs b/src/Tizen.NUI/src/public/Utility/Capture.cs index 885da7ea04d..d74d7a71b8f 100755 --- a/src/Tizen.NUI/src/public/Utility/Capture.cs +++ b/src/Tizen.NUI/src/public/Utility/Capture.cs @@ -64,6 +64,19 @@ internal Capture(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { } + /// + /// Gets or sets whether this capture source can be rendered on Screen or not. + /// If it is true, the source is not rendered on screen but it will be captured. + /// If it is false, the source is rendered on both of screen and captured result. + /// Default value is false. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool IsExclusive + { + get => Interop.Capture.IsExclusive(SwigCPtr); + set => Interop.Capture.SetExclusive(SwigCPtr, value); + } + /// /// Dispose /// @@ -81,6 +94,13 @@ protected override void Dispose(DisposeTypes type) //Called by User //Release your own managed resources here. //You should release all of your own disposable objects here. + if (finishedCallback != null) + { + finishedSignal?.Disconnect(finishedCallback); + finishedSignal?.Dispose(); + finishedSignal = null; + finishedCallback = null; + } } base.Dispose(type); @@ -119,7 +139,7 @@ public void Start(Container source, Position position, Size size, string path, C } else if (null == path) { - throw new ArgumentNullException("path should not be null"); + throw new ArgumentNullException(nameof(path), "path should not be null"); } else if (null == position) { @@ -163,7 +183,7 @@ public void Start(Container source, Size size, string path, Color color, uint qu } else if (null == path) { - throw new ArgumentNullException("path should not be null"); + throw new ArgumentNullException(nameof(path), "path should not be null"); } else if (quality > 100) { @@ -206,7 +226,7 @@ public void Start(Container source, Size size, string path, Color color) } else if (null == path) { - throw new ArgumentNullException("path should not be null"); + throw new ArgumentNullException(nameof(path), "path should not be null"); } else if (null == color) { @@ -247,7 +267,7 @@ public void Start(Container source, Size size, string path) } else if (null == path) { - throw new ArgumentNullException("path should not be null"); + throw new ArgumentNullException(nameof(path), "path should not be null"); } if (source is View || source is Layer) @@ -305,8 +325,8 @@ public event EventHandler Finished { if (finishedEventHandler == null && disposed == false) { - finishedSignal = new CaptureSignal(Interop.Capture.Get(SwigCPtr)); finishedCallback = onFinished; + finishedSignal = new CaptureSignal(Interop.Capture.Get(SwigCPtr)); finishedSignal.Connect(finishedCallback); } finishedEventHandler += value; @@ -315,10 +335,12 @@ public event EventHandler Finished { finishedEventHandler -= value; - if (finishedEventHandler == null && finishedSignal?.Empty() == false) + if (finishedEventHandler == null && finishedCallback != null) { - finishedCallback = onFinished; - finishedSignal.Disconnect(finishedCallback); + finishedSignal?.Disconnect(finishedCallback); + finishedSignal?.Dispose(); + finishedSignal = null; + finishedCallback = null; } } } diff --git a/src/Tizen.NUI/src/public/Utility/DirectionBias.cs b/src/Tizen.NUI/src/public/Utility/DirectionBias.cs index 13a591589c2..6e1ec4ccf57 100755 --- a/src/Tizen.NUI/src/public/Utility/DirectionBias.cs +++ b/src/Tizen.NUI/src/public/Utility/DirectionBias.cs @@ -19,6 +19,7 @@ namespace Tizen.NUI { /// /// The Direction Bias type. + /// This enum is used to specify the direction bias for scroll snapping. /// /// 3 [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1712: Do not prefix enum values with type name")] diff --git a/src/Tizen.NUI/src/public/Utility/ScrollViewEffect.cs b/src/Tizen.NUI/src/public/Utility/ScrollViewEffect.cs index d268a01aa3b..165b2bf9a9e 100755 --- a/src/Tizen.NUI/src/public/Utility/ScrollViewEffect.cs +++ b/src/Tizen.NUI/src/public/Utility/ScrollViewEffect.cs @@ -14,6 +14,7 @@ * limitations under the License. * */ +using System; using System.ComponentModel; namespace Tizen.NUI @@ -23,6 +24,7 @@ namespace Tizen.NUI /// ScrollView instance. /// /// 3 + [Obsolete("This has been deprecated in API12")] public class ScrollViewEffect : BaseHandle { @@ -30,6 +32,7 @@ public class ScrollViewEffect : BaseHandle /// The constructor. /// /// 3 + [Obsolete("This has been deprecated in API12")] public ScrollViewEffect() : this(Interop.ScrollView.NewScrollViewEffect(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -41,6 +44,7 @@ internal ScrollViewEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(In /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This has been deprecated in API12")] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.ScrollView.DeleteScrollViewEffect(swigCPtr); diff --git a/src/Tizen.NUI/src/public/Utility/TTSPlayer.cs b/src/Tizen.NUI/src/public/Utility/TTSPlayer.cs index 5d8bec1f382..967090f0d48 100755 --- a/src/Tizen.NUI/src/public/Utility/TTSPlayer.cs +++ b/src/Tizen.NUI/src/public/Utility/TTSPlayer.cs @@ -53,7 +53,7 @@ internal TTSPlayer(TTSPlayer handle) : this(Interop.TtsPlayer.NewTtsPlayer(TTSPl private event EventHandler stateChangedEventHandler; /// - /// State changed event. + /// The StateChanged event is triggered when the state of the TTS player changes. /// /// 3 public event EventHandler StateChanged @@ -288,13 +288,13 @@ private void OnStateChanged(TTSState prevState, TTSState nextState) } /// - /// State changed argument. + /// This class represents the event arguments used when the state of the TTS player changes. /// /// 3 public class StateChangedEventArgs : EventArgs { /// - /// PrevState. + /// The previous state of the TTS player before the change. /// /// 3 public TTSState PrevState @@ -304,7 +304,7 @@ public TTSState PrevState } /// - /// NextState. + /// The new state of the TTS player after the change. /// /// 3 public TTSState NextState diff --git a/src/Tizen.NUI/src/public/Utility/Timer.cs b/src/Tizen.NUI/src/public/Utility/Timer.cs index e796e3847e0..9c2ea2ae1ff 100755 --- a/src/Tizen.NUI/src/public/Utility/Timer.cs +++ b/src/Tizen.NUI/src/public/Utility/Timer.cs @@ -259,7 +259,12 @@ internal TimerSignalType TickSignal() /// /// Dispose. + /// Releases unmanaged and optionally managed resources. /// + /// + /// When overriding this method, you need to distinguish between explicit and implicit conditions. For explicit conditions, release both managed and unmanaged resources. For implicit conditions, only release unmanaged resources. + /// + /// Explicit to release both managed and unmanaged resources. Implicit to release only unmanaged resources. /// 3 protected override void Dispose(DisposeTypes type) { diff --git a/src/Tizen.NUI/src/public/ViewProperty/BackgroundExtraData.cs b/src/Tizen.NUI/src/public/ViewProperty/BackgroundExtraData.cs index bed98d76137..cc91769be1d 100755 --- a/src/Tizen.NUI/src/public/ViewProperty/BackgroundExtraData.cs +++ b/src/Tizen.NUI/src/public/ViewProperty/BackgroundExtraData.cs @@ -34,6 +34,7 @@ internal BackgroundExtraData(BackgroundExtraData other) { BackgroundImageBorder = other.BackgroundImageBorder; CornerRadius = other.CornerRadius; + CornerSquareness = other.CornerSquareness; CornerRadiusPolicy = other.CornerRadiusPolicy; BorderlineWidth = other.BorderlineWidth; BorderlineColor = other.BorderlineColor; @@ -52,6 +53,9 @@ internal Rectangle BackgroundImageBorder /// internal Vector4 CornerRadius { get; set; } + /// + internal Vector4 CornerSquareness { get; set; } + /// /// Whether the CornerRadius value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units). /// @@ -77,6 +81,7 @@ protected virtual void Dispose(bool disposing) { backgroundImageBorder?.Dispose(); CornerRadius?.Dispose(); + CornerSquareness?.Dispose(); BorderlineColor?.Dispose(); } disposed = true; diff --git a/src/Tizen.NUI/src/public/ViewProperty/Shadow.cs b/src/Tizen.NUI/src/public/ViewProperty/Shadow.cs index eecbd12df3b..d6401bfb6ed 100755 --- a/src/Tizen.NUI/src/public/ViewProperty/Shadow.cs +++ b/src/Tizen.NUI/src/public/ViewProperty/Shadow.cs @@ -39,6 +39,7 @@ public class Shadow : ShadowBase, ICloneable public Shadow() : base() { BlurRadius = 0; + CutoutPolicy = ColorVisualCutoutPolicyType.None; Color = defaultColor; } @@ -50,9 +51,23 @@ public Shadow() : base() /// Optional. The position offset value (x, y) from the top left corner. See . /// Optional. The shadow will extend its size by specified amount of length. See . /// 9 - public Shadow(float blurRadius, Color color, Vector2 offset = null, Vector2 extents = null) : base(offset, extents) + public Shadow(float blurRadius, Color color, Vector2 offset = null, Vector2 extents = null) : this(blurRadius, ColorVisualCutoutPolicyType.None, color, offset, extents) + { + } + + /// + /// Create a Shadow with custom values. + /// + /// The blur radius value for the shadow. Bigger value, much blurry. + /// The policy of the shadow cutout. + /// The color for the shadow. + /// Optional. The position offset value (x, y) from the top left corner. See . + /// Optional. The shadow will extend its size by specified amount of length. See . + [EditorBrowsable(EditorBrowsableState.Never)] + public Shadow(float blurRadius, ColorVisualCutoutPolicyType cutoutPolicy, Color color, Vector2 offset = null, Vector2 extents = null) : base(offset, extents) { BlurRadius = blurRadius; + CutoutPolicy = cutoutPolicy; Color = color == null ? new Color(defaultColor) : new Color(color); } @@ -61,7 +76,7 @@ public Shadow(float blurRadius, Color color, Vector2 offset = null, Vector2 exte /// /// Thrown when other is null. [EditorBrowsable(EditorBrowsableState.Never)] - public Shadow(Shadow other) : this(other == null ? throw new ArgumentNullException(nameof(other)) : other.BlurRadius, other.Color, other.Offset, other.Extents) + public Shadow(Shadow other) : this(other == null ? throw new ArgumentNullException(nameof(other)) : other.BlurRadius, other.CutoutPolicy, other.Color, other.Offset, other.Extents) { } @@ -93,12 +108,24 @@ internal Shadow(PropertyMap propertyMap) : base(propertyMap) /// /// The blur radius value for the shadow. Bigger value, much blurry. /// - /// + /// /// Negative value is ignored. (no blur) - /// + /// /// 9 public float BlurRadius { get; internal set; } + /// + /// The Cutout policy for this shadow. + /// + /// + /// ColorVisualCutoutPolicyType.None = Fully render the shadow color (Default)
+ /// ColorVisualCutoutPolicyType.CutoutView = Do not render inside bounding box of view
+ /// ColorVisualCutoutPolicyType.CutoutViewWithCornerRadius = Do not render inside view, consider corner radius value
+ /// We don't support this property for xaml yet. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public ColorVisualCutoutPolicyType CutoutPolicy { get; internal set;} + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object other) @@ -127,6 +154,7 @@ public override int GetHashCode() int hash = base.GetHashCode(); hash = (hash * 7) + (Color == null ? 0 : Color.GetHashCode()); hash = (hash * 7) + (BlurRadius.GetHashCode()); + hash = (hash * 7) + (CutoutPolicy.GetHashCode()); return hash; } } @@ -152,6 +180,8 @@ protected override PropertyMap GetPropertyMap() map[ColorVisualProperty.BlurRadius] = new PropertyValue(BlurRadius < 0 ? 0 : BlurRadius); + map[ColorVisualProperty.CutoutPolicy] = new PropertyValue((int)CutoutPolicy); + return map; } } diff --git a/src/Tizen.NUI/src/public/ViewProperty/ShadowBase.cs b/src/Tizen.NUI/src/public/ViewProperty/ShadowBase.cs index deec0e1c2d8..153f364c7cd 100755 --- a/src/Tizen.NUI/src/public/ViewProperty/ShadowBase.cs +++ b/src/Tizen.NUI/src/public/ViewProperty/ShadowBase.cs @@ -32,7 +32,7 @@ public abstract class ShadowBase private static readonly Vector2 noExtents = new Vector2(0, 0); /// - /// Constructor + /// The default constructor of ShadowBase class. /// [EditorBrowsable(EditorBrowsableState.Never)] protected ShadowBase() : this(noOffset, noExtents) @@ -162,11 +162,15 @@ internal PropertyValue ToPropertyValue(BaseComponents.View attachedView) var map = GetPropertyMap(); - if (attachedView.CornerRadius != null) + if (attachedView.CornerRadius != null || attachedView.CornerRadius != Vector4.Zero) { map[Visual.Property.CornerRadius] = attachedView.CornerRadius == null ? new PropertyValue() : new PropertyValue(attachedView.CornerRadius); map[Visual.Property.CornerRadiusPolicy] = new PropertyValue((int)attachedView.CornerRadiusPolicy); } + if (attachedView.CornerSquareness != null || attachedView.CornerSquareness != Vector4.Zero) + { + map[Visual.Property.CornerSquareness] = attachedView.CornerSquareness == null ? new PropertyValue() : new PropertyValue(attachedView.CornerSquareness); + } return new PropertyValue(map); } diff --git a/src/Tizen.NUI/src/public/Visuals/AnimatedImageVisual.cs b/src/Tizen.NUI/src/public/Visuals/AnimatedImageVisual.cs index 9e2edbf8cd8..32dcf8bcc5a 100755 --- a/src/Tizen.NUI/src/public/Visuals/AnimatedImageVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/AnimatedImageVisual.cs @@ -31,7 +31,7 @@ public class AnimatedImageVisual : VisualMap private float? loopCount = null; /// - /// Constructor. + /// Default constructor of AnimatedImageVisual class. /// /// 3 public AnimatedImageVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/BorderVisual.cs b/src/Tizen.NUI/src/public/Visuals/BorderVisual.cs index 25eef6b7887..c458a053cd8 100755 --- a/src/Tizen.NUI/src/public/Visuals/BorderVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/BorderVisual.cs @@ -28,7 +28,7 @@ public class BorderVisual : VisualMap private bool? antiAliasing = null; /// - /// Constructor. + /// Default constructor of BorderVisual class. /// /// 3 public BorderVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/ColorVisual.cs b/src/Tizen.NUI/src/public/Visuals/ColorVisual.cs index d2b58836db6..1607bd188a5 100755 --- a/src/Tizen.NUI/src/public/Visuals/ColorVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/ColorVisual.cs @@ -27,7 +27,7 @@ public class ColorVisual : VisualMap private bool? renderIfTransparent = false; /// - /// Constructor. + /// Default constructor of ColorVisual class. /// /// 3 public ColorVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/GradientVisual.cs b/src/Tizen.NUI/src/public/Visuals/GradientVisual.cs index 097052959e1..cd2738872d6 100755 --- a/src/Tizen.NUI/src/public/Visuals/GradientVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/GradientVisual.cs @@ -33,7 +33,7 @@ public class GradientVisual : VisualMap private GradientVisualSpreadMethodType? _spreadMethod = null; /// - /// Constructor. + /// Default constructor of GradientVisual. /// /// 3 public GradientVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/ImageVisual.cs b/src/Tizen.NUI/src/public/Visuals/ImageVisual.cs index be1e741c2c8..db7ea5fedf2 100755 --- a/src/Tizen.NUI/src/public/Visuals/ImageVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/ImageVisual.cs @@ -44,7 +44,7 @@ public class ImageVisual : VisualMap private bool? atlasing = false; /// - /// Constructor. + /// Default constructor of ImageVisual class. /// /// 3 public ImageVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/MeshVisual.cs b/src/Tizen.NUI/src/public/Visuals/MeshVisual.cs index d85f815630d..ca515f4005a 100755 --- a/src/Tizen.NUI/src/public/Visuals/MeshVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/MeshVisual.cs @@ -34,7 +34,7 @@ public class MeshVisual : VisualMap private Vector3 lightPosition = null; /// - /// Constructor. + /// Default constructor of MeshVisual class. /// /// 3 public MeshVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/NPatchVisual.cs b/src/Tizen.NUI/src/public/Visuals/NPatchVisual.cs index b06f9cf0972..473c36a57ad 100755 --- a/src/Tizen.NUI/src/public/Visuals/NPatchVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/NPatchVisual.cs @@ -28,7 +28,7 @@ public class NPatchVisual : VisualMap private Rectangle border = null; /// - /// Constructor. + /// Default constructor of NPatchVisual class. /// /// 3 public NPatchVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/PrimitiveVisual.cs b/src/Tizen.NUI/src/public/Visuals/PrimitiveVisual.cs index 7f881adb546..e099479e4a4 100755 --- a/src/Tizen.NUI/src/public/Visuals/PrimitiveVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/PrimitiveVisual.cs @@ -37,7 +37,7 @@ public class PrimitiveVisual : VisualMap private Vector3 _lightPosition = null; /// - /// Constructor. + /// Default constructor of PrimitiveVisual class. /// /// 3 public PrimitiveVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/SVGVisual.cs b/src/Tizen.NUI/src/public/Visuals/SVGVisual.cs index c951cadf415..3e17c88041f 100755 --- a/src/Tizen.NUI/src/public/Visuals/SVGVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/SVGVisual.cs @@ -26,7 +26,7 @@ public class SVGVisual : VisualMap private string url = null; /// - /// Constructor. + /// Default constructor of SVGVisual class. /// /// 3 public SVGVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/TextVisual.cs b/src/Tizen.NUI/src/public/Visuals/TextVisual.cs index b224299d2db..801a9b3a2b7 100755 --- a/src/Tizen.NUI/src/public/Visuals/TextVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/TextVisual.cs @@ -39,7 +39,7 @@ public class TextVisual : VisualMap private PropertyMap background = null; /// - /// Constructor. + /// Default constructor of TextVisual class. /// /// 3 public TextVisual() : base() diff --git a/src/Tizen.NUI/src/public/Visuals/VisualConstants.cs b/src/Tizen.NUI/src/public/Visuals/VisualConstants.cs index e80aa64f4d6..234dc63e480 100755 --- a/src/Tizen.NUI/src/public/Visuals/VisualConstants.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualConstants.cs @@ -199,7 +199,17 @@ public enum SamplingModeType /// /// For caching algorithms where a client strongly prefers a cache-hit to reuse a cached image. /// - DontCare + DontCare, + /// + /// Use Lanczos resample algorithm. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Lanczos, + /// + /// Iteratively box filter to generate an image of 1/2, 1/4, 1/8 etc width and height and approximately the desired size, then apply Lanczos resample algorithm. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + BoxThenLanczos, } /// @@ -540,6 +550,13 @@ public struct Property /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int BorderlineOffset = NDalic.VisualPropertyMixColor + 7; + + /// + /// The corner squareness of the visual. + /// Internally clamped between [0.0f to 1.0f] + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int CornerSquareness = NDalic.VisualPropertyMixColor + 8; } /// @@ -663,16 +680,24 @@ public struct ColorVisualProperty /// /// 3 public static readonly int MixColor = NDalic.ColorVisualMixColor; + /// /// Whether to render if the MixColor is transparent. /// /// 5 public static readonly int RenderIfTransparent = NDalic.ColorVisualMixColor + 1; + /// - /// Then radius value for the area to blur. + /// The radius value for the area to blur. /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int BlurRadius = NDalic.ColorVisualMixColor + 2; + + /// + /// The policy value for the cutout of the visual. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int CutoutPolicy = NDalic.ColorVisualMixColor + 3; } /// @@ -1015,6 +1040,29 @@ public struct ImageVisualProperty /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int NotifyAfterRasterization = NDalic.ImageVisualOrientationCorrection + 17; + + /// + /// @brief Whether to synchronize image texture size to visual size. + /// @details Name "synchronousSizing", type Property::BOOLEAN. + /// If this property is true, ImageVisual ignores mDesiredSize. + /// @note Used by the ImageVisual. The default is false. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int SynchronousSizing = NDalic.ImageVisualOrientationCorrection + 18; + + /// + /// @brief Specifies a speed factor for the animated image frame. + /// @details Name "frameSpeedFactor", type Property::FLOAT. + /// + /// The speed factor is a multiplier of the normal velocity of the animation. Values between [0,1] will + /// slow down the animation and values above one will speed up the animation. + /// + /// @note The range of this value is clamped between [0.01f ~ 100.0f]. + /// It might be supported out of bound, and negative value in future. + /// @note Used by the ImageVisual and AnimatedVectorImageVisual. The default is 1.0f. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int FrameSpeedFactor = NDalic.ImageVisualOrientationCorrection + 19; } /// @@ -1370,4 +1418,33 @@ public enum ColorBlendingMode /// Multiply }; + + /// + /// Defines how a colorvisual cutout + /// + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum ColorVisualCutoutPolicyType + { + /// + /// No cutout. (default) + /// + [EditorBrowsable(EditorBrowsableState.Never)] + None, + /// + /// Cutout as bounding box of view + /// + [EditorBrowsable(EditorBrowsableState.Never)] + CutoutView, + /// + /// Cutout as bounding box of view, include corner radius. + /// + /// + /// The CornerRadius and CornerRadiusPolicy will be used color visual itself's value. + /// If you are using this policy at Tizen.NUI.Visuals.ColorVisual, please be careful that CornerRadius value + /// is not same as View.CornerRadius. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + CutoutViewWithCornerRadius, + }; } diff --git a/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs b/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs index 7fb9c8d043c..0ca06449da4 100755 --- a/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs @@ -136,5 +136,45 @@ public void UsePreCompiledShader() Interop.VisualFactory.UsePreCompiledShader(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + + /// + /// Adds a list of pre-compiled shaders to the visual factory. + /// + /// + /// This API allows you to add the desired precompile shader to the list. + /// you can set it through PropertyMap. + /// you need to know the values for setting well to use them, so please refer to the explanation below. + /// + /// The property map consists of string keys. + /// + /// - shaderType: Set the desired shader type. we provides these type: "image","text","color","3d" and "custom" + /// - shaderOption(propertyMap): Set the desired shader option. we provides these flag: we provides a lot of shader options, so user need to check proper shader option. + /// - vertexShader: Set the vertext shader that user want. this is for custom shader. + /// - fragmentShader: Set the fragment shader that user want. this is for custom shader. + /// - shaderName: if user want to set shader name, use this. this is for custom shader.(optional) + /// + /// (example) + /// PropertyMap imageShader = new PropertyMap(); + /// imageShader.Add("shaderType", new PropertyValue("image")); + /// imageShader.Add("shaderOption", new PropertyValue(new PropertyMap().Add("ROUNDED_CORNER", new PropertyValue(true)) + /// .Add("MASKING", new PropertyValue(true)))); + /// + /// PropertyMap textShader = new PropertyMap(); + /// textShader.Add("shaderType", new PropertyValue("text")); + /// + /// VisualFactory.Instance.AddPrecompileShader(imageShader); + /// VisualFactory.Instance.AddPrecompileShader(textShader); + /// VisualFactory.Instance.UsePreCompiledShader(); + /// + /// The map contains the shader option for precompiling. + /// True if the pre-compiled shader is added, otherwise false. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool AddPrecompileShader(PropertyMap option) + { + bool result = false; + result = Interop.VisualFactory.AddPrecompileShader(SwigCPtr, PropertyMap.getCPtr(option)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } } } diff --git a/src/Tizen.NUI/src/public/Visuals/VisualObject/AnimatedImageVisual.cs b/src/Tizen.NUI/src/public/Visuals/VisualObject/AnimatedImageVisual.cs index 3875bc53273..0f2f8d19ecb 100644 --- a/src/Tizen.NUI/src/public/Visuals/VisualObject/AnimatedImageVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualObject/AnimatedImageVisual.cs @@ -142,6 +142,28 @@ public Tizen.NUI.BaseComponents.AnimatedImageView.StopBehaviorType StopBehavior } } + /// + /// Gets and sets the speed factor for the AnimatedImageVisual frame rendering. + /// The default is 1.0f. If the number is less than 1.0f then it will play slower than normal case. + /// If the number is greater than 1.0f then it will play faster than normal case. + /// We will clamp the value between [0.01f 100.0f] internally. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public float FrameSpeedFactor + { + set + { + UpdateVisualProperty((int)Tizen.NUI.ImageVisualProperty.FrameSpeedFactor, new PropertyValue(value)); + } + get + { + float ret = 1.0f; + var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.ImageVisualProperty.FrameSpeedFactor); + propertyValue?.Get(out ret); + return ret; + } + } + /// /// Get the number of total frames. /// Or -1 if image is invalid, or not loaded yet. diff --git a/src/Tizen.NUI/src/public/Visuals/VisualObject/ColorVisual.cs b/src/Tizen.NUI/src/public/Visuals/VisualObject/ColorVisual.cs index 9d6d8d7c12a..7b4193143cf 100644 --- a/src/Tizen.NUI/src/public/Visuals/VisualObject/ColorVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualObject/ColorVisual.cs @@ -68,6 +68,25 @@ public float BlurRadius return ret; } } + + /// + /// Cutout policy of color visual + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public ColorVisualCutoutPolicyType CutoutPolicy + { + set + { + UpdateVisualProperty((int)Tizen.NUI.ColorVisualProperty.CutoutPolicy, new PropertyValue((int)value)); + } + get + { + int ret = (int)ColorVisualCutoutPolicyType.None; + var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.ColorVisualProperty.CutoutPolicy); + propertyValue?.Get(out ret); + return (ColorVisualCutoutPolicyType)ret; + } + } #endregion #region Decorated Visual Properties @@ -113,6 +132,27 @@ public VisualTransformPolicyType CornerRadiusPolicy } } + /// + /// The squareness for the rounded corners of the visual. + /// The values in Vector4 are used in clockwise order from top-left to bottom-left : Vector4(top-left-corner, top-right-corner, bottom-right-corner, bottom-left-corner). + /// Each radius will clamp internally between 0.0 and 1.0. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector4 CornerSquareness + { + set + { + UpdateVisualProperty((int)Tizen.NUI.Visual.Property.CornerSquareness, new PropertyValue(value), false); + } + get + { + Vector4 ret = new Vector4(); + var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.Visual.Property.CornerSquareness); + propertyValue?.Get(ret); + return ret; + } + } + /// /// The width for the borderline of the visual. /// diff --git a/src/Tizen.NUI/src/public/Visuals/VisualObject/ImageVisual.cs b/src/Tizen.NUI/src/public/Visuals/VisualObject/ImageVisual.cs index e31665ae813..ad6506a7143 100644 --- a/src/Tizen.NUI/src/public/Visuals/VisualObject/ImageVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualObject/ImageVisual.cs @@ -174,6 +174,29 @@ public bool OrientationCorrection } } + /// + /// Gets or sets whether to automatically reload the image as the visual size.
+ /// If we set this value as true, Visual size will be works as desired size of image.
+ ///
+ /// + /// If this value is true, and will be invalidated. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool SynchronousSizing + { + set + { + UpdateVisualProperty((int)Tizen.NUI.ImageVisualProperty.SynchronousSizing, new PropertyValue(value), true); + } + get + { + bool ret = false; + var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.ImageVisualProperty.SynchronousSizing); + propertyValue?.Get(out ret); + return ret; + } + } + /// /// Gets or sets the URL of the alpha mask.
/// Optional. @@ -308,6 +331,28 @@ public ReleasePolicyType ReleasePolicy } } + /// + /// Gets or sets filtering options used when resizing images to the sample original pixels.
+ /// If not supplied, the default is SamplingModeType.BoxThenLinear.
+ /// For normal quad images only.
+ /// Optional. + ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public SamplingModeType SamplingMode + { + set + { + UpdateVisualProperty((int)Tizen.NUI.ImageVisualProperty.SamplingMode, new PropertyValue((int)value)); + } + get + { + int ret = (int)SamplingModeType.BoxThenLinear; + var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.ImageVisualProperty.SamplingMode); + propertyValue?.Get(out ret); + return (SamplingModeType)ret; + } + } + /// /// Gets or sets the desired image width.
/// If not specified, the actual image width is used.
@@ -463,6 +508,27 @@ public VisualTransformPolicyType CornerRadiusPolicy } } + /// + /// The squareness for the rounded corners of the visual. + /// The values in Vector4 are used in clockwise order from top-left to bottom-left : Vector4(top-left-corner, top-right-corner, bottom-right-corner, bottom-left-corner). + /// Each radius will clamp internally between [0.0f to 1.0f]. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector4 CornerSquareness + { + set + { + UpdateVisualProperty((int)Tizen.NUI.Visual.Property.CornerSquareness, new PropertyValue(value), false); + } + get + { + Vector4 ret = new Vector4(); + var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.Visual.Property.CornerSquareness); + propertyValue?.Get(ret); + return ret; + } + } + /// /// The width for the borderline of the visual. /// diff --git a/src/Tizen.NUI/src/public/Visuals/VisualObject/VisualBase.cs b/src/Tizen.NUI/src/public/Visuals/VisualObject/VisualBase.cs index b82bcc0e274..fdb836ac80b 100644 --- a/src/Tizen.NUI/src/public/Visuals/VisualObject/VisualBase.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualObject/VisualBase.cs @@ -35,7 +35,7 @@ namespace Tizen.NUI.Visuals /// animation.AnimateTo(view, "BorderlineOffset", -1.0f); /// [EditorBrowsable(EditorBrowsableState.Never)] - public class VisualBase : BaseHandle + public abstract class VisualBase : BaseHandle { #region Internal And Private internal PropertyMap cachedVisualPropertyMap = null; @@ -186,15 +186,6 @@ internal void ConvertFromPropertyMap(PropertyMap inputMap) #endregion #region Constructor - /// - /// Creates an visual object. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public VisualBase() : this(Interop.VisualObject.VisualObjectNew(), true) - { - NDalicPINVOKE.ThrowExceptionIfExists(); - } - internal VisualBase(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn) { } @@ -237,7 +228,7 @@ public enum PropertyUpdateModeType /// and the visuals with larger sibling order are drawn top. /// /// It will be changed automatically when the visuals are added to the view. - /// The default value is 0. + /// It is 0 before being added to the view. /// [EditorBrowsable(EditorBrowsableState.Never)] public uint SiblingOrder @@ -337,7 +328,15 @@ public float Opacity { set { - UpdateVisualProperty((int)Tizen.NUI.Visual.Property.Opacity, new PropertyValue(value), false); + using Tizen.NUI.Color currentVisualColor = Color; + if (currentVisualColor.A != value) + { + using Tizen.NUI.Color visualColor = new Tizen.NUI.Color(currentVisualColor.R, currentVisualColor.G, currentVisualColor.B, value); + UpdateVisualProperty((int)Tizen.NUI.Visual.Property.MixColor, new PropertyValue(visualColor), false); + + // warning : We should set cached Opacity after set MixColor. + UpdateVisualProperty((int)Tizen.NUI.Visual.Property.Opacity, new PropertyValue(value), false); + } } get { @@ -358,20 +357,32 @@ public float Opacity /// The default value is VisualFittingModeType.DontCare. /// If user set one of Transform property, it will be set as VisualFittingModeType.DontCare automatically. /// + /// + /// Fitting mode is only available when the visual has original size. + /// For example, ImageVisual and TextVisual support FittingMode, but ColorVisual and BorderVisual don't support. + /// If visual doesn't have original size, Property set will be ignored. + /// [EditorBrowsable(EditorBrowsableState.Never)] public VisualFittingModeType FittingMode { set { - if (value != VisualFittingModeType.DontCare) + if (IsFittingModeAvailable()) { - visualFittingModeApplied = true; + if (value != VisualFittingModeType.DontCare) + { + visualFittingModeApplied = true; + } + else + { + visualFittingModeApplied = false; + } + UpdateVisualProperty((int)Tizen.NUI.Visual.Property.VisualFittingMode, new PropertyValue((int)value)); } else { - visualFittingModeApplied = false; + Tizen.Log.Error("NUI", $"Fitting mode is not supported by this visual type:{Type}. Set as DontCare\n"); } - UpdateVisualProperty((int)Tizen.NUI.Visual.Property.VisualFittingMode, new PropertyValue((int)value)); } get { @@ -1017,7 +1028,17 @@ internal PropertyValue GetVisualProperty(int key) if (ret == null) { // If we cannot find result from cached map, Get value from native engine. - GetCurrentVisualProperty(key); + ret = GetCurrentVisualProperty(key); + + // Update cached value here + if (ret != null) + { + if (cachedVisualPropertyMap == null) + { + cachedVisualPropertyMap = new PropertyMap(); + } + cachedVisualPropertyMap[key] = ret; + } } return ret; } @@ -1070,6 +1091,30 @@ internal void ReqeustProcessorOnceEvent() } } + /// + /// Check whether given visual object is available to be use fitting mode or not. + /// + internal bool IsFittingModeAvailable() + { + switch (internalType) + { + case (int)Tizen.NUI.Visual.Type.Image: + case (int)Tizen.NUI.Visual.Type.NPatch: + case (int)Tizen.NUI.Visual.Type.AnimatedImage: + case (int)Tizen.NUI.Visual.Type.Text: + { + return true; + } + case (int)Tizen.NUI.Visual.Type.Invalid: + case (int)Tizen.NUI.Visual.Type.Border: + case (int)Tizen.NUI.Visual.Type.Color: + { + return false; + } + } + return false; + } + /// /// Dispose for VisualObject /// diff --git a/src/Tizen.NUI/src/public/WebView/WebView.cs b/src/Tizen.NUI/src/public/WebView/WebView.cs index 9496aefb341..3f066850948 100755 --- a/src/Tizen.NUI/src/public/WebView/WebView.cs +++ b/src/Tizen.NUI/src/public/WebView/WebView.cs @@ -83,9 +83,6 @@ static WebView() } } - private static readonly WebContext context = new WebContext(Interop.WebView.GetWebContext(), false); - private static readonly WebCookieManager cookieManager = new WebCookieManager(Interop.WebView.GetWebCookieManager(), false); - private Color contentBackgroundColor; private bool tilesClearedWhenHidden; private float tileCoverAreaMultiplier; @@ -127,6 +124,9 @@ static WebView() private EventHandler navigationPolicyDecidedEventHandler; private WebViewPolicyDecidedCallback navigationPolicyDecidedCallback; + private EventHandler newWindowPolicyDecidedEventHandler; + private WebViewPolicyDecidedCallback newWindowPolicyDecidedCallback; + private EventHandlerWithReturnType newWindowCreatedEventHandler; private WebViewNewWindowCreatedCallback newWindowCreatedCallback; @@ -148,11 +148,30 @@ static WebView() private EventHandler contextMenuHiddenEventHandler; private WebViewContextMenuHiddenCallback contextMenuHiddenCallback; + private EventHandler fullscreenEnteredEventHandler; + private WebViewFullscreenEnteredCallback fullscreenEnteredCallback; + + private EventHandler fullscreenExitedEventHandler; + private WebViewFullscreenExitedCallback fullscreenExitedCallback; + + private EventHandler textFoundEventHandler; + private WebViewTextFoundCallback textFoundCallback; + private PlainTextReceivedCallback plainTextReceivedCallback; + private EventHandler webAuthDisplayQREventHandler; + private WebViewWebAuthDisplayQRCallback webAuthDisplayQRCallback; + private EventHandler webAuthResponseEventHandler; + private WebViewWebAuthResponseCallback webAuthResponseCallback; + + private EventHandler userMediaPermissionRequestEventHandler; + private WebViewUserMediaPermissionRequestCallback userMediaPermissionRequestCallback; + + private WebContext webContext = null; + private WebCookieManager webCookieManager = null; /// - /// Creates a WebView. + /// Default constructor to create a WebView. /// /// 9 public WebView() : this(Interop.WebView.New(), true) @@ -181,6 +200,17 @@ public WebView(string[] args) : this(Interop.WebView.New3(args?.Length ?? 0, arg if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Creates a WebView with an args list and WebEngine type. + /// + /// Arguments passed into web engine. The first value of array must be program's name. + /// Can select the plugin of Web Engine type. Chromium or LWE. + [EditorBrowsable(EditorBrowsableState.Never)] + public WebView(string[] args, WebEngineType webEngineType) : this(Interop.WebView.New4(args?.Length ?? 0, args, (int)webEngineType), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// /// Copy constructor. /// @@ -216,11 +246,47 @@ protected override void Dispose(DisposeTypes type) return; } + if (webContext != null) + { + webContext.RegisterDownloadStartedCallback(null); + webContext.RegisterMimeOverriddenCallback(null); + webContext.RegisterHttpRequestInterceptedCallback(null); + webContext.Dispose(); + webContext = null; + } + + if (webCookieManager != null) + { + webCookieManager.Dispose(); + webCookieManager = null; + } + if (type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. //You should release all of your own disposable objects here. + + if(handlerRootMap != null) + { + foreach (string key in handlerRootMap?.Keys) + { + Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, key, new HandleRef(null, IntPtr.Zero)); + } + handlerRootMap?.Clear(); + handlerRootMap = null; + } + + if(_addJavaScriptEntireMessageHandlerMap != null) + { + foreach (string key in _addJavaScriptEntireMessageHandlerMap?.Keys) + { + Interop.WebView.AddJavaScriptEntireMessageHandler(SwigCPtr, key, new HandleRef(null, IntPtr.Zero)); + } + _addJavaScriptEntireMessageHandlerMap?.Clear(); + _addJavaScriptEntireMessageHandlerMap = null; + } + BackForwardList.Dispose(); Settings.Dispose(); } @@ -243,6 +309,13 @@ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef [EditorBrowsable(EditorBrowsableState.Never)] public delegate void JavaScriptMessageHandler(string message); + /// + /// The callback function that is invoked when the message is received from the script. + /// + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [EditorBrowsable(EditorBrowsableState.Never)] + public delegate void JavaScriptEntireMessageHandler(string messageName, string messageBody); + /// /// The callback function that is invoked when the message is received from the script. /// @@ -285,6 +358,10 @@ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef [EditorBrowsable(EditorBrowsableState.Never)] public delegate void GeolocationPermissionCallback(string host, string protocol); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [EditorBrowsable(EditorBrowsableState.Never)] + public delegate void UserMediaPermissionCallback(IntPtr permission); + /// /// The callback function that is invoked when hit test is finished. /// @@ -344,6 +421,25 @@ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void WebViewContextMenuHiddenCallback(IntPtr menu); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WebViewFullscreenEnteredCallback(); + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WebViewFullscreenExitedCallback(); + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WebViewTextFoundCallback(uint count); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void WebViewWebAuthDisplayQRCallback(string contents); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void WebViewWebAuthResponseCallback(); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void WebViewUserMediaPermissionRequestCallback(IntPtr permission, string message); + + /// /// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted when page loading has started.
@@ -624,6 +720,34 @@ public event EventHandler NavigationPolicyDecided } } + /// + /// Event for the NewWindowPolicyDecided signal which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when new window policy would be decided.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler NewWindowPolicyDecided + { + add + { + if (newWindowPolicyDecidedEventHandler == null) + { + newWindowPolicyDecidedCallback = OnNewWindowPolicyDecided; + IntPtr ip = Marshal.GetFunctionPointerForDelegate(newWindowPolicyDecidedCallback); + Interop.WebView.RegisterNewWindowPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip)); + } + newWindowPolicyDecidedEventHandler += value; + } + remove + { + newWindowPolicyDecidedEventHandler -= value; + if (newWindowPolicyDecidedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterNewWindowPolicyDecidedCallback(SwigCPtr, new HandleRef(this, ip)); + } + } + } + /// /// Event for the NewWindowCreated signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted when a new window would be created.
@@ -820,6 +944,173 @@ public event EventHandler ContextMenuHidden } } + /// + /// Event for the FullscreenEntered signal which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when fullscreen is entered.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler FullscreenEntered + { + add + { + if (fullscreenEnteredEventHandler == null) + { + fullscreenEnteredCallback = OnFullscreenEntered; + IntPtr ip = Marshal.GetFunctionPointerForDelegate(fullscreenEnteredCallback); + Interop.WebView.RegisterFullscreenEnteredCallback(SwigCPtr, new HandleRef(this, ip)); + } + fullscreenEnteredEventHandler += value; + } + remove + { + fullscreenEnteredEventHandler -= value; + if (fullscreenEnteredEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterFullscreenEnteredCallback(SwigCPtr, new HandleRef(this, ip)); + } + } + } + + /// + /// Event for the FullscreenExited signal which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when fullscreen is exited.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler FullscreenExited + { + add + { + if (fullscreenExitedEventHandler == null) + { + fullscreenExitedCallback = OnFullscreenExited; + IntPtr ip = Marshal.GetFunctionPointerForDelegate(fullscreenExitedCallback); + Interop.WebView.RegisterFullscreenExitedCallback(SwigCPtr, new HandleRef(this, ip)); + } + fullscreenExitedEventHandler += value; + } + remove + { + fullscreenExitedEventHandler -= value; + if (fullscreenExitedEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterFullscreenExitedCallback(SwigCPtr, new HandleRef(this, ip)); + } + } + } + + /// + /// Event for the TextFound signal which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when text is found.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler TextFound + { + add + { + if (textFoundEventHandler == null) + { + textFoundCallback = OnTextFound; + IntPtr ip = Marshal.GetFunctionPointerForDelegate(textFoundCallback); + Interop.WebView.RegisterTextFoundCallback(SwigCPtr, new HandleRef(this, ip)); + } + textFoundEventHandler += value; + } + remove + { + textFoundEventHandler -= value; + if (textFoundEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterTextFoundCallback(SwigCPtr, new HandleRef(this, ip)); + } + } + } + + /// + /// Event to informs user application to display QR code popup for passkey scenario. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler WebAuthDisplayQR + { + add + { + if (webAuthDisplayQREventHandler == null) + { + webAuthDisplayQRCallback = OnWebAuthDisplayQR; + IntPtr ip = Marshal.GetFunctionPointerForDelegate(webAuthDisplayQRCallback); + Interop.WebView.RegisterWebAuthDisplayQRCallback(SwigCPtr, new HandleRef(this, ip)); + } + webAuthDisplayQREventHandler += value; + } + remove + { + webAuthDisplayQREventHandler -= value; + if (webAuthDisplayQREventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterWebAuthDisplayQRCallback(SwigCPtr, new HandleRef(this, ip)); + } + } + } + + /// + /// Event to informs user application that the passkey registration and authentication has been successful. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler WebAuthResponse + { + add + { + if (webAuthResponseEventHandler == null) + { + webAuthResponseCallback = OnWebAuthResponse; + IntPtr ip = Marshal.GetFunctionPointerForDelegate(webAuthResponseCallback); + Interop.WebView.RegisterWebAuthResponseCallback(SwigCPtr, new HandleRef(this, ip)); + } + webAuthResponseEventHandler += value; + } + remove + { + webAuthResponseEventHandler -= value; + if (webAuthResponseEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterWebAuthResponseCallback(SwigCPtr, new HandleRef(this, ip)); + } + } + } + + + /// + /// Event to UserMediaPermissionRequest. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler UserMediaPermissionRequest + { + add + { + if (userMediaPermissionRequestEventHandler == null) + { + userMediaPermissionRequestCallback = OnUserMediaPermissionRequset; + IntPtr ip = Marshal.GetFunctionPointerForDelegate(userMediaPermissionRequestCallback); + Interop.WebView.RegisterUserMediaPermissionRequestCallback(SwigCPtr, new HandleRef(this, ip)); + } + userMediaPermissionRequestEventHandler += value; + } + remove + { + userMediaPermissionRequestEventHandler -= value; + if (userMediaPermissionRequestEventHandler == null) + { + IntPtr ip = IntPtr.Zero; + Interop.WebView.RegisterUserMediaPermissionRequestCallback(SwigCPtr, new HandleRef(this, ip)); + } + } + } + + /// /// Options for searching texts. /// @@ -912,17 +1203,117 @@ public enum HitTestMode All = Default | NodeData | ImageData, } + /// + /// WebEngine type which can be set by a specific constructor of this WebView. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum WebEngineType + { + /// + /// Depend on environement value setting. (default) + /// + [EditorBrowsable(EditorBrowsableState.Never)] + UseSystemSetting = -1, + + /// + /// Chromium Web Engine type. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Chromium = 0, + + /// + /// LWE, Light Web Engine type. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + LWE = 1, + } + + /// + /// IME alignment in web page. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum ImeAlignment + { + /// + /// Top-left corner. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + TopLeft = 0, + + /// + /// top-center position. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + TopCenter, + + /// + /// Top-right corner. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + TopRight, + + /// + /// Middle-left position. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + MiddleLeft, + + /// + /// Middle-center position. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + MiddleCenter, + + /// + /// Middle-right position. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + MiddleRight, + + /// + /// Bottom-left corner. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + BottomLeft, + + /// + /// Bottom-center position. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + BottomCenter, + + /// + /// Bottom-right corner. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + BottomRight, + } + /// /// Context. /// [EditorBrowsable(EditorBrowsableState.Never)] - public WebContext Context => context; + public WebContext Context + { + get + { + webContext ??= new WebContext(Interop.WebView.GetWebContext(), false); + return webContext; + } + } /// /// CookieManager. /// [EditorBrowsable(EditorBrowsableState.Never)] - public WebCookieManager CookieManager => cookieManager; + public WebCookieManager CookieManager + { + get + { + webCookieManager ??= new WebCookieManager(Interop.WebView.GetWebCookieManager(), false); + return webCookieManager; + } + } /// /// BackForwardList. @@ -2154,6 +2545,16 @@ public void ResumeNetworkLoading() if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Change orientation. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void ChangeOrientation(Window.WindowOrientation orientation) + { + Interop.WebView.ChangeOrientation(SwigCPtr, (int)orientation); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// /// Adds custom header. /// @@ -2202,6 +2603,31 @@ public bool StopInspectorServer() return result; } + /// + /// Set the style of IME. + /// + /// The position of IME + /// The alignment of IME + /// True if setting successfully, false otherwise + [EditorBrowsable(EditorBrowsableState.Never)] + public bool SetImePositionAndAlignment(Vector2 position, ImeAlignment alignment) + { + bool result = Interop.WebView.SetImePositionAndAlignment(SwigCPtr, Vector2.getCPtr(position), (int)alignment); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + + /// + /// Set the theme name of cursor. + /// + /// The theme name of cursor + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetCursorThemeName(string themeName) + { + Interop.WebView.SetCursorThemeName(SwigCPtr, themeName); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// /// Scrolls page of web view by deltaX and detlaY. /// @@ -2282,6 +2708,9 @@ public void EvaluateJavaScript(string script) if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + private Dictionary _evaluateJavaScriptHandlerMap = new Dictionary(); + private int _evaluateJavaScriptCallbackId = 0; + /// /// Evaluates JavaScript code represented as a string. /// @@ -2290,7 +2719,14 @@ public void EvaluateJavaScript(string script) [EditorBrowsable(EditorBrowsableState.Never)] public void EvaluateJavaScript(string script, JavaScriptMessageHandler handler) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler); + var id = ++_evaluateJavaScriptCallbackId; + JavaScriptMessageHandler wrapper = (msg) => + { + handler(msg); + _evaluateJavaScriptHandlerMap.Remove(id); + }; + _evaluateJavaScriptHandlerMap.Add(id, wrapper); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(wrapper); Interop.WebView.EvaluateJavaScript(SwigCPtr, script, new global::System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -2303,12 +2739,7 @@ public void EvaluateJavaScript(string script, JavaScriptMessageHandler handler) [EditorBrowsable(EditorBrowsableState.Never)] public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHandler handler) { - if (handlerRootMap.ContainsKey(objectName)) - { - return; - } - - handlerRootMap.Add(objectName, handler); + handlerRootMap[objectName] = handler; System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler); Interop.WebView.AddJavaScriptMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip)); @@ -2316,6 +2747,22 @@ public void AddJavaScriptMessageHandler(string objectName, JavaScriptMessageHand if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + private Dictionary _addJavaScriptEntireMessageHandlerMap = new Dictionary(); + + /// + /// Add a message handler into the WebView. + /// + /// The name of exposed object + /// The callback function + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddJavaScriptMessageHandler(string objectName, JavaScriptEntireMessageHandler handler) + { + _addJavaScriptEntireMessageHandlerMap[objectName] = handler; + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler); + Interop.WebView.AddJavaScriptEntireMessageHandler(SwigCPtr, objectName, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// /// Registers a callback for JS alert. /// @@ -2416,6 +2863,16 @@ public void ClearHistory() if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Exit fullscreen. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void ExitFullscreen() + { + Interop.WebView.ExitFullscreen(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// /// Scales the current page, centered at the given point. /// @@ -2607,6 +3064,16 @@ public void GetPlainTextAsynchronously(PlainTextReceivedCallback callback) if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// cancel in progress web authentication that is passkey operation. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void WebAuthenticationCancel() + { + Interop.WebView.WebAuthenticationCancel(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal static WebView DownCast(BaseHandle handle) { WebView ret = new WebView(Interop.WebView.DownCast(BaseHandle.getCPtr(handle)), true); @@ -2621,6 +3088,28 @@ internal WebView Assign(WebView webView) return ret; } + [EditorBrowsable(EditorBrowsableState.Never)] + internal override void ApplyCornerRadius() + { + base.ApplyCornerRadius(); + + if (backgroundExtraData == null) + { + return; + } + + // Update corner radius properties to webView by ActionUpdateProperty + if (backgroundExtraData.CornerRadius != null) + { + Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, WebView.Property.Url, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius)); + } + if (backgroundExtraData.CornerSquareness != null) + { + Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, WebView.Property.Url, Visual.Property.CornerSquareness, Vector4.getCPtr(backgroundExtraData.CornerSquareness)); + } + Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, WebView.Property.Url, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy); + } + private void OnPageLoadStarted(string pageUrl) { WebViewPageLoadEventArgs e = new WebViewPageLoadEventArgs(); @@ -2688,6 +3177,11 @@ private void OnNavigationPolicyDecided(IntPtr maker) navigationPolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true))); } + private void OnNewWindowPolicyDecided(IntPtr maker) + { + newWindowPolicyDecidedEventHandler?.Invoke(this, new WebViewPolicyDecidedEventArgs(new WebPolicyDecisionMaker(maker, true))); + } + private void OnNewWindowCreated(out IntPtr viewHandle) { WebView view = newWindowCreatedEventHandler?.Invoke(this, new EventArgs()); @@ -2730,5 +3224,36 @@ private void OnHitTestFinished(IntPtr test) hitTestFinishedCallback?.Invoke(new WebHitTestResult(test, true)); #pragma warning restore CA2000 // Dispose objects before losing scope } + + private void OnFullscreenEntered() + { + fullscreenEnteredEventHandler?.Invoke(this, new EventArgs()); + } + + private void OnFullscreenExited() + { + fullscreenExitedEventHandler?.Invoke(this, new EventArgs()); + } + + private void OnTextFound(uint count) + { + textFoundEventHandler?.Invoke(this, new WebViewTextFoundEventArgs(count)); + } + + private void OnWebAuthDisplayQR(string contents) + { + webAuthDisplayQREventHandler?.Invoke(this, new WebViewWebAuthDisplayQREventArgs(contents)); + } + + private void OnWebAuthResponse() + { + webAuthResponseEventHandler?.Invoke(this, new EventArgs()); + } + + private void OnUserMediaPermissionRequset(IntPtr permission, string message) + { + userMediaPermissionRequestEventHandler?.Invoke(this, new WebViewUserMediaPermissionRequestEventArgs(new WebUserMediaPermissionRequest(permission, true), message)); + } + } } diff --git a/src/Tizen.NUI/src/public/Widget/Widget.cs b/src/Tizen.NUI/src/public/Widget/Widget.cs index ce65cb5cf79..fb2bace9bff 100755 --- a/src/Tizen.NUI/src/public/Widget/Widget.cs +++ b/src/Tizen.NUI/src/public/Widget/Widget.cs @@ -29,7 +29,7 @@ public class Widget : BaseHandle internal WidgetImpl widgetImpl; /// - /// Creates a Widget handle. + /// Default constructor to create a Widget handle. /// /// 4 public Widget() : this(new WidgetImpl(), true) diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index c297b3d9024..cf165fce230 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -22,8 +22,8 @@ using System.ComponentModel; using System.Collections.Generic; using System.Runtime.InteropServices; - using Tizen.NUI.BaseComponents; +using Tizen.Common; namespace Tizen.NUI { @@ -32,7 +32,7 @@ namespace Tizen.NUI /// The window has an orientation and indicator properties.
///
/// 3 - public partial class Window : BaseHandle + public partial class Window : BaseHandle, IWindowProvider { private HandleRef stageCPtr; private Layer rootLayer; @@ -416,6 +416,44 @@ public enum ResizeDirection BottomRight = 8, } + /// + /// The Pointer edge boundary for grab. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum PointerBoundary + { + /// + /// Default value + /// + [EditorBrowsable(EditorBrowsableState.Never)] + None = 0, + + /// + /// Top + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Top = 1, + + /// + /// Right + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Right = 2, + + /// + /// Bottom + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Bottom = 3, + + /// + /// Left + /// + [EditorBrowsable(EditorBrowsableState.Never)] + Left = 4, + + } + /// /// The stage instance property (read-only).
/// Gets the current window.
@@ -425,7 +463,7 @@ public enum ResizeDirection /// /// Gets the default window. - /// The main window or default window is automatically created when the application is launched, + /// The main window or default window is automatically created when the application is launched, /// and it remains constant and unchanged throughout the application's operation. /// /// 12 @@ -831,6 +869,8 @@ public void SetInputRegion(Rectangle inputRegion) ///
/// The notification window level. /// True if no error occurred, false otherwise. + /// http://tizen.org/privilege/window.priority.set + /// This exception can be thrown due to permission denied. /// 3 public bool SetNotificationLevel(NotificationLevel level) { @@ -885,6 +925,8 @@ public bool IsOpaqueState() ///
/// The screen mode. /// True if no error occurred, false otherwise. + /// http://tizen.org/privilege/display + /// This exception can be thrown due to permission denied. /// 4 public bool SetScreenOffMode(ScreenOffMode screenOffMode) { @@ -910,6 +952,8 @@ public ScreenOffMode GetScreenOffMode() ///
/// The preferred brightness (0 to 100). /// True if no error occurred, false otherwise. + /// http://tizen.org/privilege/display + /// This exception can be thrown due to permission denied. /// 3 public bool SetBrightness(int brightness) { @@ -1067,6 +1111,8 @@ public void KeepRendering(float durationSeconds) ///
/// The key code to grab. /// True if the grab succeeds. + /// http://tizen.org/privilege/keygrab + /// This exception can be thrown due to permission denied. /// 3 public bool GrabKeyTopmost(int DaliKey) { @@ -1081,6 +1127,8 @@ public bool GrabKeyTopmost(int DaliKey) ///
/// The key code to ungrab. /// True if the ungrab succeeds. + /// http://tizen.org/privilege/keygrab + /// This exception can be thrown due to permission denied. /// 3 public bool UngrabKeyTopmost(int DaliKey) { @@ -1099,6 +1147,8 @@ public bool UngrabKeyTopmost(int DaliKey) /// The key code to grab. /// The grab mode for the key. /// True if the grab succeeds. + /// http://tizen.org/privilege/keygrab + /// This exception can be thrown due to permission denied. /// 3 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode) { @@ -1113,6 +1163,8 @@ public bool GrabKey(int DaliKey, KeyGrabMode GrabMode) ///
/// The key code to ungrab. /// True if the ungrab succeeds. + /// http://tizen.org/privilege/keygrab + /// This exception can be thrown due to permission denied. /// 3 public bool UngrabKey(int DaliKey) { @@ -1661,26 +1713,6 @@ internal Vector2 GetDpi() return ret; } - internal ObjectRegistry GetObjectRegistry() - { - global::System.IntPtr cPtr = Interop.Stage.GetObjectRegistry(stageCPtr); - - ObjectRegistry ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as ObjectRegistry; - if (ret != null) - { - global::System.Runtime.InteropServices.HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - Interop.BaseHandle.DeleteBaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - else - { - ret = new ObjectRegistry(cPtr, true); - } - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior) { Interop.Stage.SetRenderingBehavior(stageCPtr, (int)renderingBehavior); @@ -2223,6 +2255,18 @@ public Hover GetLastHoverEvent() return internalLastHoverEvent; } + /// + /// Gets the last pan gesture state the window gets. + /// + /// The last pan gesture state the window gets. + [EditorBrowsable(EditorBrowsableState.Never)] + public Gesture.StateType GetLastPanGestureState() + { + Gesture.StateType ret = (Gesture.StateType)Interop.Window.InternalRetrievingLastPanGestureState(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// /// Sets the necessary for window rotation Acknowledgement. /// After this function called, SendRotationCompletedAcknowledgement() should be called to complete window rotation. @@ -2517,7 +2561,7 @@ public SafeHandle NativeHandle /// /// Gets or sets a value indicating whether the window is modal or not. - /// The modal property of a window requires that it be set to a parent window. + /// The modal property of a window requires that it be set to a parent window. /// The window modal function operates on the specified parent window. /// [EditorBrowsable(EditorBrowsableState.Never)] @@ -2538,8 +2582,9 @@ public bool IsModal /// - /// Gets or sets a value indicating whether the window is alwats on top of other windows or not. - /// Its behavior is effective among windows with the same notification level. + /// Gets or sets a value indicating whether the window is always on top of other windows or not. + /// This is valid between windows that have no notification level or a notification level of 'none'. + /// If it has a notification level, this will not do anything. /// [EditorBrowsable(EditorBrowsableState.Never)] public bool IsAlwaysOnTop @@ -2556,5 +2601,97 @@ public bool IsAlwaysOnTop if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } + + /// + /// Gets or sets a value indicating whether the window is the bottom of other windows or not. + /// If the enable flag is true, this window will be placed below other windows. + /// Otherwise, if it's called with a false value, it will be located above other windows.. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool IsBottom + { + get + { + bool ret = Interop.Window.IsBottom(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + set + { + Interop.Window.SetBottom(SwigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// Requests relative motion grab + /// + /// True if RelativeMotionGrab succeeds. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool RelativeMotionGrab(PointerBoundary boundary) + { + bool ret = Interop.Window.RelativeMotionGrab(SwigCPtr, (uint)boundary); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Requests relative motion ungrab + /// + /// True if RelativeMotionGrab succeeds. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool RelativeMotionUnGrab() + { + bool ret = Interop.Window.RelativeMotionUnGrab(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets or gets the window blur using window blur information. + /// + /// It is designed to apply a blur effect to a window based on specified parameters. + /// This supports different types of blurring effects, including blurring the window's background only. + /// Or blurring the area surrounding the window while keeping the window itself clear. + /// The more information is written WindowBlurInfo struct. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public WindowBlurInfo BlurInfo + { + get + { + IntPtr internalBlurInfo = Interop.Window.GetBlur(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + WindowBlurInfo blurInfo = new WindowBlurInfo(); + blurInfo.BlurType = (WindowBlurType)Interop.WindowBlurInfo.GetBlurType(internalBlurInfo); + blurInfo.BlurRadius = Interop.WindowBlurInfo.GetBlurRadius(internalBlurInfo); + blurInfo.BackgroundCornerRadius = Interop.WindowBlurInfo.GetBackgroundCornerRadius(internalBlurInfo); + + Interop.WindowBlurInfo.DeleteWindowBlurInfo(internalBlurInfo); + + return blurInfo; + } + set + { + IntPtr internalBlurInfo = Interop.WindowBlurInfo.New((int)value.BlurType, value.BlurRadius, value.BackgroundCornerRadius); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + try { + Interop.Window.SetBlur(SwigCPtr, internalBlurInfo); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + finally { + Interop.WindowBlurInfo.DeleteWindowBlurInfo(internalBlurInfo); + } + } + } + + IntPtr IWindowProvider.WindowHandle => GetNativeWindowHandler(); + float IWindowProvider.X => WindowPosition.X; + float IWindowProvider.Y => WindowPosition.Y; + float IWindowProvider.Width => WindowSize.Width; + float IWindowProvider.Height => WindowSize.Height; + int IWindowProvider.Rotation => (int)GetCurrentOrientation(); } } diff --git a/src/Tizen.NUI/src/public/Window/WindowBlurInfo.cs b/src/Tizen.NUI/src/public/Window/WindowBlurInfo.cs new file mode 100644 index 00000000000..206bd7cae25 --- /dev/null +++ b/src/Tizen.NUI/src/public/Window/WindowBlurInfo.cs @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 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.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI +{ + /// + /// WindowBlurInfo is a struct designed to encapsulate the information required to apply a blur effect to a window. + /// It contains three properties that define how the blur effect is applied to the window, + /// including the type of blur, its intensity, and the corner rounding for the background blur. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public struct WindowBlurInfo + { + /// + /// The construct with blur type, radius and corner radius for background type. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public WindowBlurInfo(WindowBlurType blurType, int blurRadius, int cornerRadius) + { + BlurType = blurType; + BlurRadius = blurRadius; + BackgroundCornerRadius = cornerRadius; + } + + /// + /// The construct with blur type and radius. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public WindowBlurInfo(WindowBlurType blurType, int blurRadius) + { + BlurType = blurType; + BlurRadius = blurRadius; + BackgroundCornerRadius = 0; + } + + /// + /// Gets or sets the blur type of the window. + /// + /// The window blur type of the window. + [EditorBrowsable(EditorBrowsableState.Never)] + public WindowBlurType BlurType {get; set;} + + /// + /// Gets or sets the blur radius of the window. + /// + /// The blur radius of the window. + [EditorBrowsable(EditorBrowsableState.Never)] + public int BlurRadius {get; set;} + + /// + /// Gets or sets the corner radius of the window. + /// It is only useful when window blur type is background. + /// + /// When applying the background corner radius, ensure that the window's own corner radius is applied first. + /// The blur effect will respect the window's pre-defined corner radius settings + /// before applying the specified background corner radius. + /// + /// The corner radius of the window. + [EditorBrowsable(EditorBrowsableState.Never)] + public int BackgroundCornerRadius {get; set;} + } +} diff --git a/src/Tizen.NUI/src/public/Window/WindowEvent.cs b/src/Tizen.NUI/src/public/Window/WindowEvent.cs index 36e7b8427f0..5cb61ef37e4 100755 --- a/src/Tizen.NUI/src/public/Window/WindowEvent.cs +++ b/src/Tizen.NUI/src/public/Window/WindowEvent.cs @@ -97,7 +97,7 @@ public partial class Window /// - /// FocusChanged event. + /// This event is triggered when the focus changes on the window. /// /// 3 public event EventHandler FocusChanged @@ -1402,7 +1402,7 @@ public Touch Touch } /// - /// Wheel event arguments. + /// The Wheel event arguments. /// /// 3 public class WheelEventArgs : EventArgs @@ -1427,7 +1427,7 @@ public Wheel Wheel } /// - /// Key event arguments. + /// The Key event arguments. /// /// 3 public class KeyEventArgs : EventArgs @@ -1478,7 +1478,7 @@ public Size2D WindowSize } /// - /// MouseInOut evnet arguments. + /// The MouseInOut evnet arguments. /// [EditorBrowsable(EditorBrowsableState.Never)] public class MouseInOutEventArgs : EventArgs @@ -1503,7 +1503,7 @@ public MouseInOut MouseInOut } /// - /// MouseRelative evnet arguments. + /// The MouseRelative evnet arguments. /// [EditorBrowsable(EditorBrowsableState.Never)] public class MouseRelativeEventArgs : EventArgs @@ -1529,7 +1529,7 @@ public MouseRelative MouseRelative /// - /// PointerConstraints evnet arguments. + /// The PointerConstraints evnet arguments. /// [EditorBrowsable(EditorBrowsableState.Never)] public class PointerConstraintsEventArgs : EventArgs diff --git a/src/Tizen.NUI/src/public/Xaml/IMarkupExtension.cs b/src/Tizen.NUI/src/public/Xaml/IMarkupExtension.cs index e9709900b9b..7c4e0777fba 100755 --- a/src/Tizen.NUI/src/public/Xaml/IMarkupExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/IMarkupExtension.cs @@ -20,25 +20,25 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IMarkupExtension : IMarkupExtension { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] new T ProvideValue(IServiceProvider serviceProvider); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IMarkupExtension { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] object ProvideValue(IServiceProvider serviceProvider); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [AttributeUsage(AttributeTargets.Class, Inherited = false)] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class AcceptEmptyServiceProviderAttribute : Attribute diff --git a/src/Tizen.NUI/src/public/Xaml/IProvideValueTarget.cs b/src/Tizen.NUI/src/public/Xaml/IProvideValueTarget.cs index d2b98879f6c..18864349960 100755 --- a/src/Tizen.NUI/src/public/Xaml/IProvideValueTarget.cs +++ b/src/Tizen.NUI/src/public/Xaml/IProvideValueTarget.cs @@ -19,15 +19,15 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IProvideValueTarget { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] object TargetObject { get; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] object TargetProperty { get; } } diff --git a/src/Tizen.NUI/src/public/Xaml/IReferenceProvider.cs b/src/Tizen.NUI/src/public/Xaml/IReferenceProvider.cs index 08ade5dd2eb..a4f56d46e61 100755 --- a/src/Tizen.NUI/src/public/Xaml/IReferenceProvider.cs +++ b/src/Tizen.NUI/src/public/Xaml/IReferenceProvider.cs @@ -19,11 +19,11 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IReferenceProvider { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] object FindByName(string name); } diff --git a/src/Tizen.NUI/src/public/Xaml/IRootObjectProvider.cs b/src/Tizen.NUI/src/public/Xaml/IRootObjectProvider.cs index f2fb8129996..0746d6b00a3 100755 --- a/src/Tizen.NUI/src/public/Xaml/IRootObjectProvider.cs +++ b/src/Tizen.NUI/src/public/Xaml/IRootObjectProvider.cs @@ -19,11 +19,11 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] internal interface IRootObjectProvider { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] object RootObject { get; } } diff --git a/src/Tizen.NUI/src/public/Xaml/IValueProvider.cs b/src/Tizen.NUI/src/public/Xaml/IValueProvider.cs index d641cf8a1d6..b2f1f2c9386 100755 --- a/src/Tizen.NUI/src/public/Xaml/IValueProvider.cs +++ b/src/Tizen.NUI/src/public/Xaml/IValueProvider.cs @@ -20,11 +20,11 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IValueProvider { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] object ProvideValue(IServiceProvider serviceProvider); } diff --git a/src/Tizen.NUI/src/public/Xaml/IXamlTypeResolver.cs b/src/Tizen.NUI/src/public/Xaml/IXamlTypeResolver.cs index 2d404a36a8e..976468df26f 100755 --- a/src/Tizen.NUI/src/public/Xaml/IXamlTypeResolver.cs +++ b/src/Tizen.NUI/src/public/Xaml/IXamlTypeResolver.cs @@ -20,15 +20,15 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IXamlTypeResolver { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] Type Resolve(string qualifiedTypeName, IServiceProvider serviceProvider = null); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] bool TryResolve(string qualifiedTypeName, out Type type); } diff --git a/src/Tizen.NUI/src/public/Xaml/IXmlLineInfoProvider.cs b/src/Tizen.NUI/src/public/Xaml/IXmlLineInfoProvider.cs index bf2ff6e7422..60827b0f50b 100755 --- a/src/Tizen.NUI/src/public/Xaml/IXmlLineInfoProvider.cs +++ b/src/Tizen.NUI/src/public/Xaml/IXmlLineInfoProvider.cs @@ -20,11 +20,11 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IXmlLineInfoProvider { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] IXmlLineInfo XmlLineInfo { get; } } diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ApplicationResourcePathExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ApplicationResourcePathExtension.cs index 41349d1e8a0..bc601d22afa 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ApplicationResourcePathExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ApplicationResourcePathExtension.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty(nameof(FilePath))] [AcceptEmptyServiceProvider] diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ArrayExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ArrayExtension.cs index 0300ba64004..62f0a105767 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ArrayExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ArrayExtension.cs @@ -23,28 +23,28 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty("Items")] [AcceptEmptyServiceProvider] public class ArrayExtension : IMarkupExtension { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public ArrayExtension() { Items = new List(); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public IList Items { get; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Type Type { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Array ProvideValue(IServiceProvider serviceProvider) { diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/BindingExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/BindingExtension.cs index efb246c4eea..16f06cd8a7e 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/BindingExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/BindingExtension.cs @@ -22,49 +22,49 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty("Path")] [AcceptEmptyServiceProvider] public sealed class BindingExtension : IMarkupExtension { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Path { get; set; } = Binding.Binding.SelfPath; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public BindingMode Mode { get; set; } = BindingMode.Default; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public IValueConverter Converter { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object ConverterParameter { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string StringFormat { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object Source { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string UpdateSourceEventName { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object TargetNullValue { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object FallbackValue { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public TypedBindingBase TypedBinding { get; set; } diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/DynamicResourceExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/DynamicResourceExtension.cs index b7482522e9d..7098c1a5a4b 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/DynamicResourceExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/DynamicResourceExtension.cs @@ -22,16 +22,16 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty("Key")] public sealed class DynamicResourceExtension : IMarkupExtension { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Key { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object ProvideValue(IServiceProvider serviceProvider) { diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NUIResourcePathExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NUIResourcePathExtension.cs index 3633f5039cd..9a2e6159116 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NUIResourcePathExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NUIResourcePathExtension.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty(nameof(FilePath))] [AcceptEmptyServiceProvider] diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NullExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NullExtension.cs index d6622d4fedc..f73b019434a 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NullExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/NullExtension.cs @@ -20,13 +20,13 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ProvideCompiled("Tizen.NUI.Xaml.Build.Tasks.NullExtension")] [AcceptEmptyServiceProvider] public class NullExtension : IMarkupExtension { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object ProvideValue(IServiceProvider serviceProvider) { diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ReferenceExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ReferenceExtension.cs index f2111e66570..f28357e886a 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ReferenceExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ReferenceExtension.cs @@ -23,16 +23,16 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty("Name")] public class ReferenceExtension : IMarkupExtension { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Name { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object ProvideValue(IServiceProvider serviceProvider) { diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ResourcePathExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ResourcePathExtension.cs index 7c91e61a4e4..a31acf4e5db 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ResourcePathExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/ResourcePathExtension.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty(nameof(FilePath))] [AcceptEmptyServiceProvider] diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StaticExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StaticExtension.cs index 09e1cd01317..3ba2f992cdb 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StaticExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/StaticExtension.cs @@ -24,17 +24,17 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty(nameof(Member))] [ProvideCompiled("Tizen.NUI.Xaml.Build.Tasks.StaticExtension")] public class StaticExtension : IMarkupExtension { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Member { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object ProvideValue(IServiceProvider serviceProvider) { diff --git a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/TemplateBindingExtension.cs b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/TemplateBindingExtension.cs index 5dad6fb615e..90250704d34 100755 --- a/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/TemplateBindingExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/MarkupExtensions/TemplateBindingExtension.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty("Path")] [AcceptEmptyServiceProvider] @@ -33,23 +33,23 @@ internal TemplateBindingExtension() Path = Tizen.NUI.Binding.Binding.SelfPath; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Path { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public BindingMode Mode { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public IValueConverter Converter { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object ConverterParameter { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string StringFormat { get; set; } diff --git a/src/Tizen.NUI/src/public/Xaml/StaticResourceExtension.cs b/src/Tizen.NUI/src/public/Xaml/StaticResourceExtension.cs index 12ee8ed1c69..1beac968047 100755 --- a/src/Tizen.NUI/src/public/Xaml/StaticResourceExtension.cs +++ b/src/Tizen.NUI/src/public/Xaml/StaticResourceExtension.cs @@ -24,16 +24,16 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty("Key")] public sealed class StaticResourceExtension : IMarkupExtension { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Key { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object ProvideValue(IServiceProvider serviceProvider) { diff --git a/src/Tizen.NUI/src/public/Xaml/TypeConversionAttribute.cs b/src/Tizen.NUI/src/public/Xaml/TypeConversionAttribute.cs index 1460e446ca2..36017f3f062 100755 --- a/src/Tizen.NUI/src/public/Xaml/TypeConversionAttribute.cs +++ b/src/Tizen.NUI/src/public/Xaml/TypeConversionAttribute.cs @@ -20,16 +20,16 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [System.AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] public sealed class TypeConversionAttribute : Attribute { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Type TargetType { get; private set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public TypeConversionAttribute(Type targetType) { diff --git a/src/Tizen.NUI/src/public/Xaml/XamlFilePathAttribute.cs b/src/Tizen.NUI/src/public/Xaml/XamlFilePathAttribute.cs index dcbe7c83023..ca0ff47fde9 100755 --- a/src/Tizen.NUI/src/public/Xaml/XamlFilePathAttribute.cs +++ b/src/Tizen.NUI/src/public/Xaml/XamlFilePathAttribute.cs @@ -23,12 +23,12 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] public sealed class XamlFilePathAttribute : Attribute { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public XamlFilePathAttribute([CallerFilePath] string filePath = "") => FilePath = filePath; diff --git a/src/Tizen.NUI/src/public/Xaml/XamlParseException.cs b/src/Tizen.NUI/src/public/Xaml/XamlParseException.cs index 168bbba6ea6..b3c3624e0d1 100755 --- a/src/Tizen.NUI/src/public/Xaml/XamlParseException.cs +++ b/src/Tizen.NUI/src/public/Xaml/XamlParseException.cs @@ -23,7 +23,7 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class XamlParseException : Exception { @@ -64,7 +64,7 @@ public XamlParseException(string message, Exception innerException = null) : bas unformattedMessage = message; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public XamlParseException(string message, IXmlLineInfo xmlInfo, Exception innerException = null) : base(FormatMessage(message + GetStackInfo(), xmlInfo), innerException) { @@ -77,7 +77,7 @@ internal XamlParseException(string message, IServiceProvider serviceProvider, Ex { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public IXmlLineInfo XmlInfo { get; private set; } diff --git a/src/Tizen.NUI/src/public/Xaml/XamlResourceIdAttribute.cs b/src/Tizen.NUI/src/public/Xaml/XamlResourceIdAttribute.cs index 15c20fb4480..a50a6baed99 100755 --- a/src/Tizen.NUI/src/public/Xaml/XamlResourceIdAttribute.cs +++ b/src/Tizen.NUI/src/public/Xaml/XamlResourceIdAttribute.cs @@ -21,24 +21,24 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = true)] public sealed class XamlResourceIdAttribute : Attribute { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string ResourceId { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Path { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Type Type { get; set; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public XamlResourceIdAttribute(string resourceId, string path, Type type) { diff --git a/src/Tizen.NUI/src/public/Xaml/XamlServiceProvider.cs b/src/Tizen.NUI/src/public/Xaml/XamlServiceProvider.cs index 6c66ccd8643..f0326f1cd09 100755 --- a/src/Tizen.NUI/src/public/Xaml/XamlServiceProvider.cs +++ b/src/Tizen.NUI/src/public/Xaml/XamlServiceProvider.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class XamlServiceProvider : IServiceProvider { @@ -54,7 +54,7 @@ internal XamlServiceProvider(INode node, HydrationContext context) IValueConverterProvider = new ValueConverterProvider(); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public XamlServiceProvider() { @@ -97,7 +97,7 @@ internal IValueConverterProvider IValueConverterProvider set { services[typeof(IValueConverterProvider)] = value; } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object GetService(Type serviceType) { @@ -105,7 +105,7 @@ public object GetService(Type serviceType) return services.TryGetValue(serviceType, out service) ? service : null; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void Add(Type type, object service) { @@ -156,21 +156,21 @@ IEnumerable IProvideParentValues.ParentObjects } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class SimpleValueTargetProvider : IProvideParentValues, IProvideValueTarget, IReferenceProvider { readonly object[] objectAndParents; readonly object targetProperty; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("SimpleValueTargetProvider(object[] objectAndParents) is obsolete as of version 2.3.4. Use SimpleValueTargetProvider(object[] objectAndParents, object targetProperty) instead.")] public SimpleValueTargetProvider(object[] objectAndParents) : this(objectAndParents, null) { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public SimpleValueTargetProvider(object[] objectAndParents, object targetProperty) { @@ -192,7 +192,7 @@ object IProvideValueTarget.TargetObject object IProvideValueTarget.TargetProperty => targetProperty; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object FindByName(string name) { @@ -210,7 +210,7 @@ public object FindByName(string name) } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class XamlTypeResolver : IXamlTypeResolver { @@ -218,7 +218,7 @@ public class XamlTypeResolver : IXamlTypeResolver readonly GetTypeFromXmlName getTypeFromXmlName; readonly IXmlNamespaceResolver namespaceResolver; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public XamlTypeResolver(IXmlNamespaceResolver namespaceResolver, Assembly currentAssembly) : this(namespaceResolver, XamlParser.GetElementType, currentAssembly) @@ -305,18 +305,18 @@ public XamlRootObjectProvider(object rootObject) public object RootObject { get; } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class XmlLineInfoProvider : IXmlLineInfoProvider { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public XmlLineInfoProvider(IXmlLineInfo xmlLineInfo) { XmlLineInfo = xmlLineInfo; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public IXmlLineInfo XmlLineInfo { get; } } @@ -341,30 +341,30 @@ public object FindByName(string name) } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ObsoleteAttribute(" ", false)] public class NameScopeProvider : INameScopeProvider { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public INameScope NameScope { get; set; } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class XmlNamespaceResolver : IXmlNamespaceResolver { readonly Dictionary namespaces = new Dictionary(); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public IDictionary GetNamespacesInScope(XmlNamespaceScope scope) { throw new NotImplementedException(); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string LookupNamespace(string prefix) { @@ -374,14 +374,14 @@ public string LookupNamespace(string prefix) return null; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string LookupPrefix(string namespaceName) { throw new NotImplementedException(); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void Add(string prefix, string ns) { diff --git a/src/Tizen.NUI/src/public/Xaml/XmlLineInfo.cs b/src/Tizen.NUI/src/public/Xaml/XmlLineInfo.cs index e7af646fcee..451c4c8b017 100755 --- a/src/Tizen.NUI/src/public/Xaml/XmlLineInfo.cs +++ b/src/Tizen.NUI/src/public/Xaml/XmlLineInfo.cs @@ -20,19 +20,19 @@ namespace Tizen.NUI.Xaml { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class XmlLineInfo : IXmlLineInfo { readonly bool hasLineInfo; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public XmlLineInfo() { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public XmlLineInfo(int linenumber, int lineposition) { @@ -41,18 +41,18 @@ public XmlLineInfo(int linenumber, int lineposition) LinePosition = lineposition; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool HasLineInfo() { return hasLineInfo; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public int LineNumber { get; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public int LinePosition { get; } } diff --git a/src/Tizen.NUI/src/public/XamlBinding/BindableObjectExtensions.cs b/src/Tizen.NUI/src/public/XamlBinding/BindableObjectExtensions.cs index f011036e33f..89cd54489c6 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/BindableObjectExtensions.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindableObjectExtensions.cs @@ -21,11 +21,11 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static class BindableObjectExtensions { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static void SetBinding(this BindableObject self, BindableProperty targetProperty, string path, BindingMode mode = BindingMode.Default, IValueConverter converter = null, string stringFormat = null) diff --git a/src/Tizen.NUI/src/public/XamlBinding/BindablePropertyConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/BindablePropertyConverter.cs index 98a4d4cd1c9..ae38975207d 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/BindablePropertyConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindablePropertyConverter.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.BindablePropertyConverter")] [TypeConversion(typeof(BindableProperty))] @@ -92,7 +92,7 @@ object IExtendedTypeConverter.ConvertFromInvariantString(string value, IServiceP throw new XamlParseException($"Can't resolve {value}. Syntax is [[prefix:]Type.]PropertyName.", lineinfo); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override object ConvertFromInvariantString(string value) { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Binding.cs b/src/Tizen.NUI/src/public/XamlBinding/Binding.cs index 2e13748227b..098e494d1e9 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Binding.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Binding.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [SuppressMessage("Microsoft.Design", "CA1724: Type names should not match namespaces")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Binding : BindingBase @@ -41,13 +41,13 @@ public sealed class Binding : BindingBase object source; string updateSourceEventName; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Binding() { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Binding(string path, BindingMode mode = BindingMode.Default, IValueConverter converter = null, object converterParameter = null, string stringFormat = null, object source = null) { @@ -64,7 +64,7 @@ public Binding(string path, BindingMode mode = BindingMode.Default, IValueConver Source = source; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public IValueConverter Converter { @@ -77,7 +77,7 @@ public IValueConverter Converter } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object ConverterParameter { @@ -90,7 +90,7 @@ public object ConverterParameter } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Path { @@ -104,7 +104,7 @@ public string Path } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object Source { @@ -121,7 +121,7 @@ public object Source } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string UpdateSourceEventName { diff --git a/src/Tizen.NUI/src/public/XamlBinding/BindingBase.cs b/src/Tizen.NUI/src/public/XamlBinding/BindingBase.cs index 49f468b4436..d6ae7b1d617 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/BindingBase.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindingBase.cs @@ -42,7 +42,7 @@ internal BindingBase() /// /// Gets or sets the mode for this binding. /// - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public BindingMode Mode { @@ -65,7 +65,7 @@ public BindingMode Mode /// /// Gets or sets the string format for this binding. /// - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string StringFormat { @@ -78,7 +78,7 @@ public string StringFormat } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object TargetNullValue { @@ -90,7 +90,7 @@ public object TargetNullValue } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object FallbackValue { @@ -112,7 +112,7 @@ public object FallbackValue /// Stops synchronization on the collection. /// /// The collection on which to stop synchronization. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static void DisableCollectionSynchronization(IEnumerable collection) { @@ -122,7 +122,7 @@ public static void DisableCollectionSynchronization(IEnumerable collection) SynchronizedCollections.Remove(collection); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static void EnableCollectionSynchronization(IEnumerable collection, object context, CollectionSynchronizationCallback callback) { @@ -137,7 +137,7 @@ public static void EnableCollectionSynchronization(IEnumerable collection, objec /// /// Throws an InvalidOperationException if the binding has been applied. /// - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected void ThrowIfApplied() { diff --git a/src/Tizen.NUI/src/public/XamlBinding/BindingTypeConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/BindingTypeConverter.cs index 2c74460a9fc..db86252534a 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/BindingTypeConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/BindingTypeConverter.cs @@ -20,13 +20,13 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.BindingTypeConverter")] [TypeConversion(typeof(Binding))] public sealed class BindingTypeConverter : TypeConverter { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override object ConvertFromInvariantString(string value) { diff --git a/src/Tizen.NUI/src/public/XamlBinding/CollectionSynchronizationCallback.cs b/src/Tizen.NUI/src/public/XamlBinding/CollectionSynchronizationCallback.cs index fa9c27f245d..4c9685a77f9 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/CollectionSynchronizationCallback.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/CollectionSynchronizationCallback.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public delegate void CollectionSynchronizationCallback(IEnumerable collection, object context, Action accessMethod, bool writeAccess); } diff --git a/src/Tizen.NUI/src/public/XamlBinding/ColorTypeConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/ColorTypeConverter.cs index 6b59a3bb076..f45ce4e8a37 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/ColorTypeConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/ColorTypeConverter.cs @@ -22,7 +22,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.ColorTypeConverter")] [TypeConversion(typeof(Color))] @@ -32,7 +32,7 @@ public class ColorTypeConverter : TypeConverter // HEX #rgb, #argb, #rrggbb, #aarrggbb // float array 0.5,0.5,0.5,0.5 // Predefined color case insensitive - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override object ConvertFromInvariantString(string value) { @@ -95,7 +95,7 @@ static uint ToHexD(char c) return (j << 4) | j; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static Color FromRgba(int r, int g, int b, int a) { @@ -106,7 +106,7 @@ public static Color FromRgba(int r, int g, int b, int a) return new Color(red, green, blue, alpha); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static Color FromRgb(int r, int g, int b) { @@ -152,7 +152,7 @@ static Color FromHex(string hex) } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override string ConvertToString(object value) { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Command.cs b/src/Tizen.NUI/src/public/XamlBinding/Command.cs index ecc7368902e..5c6fd816965 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Command.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Command.cs @@ -22,11 +22,11 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Command : Command { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Command(Action execute) : base(o => @@ -43,7 +43,7 @@ public Command(Action execute) } } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Command(Action execute, Func canExecute) : base(o => @@ -94,7 +94,7 @@ public class Command : ICommand /// Initializes a new instance of the Command class. /// /// An instance to execute when the Command is executed. - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Command(Action execute) { @@ -108,7 +108,7 @@ public Command(Action execute) /// Initializes a new instance of the Command class. /// /// An Action to execute when the Command is executed. - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Command(Action execute) : this(o => execute()) { @@ -121,7 +121,7 @@ public Command(Action execute) : this(o => execute()) /// /// An Action to execute when the Command is executed. /// A instance indicating if the Command can be executed. - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Command(Action execute, Func canExecute) : this(execute) { @@ -136,7 +136,7 @@ public Command(Action execute, Func canExecute) : this(exe /// /// An Action to execute when the Command is executed. /// A instance indicating if the Command can be executed. - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Command(Action execute, Func canExecute) : this(o => execute(), o => canExecute()) { @@ -151,7 +151,7 @@ public Command(Action execute, Func canExecute) : this(o => execute(), o = /// /// An Object used as parameter to determine if the Command can be executed. /// true if the Command can be executed, false otherwise. - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public bool CanExecute(object parameter) { @@ -164,7 +164,7 @@ public bool CanExecute(object parameter) /// /// Occurs when the target of the Command should reevaluate whether or not the Command can be executed. /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public event EventHandler CanExecuteChanged; @@ -172,7 +172,7 @@ public bool CanExecute(object parameter) /// Invokes the execute Action. /// /// An Object used as parameter for the execute Action. - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void Execute(object parameter) { @@ -182,7 +182,7 @@ public void Execute(object parameter) /// /// Send a CanExecuteChanged. /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void ChangeCanExecute() { diff --git a/src/Tizen.NUI/src/public/XamlBinding/ElementEventArgs.cs b/src/Tizen.NUI/src/public/XamlBinding/ElementEventArgs.cs index c968b60f9f0..36eef26ebd5 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/ElementEventArgs.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/ElementEventArgs.cs @@ -20,11 +20,11 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class ElementEventArgs : EventArgs { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public ElementEventArgs(Element element) { @@ -34,7 +34,7 @@ public ElementEventArgs(Element element) Element = element; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Element Element { get; private set; } } diff --git a/src/Tizen.NUI/src/public/XamlBinding/FloatGraphicsTypeConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/FloatGraphicsTypeConverter.cs index 1b4dbdecef0..b25c9c278e4 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/FloatGraphicsTypeConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/FloatGraphicsTypeConverter.cs @@ -31,13 +31,13 @@ namespace Tizen.NUI.Binding /// dp, sp suffix is converted to pixel value with Dpi and ScalingFactors by GraphicsTypeManager. /// /// - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ProvideCompiledAttribute("Tizen.NUI.Xaml.Core.XamlC.FloatGraphicsTypeConverter")] public class FloatGraphicsTypeConverter : TypeConverter { /// - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override object ConvertFromInvariantString(string value) { @@ -50,7 +50,7 @@ public override object ConvertFromInvariantString(string value) } /// - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override string ConvertToString(object value) { diff --git a/src/Tizen.NUI/src/public/XamlBinding/IResourcesProvider.cs b/src/Tizen.NUI/src/public/XamlBinding/IResourcesProvider.cs index c2d473fa7a8..c47edd7bfae 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/IResourcesProvider.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/IResourcesProvider.cs @@ -19,7 +19,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IResourcesProvider { diff --git a/src/Tizen.NUI/src/public/XamlBinding/IValueConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/IValueConverter.cs index 937ff820ab9..907219b6d0f 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/IValueConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/IValueConverter.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IValueConverter { diff --git a/src/Tizen.NUI/src/public/XamlBinding/IntGraphicsTypeConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/IntGraphicsTypeConverter.cs index 4484b008e2f..7e58cdc0a93 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/IntGraphicsTypeConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/IntGraphicsTypeConverter.cs @@ -26,12 +26,12 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ProvideCompiledAttribute("Tizen.NUI.Xaml.Core.XamlC.IntGraphicsTypeConverter")] public class IntGraphicsTypeConverter : TypeConverter { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override object ConvertFromInvariantString(string value) { @@ -43,7 +43,7 @@ public override object ConvertFromInvariantString(string value) throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(int)}"); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override string ConvertToString(object value) { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Behavior.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Behavior.cs index 2ce1f16b790..28b9f48dde6 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Behavior.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Behavior.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public abstract class Behavior : BindableObject, IAttachedObject { @@ -32,7 +32,7 @@ internal Behavior(Type associatedType) AssociatedType = associatedType; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected Type AssociatedType { get; } @@ -50,30 +50,30 @@ void IAttachedObject.DetachFrom(BindableObject bindable) OnDetachingFrom(bindable); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected virtual void OnAttachedTo(BindableObject bindable) { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected virtual void OnDetachingFrom(BindableObject bindable) { } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public abstract class Behavior : Behavior where T : BindableObject { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected Behavior() : base(typeof(T)) { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected override void OnAttachedTo(BindableObject bindable) { @@ -81,13 +81,13 @@ protected override void OnAttachedTo(BindableObject bindable) OnAttachedTo((T)bindable); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected virtual void OnAttachedTo(T bindable) { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected override void OnDetachingFrom(BindableObject bindable) { @@ -95,7 +95,7 @@ protected override void OnDetachingFrom(BindableObject bindable) base.OnDetachingFrom(bindable); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] protected virtual void OnDetachingFrom(T bindable) { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/BindingCondition.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/BindingCondition.cs index 23c6692e533..77c72edfa46 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/BindingCondition.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/BindingCondition.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.PassthroughValueProvider")] [AcceptEmptyServiceProvider] @@ -32,14 +32,14 @@ public sealed class BindingCondition : Condition, IValueProvider BindingBase binding; object triggerValue; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public BindingCondition() { boundProperty = BindableProperty.CreateAttached("Bound", typeof(object), typeof(BindingCondition), null, propertyChanged: OnBoundPropertyChanged); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public BindingBase Binding { @@ -54,7 +54,7 @@ public BindingBase Binding } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object Value { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Condition.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Condition.cs index dd1c2a37cb3..53f2bd7d11e 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Condition.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/Condition.cs @@ -20,7 +20,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public abstract class Condition { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/DataTrigger.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/DataTrigger.cs index c8ab3ece116..9363c843408 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/DataTrigger.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/DataTrigger.cs @@ -22,20 +22,20 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty("Setters")] [ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.PassthroughValueProvider")] [AcceptEmptyServiceProvider] public sealed class DataTrigger : TriggerBase, IValueProvider { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public DataTrigger([TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) : base(new BindingCondition(), targetType) { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public BindingBase Binding { @@ -52,14 +52,14 @@ public BindingBase Binding } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public new IList Setters { get { return base.Setters; } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This has been deprecated in API9 and will be removed in API11. Use GetValue() instead.")] public object Value diff --git a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/EventTrigger.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/EventTrigger.cs index 983f073faca..9aaa9cbf9a7 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/EventTrigger.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/EventTrigger.cs @@ -23,7 +23,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty("Actions")] public sealed class EventTrigger : TriggerBase @@ -36,18 +36,18 @@ public sealed class EventTrigger : TriggerBase string eventname; Delegate handlerdelegate; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public EventTrigger() : base(typeof(BindableObject)) { Actions = new SealedList(); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public IList Actions { get; } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Event { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/MultiTrigger.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/MultiTrigger.cs index 58fbe534ff7..a3d3f299320 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/MultiTrigger.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/MultiTrigger.cs @@ -21,25 +21,25 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ContentProperty("Setters")] public sealed class MultiTrigger : TriggerBase { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public MultiTrigger([TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType) : base(new MultiCondition(), targetType) { } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public IList Conditions { get { return ((MultiCondition)Condition).Conditions; } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public new IList Setters { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/XamlPropertyCondition.cs b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/XamlPropertyCondition.cs index 8389ca2b3a1..b2a3b2e14ee 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Interactivity/XamlPropertyCondition.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Interactivity/XamlPropertyCondition.cs @@ -22,7 +22,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ProvideCompiled("Tizen.NUI.Core.XamlC.PassthroughValueProvider")] [AcceptEmptyServiceProvider] @@ -33,14 +33,14 @@ public sealed class XamlPropertyCondition : Condition, IValueProvider BindableProperty property; object triggerValue; - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public XamlPropertyCondition() { stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public BindableProperty Property { @@ -62,7 +62,7 @@ public BindableProperty Property } } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public object Value { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Internals/DynamicResource.cs b/src/Tizen.NUI/src/public/XamlBinding/Internals/DynamicResource.cs index 328476f7520..b1707e1107b 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Internals/DynamicResource.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Internals/DynamicResource.cs @@ -19,18 +19,18 @@ namespace Tizen.NUI.Binding.Internals { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class DynamicResource { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public DynamicResource(string key) { Key = key; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string Key { get; private set; } } diff --git a/src/Tizen.NUI/src/public/XamlBinding/Internals/IDynamicResourceHandler.cs b/src/Tizen.NUI/src/public/XamlBinding/Internals/IDynamicResourceHandler.cs index aaa96de5d11..e44de49018f 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Internals/IDynamicResourceHandler.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Internals/IDynamicResourceHandler.cs @@ -20,11 +20,11 @@ namespace Tizen.NUI.Binding.Internals { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface IDynamicResourceHandler { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] void SetDynamicResource(BindableProperty targetProperty, string key); } diff --git a/src/Tizen.NUI/src/public/XamlBinding/Internals/INameScope.cs b/src/Tizen.NUI/src/public/XamlBinding/Internals/INameScope.cs index 31175cb903c..2616768dbb1 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Internals/INameScope.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Internals/INameScope.cs @@ -21,23 +21,23 @@ namespace Tizen.NUI.Binding.Internals { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public interface INameScope { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] object FindByName(string name); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] void RegisterName(string name, object scopedElement); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] void UnregisterName(string name); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [ObsoleteAttribute(" ", false)] void RegisterName(string name, object scopedElement, IXmlLineInfo xmlLineInfo); diff --git a/src/Tizen.NUI/src/public/XamlBinding/Internals/NameScope.cs b/src/Tizen.NUI/src/public/XamlBinding/Internals/NameScope.cs index 69f9683242d..13e9ca75f3a 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Internals/NameScope.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Internals/NameScope.cs @@ -24,11 +24,11 @@ namespace Tizen.NUI.Binding.Internals { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class NameScope : INameScope { - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty NameScopeProperty = BindableProperty.CreateAttached("NameScope", typeof(INameScope), typeof(NameScope), default(INameScope)); @@ -97,7 +97,7 @@ void INameScope.UnregisterName(string name) names.Remove(name); } - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static INameScope GetNameScope(BindableObject bindable) { @@ -105,7 +105,7 @@ public static INameScope GetNameScope(BindableObject bindable) } /// Thrown when bindable is null. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static void SetNameScope(BindableObject bindable, INameScope value) { diff --git a/src/Tizen.NUI/src/public/XamlBinding/NameScopeExtensions.cs b/src/Tizen.NUI/src/public/XamlBinding/NameScopeExtensions.cs index a83d1265cff..4a10f440d90 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/NameScopeExtensions.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/NameScopeExtensions.cs @@ -21,11 +21,11 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static class NameScopeExtensions { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static T FindByName(this Element element, string name) { @@ -52,7 +52,7 @@ internal static void PopElement() /// /// Used to find the object defined in Xaml file. /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static T FindByNameInCurrentNameScope(string name) { diff --git a/src/Tizen.NUI/src/public/XamlBinding/PointSizeTypeConverter.cs b/src/Tizen.NUI/src/public/XamlBinding/PointSizeTypeConverter.cs index 8e6a8707159..44852b61618 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/PointSizeTypeConverter.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/PointSizeTypeConverter.cs @@ -31,7 +31,7 @@ namespace Tizen.NUI.Binding [ProvideCompiledAttribute("Tizen.NUI.Xaml.Core.XamlC.PointSizeTypeConverter")] public class PointSizeTypeConverter : TypeConverter { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override object ConvertFromInvariantString(string value) { @@ -43,7 +43,7 @@ public override object ConvertFromInvariantString(string value) throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(float)}"); } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public override string ConvertToString(object value) { diff --git a/src/Tizen.NUI/src/public/XamlBinding/Registrar.cs b/src/Tizen.NUI/src/public/XamlBinding/Registrar.cs index 8bc42b0e86c..bf5e11fbaa7 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/Registrar.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/Registrar.cs @@ -26,7 +26,7 @@ namespace Tizen.NUI.Binding.Internals /// For internal use. /// /// - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class Registrar where TRegistrable : class { @@ -37,7 +37,7 @@ public class Registrar where TRegistrable : class /// /// The type of the view /// The type of the render. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public void Register(Type tview, Type trender) { @@ -78,7 +78,7 @@ internal TRegistrable GetHandler(Type type, params object[] args) /// The type of the handler /// The type. /// The handler instance. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public TOut GetHandler(Type type) where TOut : TRegistrable { @@ -92,7 +92,7 @@ public TOut GetHandler(Type type) where TOut : TRegistrable /// The type. /// The args of the type /// The handler instance. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public TOut GetHandler(Type type, params object[] args) where TOut : TRegistrable { @@ -105,7 +105,7 @@ public TOut GetHandler(Type type, params object[] args) where TOut : TRegi /// The type /// The object instance. /// The handle of the obj. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public TOut GetHandlerForObject(object obj) where TOut : TRegistrable { @@ -125,7 +125,7 @@ public TOut GetHandlerForObject(object obj) where TOut : TRegistrable /// The object instance /// The args of the type /// The handler of the object. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public TOut GetHandlerForObject(object obj, params object[] args) where TOut : TRegistrable { @@ -143,7 +143,7 @@ public TOut GetHandlerForObject(object obj, params object[] args) where TO /// /// The view type. /// The type of the handle. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Type GetHandlerType(Type viewType) { @@ -185,7 +185,7 @@ public Type GetHandlerType(Type viewType) /// /// The object instance. /// The type of the handler. - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Type GetHandlerTypeForObject(object obj) { @@ -221,7 +221,7 @@ bool LookupHandlerType(Type viewType, out Type handlerType) /// /// For internal use /// - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static class Registrar { @@ -231,7 +231,7 @@ static Registrar() internal static Dictionary Effects { get; } = new Dictionary(); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static IEnumerable ExtraAssemblies { get; set; } } diff --git a/src/Tizen.NUI/src/public/XamlBinding/ResourceDictionary.cs b/src/Tizen.NUI/src/public/XamlBinding/ResourceDictionary.cs index 10510906cc9..0e7c088662f 100755 --- a/src/Tizen.NUI/src/public/XamlBinding/ResourceDictionary.cs +++ b/src/Tizen.NUI/src/public/XamlBinding/ResourceDictionary.cs @@ -29,7 +29,7 @@ namespace Tizen.NUI.Binding { - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class ResourceDictionary : IResourceDictionary, IDictionary { @@ -39,7 +39,7 @@ public class ResourceDictionary : IResourceDictionary, IDictionary