Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cxfa_measurement.h
Go to the documentation of this file.
1// Copyright 2016 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 XFA_FXFA_PARSER_CXFA_MEASUREMENT_H_
8#define XFA_FXFA_PARSER_CXFA_MEASUREMENT_H_
9
10#include "core/fxcrt/widestring.h"
11#include "xfa/fxfa/fxfa_basic.h"
12
14 public:
15 explicit CXFA_Measurement(WideStringView wsMeasure);
17 CXFA_Measurement(float fValue, XFA_Unit eUnit);
18
19 static XFA_Unit GetUnitFromString(WideStringView wsUnit);
20
21 void Set(float fValue, XFA_Unit eUnit) {
22 m_fValue = fValue;
23 m_eUnit = eUnit;
24 }
25
26 XFA_Unit GetUnit() const { return m_eUnit; }
27 float GetValue() const { return m_fValue; }
28
29 WideString ToString() const;
30 float ToUnit(XFA_Unit eUnit) const;
31
32 private:
33 void SetString(WideStringView wsMeasure);
34 bool ToUnitInternal(XFA_Unit eUnit, float* fValue) const;
35
36 float m_fValue = 0.0f;
38};
39
40#endif // XFA_FXFA_PARSER_CXFA_MEASUREMENT_H_
absl::optional< int32_t > GetValue(uint32_t key) const
absl::optional< WideString > GetString(uint32_t key) const
absl::optional< CXFA_Measurement > GetMeasurement(uint32_t key) const
void MergeDataFrom(const CFXJSE_MapModule *pSrc)
void SetValue(uint32_t key, int32_t value)
void SetMeasurement(uint32_t key, const CXFA_Measurement &measurement)
CFXJSE_MapModule & operator=(const CFXJSE_MapModule &that)=delete
void SetString(uint32_t key, const WideString &wsString)
void RemoveKey(uint32_t key)
CFXJSE_MapModule(const CFXJSE_MapModule &that)=delete
bool HasKey(uint32_t key) const
CXFA_Measurement(float fValue, XFA_Unit eUnit)
void Set(float fValue, XFA_Unit eUnit)
float GetValue() const
CXFA_Measurement(WideStringView wsMeasure)
float ToUnit(XFA_Unit eUnit) const
static XFA_Unit GetUnitFromString(WideStringView wsUnit)
WideString ToString() const
XFA_Unit GetUnit() const
XFA_Unit
Definition fxfa_basic.h:91