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 XFA_FDE_CSS_CFDE_CSSNUMBERVALUE_H_ 8 #define XFA_FDE_CSS_CFDE_CSSNUMBERVALUE_H_ 9 10 #include "core/fxcrt/fx_system.h" 11 #include "xfa/fde/css/cfde_cssvalue.h" 12 13 enum class FDE_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 CFDE_CSSNumberValue : public CFDE_CSSValue { 27 public: 28 CFDE_CSSNumberValue(FDE_CSSNumberType type, FX_FLOAT value); 29 ~CFDE_CSSNumberValue() override; 30 Value()31 FX_FLOAT Value() const { return value_; } Kind()32 FDE_CSSNumberType Kind() const { return type_; } 33 34 FX_FLOAT Apply(FX_FLOAT percentBase) const; 35 36 private: 37 FDE_CSSNumberType type_; 38 FX_FLOAT value_; 39 }; 40 41 #endif // XFA_FDE_CSS_CFDE_CSSNUMBERVALUE_H_ 42