Upstream version 10.38.212.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / tools / tizen / xwalk_platform_installer.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_PLATFORM_INSTALLER_H_
6 #define XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PLATFORM_INSTALLER_H_
7
8 #include <pkgmgr_installer.h>
9
10 #include <string>
11
12 #include "base/files/file_path.h"
13
14 class PlatformInstaller {
15  public:
16   PlatformInstaller();
17   explicit PlatformInstaller(const std::string& appid);
18   ~PlatformInstaller();
19   bool InitializePkgmgrSignal(int argc, const char** argv);
20
21   bool InstallApplication(const base::FilePath& xmlpath,
22                           const base::FilePath& iconpath);
23   bool UninstallApplication();
24   bool UpdateApplication(const base::FilePath& xmlpath,
25                          const base::FilePath& iconpath);
26   bool ReinstallApplication();
27
28  private:
29   bool InstallApplicationInternal(const base::FilePath& xmlpath,
30                                   const base::FilePath& iconpath);
31   bool UninstallApplicationInternal();
32   bool UpdateApplicationInternal(const base::FilePath& xmlpath,
33                                  const base::FilePath& iconpath);
34
35   bool SendSignal(const std::string& key, const std::string& value);
36
37   pkgmgr_installer* handle_;
38
39   std::string appid_;
40   std::string pkgid_;
41 };
42
43 #endif  // XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PLATFORM_INSTALLER_H_