f89e76188ed33574c2f3a31af0d37307a48018e5
[platform/core/appfw/pkgmgr-info.git] / src / client / pkginfo_client.hh
1 // Copyright (c) 2021 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 CLIENT_PKGINFO_CLIENT_HH_
6 #define CLIENT_PKGINFO_CLIENT_HH_
7
8 #include "abstract_parcelable.hh"
9 #include "client_socket.hh"
10 #include "request_type.hh"
11
12 #include <string>
13
14 namespace pkgmgr_client {
15
16 class PkgInfoClient {
17  public:
18   PkgInfoClient(std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> parcel,
19       uid_t uid, pkgmgr_common::ReqType req_type);
20   bool SendRequest();
21   std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> GetResultParcel();
22
23  private:
24   bool RequestHandlerDirectAccess();
25
26   std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> parcel_;
27   std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> result_parcel_;
28   std::unique_ptr<pkgmgr_common::socket::ClientSocket> socket_;
29   uid_t uid_;
30   pkgmgr_common::ReqType req_type_;
31   bool is_offline_;
32 };
33
34 }  // namespace pkgmgr_client
35
36 #endif  // CLIENT_PKGINFO_CLIENT_HH_