Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ComponentBased.ComponentManager] Enhance API descriptions #6374

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
namespace Tizen.Applications.ComponentBased
{
/// <summary>
/// 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.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public class ComponentInfo : IDisposable
Expand All @@ -41,13 +42,13 @@ internal ComponentInfo(IntPtr infoHandle)
}

/// <summary>
/// A constructor of ComponentInfo that takes the component ID.
/// Initializes a new instance of the <see cref="ComponentInfo"/> class with the specified component ID.
/// </summary>
/// <param name="componentId">Component ID.</param>
/// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
/// <exception cref="InvalidOperationException">Thrown when failed because of the system error.</exception>
/// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>>
/// <param name="componentId">The ID of the component.</param>
/// <exception cref="ArgumentException">Thrown when the component ID is invalid.</exception>
/// <exception cref="InvalidOperationException">Thrown when a system error occurs.</exception>
/// <exception cref="OutOfMemoryException">Thrown when memory allocation fails.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when permission is denied.</exception>
/// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
/// <since_tizen> 6 </since_tizen>
public ComponentInfo(string componentId)
Expand All @@ -63,15 +64,15 @@ public ComponentInfo(string componentId)
}

/// <summary>
/// Destructor of the class.
/// Finalizes an instance of the <see cref="ComponentInfo"/> class.
/// </summary>
~ComponentInfo()
{
Dispose(false);
}

/// <summary>
/// Gets the component ID.
/// Gets the ID of the component.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public string ComponentId
Expand All @@ -94,7 +95,7 @@ public string ComponentId
}

/// <summary>
/// Gets the application ID of the component.
/// Gets the application ID associated with the component.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public string ApplicationId
Expand Down Expand Up @@ -132,7 +133,7 @@ public ComponentType ComponentType
}

/// <summary>
/// Checks whether the icon of the component should be displayed or not.
/// Checks whether the icon of the component should be displayed.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public bool IsIconDisplayed
Expand All @@ -151,7 +152,7 @@ public bool IsIconDisplayed
}

/// <summary>
/// Checks whether the component should be managed by task-manager or not.
/// Checks whether the component is managed by the task manager.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public bool IsManagedByTaskManager
Expand All @@ -170,7 +171,7 @@ public bool IsManagedByTaskManager
}

/// <summary>
/// Gets the absolute path of the icon image.
/// Gets the absolute path of the component's icon image.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public string IconPath
Expand Down Expand Up @@ -207,11 +208,11 @@ public string Label
}

/// <summary>
/// Gets the localized label of the component for the given locale.
/// Gets the localized label of the component for a specified locale.
/// </summary>
/// <param name="locale">Locale.</param>
/// <remarks>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)]")</remarks>
/// <returns>The localized label.</returns>
/// <param name="locale">The locale in the format of language and country code (e.g., "en-US").</param>
/// <remarks>Available values are in the format "[2-letter lowercase language code (ISO 639-1)]-[2-letter lowercase country code (ISO 3166-alpha-2)]".</remarks>
/// <returns>The localized label corresponding to the specified locale.</returns>
/// <since_tizen> 6 </since_tizen>
public string GetLocalizedLabel(string locale)
{
Expand All @@ -226,7 +227,7 @@ public string GetLocalizedLabel(string locale)
}

/// <summary>
/// Releases all resources used by the ComponentInfo class.
/// Releases all resources used by the <see cref="ComponentInfo"/> class.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public void Dispose()
Expand All @@ -236,7 +237,7 @@ public void Dispose()
}

/// <summary>
/// Releases all resources used by the ComponentInfo class.
/// Releases resources used by the <see cref="ComponentInfo"/> class.
/// </summary>
/// <param name="disposing">Disposing</param>
/// <since_tizen> 6 </since_tizen>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ namespace Tizen.Applications.ComponentBased
public static class ComponentManager
{
private const string LogTag = "Tizen.Applications";

/// <summary>
/// Gets the information of the installed components asynchronously.
/// Asynchronously retrieves a list of installed components.
/// </summary>
/// <returns>The installed component info list.</returns>
/// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
/// <exception cref="InvalidOperationException">Thrown when failed because of the "component not exist" error or the system error.</exception>
/// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
/// <returns>
/// A task that represents the asynchronous operation.
/// The task result contains an <see cref="IEnumerable{ComponentInfo}"/> of the installed component information.
/// </returns>
/// <exception cref="ArgumentException">Thrown when an invalid argument is provided.</exception>
/// <exception cref="InvalidOperationException">Thrown when the component does not exist or if a system error occurs.</exception>
/// <exception cref="OutOfMemoryException">Thrown when the system runs out of memory.</exception>
/// <exception cref="UnauthorizedAccessException"> Thrown when permission is denied to access the component information.</exception>
/// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
/// <since_tizen> 6 </since_tizen>
public static async Task<IEnumerable<ComponentInfo>> GetInstalledComponentsAsync()
Expand Down Expand Up @@ -74,13 +77,16 @@ public static async Task<IEnumerable<ComponentInfo>> GetInstalledComponentsAsync
}

/// <summary>
/// Gets the information of the running components asynchronously.
/// Asynchronously retrieves a list of currently running components.
/// </summary>
/// <returns>The component running context list.</returns>
/// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
/// <exception cref="InvalidOperationException">Thrown when failed because of the "component not exist" error or the system error.</exception>
/// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
/// <returns>
/// A task that represents the asynchronous operation.
/// The task result contains an <see cref="IEnumerable{ComponentRunningContext}"/> of the running components.
/// </returns>
/// <exception cref="ArgumentException">Thrown when an invalid argument is provided.</exception>
/// <exception cref="InvalidOperationException">Thrown when the component does not exist or if a system error occurs.</exception>
/// <exception cref="OutOfMemoryException">Thrown when the system runs out of memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to access the running components.</exception>
/// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
/// <since_tizen> 6 </since_tizen>
public static async Task<IEnumerable<ComponentRunningContext>> GetRunningComponentsAsync()
Expand Down Expand Up @@ -117,14 +123,16 @@ public static async Task<IEnumerable<ComponentRunningContext>> GetRunningCompone
}

/// <summary>
/// Checks whether the component is running or not.
/// Checks if a specified component is currently running.
/// </summary>
/// <param name="componentId">Component ID.</param>
/// <returns>Returns true if the component is running, otherwise false.</returns>
/// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
/// <exception cref="InvalidOperationException">Thrown when failed because of the "component not exist" error or the system error.</exception>
/// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
/// <param name="componentId">The unique identifier of the component.</param>
/// <returns>
/// True if the component is running; otherwise, false.
/// </returns>
/// <exception cref="ArgumentException">Thrown when an invalid argument is provided.</exception>
/// <exception cref="InvalidOperationException">Thrown when the component does not exist or if a system error occurs.</exception>
/// <exception cref="OutOfMemoryException">Thrown when the system runs out of memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to access the component status.</exception>
/// <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
/// <since_tizen> 6 </since_tizen>
public static bool IsRunning(string componentId)
Expand All @@ -139,17 +147,17 @@ public static bool IsRunning(string componentId)
}

/// <summary>
/// Terminates the component if it is running in the background.
/// Requests to terminate a specified component that is running in the background.
/// </summary>
/// <param name="context">Component ID</param>
/// <exception cref="ArgumentException">Thrown when failed because of an invalid argument.</exception>
/// <exception cref="InvalidOperationException">Thrown when failed because of the "component not exist" error or the system error.</exception>
/// <exception cref="OutOfMemoryException">Thrown when failed because of out of memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
/// <param name="context">The context of the running component to terminate.</param>
/// <exception cref="ArgumentException">Thrown when an invalid argument is provided.</exception>
/// <exception cref="InvalidOperationException">Thrown when the component does not exist or if a system error occurs.</exception>
/// <exception cref="OutOfMemoryException">Thrown when the system runs out of memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when permission is denied to terminate the component.</exception>
/// <privilege>http://tizen.org/privilege/appmanager.kill.bgapp</privilege>
/// <remarks>
/// 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.
/// </remarks>
/// <since_tizen> 6 </since_tizen>
public static void TerminateBackgroundComponent(ComponentRunningContext context)
Expand Down
Loading
Loading