/* * (c) Copyright Ascensio System SIA 2010-2023 * * 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. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * 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: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish * street, Riga, Latvia, EU, LV-1050. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #include "File.h" #include "WritingElement.h" #include "Logic/ParagraphProperty.h" #include "Logic/RunProperty.h" #include "Logic/Pict.h" #include "Drawing/Drawing.h" namespace ComplexTypes { namespace Word { //-------------------------------------------------------------------------------- // LvlLegacy 17.9.5 (Part 1) //-------------------------------------------------------------------------------- class CLvlLegacy : public ComplexType { public: ComplexTypes_AdditionConstructors(CLvlLegacy) CLvlLegacy(); virtual ~CLvlLegacy(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oLegacy; nullable m_oLegacyIndent; nullable m_oLegacySpace; }; //-------------------------------------------------------------------------------- // LevelText 17.9.12 (Part 1) //-------------------------------------------------------------------------------- class CLevelText : public ComplexType { public: ComplexTypes_AdditionConstructors(CLevelText) CLevelText(); virtual ~CLevelText(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oNull; nullable_string m_sVal; }; //-------------------------------------------------------------------------------- // LevelSuffix 17.9.29 (Part 1) //-------------------------------------------------------------------------------- class CLevelSuffix : public ComplexType { public: ComplexTypes_AdditionConstructors(CLevelSuffix) CLevelSuffix(); virtual ~CLevelSuffix(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oVal; }; //-------------------------------------------------------------------------------- // MultiLevelType 17.9.13 (Part 1) //-------------------------------------------------------------------------------- class CMultiLevelType : public ComplexType { public: ComplexTypes_AdditionConstructors(CMultiLevelType) CMultiLevelType(); virtual ~CMultiLevelType(); virtual void FromXML(XmlUtils::CXmlNode& oNode); virtual void FromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring ToString() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oVal; }; } // Word } // ComplexTypes namespace OOX { namespace Numbering { //-------------------------------------------------------------------------------- // Lvl 17.9.6 (Part 1) //-------------------------------------------------------------------------------- class CLvl : public WritingElement { public: WritingElement_AdditionMethods(CLvl) CLvl(); virtual ~CLvl(); virtual void fromXML(XmlUtils::CXmlNode& oNode); void ReadElements(XmlUtils::CXmlLiteReader& oReader, int nDepth); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_int m_oIlvl; nullable m_oTentative; nullable m_oTplc; nullable m_oIsLgl; nullable m_oLegacy; nullable m_oLvlJc; nullable m_oLvlPicBulletId; nullable m_oLvlRestart; nullable m_oLvlText; nullable m_oNumFmt; nullable m_oPPr; nullable m_oPStyle; nullable m_oRPr; nullable m_oStart; nullable m_oSuffix; }; //-------------------------------------------------------------------------------- // AbstractNum 17.9.1 (Part 1); listDef element [Word 2003 XML] //-------------------------------------------------------------------------------- class CAbstractNum : public WritingElement { public: WritingElement_AdditionMethods(CAbstractNum) CAbstractNum(); virtual ~CAbstractNum(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; void copy(CAbstractNum* copies); private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_int m_oAbstractNumId; std::vector m_arrLvl; nullable m_oMultiLevelType; nullable m_oName; nullable m_oNsid; nullable m_oNumStyleLink; nullable m_oStyleLink; nullable m_oTmpl; std::map m_mapLvl; //ilvl, index m_arrLvl }; //-------------------------------------------------------------------------------- // NumLvl 17.9.9 (Part 1) //-------------------------------------------------------------------------------- class CNumLvl : public WritingElement { public: WritingElement_AdditionMethods(CNumLvl) CNumLvl(); virtual ~CNumLvl(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_int m_oIlvl; nullable m_oLvl; nullable m_oStartOverride; }; //-------------------------------------------------------------------------------- // Num 17.9.16 (Part 1) //-------------------------------------------------------------------------------- class CNum : public WritingElement { public: WritingElement_AdditionMethods(CNum) CNum(); virtual ~CNum(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_int m_oNumId; nullable m_oAbstractNumId; std::vector m_arrLvlOverride; std::map m_mapLvlOverride; //ilvl, index m_arrLvlOverride }; //-------------------------------------------------------------------------------- // NumPicBullet 17.9.21 (Part 1) //-------------------------------------------------------------------------------- class CNumPicBullet : public WritingElement { public: WritingElement_AdditionMethods(CNumPicBullet) CNumPicBullet(); virtual ~CNumPicBullet(); virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual EElementType getType() const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable_int m_oNumPicBulletId; nullable m_oDrawing; nullable m_oVmlDrawing; }; } // Numbering } // OOX namespace OOX { class CNumbering : public OOX::File, public IFileContainer, public WritingElement { public: CNumbering(OOX::Document *pMain); CNumbering(OOX::Document *pMain, const CPath& oRootPath, const CPath& oPath); CNumbering(XmlUtils::CXmlNode& oNode); CNumbering(XmlUtils::CXmlLiteReader& oReader); virtual ~CNumbering(); const CNumbering& operator =(const XmlUtils::CXmlNode& oNode); const CNumbering& operator =(const XmlUtils::CXmlLiteReader& oReader); virtual void read(const CPath& oFilePath); virtual void read(const CPath& oRootPath, const CPath& oFilePath); virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const; virtual void fromXML(XmlUtils::CXmlNode& oNode); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual const OOX::FileType type() const; virtual const CPath DefaultDirectory() const; virtual const CPath DefaultFileName() const; virtual EElementType getType() const; std::map> m_mapNum; // numId, abstractNumId/index std::map m_mapAbstractNum; //abstractNumId, index m_arrAbstractNum std::vector m_arrAbstractNum; std::vector m_arrNum; nullable m_oNumIdMacAtCleanup; std::vector m_arrNumPicBullet; std::vector> m_mapEmbeddedNames; }; } // namespace OOX