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 FAppPkgIPackageInstallationEventListener.h
19 * @brief This is the header file for the %IPackageInstallationEventListener interface.
21 * This header file contains the declarations of the %IPackageInstallationEventListener interface.
24 #ifndef _FAPP_PKG_IPACKAGE_INSTALLATION_EVENT_LISTENER_H_
25 #define _FAPP_PKG_IPACKAGE_INSTALLATION_EVENT_LISTENER_H_
27 #include <FAppPkgPackageManager.h>
28 #include <FBaseRtIEventListener.h>
30 namespace Tizen { namespace App { namespace Package
33 * @enum PackageInstallationResult
35 * Defines the result of package installation.
39 enum PackageInstallationResult
41 PACKAGE_INSTALLATION_RESULT_SUCCESS = 0, /**< Success */
42 PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE, /**< An invalid package */
43 PACKAGE_INSTALLATION_RESULT_STORAGE_FULL, /**< The installation target storage is full. */
47 * @interface IPackageInstallationEventListener
48 * @brief This interface defines a listener for a package installation and uninstallation.
52 * The %IPackageInstallationEventListener interface defines a listener that is notified for events related to installation or uninstallation of packages on a device.
53 * The events include installation completion, uninstallation completion, and installation progress.
54 * This listener is registered with the PackageManager::AddPackageInstallationEventListener() method and unregistered with the PackageManager::RemovePackageInstallationEventListener() method.
55 * Generally, this listener is used in system applications such as application service that utilizes packages' (un)installation information in a system.
57 class _OSP_EXPORT_ IPackageInstallationEventListener
58 : virtual public Tizen::Base::Runtime::IEventListener
62 * This polymorphic destructor should be overridden if required.
63 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
67 virtual ~IPackageInstallationEventListener(void) {}
70 * Called when a package installation is completed. @n
71 * The value of @c installationResult is @c PACKAGE_INSTALLATION_RESULT_SUCCESS if the installation is successful.
75 * @param[in] packageId The package ID
76 * @param[in] installationResult The installation result
78 virtual void OnPackageInstallationCompleted(const PackageId& packageId, PackageInstallationResult installationResult) = 0;
81 * Called when a package uninstallation is completed. @n
82 * The value of @c uninstallationResult is @c true if the uninstallation is successful, else @c false.
86 * @param[in] packageId The package ID
87 * @param[in] uninstallationResult Set to @c true if the uninstallation is successful, @n
90 virtual void OnPackageUninstallationCompleted(const PackageId& packageId, bool uninstallationResult) = 0;
93 * Called when a package installation is in progress.
97 * @param[in] packageId The package ID
98 * @param[in] progress The progress of an installation in percentage
100 virtual void OnPackageInstallationInProgress(const PackageId& packageId, int progress) = 0;
105 // This method is for internal use only.
106 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
108 // This method is reserved and may change its name at any time without prior notice.
112 virtual void IPackageInstallationEventListener_Reserved1(void) {}
115 // This method is for internal use only.
116 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
118 // This method is reserved and may change its name at any time without prior notice.
122 virtual void IPackageInstallationEventListener_Reserved2(void) {}
125 // This method is for internal use only.
126 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
128 // This method is reserved and may change its name at any time without prior notice.
132 virtual void IPackageInstallationEventListener_Reserved3(void) {}
134 }; // IPackageInstallationEventListener
136 } } } // Tizen::App::Package
138 #endif // _FAPP_PKG_IPACKAGE_INSTALLATION_EVENT_LISTENER_H_