/*
* Copyright (c) 2016 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.Collections.Generic;
namespace Tizen.Applications
{
///
/// This class is a parameter of the PackageManager::GetPackages method.
///
/// 3
public class PackageFilter
{
private IDictionary _filter;
private IDictionary _stringFilter;
///
/// The default constructor with an empty filter list. All the installed applications will satisfy this filter unless updated with more specific filters.
///
/// 3
public PackageFilter()
{
_filter = new Dictionary();
_stringFilter = new Dictionary();
}
///
/// The constructor with specific filters. Using this will filter out the installed packages which do not meet the filter criteria.
///
/// Package filters.
/// 3
public PackageFilter(IDictionary filter)
{
_filter = filter;
}
///
/// The constructor with specific filters. Using this will filter out the installed packages which do not meet the filter criteria.
///
/// The dictionary contains filter keys as the keys, and filter values as the value.
/// Package filters using string values.
/// 9
public PackageFilter(IDictionary stringFilter)
{
_stringFilter = stringFilter;
}
///
/// The constructor with specific filters. Using this will filter out the installed packages which do not meet the filter criteria.
///
/// Package filters.
/// Package filters using string values.
/// 9
public PackageFilter(IDictionary filter, IDictionary stringFilter)
{
_filter = filter;
_stringFilter = stringFilter;
}
///
/// Filters to be used in the GetPackages method.
///
/// 3
public IDictionary Filters
{
get
{
return _filter;
}
}
///
/// String filters to be used in the GetPackages method.
///
/// 9
public IDictionary StringFilters
{
get
{
return _stringFilter;
}
}
///
/// This class contains possible keys for the filter to be used in the GetPackages method.
///
/// 3
public static class Keys
{
///
/// Key of the boolean property for filtering if the package is removable.
///
/// 3
public const string Removable = "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE";
///
/// Key of the boolean property for filtering if the package is read-only.
///
/// 3
public const string ReadOnly = "PMINFO_PKGINFO_PROP_PACKAGE_READONLY";
///
/// Key of the boolean property for filtering if the package supports disabling.
///
/// 3
public const string SupportsDisable = "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE";
///
/// Key of the boolean property for filtering if the package is disabled.
///
/// 3
public const string Disable = "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE";
///
/// Key of the boolean property for filtering if the package is preloaded.
///
/// 3
public const string Preload = "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD";
///
/// Key of the string property for filtering the resource type of the package.
///
/// 9
public const string ResourceType = "PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE";
}
}
}