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