102d7803365338858b9dfb8c5106bb24f547893e
[platform/core/appfw/pkgmgr-info.git] / src / common / parcel / command_parcelable.hh
1 #ifndef COMMAND_PARCELABLE_HH_
2 #define COMMAND_PARCELABLE_HH_
3
4 #include "abstract_parcelable.hh"
5
6 #include <string>
7 #include <vector>
8
9 enum CommandType {
10   Unknown = -1,
11   RemoveCache,
12   UpdatePendingCache
13 };
14
15 namespace pkgmgr_common {
16 namespace parcel {
17
18 #ifndef EXPORT_API
19 #define EXPORT_API __attribute__((visibility("default")))
20 #endif
21
22 class EXPORT_API CommandParcelable : public AbstractParcelable {
23  public:
24   CommandParcelable();
25   CommandParcelable(uid_t uid, CommandType cmd, std::vector<std::string> args);
26   CommandType GetCmd();
27   const std::vector<std::string>& GetArgs();
28   void SetCmd(CommandType cmd);
29   void WriteToParcel(tizen_base::Parcel* parcel) const override;
30   void ReadFromParcel(tizen_base::Parcel* parcel) override;
31
32  private:
33   uid_t uid_;
34   CommandType cmd_;
35   std::vector<std::string> args_;
36 };
37
38 }  // namespace parcel
39 }  // namespace pkgmgr_common
40
41 #endif  // COMMAND_PARCELABLE_HH_