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 SCAN_RANGE_H 17 #define SCAN_RANGE_H 18 19 #include <vector> 20 #include "parcel.h" 21 22 namespace OHOS::Scan { 23 class ScanRange final : public Parcelable { 24 public: 25 explicit ScanRange(); 26 27 ScanRange(const ScanRange &right); 28 29 ScanRange &operator=(const ScanRange &right); 30 31 virtual ~ScanRange(); 32 33 void Reset(); 34 35 void SetMinValue(const int32_t &minValue); 36 37 void SetMaxValue(const int32_t &maxValue); 38 39 void SetQuantValue(const int32_t &quantValue); 40 41 [[nodiscard]] int32_t GetMinValue() const; 42 43 [[nodiscard]] int32_t GetMaxValue() const; 44 45 [[nodiscard]] int32_t GetQuantValue() const; 46 47 virtual bool Marshalling(Parcel &parcel) const override; 48 49 static std::shared_ptr<ScanRange> Unmarshalling(Parcel &parcel); 50 51 void Dump(); 52 53 private: 54 void ReadFromParcel(Parcel &parcel); 55 56 private: 57 int32_t minValue_; 58 59 int32_t maxValue_; 60 61 int32_t quantValue_; 62 }; 63 } // namespace OHOS::Scan 64 #endif // SCAN_RANGE_H 65