Upstream version 10.38.210.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / tools / tizen / xwalk_package_installer_helper.h
1 // Copyright (c) 2014 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PACKAGE_INSTALLER_HELPER_H_
6 #define XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PACKAGE_INSTALLER_HELPER_H_
7
8 #include <pkgmgr_installer.h>
9
10 #include <string>
11
12 class PackageInstallerHelper {
13  public:
14   explicit PackageInstallerHelper(const std::string& appid);
15   ~PackageInstallerHelper();
16   bool InitializePkgmgrSignal(int argc, const char** argv);
17
18   bool InstallApplication(const std::string& xmlpath,
19                           const std::string& iconpath);
20   bool UninstallApplication();
21   bool UpdateApplication(const std::string& xmlpath,
22                          const std::string& iconpath);
23   bool ReinstallApplication();
24
25  private:
26   bool InstallApplicationInternal(const std::string& xmlpath,
27                                   const std::string& iconpath);
28   bool UninstallApplicationInternal();
29   bool UpdateApplicationInternal(const std::string& xmlpath,
30                                  const std::string& iconpath);
31
32   bool SendSignal(const std::string& key, const std::string& value);
33
34   pkgmgr_installer* handle_;
35
36   std::string appid_;
37   std::string pkgid_;
38 };
39
40 #endif  // XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PACKAGE_INSTALLER_HELPER_H_