Applied latest source code
[apps/native/preloaded/Installer.git] / InstallerService / inc / InstallerService.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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                InstallerService.h
19  * @brief               This file contains the declaration of InstallerService Class,
20  *                              which provides basic features necessary to define an ServiceApp.
21  */
22
23 #ifndef _INSTALLER_SERVICE_H_
24 #define _INSTALLER_SERVICE_H_
25
26 #include <FApp.h>
27 #include <FBase.h>
28 #include <FLocales.h>
29 #include <FUi.h>
30 #include <FShell.h>
31
32 class InstallerServiceApp
33         : public Tizen::App::ServiceApp
34         , public virtual Tizen::App::IAppControlProviderEventListener
35         , public virtual Tizen::App::Package::IPackageInstallationEventListener
36 {
37 public:
38         InstallerServiceApp(void);
39         virtual ~InstallerServiceApp(void);
40         result Install(const Tizen::Base::String& filePath);
41
42         virtual bool OnAppInitializing(Tizen::App::AppRegistry& appRegistry);
43         virtual bool OnAppInitialized(void);
44         virtual bool OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination = false);
45         virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId,
46                         const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData);
47         virtual void OnPackageInstallationCompleted(const Tizen::App::PackageId& packageId, Tizen::App::Package::PackageInstallationResult installationResult);
48         virtual void OnPackageInstallationInProgress(const Tizen::App::PackageId& packageId, int progress);
49         virtual void OnPackageUninstallationCompleted(const Tizen::App::PackageId& packageId, bool uninstallationResult);
50
51         static Tizen::App::ServiceApp* CreateInstance(void);
52 private:
53         Tizen::App::PackageId __packageId;
54         Tizen::App::Package::PackageInfo* __pInfo;
55         Tizen::Ui::Controls::Label* __pDegreeLabel;
56         Tizen::Ui::Controls::Label* __pCountLabel;
57         Tizen::Ui::Controls::Progress* __pProgress;
58         Tizen::Shell::QuickPanelFrame* __pFrame;
59         Tizen::Base::Collection::ArrayList __filePathList;
60         Tizen::Locales::DateTimeFormatter* __pDateTimeFormatter;
61         int __index;
62 };
63
64 #endif // _INSTALLER_SERVICE_H_