2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using System.Collections.Generic;
19 namespace Tizen.Applications
22 /// This class is a parameter of the PackageManager::GetPackages method.
24 /// <since_tizen> 3 </since_tizen>
25 public class PackageFilter
27 private IDictionary<string, bool> _filter;
28 private IDictionary<string, string> _stringFilter;
31 /// The default constructor with an empty filter list. All the installed applications will satisfy this filter unless updated with more specific filters.
33 /// <since_tizen> 3 </since_tizen>
34 public PackageFilter()
36 _filter = new Dictionary<string, bool>();
37 _stringFilter = new Dictionary<string, string>();
41 /// The constructor with specific filters. Using this will filter out the installed packages which do not meet the filter criteria.
43 /// <param name="filter">Package filters.</param>
44 /// <since_tizen> 3 </since_tizen>
45 public PackageFilter(IDictionary<string, bool> filter)
51 /// The constructor with specific filters. Using this will filter out the installed packages which do not meet the filter criteria.
53 /// <remarks>The dictionary contains filter keys as the keys, and filter values as the value.</remarks>
54 /// <param name="stringFilter">Package filters using string values.</param>
55 /// <since_tizen> 9 </since_tizen>
56 public PackageFilter(IDictionary<string, string> stringFilter)
58 _stringFilter = stringFilter;
62 /// The constructor with specific filters. Using this will filter out the installed packages which do not meet the filter criteria.
64 /// <param name="filter">Package filters.</param>
65 /// <param name="stringFilter">Package filters using string values.</param>
66 /// <since_tizen> 9 </since_tizen>
67 public PackageFilter(IDictionary<string, bool> filter, IDictionary<string, string> stringFilter)
70 _stringFilter = stringFilter;
74 /// Filters to be used in the GetPackages method.
76 /// <since_tizen> 3 </since_tizen>
77 public IDictionary<string, bool> Filters
86 /// String filters to be used in the GetPackages method.
88 /// <since_tizen> 9 </since_tizen>
89 public IDictionary<string, string> StringFilters
98 /// This class contains possible keys for the filter to be used in the GetPackages method.
100 /// <since_tizen> 3 </since_tizen>
101 public static class Keys
104 /// Key of the boolean property for filtering if the package is removable.
106 /// <since_tizen> 3 </since_tizen>
107 public const string Removable = "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE";
109 /// Key of the boolean property for filtering if the package is read-only.
111 /// <since_tizen> 3 </since_tizen>
112 public const string ReadOnly = "PMINFO_PKGINFO_PROP_PACKAGE_READONLY";
114 /// Key of the boolean property for filtering if the package supports disabling.
116 /// <since_tizen> 3 </since_tizen>
117 public const string SupportsDisable = "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE";
119 /// Key of the boolean property for filtering if the package is disabled.
121 /// <since_tizen> 3 </since_tizen>
122 public const string Disable = "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE";
124 /// Key of the boolean property for filtering if the package is preloaded.
126 /// <since_tizen> 3 </since_tizen>
127 public const string Preload = "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD";
130 /// Key of the string property for filtering the resource type of the package.
132 /// <since_tizen> 9 </since_tizen>
133 public const string ResourceType = "PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE";