Files
core/OOXML/XlsxFormat/Worksheets/Sparkline.h
2026-05-19 16:46:09 +03:00

182 lines
6.0 KiB
C++

/*
* 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 "../Chart/ChartSerialize.h"
#include "../Styles/rPr.h"
namespace SimpleTypes
{
namespace Spreadsheet
{
class ST_SparklineType;
class ST_SparklineAxisMinMax;
}
}
namespace OOX
{
namespace Spreadsheet
{
class CSparkline : public WritingElement
{
public:
WritingElement_AdditionMethods(CSparkline)
WritingElement_XlsbConstructors(CSparkline)
CSparkline();
virtual ~CSparkline();
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(XLS::BaseObjectPtr& obj);
XLS::BaseObjectPtr toBin();
virtual EElementType getType () const;
private:
void ReadAttributes(XLS::BaseObjectPtr& obj);
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
nullable<std::wstring> m_oRef;
nullable<std::wstring> m_oSqRef;
};
class CSparklines : public WritingElementWithChilds<CSparkline>
{
public:
WritingElement_AdditionMethods(CSparklines)
WritingElement_XlsbConstructors(CSparklines)
CSparklines();
virtual ~CSparklines();
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(XLS::BaseObjectPtr& obj);
std::vector<XLS::BaseObjectPtr> toBin();
virtual EElementType getType () const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
};
class CSparklineGroup : public WritingElement
{
public:
WritingElement_AdditionMethods(CSparklineGroup)
WritingElement_XlsbConstructors(CSparklineGroup)
CSparklineGroup();
virtual ~CSparklineGroup();
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(XLS::BaseObjectPtr& obj);
XLS::BaseObjectPtr toBin();
virtual EElementType getType () const;
private:
void ReadAttributes(XLS::BaseObjectPtr& obj);
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
nullable<SimpleTypes::CDouble> m_oManualMax;
nullable<SimpleTypes::CDouble> m_oManualMin;
nullable<SimpleTypes::CDouble> m_oLineWeight;
nullable<SimpleTypes::Spreadsheet::ST_SparklineType> m_oType;
nullable<SimpleTypes::COnOff> m_oDateAxis;
nullable<OOX::Spreadsheet::ST_DispBlanksAs> m_oDisplayEmptyCellsAs;
nullable<SimpleTypes::COnOff> m_oMarkers;
nullable<SimpleTypes::COnOff> m_oHigh;
nullable<SimpleTypes::COnOff> m_oLow;
nullable<SimpleTypes::COnOff> m_oFirst;
nullable<SimpleTypes::COnOff> m_oLast;
nullable<SimpleTypes::COnOff> m_oNegative;
nullable<SimpleTypes::COnOff> m_oDisplayXAxis;
nullable<SimpleTypes::COnOff> m_oDisplayHidden;
nullable<SimpleTypes::Spreadsheet::ST_SparklineAxisMinMax> m_oMinAxisType;
nullable<SimpleTypes::Spreadsheet::ST_SparklineAxisMinMax> m_oMaxAxisType;
nullable<SimpleTypes::COnOff> m_oRightToLeft;
nullable<OOX::Spreadsheet::CColor> m_oColorSeries;
nullable<OOX::Spreadsheet::CColor> m_oColorNegative;
nullable<OOX::Spreadsheet::CColor> m_oColorAxis;
nullable<OOX::Spreadsheet::CColor> m_oColorMarkers;
nullable<OOX::Spreadsheet::CColor> m_oColorFirst;
nullable<OOX::Spreadsheet::CColor> m_oColorLast;
nullable<OOX::Spreadsheet::CColor> m_oColorHigh;
nullable<OOX::Spreadsheet::CColor> m_oColorLow;
nullable<std::wstring> m_oRef;
nullable<CSparklines> m_oSparklines;
nullable<SimpleTypes::CGuid> m_oUId;
};
class CSparklineGroups : public WritingElementWithChilds<CSparklineGroup>
{
public:
WritingElement_AdditionMethods(CSparklineGroups)
WritingElement_XlsbConstructors(CSparklineGroups)
CSparklineGroups();
virtual ~CSparklineGroups();
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(XLS::BaseObjectPtr& obj);
XLS::BaseObjectPtr toBin();
virtual EElementType getType () const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
};
} //Spreadsheet
} // namespace OOX