Add new steps for trust anchor
[platform/core/appfw/wgt-backend.git] / src / wgt / wgt_app_query_interface.h
1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef WGT_WGT_APP_QUERY_INTERFACE_H_
6 #define WGT_WGT_APP_QUERY_INTERFACE_H_
7
8 #include <common/app_query_interface.h>
9
10 #include <sys/types.h>
11
12 #include <string>
13
14 namespace wgt {
15
16 /**
17  * \brief Helper functionalities used before
18  *        configuring app-installer steps.
19  *        Eg. it is used to check, if package is to be installed or updated
20  */
21 class WgtAppQueryInterface : public common_installer::AppQueryInterface {
22  public:
23   /**
24    * \brief method for checking if package is installed based
25    *        on argv
26    *
27    * \return true if package is installed
28    */
29   bool IsPkgInstalled(const std::string& arg, uid_t uid) override;
30
31   /**
32    * \brief This method is workaround for detecting installation of hybrid
33    *        application.
34    *
35    * \return true if package is hybrid
36    */
37   bool IsHybridApplication(const std::string& arg, uid_t uid);
38
39   /**
40    * \brief method for getting package id from package file
41    *
42    * \return package id
43    */
44   std::string GetPkgId(const std::string& arg) override;
45 };
46
47 }  // namespace wgt
48
49 #endif  // WGT_WGT_APP_QUERY_INTERFACE_H_