1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
5 #ifndef COMMON_PKGMGR_SIGNAL_H_
6 #define COMMON_PKGMGR_SIGNAL_H_
8 #include <pkgmgr_installer.h>
13 #include "common/request.h"
14 #include "common/step/step.h"
15 #include "common/utils/macros.h"
17 namespace common_installer {
20 // Utility for sending signal to pkgmgr
29 explicit PkgmgrSignal(pkgmgr_installer* pi, RequestType req_type);
32 const std::string& type = std::string(),
33 const std::string& pkgid = std::string());
34 bool SendProgress(int progress,
35 const std::string& type = std::string(),
36 const std::string& pkgid = std::string());
39 const std::string& type = std::string(),
40 const std::string& pkgid = std::string());
41 bool IsFinished() const;
43 State state() const { return state_; }
49 const std::string& type = std::string(),
50 const std::string& pkgid = std::string()) const;
51 const char* GetResultKey(Step::Status result) const;
52 bool SendAppids(const std::string& type, const std::string& pkgid) const;
54 pkgmgr_installer* pi_;
56 RequestType request_type_;
58 DISALLOW_COPY_AND_ASSIGN(PkgmgrSignal);
61 } // namespace common_installer
63 #endif // COMMON_PKGMGR_SIGNAL_H_