1 /*
2  * Copyright (c) 2022 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 PRINT_EXTENSION_INFO_H
17 #define PRINT_EXTENSION_INFO_H
18 
19 #include "parcel.h"
20 
21 namespace OHOS::Print {
22 class PrintExtensionInfo final : public Parcelable {
23 public:
24     explicit PrintExtensionInfo();
25     PrintExtensionInfo(const PrintExtensionInfo &right);
26     ~PrintExtensionInfo() = default;
27 
28     PrintExtensionInfo &operator=(const PrintExtensionInfo &right);
29 
30     void SetExtensionId(const std::string &extensionId);
31 
32     void SetVendorId(const std::string &vendorId);
33 
34     void SetVendorName(const std::string &vendorName);
35 
36     void SetVendorIcon(uint32_t vendorIcon);
37 
38     void SetVersion(const std::string &version);
39 
40     [[nodiscard]] const std::string &GetExtensionId() const;
41 
42     [[nodiscard]] const std::string &GetVendorId() const;
43 
44     [[nodiscard]] const std::string &GetVendorName() const;
45 
46     [[nodiscard]] uint32_t GetVendorIcon() const;
47 
48     [[nodiscard]] const std::string &GetVersion() const;
49 
50     virtual bool Marshalling(Parcel &parcel) const override;
51 
52     static std::shared_ptr<PrintExtensionInfo> Unmarshalling(Parcel &parcel);
53 
54     void Dump();
55 
56 private:
57     void ReadFromParcel(Parcel &parcel);
58 
59 private:
60     std::string extensionId_;
61     std::string vendorId_;
62     std::string vendorName_;
63     uint32_t vendorIcon_;
64     std::string version_;
65 };
66 }  // namespace OHOS::Print
67 #endif  // PRINT_EXTENSION_INFO_H
68