Revert "Revert "Fix intApp TC failure""
[platform/framework/native/appfw.git] / inc / FAppPkgPackageInfo.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file        FAppPkgPackageInfo.h
19  * @brief       This is the header file for the %PackageInfo class.
20  *
21  * This header file contains the declarations of the %PackageInfo class.
22  */
23
24 #ifndef _FAPP_PKG_PACKAGE_INFO_H_
25 #define _FAPP_PKG_PACKAGE_INFO_H_
26
27 #include <FBase.h>
28 #include <FAppTypes.h>
29 #include <FAppPkgPackageManager.h>
30
31 namespace Tizen { namespace App { namespace Package
32 {
33
34 /**
35  * @class               PackageInfo
36  * @brief               This class represents the information of a package.
37  *
38  * @since       2.0
39  *
40  * @final               This class is not intended for extension.
41  *
42  * The %PackageInfo class provides the information of a package.
43  *
44  */
45 class _OSP_EXPORT_ PackageInfo
46         : public Tizen::Base::Object
47 {
48 public:
49         /**
50          * This destructor overrides Tizen::Base::Object::~Object().
51          *
52          * @since       2.0
53          */
54         virtual ~PackageInfo(void);
55
56         /**
57          * Gets the package ID.
58          *
59          * @since       2.0
60          *
61          * @return      The package ID
62          */
63         PackageId GetId(void) const;
64
65         /**
66          * Gets the version of a package.
67          *
68          * @since       2.0
69          *
70          * @return      The version of the package
71          */
72         Tizen::Base::String GetVersion(void) const;
73
74         /**
75          * Gets the display name of a package.
76          *
77          * @since       2.0
78          *
79          * @return      The display name of the package
80          */
81         Tizen::Base::String GetDisplayName(void) const;
82
83         /**
84          * Gets the description of a package.
85          *
86          * @since       2.0
87          *
88          * @return      The description of the package, @n
89          *          else an empty string is returned if there is no value
90          */
91         Tizen::Base::String GetDescription(void) const;
92
93         /**
94          * Gets the author of a package.
95          *
96          * @since       2.0
97          *
98          * @return      The author of the package, @n
99          *          else an empty string is returned if there is no value
100          */
101         Tizen::Base::String GetAuthor(void) const;
102
103         /**
104          * Gets the URL of a package.
105          *
106          * @since       2.0
107          *
108          * @return      The URL of the package, @n
109          *          else an empty string is returned if there is no value
110          */
111         Tizen::Base::String GetUrl(void) const;
112
113         /**
114          * Gets the date and the time when a package is installed.
115          *
116          * @since       2.0
117          *
118          * @return      An instance of Tizen::Base::DateTime which contains the package installation details
119          */
120         Tizen::Base::DateTime GetInstallationTime(void) const;
121
122         /**
123          * Checks if a package is installed in the external storage.
124          *
125          * @since       2.0
126          *
127          * @return      @c true if the package is installed in the external storage, @n
128          *                      else @c false
129          */
130         bool IsInstalledInExternalStorage(void) const;
131
132         /**
133          * Checks if it is possible to uninstall a package.
134          *
135          * @since       2.0
136          *
137          * @return      @c true if it is possible to uninstall the package, @n
138          *                      else @c false
139          */
140         bool IsUninstallable(void) const;
141
142         /**
143          * Checks if it is possible to move a package to either the internal or the external storage.
144          *
145          * @since       2.0
146          *
147          * @return      @c true if it is possible to move the package to either the internal or the external storage, @n
148          *                      else @c false
149          */
150         bool IsMovable(void) const;
151
152         /**
153          * Checks if a package is downloaded.
154          *
155          * @since       2.0
156          *
157          * @return      @c true if the package is downloaded, @n
158          *                      else @c false
159          */
160         bool IsDownloaded(void) const;
161
162         /**
163          * Gets the size of a package.
164          *
165          * @since       2.0
166          *
167          * @return      The size of the package
168          */
169         long long GetSize(void) const;
170
171         /**
172          * Gets the data size of a package.
173          *
174          * @since       2.0
175          *
176          * @return      The data size of the package
177          */
178         long long GetDataSize(void) const;
179
180         /**
181          * Gets the main application ID of a package.
182          *
183          * @since       2.0
184          *
185          * @return The main application ID
186          */
187         AppId GetMainAppId(void) const;
188
189         /**
190          * Gets the store client package ID that installed the package.
191          *
192          * @since       2.0
193          *
194          * @return The store client package ID
195          */
196         PackageId GetStoreClientId(void) const;
197
198         /**
199          * Gets the application information list of a package.
200          *
201          * @since       2.0
202          *
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.
207          */
208         Tizen::Base::Collection::IList* GetPackageAppInfoListN(void) const;
209
210         /**
211          * Gets the application information with the specific application ID.
212          *
213          * @since       2.0
214          *
215          * @return              A pointer to the PackageAppInfo instance
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 has not been 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.
222          */
223         PackageAppInfo* GetPackageAppInfoN(const AppId& appId) const;
224
225         /**
226          * Gets the type of a package.
227          *
228          * @since               2.0
229          * @privlevel   platform
230          * @privilege   %http://tizen.org/privilege/packagemanager.setting @n
231          *              (%http://tizen.org/privilege/packagesetting is deprecated.)
232          *
233          * @return              The package type
234          */
235         PackageType GetType(void) const;
236
237         /**
238         * Gets the privilege information list of a package.
239         *
240         * @since         2.1
241         *
242         * @return        A pointer to the list of the 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.
247         */
248         Tizen::Base::Collection::IList* GetPrivilegeListN(void) const;
249
250 private:
251         /**
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.
254          */
255         PackageInfo(void);
256
257         /**
258          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
259          */
260         PackageInfo(const PackageInfo& rhs);
261
262         /**
263          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
264          */
265         PackageInfo& operator =(const PackageInfo& rhs);
266
267 private:
268         class _PackageInfoImpl * __pPackageInfoImpl;
269
270         friend class _PackageInfoImpl;
271         friend class _PackageManagerImpl;
272         friend class _PackageManagerServer;
273
274 }; // PackageInfo
275
276 } } } // Tizen::App::Package
277
278 #endif // _FAPP_PKG_PACKAGE_INFO_H_