/* * (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 "../WritingElement.h" #include "../../Base/Nullable.h" #include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_structures/BIFF12/Color.h" namespace NSBinPptxRW { class CBinaryFileReader; class CXlsbBinaryWriter; } namespace SimpleTypes { class COnOff; class CDouble; class CDecimalNumber; class CVerticalAlignRun; class CUnsignedDecimalNumber; namespace Spreadsheet { class CHexColor; class CThemeColor; class CFontCharset; class CFontFamily; class CFontScheme; class CUnderline; } } namespace ComplexTypes { namespace Spreadsheet { class COnOff2; class String; class CDouble; } } namespace OOX { namespace Spreadsheet { class CFont; class CRgbColor : public WritingElement { public: WritingElement_AdditionMethods(CRgbColor) WritingElement_XlsbConstructors(CRgbColor) CRgbColor(); virtual ~CRgbColor(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); void fromBin(XLS::BaseObjectPtr& obj); XLS::BaseObjectPtr toBin(); virtual EElementType getType () const; private: virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oRgb; }; class CIndexedColors : public WritingElementWithChilds { public: WritingElement_AdditionMethods(CIndexedColors) WritingElement_XlsbVectorConstructors(CIndexedColors) CIndexedColors(); virtual ~CIndexedColors(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); void fromBin(std::vector& obj); std::vector toBin(); virtual EElementType getType () const; static bool GetDefaultRGBAByIndex(int index, unsigned char& unR, unsigned char& unG, unsigned char& unB, unsigned char& unA); static int GetDefaultIndexByRGBA( unsigned char unR, unsigned char unG, unsigned char unB, unsigned char unA); std::map mapIndexedColors; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); }; class CColor : public WritingElement { public: WritingElement_AdditionMethods(CColor) WritingElement_XlsbConstructors(CColor) CColor(OOX::Document *pMain = NULL); virtual ~CColor(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; void toXML2(NSStringUtils::CStringBuilder& writer, const std::wstring& sName) const; void toXMLWithNS(NSStringUtils::CStringBuilder& writer, const std::wstring &node_ns, const std::wstring &node_name, const std::wstring &child_ns) const; virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); void fromBin(XLS::BaseObjectPtr& obj); void fromBin(XLS::BaseObject* obj); XLS::BaseObjectPtr toBin(); void toBin(XLS::StreamCacheWriterPtr& writer); XLS::BaseObjectPtr toBin14(); XLSB::Color toColor(); XLSB::Color GetDefaultColor(); virtual EElementType getType () const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); void ReadAttributes(XLS::BaseObjectPtr& obj); void ReadAttributes(XLS::BaseObject* obj); public: nullable m_oAuto; nullable m_oIndexed; nullable m_oRgb; nullable m_oThemeColor; nullable m_oTint; }; class CMruColors : public WritingElementWithChilds { public: WritingElement_AdditionMethods(CMruColors) WritingElement_XlsbVectorConstructors(CMruColors) CMruColors(); virtual ~CMruColors(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); void fromBin(std::vector& obj); std::vector toBin(); virtual EElementType getType () const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); }; class CCharset : public WritingElement { public: WritingElement_AdditionMethods(CCharset) CCharset(OOX::Document *pMain = NULL); virtual ~CCharset(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oCharset; }; class CVerticalAlign : public WritingElement { public: WritingElement_AdditionMethods(CVerticalAlign) CVerticalAlign(OOX::Document *pMain = NULL); virtual ~CVerticalAlign(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oVerticalAlign; }; class CFontFamily : public WritingElement { public: WritingElement_AdditionMethods(CFontFamily) CFontFamily(OOX::Document *pMain = NULL); virtual ~CFontFamily(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oFontFamily; }; class CFontScheme : public WritingElement { public: WritingElement_AdditionMethods(CFontScheme) CFontScheme(); virtual ~CFontScheme(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oFontScheme; }; class CUnderline : public WritingElement { public: WritingElement_AdditionMethods(CUnderline) CUnderline(OOX::Document *pMain = NULL); virtual ~CUnderline(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oUnderline; }; //необработано: class CRPr : public WritingElement { public: WritingElement_AdditionMethods(CRPr) CRPr(OOX::Document *pMain = NULL); virtual ~CRPr(); virtual void fromXML(XmlUtils::CXmlNode& node); virtual std::wstring toXML() const; virtual void toXML(NSStringUtils::CStringBuilder& writer) const; virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); void fromFont(CFont* font); CFont* toFont(); void fromXLSB (NSBinPptxRW::CBinaryFileReader& oStream, _UINT16 nType); void toXLSB (NSBinPptxRW::CXlsbBinaryWriter& oStream) const; _UINT32 getXLSBSize() const; virtual EElementType getType () const; private: void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: nullable m_oBold; nullable m_oCharset; nullable m_oColor; nullable m_oCondense; nullable m_oExtend; nullable m_oFamily; nullable m_oItalic; nullable m_oOutline; nullable m_oRFont; nullable m_oScheme; nullable m_oShadow; nullable m_oStrike; nullable m_oSz; nullable m_oUnderline; nullable m_oVertAlign; ////// nullable m_nFontIndex; }; } //Spreadsheet } // namespace OOX