1 // Copyright 2017 PDFium Authors. All rights reserved. 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 #include "core/fxcrt/fx_system.h" 12 13 enum class CFX_CSSNumberType { 14 Number, 15 Percent, 16 EMS, 17 EXS, 18 Pixels, 19 CentiMeters, 20 MilliMeters, 21 Inches, 22 Points, 23 Picas, 24 }; 25 26 class CFX_CSSNumberValue : public CFX_CSSValue { 27 public: 28 CFX_CSSNumberValue(CFX_CSSNumberType type, float value); 29 ~CFX_CSSNumberValue() override; 30 Value()31 float Value() const { return value_; } Kind()32 CFX_CSSNumberType Kind() const { return type_; } 33 34 float Apply(float percentBase) const; 35 36 private: 37 CFX_CSSNumberType type_; 38 float value_; 39 }; 40 41 #endif // CORE_FXCRT_CSS_CFX_CSSNUMBERVALUE_H_ 42