3e59eea82eb6875f7c84a6a64a2075160d38834e
[platform/framework/web/crosswalk.git] / src / xwalk / application / tools / tizen / xwalk_pkg_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_PKG_INSTALLER_H_
6 #define XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PKG_INSTALLER_H_
7
8 #if defined(OS_TIZEN)
9 #include <pkgmgr_installer.h>
10 #endif
11
12 #include <string>
13
14 class PkgInstaller {
15  public:
16   explicit PkgInstaller(const std::string& appid);
17   ~PkgInstaller();
18   bool InstallApplication(const std::string& xmlpath,
19                           const std::string& iconpath);
20   bool UninstallApplication();
21
22  private:
23 #if defined(OS_TIZEN)
24   enum RequestType {
25     INSTALL,
26     UNINSTALL
27   };
28   bool ParseManifest(RequestType type, const std::string& xmlpath);
29   bool SendSignal(const std::string& key, const std::string& value);
30
31   pkgmgr_installer* handle_;
32 #endif
33
34   std::string appid_;
35 };
36
37 #endif  // XWALK_APPLICATION_TOOLS_TIZEN_XWALK_PKG_INSTALLER_H_