2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FAppPkgPackageInfo.h
20 * @brief This is the header file for the %PackageInfo class.
22 * This header file contains the declarations of the %PackageInfo class.
25 #ifndef _FAPP_PKG_PACKAGE_INFO_H_
26 #define _FAPP_PKG_PACKAGE_INFO_H_
29 #include <FAppTypes.h>
30 #include <FAppPkgPackageManager.h>
32 namespace Tizen { namespace App { namespace Package
37 * @brief This class represents the information of a package.
41 * @final This class is not intended for extension.
43 * The %PackageInfo class provides the information of a package.
46 class _OSP_EXPORT_ PackageInfo
47 : public Tizen::Base::Object
51 * This destructor overrides Tizen::Base::Object::~Object().
55 virtual ~PackageInfo(void);
62 * @return A package ID
64 PackageId GetId(void) const;
67 * Gets the version of a package.
71 * @return The version of a package
73 Tizen::Base::String GetVersion(void) const;
76 * Gets the display name of a package.
80 * @return The display name of a package
82 Tizen::Base::String GetDisplayName(void) const;
85 * Gets the description of a package.
89 * @return The description of a package, @n
90 * else an empty string is returned if there is no value
92 Tizen::Base::String GetDescription(void) const;
95 * Gets the author of a package.
99 * @return The author of a package, @n
100 * else an empty string is returned if there is no value
102 Tizen::Base::String GetAuthor(void) const;
105 * Gets the URL of a package.
109 * @return The URL of a package, @n
110 * else an empty string is returned if there is no value
112 Tizen::Base::String GetUrl(void) const;
115 * Gets the date and time when a package is installed.
119 * @return An instance of Tizen::Base::DateTime when a package is installed
121 Tizen::Base::DateTime GetInstallationTime(void) const;
124 * Checks whether a package is installed in the external storage.
128 * @return @c true if a package is installed in the external storage, @n
131 bool IsInstalledInExternalStorage(void) const;
134 * Checks whether it is possible to uninstall a package.
138 * @return @c true if it is possible to uninstall a package, @n
141 bool IsUninstallable(void) const;
144 * Checks whether it is possible to move a package to either internal or external storage.
148 * @return @c true if it is possible to move a package to either internal or external storage, @n
151 bool IsMovable(void) const;
154 * Checks whether a package is downloaded.
158 * @return @c true if a package is downloaded, @n
161 bool IsDownloaded(void) const;
164 * Gets the size of a package.
168 * @return The size of a package
170 long long GetSize(void) const;
173 * Gets the data size of a package.
177 * @return The data size of a package
179 long long GetDataSize(void) const;
182 * Gets the main application ID of a package.
186 * @return The main application ID
188 AppId GetMainAppId(void) const;
191 * Gets the store client package ID that installed the package.
195 * @return The store client package ID
197 PackageId GetStoreClientId(void) const;
200 * Gets the application information list of a package.
204 * @return A pointer to the list of the PackageAppInfo instances
205 * @exception E_SUCCESS The method is successful.
206 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
207 * @remarks The specific error code can be accessed using the GetLastResult() method.
209 Tizen::Base::Collection::IList* GetPackageAppInfoListN(void) const;
212 * Gets the application information with the specific application ID.
216 * @return A pointer to PackageAppInfo
217 * @param[in] appId The application ID
218 * @exception E_SUCCESS The method is successful.
219 * @exception E_INVALID_ARG The specified input parameter is invalid.
220 * @exception E_OBJ_NOT_FOUND The application information is not found.
221 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
222 * @remarks The specific error code can be accessed using the GetLastResult() method.
224 PackageAppInfo* GetPackageAppInfoN(const AppId& appId) const;
227 * Gets the type of a package.
230 * @privlevel platform
231 * @privilege http://tizen.org/privilege/packagesetting
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;
275 } } } // Tizen::App::Package
277 #endif // _FAPP_PKG_PACKAGE_INFO_H_