2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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.
18 * @file FAppPkgPackageInfo.h
19 * @brief This is the header file for the %PackageInfo class.
21 * This header file contains the declarations of the %PackageInfo class.
24 #ifndef _FAPP_PKG_PACKAGE_INFO_H_
25 #define _FAPP_PKG_PACKAGE_INFO_H_
28 #include <FAppTypes.h>
29 #include <FAppPkgPackageManager.h>
31 namespace Tizen { namespace App { namespace Package
36 * @brief This class represents the information of a package.
40 * @final This class is not intended for extension.
42 * The %PackageInfo class provides the information of a package.
45 class _OSP_EXPORT_ PackageInfo
46 : public Tizen::Base::Object
50 * This destructor overrides Tizen::Base::Object::~Object().
54 virtual ~PackageInfo(void);
61 * @return A package ID
63 PackageId GetId(void) const;
66 * Gets the version of a package.
70 * @return The version of a package
72 Tizen::Base::String GetVersion(void) const;
75 * Gets the display name of a package.
79 * @return The display name of a package
81 Tizen::Base::String GetDisplayName(void) const;
84 * Gets the description of a package.
88 * @return The description of a package, @n
89 * else an empty string is returned if there is no value
91 Tizen::Base::String GetDescription(void) const;
94 * Gets the author of a package.
98 * @return The author of a package, @n
99 * else an empty string is returned if there is no value
101 Tizen::Base::String GetAuthor(void) const;
104 * Gets the URL of a package.
108 * @return The URL of a package, @n
109 * else an empty string is returned if there is no value
111 Tizen::Base::String GetUrl(void) const;
114 * Gets the date and time when a package is installed.
118 * @return An instance of Tizen::Base::DateTime when a package is installed
120 Tizen::Base::DateTime GetInstallationTime(void) const;
123 * Checks whether a package is installed in the external storage.
127 * @return @c true if a package is installed in the external storage, @n
130 bool IsInstalledInExternalStorage(void) const;
133 * Checks whether it is possible to uninstall a package.
137 * @return @c true if it is possible to uninstall a package, @n
140 bool IsUninstallable(void) const;
143 * Checks whether it is possible to move a package to either internal or external storage.
147 * @return @c true if it is possible to move a package to either internal or external storage, @n
150 bool IsMovable(void) const;
153 * Checks whether a package is downloaded.
157 * @return @c true if a package is downloaded, @n
160 bool IsDownloaded(void) const;
163 * Gets the size of a package.
167 * @return The size of a package
169 long long GetSize(void) const;
172 * Gets the data size of a package.
176 * @return The data size of a package
178 long long GetDataSize(void) const;
181 * Gets the main application ID of a package.
185 * @return The main application ID
187 AppId GetMainAppId(void) const;
190 * Gets the store client package ID that installed the package.
194 * @return The store client package ID
196 PackageId GetStoreClientId(void) const;
199 * Gets the application information list of a package.
203 * @return A pointer to the list of the PackageAppInfo instances
204 * @exception E_SUCCESS The method is successful.
205 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
206 * @remarks The specific error code can be accessed using the GetLastResult() method.
208 Tizen::Base::Collection::IList* GetPackageAppInfoListN(void) const;
211 * Gets the application information with the specific application ID.
215 * @return A pointer to PackageAppInfo
216 * @param[in] appId The application ID
217 * @exception E_SUCCESS The method is successful.
218 * @exception E_INVALID_ARG The specified input parameter is invalid.
219 * @exception E_OBJ_NOT_FOUND The application information is not found.
220 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
221 * @remarks The specific error code can be accessed using the GetLastResult() method.
223 PackageAppInfo* GetPackageAppInfoN(const AppId& appId) const;
226 * Gets the type of a package.
229 * @privlevel platform
230 * @privilege %http://tizen.org/privilege/packagemanager.setting @n
231 * (%http://tizen.org/privilege/packagesetting is deprecated.)
233 * @return The package type
235 PackageType GetType(void) const;
238 * Gets the privilege information list of a package.
242 * @return A pointer to the list of Tizen::Security::PrivilegeInfo instances, @n
243 * else @c null if it fails
244 * @exception E_SUCCESS The method is successful.
245 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
246 * @remarks The specific error code can be accessed using the GetLastResult() method.
248 Tizen::Base::Collection::IList* GetPrivilegeListN(void) const;
252 * This is the default constructor for this class. This default constructor is intentionally
253 declared as private so that only the platform can create an instance.
258 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
260 PackageInfo(const PackageInfo& rhs);
263 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
265 PackageInfo& operator =(const PackageInfo& rhs);
268 class _PackageInfoImpl * __pPackageInfoImpl;
270 friend class _PackageInfoImpl;
271 friend class _PackageManagerImpl;
272 friend class _PackageManagerServer;
276 } } } // Tizen::App::Package
278 #endif // _FAPP_PKG_PACKAGE_INFO_H_