Modify Scanner class
[platform/framework/native/appfw.git] / inc / FAppPkgIPackageInstallationEventListener.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        FAppPkgIPackageInstallationEventListener.h
20  * @brief       This is the header file for the %IPackageInstallationEventListener interface.
21  *
22  * This header file contains the declarations of the %IPackageInstallationEventListener interface.
23  */
24
25 #ifndef _FAPP_PKG_IPACKAGE_INSTALLATION_EVENT_LISTENER_H_
26 #define _FAPP_PKG_IPACKAGE_INSTALLATION_EVENT_LISTENER_H_
27
28 #include <FAppPkgPackageManager.h>
29 #include <FBaseRtIEventListener.h>
30
31 namespace Tizen { namespace App { namespace Package
32 {
33 /**
34  * @enum                PackageInstallationResult
35  *
36  * Defines the result of package installation.
37  *
38  * @since       2.0
39  */
40 enum PackageInstallationResult
41 {
42         PACKAGE_INSTALLATION_RESULT_SUCCESS = 0,                                /**< Success */
43         PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE,                    /**< An invalid package */
44         PACKAGE_INSTALLATION_RESULT_STORAGE_FULL,                               /**< The installation target storage is full. */
45 };
46
47 /**
48 * @interface    IPackageInstallationEventListener
49 * @brief                This interface defines a listener for a package installation and uninstallation.
50 *
51 * @since        2.0
52 *
53 * The %IPackageInstallationEventListener interface defines a listener for a package installation and uninstallation.
54 */
55 class _OSP_EXPORT_ IPackageInstallationEventListener
56         : virtual public Tizen::Base::Runtime::IEventListener
57 {
58 public:
59         /**
60          * This polymorphic destructor should be overridden if required.
61          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
62          *
63          * @since       2.0
64          */
65         virtual ~IPackageInstallationEventListener(void) {}
66
67         /**
68          * Called when a package installation is completed. @n
69          * The value of @c installationResult is @c PACKAGE_INSTALLATION_RESULT_SUCCESS if the installation is successful.
70          *
71          * @since       2.0
72          *
73          * @param[in]   packageId                               The package ID
74          * @param[in]   installationResult              The installation result
75          */
76         virtual void OnPackageInstallationCompleted(const PackageId& packageId, PackageInstallationResult installationResult) = 0;
77
78         /**
79          * Called when a package uninstallation is completed. @n
80          * The value of @c uninstallationResult is @c true if the uninstallation is successful, else @c false.
81          *
82          * @since       2.0
83          *
84          * @param[in]   packageId                       The package ID
85          * @param[in]   uninstallationResult            Set to @c true if the uninstallation is successful, @n
86          *                                                                                      else @c false
87          */
88         virtual void OnPackageUninstallationCompleted(const PackageId& packageId, bool uninstallationResult) = 0;
89
90         /**
91          * Called when a package installation is in progress.
92          *
93          * @since       2.0
94          *
95          * @param[in]   packageId                       The package ID
96          * @param[in]   progress                The progress of an installation in percentage
97          */
98         virtual void OnPackageInstallationInProgress(const PackageId& packageId, int progress) = 0;
99
100
101 protected:
102         //
103         // This method is for internal use only.
104         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
105         //
106         // This method is reserved and may change its name at any time without prior notice.
107         //
108         // @since       2.0
109         //
110         virtual void IPackageInstallationEventListener_Reserved1(void) {}
111
112         //
113         // This method is for internal use only.
114         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
115         //
116         // This method is reserved and may change its name at any time without prior notice.
117         //
118         // @since       2.0
119         //
120         virtual void IPackageInstallationEventListener_Reserved2(void) {}
121
122         //
123         // This method is for internal use only.
124         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
125         //
126         // This method is reserved and may change its name at any time without prior notice.
127         //
128         // @since       2.0
129         //
130         virtual void IPackageInstallationEventListener_Reserved3(void) {}
131
132 }; // IPackageInstallationEventListener
133
134 } } } // Tizen::App::Package
135
136 #endif // _FAPP_PKG_IPACKAGE_INSTALLATION_EVENT_LISTENER_H_