• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef BOOMERANG_PARAMS_H
17 #define BOOMERANG_PARAMS_H
18 
19 #include "intention_identity.h"
20 #include "boomerang_callback.h"
21 
22 namespace OHOS {
23 namespace Msdp {
24 namespace DeviceStatus {
25 enum BoomerangRequestID : uint32_t {
26     ADD_BOOMERAMG_LISTENER,
27     REMOVE_BOOMERAMG_LISTENER,
28     NOTIFY_METADATA,
29     SUBMIT_METADATA,
30     ENCODE_IMAGE,
31     DECODE_IMAGE,
32 };
33 
34 struct SubscribeBoomerangParam final : public ParamBase {
35     SubscribeBoomerangParam() = default;
36     SubscribeBoomerangParam(BoomerangType type, std::string bundleName, sptr<IRemoteBoomerangCallback> callback);
37 
38     bool Marshalling(MessageParcel &parcel) const override;
39     bool Unmarshalling(MessageParcel &parcel) override;
40 
41     BoomerangType type_;
42     std::string bundleName_;
43     sptr<IRemoteBoomerangCallback> callback_;
44 };
45 
46 struct NotifyMetadataParam final : public ParamBase {
47     NotifyMetadataParam() = default;
48     NotifyMetadataParam(std::string bundleName, sptr<IRemoteBoomerangCallback> callback);
49 
50     bool Marshalling(MessageParcel &parcel) const override;
51     bool Unmarshalling(MessageParcel &parcel) override;
52 
53     std::string bundleName_;
54     sptr<IRemoteBoomerangCallback> callback_;
55 };
56 
57 struct MetadataParam final : public ParamBase {
58     MetadataParam() = default;
59     MetadataParam(std::string metadata);
60 
61     bool Marshalling(MessageParcel &parcel) const override;
62     bool Unmarshalling(MessageParcel &parcel) override;
63 
64     std::string metadata_;
65 };
66 
67 struct EncodeImageParam final : public ParamBase {
68     EncodeImageParam() = default;
69     EncodeImageParam(std::shared_ptr<Media::PixelMap> pixelMap, std::string matedata,
70         sptr<IRemoteBoomerangCallback> callback);
71 
72     bool Marshalling(MessageParcel &parcel) const override;
73     bool Unmarshalling(MessageParcel &parcel) override;
74 
75     std::shared_ptr<Media::PixelMap> pixelMap_;
76     std::string metadata_;
77     sptr<IRemoteBoomerangCallback> callback_;
78 };
79 
80 struct DecodeImageParam final : public ParamBase {
81     DecodeImageParam() = default;
82     DecodeImageParam(std::shared_ptr<Media::PixelMap> pixelMap, sptr<IRemoteBoomerangCallback> callback);
83 
84     bool Marshalling(MessageParcel &parcel) const override;
85     bool Unmarshalling(MessageParcel &parcel) override;
86 
87     std::shared_ptr<Media::PixelMap> pixelMap_;
88     sptr<IRemoteBoomerangCallback> callback_;
89 };
90 
91 using UnsubscribeBoomerangParam = SubscribeBoomerangParam;
92 } // namespace DeviceStatus
93 } // namespace Msdp
94 } // namespace OHOS
95 #endif // BOOMERANG_PARAMS_H