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_RESOLUTION_H 17 #define PRINT_RESOLUTION_H 18 19 #include <string> 20 #include "parcel.h" 21 22 namespace OHOS::Print { 23 class PrintResolution final : public Parcelable { 24 public: 25 explicit PrintResolution(); 26 27 PrintResolution(const PrintResolution &right); 28 29 PrintResolution &operator=(const PrintResolution &right); 30 31 virtual ~PrintResolution(); 32 33 void Reset(); 34 35 [[nodiscard]] const std::string &GetId() const; 36 37 [[nodiscard]] uint32_t GetHorizontalDpi() const; 38 39 [[nodiscard]] uint32_t GetVerticalDpi() const; 40 41 void SetId(const std::string &id); 42 43 void SetHorizontalDpi(uint32_t hdpi); 44 45 void SetVerticalDpi(uint32_t vdpi); 46 47 virtual bool Marshalling(Parcel &parcel) const override; 48 49 static std::shared_ptr<PrintResolution> Unmarshalling(Parcel &parcel); 50 51 void Dump(); 52 53 private: 54 void ReadFromParcel(Parcel &parcel); 55 56 private: 57 std::string id_; 58 uint32_t horizontalDpi_; 59 uint32_t verticalDpi_; 60 }; 61 } // namespace OHOS::Print 62 #endif // PRINT_RESOLUTION_H 63