/* * Copyright (C) Ascensio System SIA, 2009-2026 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation, together with the * additional terms provided in the LICENSE file. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA by email at info@onlyoffice.com * or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga, * LV-1050, Latvia, European Union. * * The interactive user interfaces in modified versions of the Program * are required to display Appropriate Legal Notices in accordance with * Section 5 of the GNU AGPL version 3. * * No trademark rights are granted under this License. * * All non-code elements of the Product, including illustrations, * icon sets, and technical writing content, are licensed under the * Creative Commons Attribution-ShareAlike 4.0 International License: * https://creativecommons.org/licenses/by-sa/4.0/legalcode * * This license applies only to such non-code elements and does not * modify or replace the licensing terms applicable to the Program's * source code, which remains licensed under the GNU Affero General * Public License v3. * * SPDX-License-Identifier: AGPL-3.0-only */ #pragma once #include "Base.h" #include "../../DesktopEditor/common/Types.h" double Cm_To_Mm(const double &dValue); double Cm_To_Pt(const double &dValue); double Cm_To_Px(const double &dValue); double Cm_To_Inch(const double &dValue); double Cm_To_Dx(const double &dValue); double Cm_To_Sx(const double &dValue); double Cm_To_Multi(const double &dValue); double Cm_To_Emu(const double &dValue); double Mm_To_Cm(const double &dValue); double Mm_To_Pt(const double &dValue); double Mm_To_Px(const double &dValue); double Mm_To_Inch(const double &dValue); double Mm_To_Dx(const double &dValue); double Mm_To_Sx(const double &dValue); double Mm_To_Multi(const double &dValue); double Mm_To_Emu(const double &dValue); double Pt_To_Cm(const double &dValue); double Pt_To_Mm(const double &dValue); double Pt_To_Px(const double &dValue); double Pt_To_Inch(const double &dValue); double Pt_To_Dx(const double &dValue); double Pt_To_Sx(const double &dValue); double Pt_To_Multi(const double &dValue); double Pt_To_Emu(const double &dValue); double Px_To_Cm(const double &dValue); double Px_To_Mm(const double &dValue); double Px_To_Pt(const double &dValue); double Px_To_Inch(const double &dValue); double Px_To_Dx(const double &dValue); double Px_To_Sx(const double &dValue); double Px_To_Multi(const double &dValue); double Px_To_Emu(const double &dValue); double Inch_To_Cm(const double &dValue); double Inch_To_Mm(const double &dValue); double Inch_To_Pt(const double &dValue); double Inch_To_Px(const double &dValue); double Inch_To_Dx(const double &dValue); double Inch_To_Sx(const double &dValue); double Inch_To_Multi(const double &dValue); double Inch_To_Emu(const double &dValue); double Dx_To_Cm(const double &dValue); double Dx_To_Mm(const double &dValue); double Dx_To_Pt(const double &dValue); double Dx_To_Px(const double &dValue); double Dx_To_Inch(const double &dValue); double Dx_To_Sx(const double &dValue); double Dx_To_Multi(const double &dValue); double Dx_To_Emu(const double &dValue); double Sx_To_Cm(const double &dValue); double Sx_To_Mm(const double &dValue); double Sx_To_Pt(const double &dValue); double Sx_To_Px(const double &dValue); double Sx_To_Inch(const double &dValue); double Sx_To_Dx(const double &dValue); double Sx_To_Multi(const double &dValue); double Sx_To_Emu(const double &dValue); double Multi_To_Cm(const double &dValue); double Multi_To_Mm(const double &dValue); double Multi_To_Pt(const double &dValue); double Multi_To_Px(const double &dValue); double Multi_To_Inch(const double &dValue); double Multi_To_Sx(const double &dValue); double Multi_To_Dx(const double &dValue); double Multi_To_Emu(const double &dValue); double Emu_To_Cm(const double &dValue); double Emu_To_Mm(const double &dValue); double Emu_To_Pt(const double &dValue); double Emu_To_Twips(const double &dValue); double Emu_To_Px(const double &dValue); double Emu_To_Inch(const double &dValue); double Emu_To_Sx(const double &dValue); double Emu_To_Dx(const double &dValue); double Emu_To_Multi(const double &dValue); namespace XmlUtils { int GetDigit(wchar_t c); int GetDigit(char c); bool IsDigit(wchar_t c); _INT64 GetHex(const std::wstring& string); _INT64 GetHex (const std::string& string); int GetColorBGR(const std::wstring& string); std::wstring GetLower(const std::wstring& string); std::wstring GetUpper(const std::wstring& string); void replace_all(std::wstring& subject, const std::wstring& search, const std::wstring& replace); void replace_all(std::string& subject, const std::string& search, const std::string& replace); bool GetBoolean(const std::wstring& string); bool GetBoolean2(const std::wstring& string); _INT64 GetInteger64(const std::wstring& string); int GetInteger(const std::wstring& string); unsigned int GetUInteger(const std::wstring& string); double GetDouble(const std::wstring& string); float GetFloat(const std::wstring& string); std::wstring ToString(const bool& value); std::wstring ToString(const float& value); std::wstring ToString(const double& value); std::wstring ToString(const int& value); std::wstring ToString(const long& value); std::wstring ToString(const unsigned long& value); std::wstring ToString(BYTE value, const wchar_t* format); std::string ToString(BYTE value, const char* format); std::wstring ToString(_INT16 value, const wchar_t* format); std::string ToString(_INT16 value, const char* format); std::wstring ToString(_UINT16 value, const wchar_t* format); std::string ToString(_UINT16 value, const char* format); std::wstring ToString(_INT64 value, const wchar_t* format); std::string ToString(_INT64 value, const char* format); std::wstring ToString(_UINT64 value, const wchar_t* format); std::string ToString(_UINT64 value, const char* format); std::wstring ToString(_INT32 value, const wchar_t* format); std::string ToString(_INT32 value, const char* format); std::wstring ToString(_UINT32 value, const wchar_t* format); std::string ToString(_UINT32 value, const char* format); std::wstring ToString(double value, const wchar_t* format); std::string ToString(double value, const char* format); int Rand(); int GenerateInt(); std::wstring GenerateGuid(); std::wstring DoubleToString(double value, wchar_t* format); std::wstring EncodeXmlString(const std::wstring& data, bool bDeleteNoUnicode = true); std::wstring DeleteNonUnicode(const std::wstring& data); std::wstring EncodeXmlStringExtend(const std::wstring& data, bool bDeleteNoUnicode = true); }