1 // Copyright 2017 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FXCRT_CSS_CFX_CSSNUMBERVALUE_H_ 8 #define CORE_FXCRT_CSS_CFX_CSSNUMBERVALUE_H_ 9 10 #include "core/fxcrt/css/cfx_cssvalue.h" 11 12 class CFX_CSSNumberValue final : public CFX_CSSValue { 13 public: 14 enum class Unit { 15 kNumber, 16 kPercent, 17 kEMS, 18 kEXS, 19 kPixels, 20 kCentiMeters, 21 kMilliMeters, 22 kInches, 23 kPoints, 24 kPicas, 25 }; 26 27 CFX_CSSNumberValue(Unit unit, float value); 28 ~CFX_CSSNumberValue() override; 29 unit()30 Unit unit() const { return unit_; } value()31 float value() const { return value_; } 32 float Apply(float percentBase) const; 33 34 private: 35 Unit unit_; 36 float value_; 37 }; 38 39 #endif // CORE_FXCRT_CSS_CFX_CSSNUMBERVALUE_H_ 40