init repo
This commit is contained in:
52
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Ah.h
Normal file
52
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Ah.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_AH_INCLUDE_H_
|
||||
#define PPTX_LOGIC_AH_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class Ah : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
Ah(){}
|
||||
virtual ~Ah(){}
|
||||
virtual CString GetODString()const = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_AH_INCLUDE_H_
|
||||
118
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/AhBase.h
Normal file
118
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/AhBase.h
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_AHBASE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_AHBASE_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "Ah.h"
|
||||
#include "AhXY.h"
|
||||
#include "AhPolar.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class AhBase : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(AhBase)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
CString name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
|
||||
if (name == _T("ahXY"))
|
||||
ah.reset(new Logic::AhXY(node));
|
||||
else if (name == _T("ahPolar"))
|
||||
ah.reset(new Logic::AhPolar(node));
|
||||
else ah.reset();
|
||||
}
|
||||
|
||||
virtual void GetAdjustHandleFrom(XmlUtils::CXmlNode& element)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (element.GetNode(_T("a:ahXY"), oNode))
|
||||
ah.reset(new Logic::AhXY(oNode));
|
||||
else if(element.GetNode(_T("a:ahPolar"), oNode))
|
||||
ah.reset(new Logic::AhPolar(oNode));
|
||||
else ah.reset();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
if (ah.is_init())
|
||||
return ah->toXML();
|
||||
|
||||
return _T("");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if (ah.is_init())
|
||||
ah->toPPTY(pWriter);
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (ah.is_init())
|
||||
ah->toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
template<class T> const bool is() const { return (!ah.IsInit())?false:(typeid(*ah) == typeid(T));}
|
||||
template<class T> T& as() {return static_cast<T&>(*ah);}
|
||||
template<class T> const T& as() const {return static_cast<const T&>(*ah);}
|
||||
|
||||
virtual bool is_init()const{return (ah.is_init());};
|
||||
|
||||
public:
|
||||
smart_ptr<Ah> ah;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
public:
|
||||
virtual void SetParentPointer(const WrapperWritingElement* pParent)
|
||||
{
|
||||
if(is_init())
|
||||
ah->SetParentPointer(pParent);
|
||||
}
|
||||
|
||||
CString GetODString()const
|
||||
{
|
||||
if (!ah.IsInit())
|
||||
return _T("");
|
||||
return ah->GetODString();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_AHBASE_INCLUDE_H_
|
||||
156
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/AhPolar.h
Normal file
156
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/AhPolar.h
Normal file
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_AHPOLAR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_AHPOLAR_INCLUDE_H_
|
||||
|
||||
#include "Ah.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AhPolar : public Ah
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(AhPolar)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNode oPos = node.ReadNode(_T("a:pos"));
|
||||
|
||||
x = oPos.GetAttributeBase(L"x");
|
||||
y = oPos.GetAttributeBase(L"y");
|
||||
|
||||
node.ReadAttributeBase(L"gdRefAng", gdRefAng);
|
||||
node.ReadAttributeBase(L"gdRefR", gdRefR);
|
||||
node.ReadAttributeBase(L"maxAng", maxAng);
|
||||
node.ReadAttributeBase(L"maxR", maxR);
|
||||
node.ReadAttributeBase(L"minAng", minAng);
|
||||
node.ReadAttributeBase(L"minR", minR);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr1;
|
||||
oAttr1.Write(_T("gdRefR"), gdRefR);
|
||||
oAttr1.Write(_T("minR"), minR);
|
||||
oAttr1.Write(_T("maxR"), maxR);
|
||||
oAttr1.Write(_T("gdRefAng"), gdRefAng);
|
||||
oAttr1.Write(_T("minAng"), minAng);
|
||||
oAttr1.Write(_T("maxAng"), maxAng);
|
||||
|
||||
XmlUtils::CAttribute oAttr2;
|
||||
oAttr2.Write(_T("x"), x);
|
||||
oAttr2.Write(_T("y"), y);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:ahPolar"), oAttr1, XmlUtils::CreateNode(_T("a:pos"), oAttr2));
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:ahPolar"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("gdRefR"), gdRefR);
|
||||
pWriter->WriteAttribute(_T("minR"), minR);
|
||||
pWriter->WriteAttribute(_T("maxR"), maxR);
|
||||
pWriter->WriteAttribute(_T("gdRefAng"), gdRefAng);
|
||||
pWriter->WriteAttribute(_T("minAng"), minAng);
|
||||
pWriter->WriteAttribute(_T("maxAng"), maxAng);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(_T("a:pos"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("x"), x);
|
||||
pWriter->WriteAttribute(_T("y"), y);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:pos"));
|
||||
|
||||
pWriter->EndNode(_T("a:ahPolar"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(GEOMETRY_TYPE_AH_POLAR);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, x);
|
||||
pWriter->WriteString1(1, y);
|
||||
|
||||
pWriter->WriteString2(2, gdRefAng);
|
||||
pWriter->WriteString2(3, gdRefR);
|
||||
pWriter->WriteString2(4, maxAng);
|
||||
pWriter->WriteString2(5, maxR);
|
||||
pWriter->WriteString2(6, minAng);
|
||||
pWriter->WriteString2(7, minR);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
CString x;
|
||||
CString y;
|
||||
|
||||
nullable_string gdRefAng;
|
||||
nullable_string gdRefR;
|
||||
nullable_string maxAng;
|
||||
nullable_string maxR;
|
||||
nullable_string minAng;
|
||||
nullable_string minR;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
public:
|
||||
CString GetODString()const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr1;
|
||||
oAttr1.Write(_T("gdRefR"), gdRefR);
|
||||
oAttr1.Write(_T("minR"), minR);
|
||||
oAttr1.Write(_T("maxR"), maxR);
|
||||
oAttr1.Write(_T("gdRefAng"), gdRefAng);
|
||||
oAttr1.Write(_T("minAng"), minAng);
|
||||
oAttr1.Write(_T("maxAng"), maxAng);
|
||||
|
||||
XmlUtils::CAttribute oAttr2;
|
||||
oAttr2.Write(_T("x"), x);
|
||||
oAttr2.Write(_T("y"), y);
|
||||
|
||||
return XmlUtils::CreateNode(_T("ahPolar"), oAttr1, XmlUtils::CreateNode(_T("pos"), oAttr2));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_AHPOLAR_INCLUDE_H_
|
||||
157
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/AhXY.h
Normal file
157
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/AhXY.h
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_AHXY_INCLUDE_H_
|
||||
#define PPTX_LOGIC_AHXY_INCLUDE_H_
|
||||
|
||||
#include "Ah.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AhXY : public Ah
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(AhXY)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNode oPos = node.ReadNode(_T("a:pos"));
|
||||
|
||||
x = oPos.ReadAttributeBase(L"x");
|
||||
y = oPos.ReadAttributeBase(L"y");
|
||||
|
||||
node.ReadAttributeBase(L"gdRefX", gdRefX);
|
||||
node.ReadAttributeBase(L"gdRefY", gdRefY);
|
||||
node.ReadAttributeBase(L"maxX", maxX);
|
||||
node.ReadAttributeBase(L"maxY", maxY);
|
||||
node.ReadAttributeBase(L"minX", minX);
|
||||
node.ReadAttributeBase(L"minY", minY);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr1;
|
||||
oAttr1.Write(_T("gdRefX"), gdRefX);
|
||||
oAttr1.Write(_T("minX"), minX);
|
||||
oAttr1.Write(_T("maxX"), maxX);
|
||||
oAttr1.Write(_T("gdRefY"), gdRefY);
|
||||
oAttr1.Write(_T("minY"), minY);
|
||||
oAttr1.Write(_T("maxY"), maxY);
|
||||
|
||||
XmlUtils::CAttribute oAttr2;
|
||||
oAttr2.Write(_T("x"), x);
|
||||
oAttr2.Write(_T("y"), y);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:ahXY"), oAttr1, XmlUtils::CreateNode(_T("a:pos"), oAttr2));
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:ahXY"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("gdRefX"), gdRefX);
|
||||
pWriter->WriteAttribute(_T("minX"), minX);
|
||||
pWriter->WriteAttribute(_T("maxX"), maxX);
|
||||
pWriter->WriteAttribute(_T("gdRefY"), gdRefY);
|
||||
pWriter->WriteAttribute(_T("minY"), minY);
|
||||
pWriter->WriteAttribute(_T("maxY"), maxY);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(_T("a:pos"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("x"), x);
|
||||
pWriter->WriteAttribute(_T("y"), y);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:pos"));
|
||||
|
||||
pWriter->EndNode(_T("a:ahXY"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(GEOMETRY_TYPE_AH_XY);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, x);
|
||||
pWriter->WriteString1(1, y);
|
||||
|
||||
pWriter->WriteString2(2, gdRefX);
|
||||
pWriter->WriteString2(3, gdRefY);
|
||||
pWriter->WriteString2(4, maxX);
|
||||
pWriter->WriteString2(5, maxY);
|
||||
pWriter->WriteString2(6, minX);
|
||||
pWriter->WriteString2(7, minY);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
CString x;
|
||||
CString y;
|
||||
|
||||
nullable_string gdRefX;
|
||||
nullable_string gdRefY;
|
||||
nullable_string maxX;
|
||||
nullable_string maxY;
|
||||
nullable_string minX;
|
||||
nullable_string minY;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
public:
|
||||
|
||||
CString GetODString()const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr1;
|
||||
oAttr1.Write(_T("gdRefX"), gdRefX);
|
||||
oAttr1.Write(_T("minX"), minX);
|
||||
oAttr1.Write(_T("maxX"), maxX);
|
||||
oAttr1.Write(_T("gdRefY"), gdRefY);
|
||||
oAttr1.Write(_T("minY"), minY);
|
||||
oAttr1.Write(_T("maxY"), maxY);
|
||||
|
||||
XmlUtils::CAttribute oAttr2;
|
||||
oAttr2.Write(_T("x"), x);
|
||||
oAttr2.Write(_T("y"), y);
|
||||
|
||||
return XmlUtils::CreateNode(_T("ahXY"), oAttr1, XmlUtils::CreateNode(_T("pos"), oAttr2));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_AHXY_INCLUDE_H_
|
||||
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Backdrop.h
Normal file
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Backdrop.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BACKDROP_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BACKDROP_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Backdrop : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Backdrop)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNode oNodeA = node.ReadNode(_T("a:anchor"));
|
||||
XmlUtils::CXmlNode oNodeN = node.ReadNode(_T("a:norm"));
|
||||
XmlUtils::CXmlNode oNodeU = node.ReadNode(_T("a:up"));
|
||||
|
||||
anchorX = oNodeA.ReadAttributeInt(L"x");
|
||||
anchorY = oNodeA.ReadAttributeInt(L"y");
|
||||
anchorZ = oNodeA.ReadAttributeInt(L"z");
|
||||
|
||||
normX = oNodeN.ReadAttributeInt(L"dx");
|
||||
normY = oNodeN.ReadAttributeInt(L"dy");
|
||||
normZ = oNodeN.ReadAttributeInt(L"dz");
|
||||
|
||||
upX = oNodeU.ReadAttributeInt(L"dx");
|
||||
upY = oNodeU.ReadAttributeInt(L"dy");
|
||||
upZ = oNodeU.ReadAttributeInt(L"dz");
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
CString str1 = _T("");
|
||||
str1.Format(_T("<a:anchor x=\"%d\" y=\"%d\" z=\"%d\" />"), anchorX, anchorY, anchorZ);
|
||||
|
||||
CString str2 = _T("");
|
||||
str1.Format(_T("<a:norm dx=\"%d\" dy=\"%d\" dz=\"%d\" />"), normX, normY, normZ);
|
||||
|
||||
CString str3 = _T("");
|
||||
str1.Format(_T("<a:up dx=\"%d\" dy=\"%d\" dz=\"%d\" />"), upX, upY, upZ);
|
||||
|
||||
return _T("<a:backdrop>") + str1 + str2 + str3 + _T("</a:backdrop>");
|
||||
}
|
||||
public:
|
||||
int anchorX;
|
||||
int anchorY;
|
||||
int anchorZ;
|
||||
|
||||
int normX;
|
||||
int normY;
|
||||
int normZ;
|
||||
|
||||
int upX;
|
||||
int upY;
|
||||
int upZ;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BACKDROP_INCLUDE_H_
|
||||
91
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bevel.h
Normal file
91
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bevel.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BEVEL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BEVEL_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "./../Limit/BevelType.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Bevel : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Bevel)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
|
||||
node.ReadAttributeBase(L"w", w);
|
||||
node.ReadAttributeBase(L"h", h);
|
||||
node.ReadAttributeBase(L"prst", prst);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("w"), w);
|
||||
oAttr.Write(_T("h"), h);
|
||||
oAttr.WriteLimitNullable(_T("prst"), prst);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:") + m_name, oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, w);
|
||||
pWriter->WriteInt2(1, h);
|
||||
pWriter->WriteLimit2(2, prst);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_int w;
|
||||
nullable_int h;
|
||||
nullable_limit<Limit::BevelType> prst;
|
||||
|
||||
public:
|
||||
CString m_name;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BEVEL_INCLUDE_H_
|
||||
116
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bg.cpp
Normal file
116
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bg.cpp
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include "./stdafx.h"
|
||||
|
||||
#include "Bg.h"
|
||||
#include "../Slide.h"
|
||||
#include "../SlideMaster.h"
|
||||
#include "../SlideLayout.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
Bg::Bg()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Bg::~Bg()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Bg::Bg(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
}
|
||||
|
||||
|
||||
const Bg& Bg::operator =(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Bg::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"bwMode", bwMode);
|
||||
bgPr = node.ReadNodeNoNS(_T("bgPr"));
|
||||
bgRef = node.ReadNodeNoNS(_T("bgRef"));
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
|
||||
CString Bg::toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.WriteLimitNullable(_T("bwMode"), bwMode);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(bgPr);
|
||||
oValue.WriteNullable(bgRef);
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:bg"), oAttr, oValue);
|
||||
}
|
||||
|
||||
void Bg::FillParentPointersForChilds()
|
||||
{
|
||||
|
||||
|
||||
if(bgPr.IsInit())
|
||||
bgPr->SetParentPointer(this);
|
||||
if(bgRef.IsInit())
|
||||
bgRef->SetParentPointer(this);
|
||||
}
|
||||
|
||||
void Bg::GetBackground(Logic::BgPr& bg, DWORD& ARGB)const
|
||||
{
|
||||
if(bgPr.IsInit())
|
||||
bg = bgPr.get();
|
||||
else
|
||||
{
|
||||
ARGB = bgRef->Color.GetARGB();
|
||||
if(parentFileIs<Slide>())
|
||||
parentFileAs<Slide>().Theme->themeElements.fmtScheme.GetFillStyle(bgRef->idx.get_value_or(0), bg.Fill);
|
||||
else if(parentFileIs<SlideLayout>())
|
||||
parentFileAs<SlideLayout>().Theme->themeElements.fmtScheme.GetFillStyle(bgRef->idx.get_value_or(0), bg.Fill);
|
||||
else if(parentFileIs<SlideMaster>())
|
||||
parentFileAs<SlideMaster>().Theme->themeElements.fmtScheme.GetFillStyle(bgRef->idx.get_value_or(0), bg.Fill);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace PPTX
|
||||
141
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bg.h
Normal file
141
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bg.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_SLIDE_BACKGROUND_INCLUDE_H_
|
||||
#define PPTX_LOGIC_SLIDE_BACKGROUND_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "./../Limit/BWMode.h"
|
||||
#include "BgPr.h"
|
||||
#include "StyleRef.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Bg : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
Bg();
|
||||
virtual ~Bg();
|
||||
explicit Bg(XmlUtils::CXmlNode& node);
|
||||
const Bg& operator =(XmlUtils::CXmlNode& node);
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual CString toXML() const;
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("p:bg"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("bwMode"), bwMode);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->Write(bgPr);
|
||||
pWriter->Write(bgRef);
|
||||
|
||||
pWriter->EndNode(_T("p:bg"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, bwMode);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord2(0, bgPr);
|
||||
pWriter->WriteRecord2(1, bgRef);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
if (0 == _at)
|
||||
{
|
||||
bwMode = new Limit::BWMode();
|
||||
bwMode->SetBYTECode(pReader->GetUChar());
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
bgPr = new BgPr();
|
||||
bgPr->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
bgRef = new StyleRef();
|
||||
bgRef->m_name = _T("p:bgRef");
|
||||
bgRef->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_limit<Limit::BWMode> bwMode;
|
||||
nullable<BgPr> bgPr;
|
||||
nullable<StyleRef> bgRef;
|
||||
|
||||
virtual void GetBackground(Logic::BgPr& bg, DWORD& ARGB)const;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_SLIDE_BACKGROUND_INCLUDE_H_
|
||||
151
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/BgPr.h
Normal file
151
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/BgPr.h
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_SLIDE_BGPR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_SLIDE_BGPR_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "UniFill.h"
|
||||
#include "EffectProperties.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class BgPr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BgPr)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"shadeToTitle", shadeToTitle);
|
||||
Fill.GetFillFrom(node);
|
||||
EffectList.GetEffectListFrom(node);
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("shadeToTitle"), shadeToTitle);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(Fill);
|
||||
oValue.Write(EffectList);
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:bgPr"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("p:bgPr"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("shadeToTitle"), shadeToTitle);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
Fill.toXmlWriter(pWriter);
|
||||
EffectList.toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(_T("p:bgPr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteBool2(0, shadeToTitle);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, Fill);
|
||||
pWriter->WriteRecord1(1, EffectList);
|
||||
}
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
if (0 == _at)
|
||||
shadeToTitle = pReader->GetBool();
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Fill.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
UniFill Fill;
|
||||
EffectProperties EffectList;
|
||||
|
||||
nullable_bool shadeToTitle;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Fill.SetParentPointer(this);
|
||||
EffectList.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_SLIDE_BGPR_INCLUDE_H_
|
||||
427
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/BodyPr.h
Normal file
427
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/BodyPr.h
Normal file
@@ -0,0 +1,427 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BODYPR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BODYPR_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "./../Limit/TextAnchor.h"
|
||||
#include "./../Limit/HorzOverflow.h"
|
||||
#include "./../Limit/TextVerticalType.h"
|
||||
#include "./../Limit/VertOverflow.h"
|
||||
#include "./../Limit/TextWrap.h"
|
||||
#include "Scene3d.h"
|
||||
#include "Sp3d.h"
|
||||
#include "PrstTxWarp.h"
|
||||
#include "TextFit.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BodyPr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BodyPr)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
|
||||
node.ReadAttributeBase(L"anchor", anchor);
|
||||
node.ReadAttributeBase(L"anchorCtr", anchorCtr);
|
||||
node.ReadAttributeBase(L"bIns", bIns);
|
||||
node.ReadAttributeBase(L"compatLnSpc", compatLnSpc);
|
||||
node.ReadAttributeBase(L"forceAA", forceAA);
|
||||
node.ReadAttributeBase(L"fromWordArt", fromWordArt);
|
||||
node.ReadAttributeBase(L"horzOverflow", horzOverflow);
|
||||
node.ReadAttributeBase(L"lIns", lIns);
|
||||
node.ReadAttributeBase(L"numCol", numCol);
|
||||
node.ReadAttributeBase(L"rIns", rIns);
|
||||
node.ReadAttributeBase(L"rot", rot);
|
||||
node.ReadAttributeBase(L"rtlCol", rtlCol);
|
||||
node.ReadAttributeBase(L"spcCol", spcCol);
|
||||
node.ReadAttributeBase(L"spcFirstLastPara", spcFirstLastPara);
|
||||
node.ReadAttributeBase(L"tIns", tIns);
|
||||
node.ReadAttributeBase(L"upright", upright);
|
||||
node.ReadAttributeBase(L"vert", vert);
|
||||
node.ReadAttributeBase(L"vertOverflow", vertOverflow);
|
||||
node.ReadAttributeBase(L"wrap", wrap);
|
||||
|
||||
Fit.GetTextFitFrom(node);
|
||||
prstTxWarp = node.ReadNode(_T("a:prstTxWarp"));
|
||||
scene3d = node.ReadNode(_T("a:scene3d"));
|
||||
|
||||
XmlUtils::CXmlNode oNode = node.ReadNodeNoNS(_T("flatTx"));
|
||||
oNode.ReadAttributeBase(L"z", flatTx);
|
||||
|
||||
sp3d = node.ReadNode(_T("a:sp3d"));
|
||||
|
||||
Normalize();
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("rot"), rot);
|
||||
oAttr.Write(_T("spcFirstLastPara"), spcFirstLastPara);
|
||||
oAttr.WriteLimitNullable(_T("vertOverflow"), vertOverflow);
|
||||
oAttr.WriteLimitNullable(_T("horzOverflow"), horzOverflow);
|
||||
oAttr.WriteLimitNullable(_T("vert"), vert);
|
||||
oAttr.WriteLimitNullable(_T("wrap"), wrap);
|
||||
oAttr.Write(_T("lIns"), lIns);
|
||||
oAttr.Write(_T("tIns"), tIns);
|
||||
oAttr.Write(_T("rIns"), rIns);
|
||||
oAttr.Write(_T("bIns"), bIns);
|
||||
oAttr.Write(_T("numCol"), numCol);
|
||||
oAttr.Write(_T("spcCol"), spcCol);
|
||||
oAttr.Write(_T("rtlCol"), rtlCol);
|
||||
oAttr.Write(_T("fromWordArt"), fromWordArt);
|
||||
oAttr.WriteLimitNullable(_T("anchor"), anchor);
|
||||
oAttr.Write(_T("anchorCtr"), anchorCtr);
|
||||
oAttr.Write(_T("forceAA"), forceAA);
|
||||
oAttr.Write(_T("upright"), upright);
|
||||
oAttr.Write(_T("compatLnSpc"), compatLnSpc);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(prstTxWarp);
|
||||
oValue.Write(Fit);
|
||||
oValue.WriteNullable(scene3d);
|
||||
oValue.WriteNullable(sp3d);
|
||||
if (flatTx.IsInit())
|
||||
{
|
||||
XmlUtils::CAttribute oAttr2;
|
||||
oAttr2.Write(_T("z"), flatTx);
|
||||
|
||||
oValue.m_strValue += XmlUtils::CreateNode(m_namespace + _T(":flatTx"), oAttr2);
|
||||
}
|
||||
|
||||
return XmlUtils::CreateNode(m_namespace + _T(":bodyPr"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(m_namespace + _T(":bodyPr"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("rot"), rot);
|
||||
pWriter->WriteAttribute(_T("spcFirstLastPara"), spcFirstLastPara);
|
||||
pWriter->WriteAttribute(_T("vertOverflow"), vertOverflow);
|
||||
pWriter->WriteAttribute(_T("horzOverflow"), horzOverflow);
|
||||
pWriter->WriteAttribute(_T("vert"), vert);
|
||||
pWriter->WriteAttribute(_T("wrap"), wrap);
|
||||
pWriter->WriteAttribute(_T("lIns"), lIns);
|
||||
pWriter->WriteAttribute(_T("tIns"), tIns);
|
||||
pWriter->WriteAttribute(_T("rIns"), rIns);
|
||||
pWriter->WriteAttribute(_T("bIns"), bIns);
|
||||
pWriter->WriteAttribute(_T("numCol"), numCol);
|
||||
pWriter->WriteAttribute(_T("spcCol"), spcCol);
|
||||
pWriter->WriteAttribute(_T("rtlCol"), rtlCol);
|
||||
pWriter->WriteAttribute(_T("fromWordArt"), fromWordArt);
|
||||
pWriter->WriteAttribute(_T("anchor"), anchor);
|
||||
pWriter->WriteAttribute(_T("anchorCtr"), anchorCtr);
|
||||
pWriter->WriteAttribute(_T("forceAA"), forceAA);
|
||||
pWriter->WriteAttribute(_T("upright"), upright);
|
||||
pWriter->WriteAttribute(_T("compatLnSpc"), compatLnSpc);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->Write(prstTxWarp);
|
||||
Fit.toXmlWriter(pWriter);
|
||||
pWriter->Write(scene3d);
|
||||
pWriter->Write(sp3d);
|
||||
if (flatTx.IsInit())
|
||||
{
|
||||
pWriter->StartNode(m_namespace + _T(":flatTx"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("z"), flatTx);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(m_namespace + _T(":flatTx"));
|
||||
}
|
||||
|
||||
pWriter->EndNode(m_namespace + _T(":bodyPr"));
|
||||
}
|
||||
|
||||
void Merge(BodyPr& bodyPr)const
|
||||
{
|
||||
if(Fit.type != TextFit::FitEmpty)
|
||||
Fit.Merge(bodyPr.Fit);
|
||||
|
||||
|
||||
if(anchor.IsInit())
|
||||
bodyPr.anchor = *anchor;
|
||||
if(anchorCtr.IsInit())
|
||||
bodyPr.anchorCtr = *anchorCtr;
|
||||
if(bIns.IsInit())
|
||||
bodyPr.bIns = *bIns;
|
||||
if(compatLnSpc.IsInit())
|
||||
bodyPr.compatLnSpc = *compatLnSpc;
|
||||
if(forceAA.IsInit())
|
||||
bodyPr.forceAA = *forceAA;
|
||||
if(fromWordArt.IsInit())
|
||||
bodyPr.fromWordArt = *fromWordArt;
|
||||
if(horzOverflow.IsInit())
|
||||
bodyPr.horzOverflow = *horzOverflow;
|
||||
if(lIns.IsInit())
|
||||
bodyPr.lIns = *lIns;
|
||||
if(numCol.IsInit())
|
||||
bodyPr.numCol = *numCol;
|
||||
if(rIns.IsInit())
|
||||
bodyPr.rIns = *rIns;
|
||||
if(rot.IsInit())
|
||||
bodyPr.rot = *rot;
|
||||
if(rtlCol.IsInit())
|
||||
bodyPr.rtlCol = *rtlCol;
|
||||
if(spcCol.IsInit())
|
||||
bodyPr.spcCol = *spcCol;
|
||||
if(spcFirstLastPara.IsInit())
|
||||
bodyPr.spcFirstLastPara = *spcFirstLastPara;
|
||||
if(tIns.IsInit())
|
||||
bodyPr.tIns = *tIns;
|
||||
if(upright.IsInit())
|
||||
bodyPr.upright = *upright;
|
||||
if(vert.IsInit())
|
||||
bodyPr.vert = *vert;
|
||||
if(vertOverflow.IsInit())
|
||||
bodyPr.vertOverflow = *vertOverflow;
|
||||
if(wrap.IsInit())
|
||||
bodyPr.wrap = *wrap;
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, flatTx);
|
||||
pWriter->WriteLimit2(1, anchor);
|
||||
pWriter->WriteBool2(2, anchorCtr);
|
||||
pWriter->WriteInt2(3, bIns);
|
||||
pWriter->WriteBool2(4, compatLnSpc);
|
||||
pWriter->WriteBool2(5, forceAA);
|
||||
pWriter->WriteBool2(6, fromWordArt);
|
||||
pWriter->WriteLimit2(7, horzOverflow);
|
||||
pWriter->WriteInt2(8, lIns);
|
||||
pWriter->WriteInt2(9, numCol);
|
||||
pWriter->WriteInt2(10, rIns);
|
||||
pWriter->WriteInt2(11, rot);
|
||||
pWriter->WriteBool2(12, rtlCol);
|
||||
pWriter->WriteInt2(13, spcCol);
|
||||
pWriter->WriteBool2(14, spcFirstLastPara);
|
||||
pWriter->WriteInt2(15, tIns);
|
||||
pWriter->WriteBool2(16, upright);
|
||||
pWriter->WriteLimit2(17, vert);
|
||||
pWriter->WriteLimit2(18, vertOverflow);
|
||||
pWriter->WriteLimit2(19, wrap);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord2(0, prstTxWarp);
|
||||
pWriter->WriteRecord1(1, Fit);
|
||||
pWriter->WriteRecord2(2, scene3d);
|
||||
pWriter->WriteRecord2(3, sp3d);
|
||||
}
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
pReader->Skip(1);
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
flatTx = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
anchor = new Limit::TextAnchor();
|
||||
anchor->SetBYTECode(pReader->GetUChar());
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
anchorCtr = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
bIns = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
compatLnSpc = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
forceAA = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
fromWordArt = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
horzOverflow = new Limit::HorzOverflow();
|
||||
horzOverflow->SetBYTECode(pReader->GetUChar());
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
lIns = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
numCol = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
rIns = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
rot = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
{
|
||||
rtlCol = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
spcCol = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
{
|
||||
spcFirstLastPara = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
tIns = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 16:
|
||||
{
|
||||
upright = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 17:
|
||||
{
|
||||
vert = new Limit::TextVerticalType();
|
||||
vert->SetBYTECode(pReader->GetUChar());
|
||||
break;
|
||||
}
|
||||
case 18:
|
||||
{
|
||||
vertOverflow = new Limit::VertOverflow();
|
||||
vertOverflow->SetBYTECode(pReader->GetUChar());
|
||||
break;
|
||||
}
|
||||
case 19:
|
||||
{
|
||||
wrap = new Limit::TextWrap();
|
||||
wrap->SetBYTECode(pReader->GetUChar());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<PrstTxWarp> prstTxWarp;
|
||||
TextFit Fit;
|
||||
nullable<Scene3d> scene3d;
|
||||
nullable_int flatTx;
|
||||
nullable<Sp3d> sp3d;
|
||||
|
||||
|
||||
nullable_limit<Limit::TextAnchor> anchor;
|
||||
nullable_bool anchorCtr;
|
||||
nullable_int bIns;
|
||||
nullable_bool compatLnSpc;
|
||||
nullable_bool forceAA;
|
||||
nullable_bool fromWordArt;
|
||||
nullable_limit<Limit::HorzOverflow> horzOverflow;
|
||||
nullable_int lIns;
|
||||
nullable_int numCol;
|
||||
nullable_int rIns;
|
||||
nullable_int rot;
|
||||
nullable_bool rtlCol;
|
||||
nullable_int spcCol;
|
||||
nullable_bool spcFirstLastPara;
|
||||
nullable_int tIns;
|
||||
nullable_bool upright;
|
||||
nullable_limit<Limit::TextVerticalType> vert;
|
||||
nullable_limit<Limit::VertOverflow> vertOverflow;
|
||||
nullable_limit<Limit::TextWrap> wrap;
|
||||
|
||||
public:
|
||||
mutable CString m_namespace;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(prstTxWarp.IsInit())
|
||||
prstTxWarp->SetParentPointer(this);
|
||||
Fit.SetParentPointer(this);
|
||||
if(scene3d.IsInit())
|
||||
scene3d->SetParentPointer(this);
|
||||
}
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
numCol.normalize(1, 16);
|
||||
spcCol.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BODYPR_INCLUDE_H
|
||||
114
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuAutoNum.h
Normal file
114
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuAutoNum.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUAUTONUM_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUAUTONUM_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../../Limit/TextAutonumberScheme.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuAutoNum : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuAutoNum)
|
||||
|
||||
BuAutoNum& operator=(const BuAutoNum& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
type = oSrc.type;
|
||||
startAt = oSrc.startAt;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"type", type);
|
||||
node.ReadAttributeBase(L"startAt", startAt);
|
||||
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("type"), type.get());
|
||||
oAttr.Write(_T("startAt"), startAt);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:buAutoNum"), oAttr);
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:buAutoNum"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("type"), type.get());
|
||||
pWriter->WriteAttribute(_T("startAt"), startAt);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:buAutoNum"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_BULLET_AUTONUM);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit1(0, type);
|
||||
pWriter->WriteInt2(1, startAt);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
Limit::TextAutonumberScheme type;
|
||||
nullable_int startAt;
|
||||
|
||||
public:
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
startAt.normalize(1, 32767);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUAUTONUM_INCLUDE_H
|
||||
92
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuBlip.h
Normal file
92
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuBlip.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUBLIP_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUBLIP_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../Fills/Blip.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuBlip : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuBlip)
|
||||
|
||||
BuBlip& operator=(const BuBlip& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
blip = oSrc.blip;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
blip = node.ReadNodeNoNS(_T("blip"));
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return XmlUtils::CreateNode(_T("a:buBlip"), blip.toXML());
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:buBlip"));
|
||||
pWriter->EndAttributes();
|
||||
blip.toXmlWriter(pWriter);
|
||||
pWriter->EndNode(_T("a:buBlip"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_BULLET_BLIP);
|
||||
pWriter->WriteRecord1(0, blip);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
Blip blip;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
blip.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUBLIP_INCLUDE_H
|
||||
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuChar.h
Normal file
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuChar.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUCHAR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUCHAR_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuChar : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuChar)
|
||||
|
||||
BuChar& operator=(const BuChar& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Char = oSrc.Char;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Char = node.GetAttribute(_T("char"));
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("char"), Char);
|
||||
return XmlUtils::CreateNode(_T("a:buChar"), oAttr);
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:buChar"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("char"), Char);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:buChar"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_BULLET_CHAR);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, Char);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
|
||||
if (pWriter->m_oCommon.m_pNativePicker->m_bIsEmbeddedFonts)
|
||||
pWriter->m_oCommon.m_pNativePicker->m_oEmbeddedFonts.CheckString(Char);
|
||||
}
|
||||
|
||||
public:
|
||||
CString Char;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUCHAR_INCLUDE_H
|
||||
98
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuClr.h
Normal file
98
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuClr.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUCLR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUCLR_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuClr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuClr)
|
||||
|
||||
BuClr& operator=(const BuClr& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Color = oSrc.Color;
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual DWORD GetRGBA()const{return Color.GetRGBA();};
|
||||
virtual DWORD GetARGB()const{return Color.GetARGB();};
|
||||
virtual DWORD GetBGRA()const{return Color.GetBGRA();};
|
||||
virtual DWORD GetABGR()const{return Color.GetABGR();};
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Color.GetColorFrom(node);
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return XmlUtils::CreateNode(_T("a:buClr"), Color.toXML());
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:buClr"));
|
||||
pWriter->EndAttributes();
|
||||
Color.toXmlWriter(pWriter);
|
||||
pWriter->EndNode(_T("a:buClr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_COLOR_CLR);
|
||||
pWriter->WriteRecord1(0, Color);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniColor Color;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Color.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUCLR_INCLUDE_H
|
||||
80
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuClrTx.h
Normal file
80
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuClrTx.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUCLRTX_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUCLRTX_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuClrTx : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuClrTx)
|
||||
|
||||
BuClrTx& operator=(const BuClrTx& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:buClrTx/>");
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteString(_T("<a:buClrTx/>"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_COLOR_CLRTX);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUCLRTX_INCLUDE_H
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUFONTTX_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUFONTTX_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuFontTx : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuFontTx)
|
||||
|
||||
BuFontTx& operator=(const BuFontTx& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:buFontTx/>");
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteString(_T("<a:buFontTx/>"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_TYPEFACE_TX);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUFONTTX_INCLUDE_H
|
||||
79
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuNone.h
Normal file
79
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuNone.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUNONE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUNONE_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuNone : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuNone)
|
||||
|
||||
BuNone& operator=(const BuNone& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:buNone/>");
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteString(_T("<a:buNone/>"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_BULLET_NONE);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUNONE_INCLUDE_H
|
||||
100
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuSzPct.h
Normal file
100
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuSzPct.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUSZPCT_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUSZPCT_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuSzPct : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuSzPct)
|
||||
|
||||
BuSzPct& operator=(const BuSzPct& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
val = oSrc.val;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
val = node.ReadAttributeInt(_T("val"));
|
||||
Normalize();
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write( _T("val"), val);
|
||||
return XmlUtils::CreateNode(_T("a:buSzPct"), oAttr);
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:buSzPct"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("val"), val);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:buSzPct"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_SIZE_PCT);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt1(0, val);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
public:
|
||||
int val;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
normalize_value(val, 25000, 400000);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUSZPCT_INCLUDE_H
|
||||
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuSzPts.h
Normal file
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuSzPts.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUSZPTS_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUSZPTS_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuSzPts : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuSzPts)
|
||||
|
||||
BuSzPts& operator=(const BuSzPts& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
val = oSrc.val;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
val = node.ReadAttributeInt(_T("val"));
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("val"), val);
|
||||
return XmlUtils::CreateNode(_T("a:buSzPts"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:buSzPts"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("val"), val);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:buSzPts"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_SIZE_PTS);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt1(0, val);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
public:
|
||||
int val;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
normalize_value(val, 100, 400000);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUSZPTS_INCLUDE_H
|
||||
79
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuSzTx.h
Normal file
79
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BuSzTx.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BUSZTX_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BUSZTX_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BuSzTx : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BuSzTx)
|
||||
|
||||
BuSzTx& operator=(const BuSzTx& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:buSzTx/>");
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteString(_T("<a:buSzTx/>"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_SIZE_TX);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BUSZTX_INCLUDE_H
|
||||
193
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/Bullet.h
Normal file
193
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/Bullet.h
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BULLET_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BULLET_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "BuNone.h"
|
||||
#include "BuChar.h"
|
||||
#include "BuAutoNum.h"
|
||||
#include "BuBlip.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class Bullet : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Bullet)
|
||||
|
||||
Bullet& operator=(const Bullet& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
m_Bullet = oSrc.m_Bullet;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
CString strName = XmlUtils::GetNameNoNS(node.GetName());
|
||||
|
||||
if (strName == _T("buNone"))
|
||||
m_Bullet.reset(new Logic::BuNone(node));
|
||||
else if (strName == _T("buChar"))
|
||||
m_Bullet.reset(new Logic::BuChar(node));
|
||||
else if (strName == _T("buAutoNum"))
|
||||
m_Bullet.reset(new Logic::BuAutoNum(node));
|
||||
else if (strName == _T("buBlip"))
|
||||
m_Bullet.reset(new Logic::BuBlip(node));
|
||||
else m_Bullet.reset();
|
||||
}
|
||||
|
||||
virtual void ReadBulletFrom(XmlUtils::CXmlNode& element)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (element.GetNode(_T("a:buNone"), oNode))
|
||||
m_Bullet.reset(new Logic::BuNone(oNode));
|
||||
else if (element.GetNode(_T("a:buChar"), oNode))
|
||||
m_Bullet.reset(new Logic::BuChar(oNode));
|
||||
else if (element.GetNode(_T("a:buAutoNum"), oNode))
|
||||
m_Bullet.reset(new Logic::BuAutoNum(oNode));
|
||||
else if (element.GetNode(_T("a:buBlip"), oNode))
|
||||
m_Bullet.reset(new Logic::BuBlip(oNode));
|
||||
else m_Bullet.reset();
|
||||
}
|
||||
|
||||
virtual bool is_init()const{return (m_Bullet.IsInit());};
|
||||
virtual bool has_bullet()const{return ((is_init()) && (!is<BuNone>()));};
|
||||
|
||||
template<class T> AVSINLINE const bool is() const { return m_Bullet.is<T>(); }
|
||||
template<class T> AVSINLINE T& as() { return m_Bullet.as<T>(); }
|
||||
template<class T> AVSINLINE const T& as() const { return m_Bullet.as<T>(); }
|
||||
|
||||
virtual CString Bullet::toXML()const
|
||||
{
|
||||
if (m_Bullet.IsInit())
|
||||
return m_Bullet->toXML();
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (m_Bullet.is_init())
|
||||
m_Bullet->toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if (m_Bullet.is_init())
|
||||
m_Bullet->toPPTY(pWriter);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
if (pReader->GetPos() == _end_rec)
|
||||
return;
|
||||
|
||||
BYTE _type = pReader->GetUChar();
|
||||
|
||||
switch (_type)
|
||||
{
|
||||
case BULLET_TYPE_BULLET_CHAR:
|
||||
{
|
||||
pReader->Skip(6);
|
||||
Logic::BuChar* p1 = new Logic::BuChar();
|
||||
p1->Char = pReader->GetString2();
|
||||
pReader->Skip(1);
|
||||
|
||||
m_Bullet.reset(p1);
|
||||
break;
|
||||
}
|
||||
case BULLET_TYPE_BULLET_AUTONUM:
|
||||
{
|
||||
Logic::BuAutoNum* p2 = new Logic::BuAutoNum();
|
||||
pReader->Skip(5);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
p2->type.SetBYTECode(pReader->GetUChar());
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
p2->startAt = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_Bullet.reset(p2);
|
||||
break;
|
||||
}
|
||||
case BULLET_TYPE_BULLET_BLIP:
|
||||
|
||||
break;
|
||||
default:
|
||||
m_Bullet.reset(new Logic::BuNone());
|
||||
break;
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
smart_ptr<WrapperWritingElement> m_Bullet;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
public:
|
||||
virtual void SetParentPointer(const WrapperWritingElement* pParent)
|
||||
{
|
||||
if(is_init())
|
||||
m_Bullet->SetParentPointer(pParent);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BULLET_INCLUDE_H
|
||||
172
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BulletColor.h
Normal file
172
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BulletColor.h
Normal file
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BULLETCOLOR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BULLETCOLOR_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "BuClrTx.h"
|
||||
#include "BuClr.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BulletColor : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BulletColor)
|
||||
|
||||
BulletColor& operator=(const BulletColor& oColor)
|
||||
{
|
||||
parentFile = oColor.parentFile;
|
||||
parentElement = oColor.parentElement;
|
||||
|
||||
m_Color = oColor.m_Color;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
CString strName = node.GetName();
|
||||
|
||||
if (strName == _T("a:buClrTx"))
|
||||
m_Color.reset(new Logic::BuClrTx(node));
|
||||
else if (strName == _T("a:buClr"))
|
||||
m_Color.reset(new Logic::BuClr(node));
|
||||
else m_Color.reset();
|
||||
}
|
||||
|
||||
void ReadBulletColorFrom(XmlUtils::CXmlNode& element)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (element.GetNode(_T("a:buClrTx"), oNode))
|
||||
m_Color.reset(new Logic::BuClrTx(oNode));
|
||||
else if (element.GetNode(_T("a:buClr"), oNode))
|
||||
m_Color.reset(new Logic::BuClr(oNode));
|
||||
else m_Color.reset();
|
||||
}
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if (m_Color.is_init())
|
||||
m_Color->toPPTY(pWriter);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
if (pReader->GetPos() == _end_rec)
|
||||
return;
|
||||
|
||||
BYTE _type = pReader->GetUChar();
|
||||
|
||||
if (_type == BULLET_TYPE_COLOR_CLRTX)
|
||||
{
|
||||
m_Color.reset(new Logic::BuClrTx());
|
||||
}
|
||||
else
|
||||
{
|
||||
Logic::BuClr* pClr = new Logic::BuClr();
|
||||
pReader->Skip(5);
|
||||
pClr->Color.fromPPTY(pReader);
|
||||
m_Color.reset(pClr);
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (m_Color.is_init())
|
||||
m_Color->toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
virtual bool is_init()const{return (m_Color.IsInit());};
|
||||
virtual bool has_spec_color()const{return is<BuClr>();};
|
||||
|
||||
template<class T> AVSINLINE const bool is() const { return m_Color.is<T>(); }
|
||||
template<class T> AVSINLINE T& as() { return m_Color.as<T>(); }
|
||||
template<class T> AVSINLINE const T& as() const { return m_Color.as<T>(); }
|
||||
|
||||
virtual DWORD BulletColor::GetRGBA()const
|
||||
{
|
||||
if(has_spec_color())
|
||||
return as<BuClr>().GetRGBA();
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual DWORD BulletColor::GetARGB()const
|
||||
{
|
||||
if(has_spec_color())
|
||||
return as<BuClr>().GetARGB();
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual DWORD BulletColor::GetBGRA()const
|
||||
{
|
||||
if(has_spec_color())
|
||||
return as<BuClr>().GetBGRA();
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual DWORD BulletColor::GetABGR()const
|
||||
{
|
||||
if(has_spec_color())
|
||||
return as<BuClr>().GetABGR();
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual CString toXML()const
|
||||
{
|
||||
if (m_Color.IsInit())
|
||||
return m_Color->toXML();
|
||||
return _T("");
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
smart_ptr<WrapperWritingElement> m_Color;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
public:
|
||||
virtual void SetParentPointer(const WrapperWritingElement* pParent)
|
||||
{
|
||||
if(is_init())
|
||||
m_Color->SetParentPointer(pParent);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BULLETCOLOR_INCLUDE_H
|
||||
155
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BulletSize.h
Normal file
155
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Bullets/BulletSize.h
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BULLETSIZE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BULLETSIZE_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "BuSzTx.h"
|
||||
#include "BuSzPct.h"
|
||||
#include "BuSzPts.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BulletSize : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BulletSize)
|
||||
|
||||
BulletSize& operator=(const BulletSize& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
m_Size = oSrc.m_Size;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
CString strName = node.GetName();
|
||||
|
||||
if (strName == _T("a:buSzTx"))
|
||||
m_Size.reset(new Logic::BuSzTx(node));
|
||||
else if (strName == _T("a:buSzPct"))
|
||||
m_Size.reset(new Logic::BuSzPct(node));
|
||||
else if (strName == _T("a:buSzPts"))
|
||||
m_Size.reset(new Logic::BuSzPts(node));
|
||||
else m_Size.reset();
|
||||
}
|
||||
|
||||
virtual void ReadBulletSizeFrom(XmlUtils::CXmlNode& element)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if(element.GetNode(_T("a:buSzTx"), oNode))
|
||||
m_Size.reset(new Logic::BuSzTx(oNode));
|
||||
else if(element.GetNode(_T("a:buSzPct"), oNode))
|
||||
m_Size.reset(new Logic::BuSzPct(oNode));
|
||||
else if(element.GetNode(_T("a:buSzPts"), oNode))
|
||||
m_Size.reset(new Logic::BuSzPts(oNode));
|
||||
else m_Size.reset();
|
||||
}
|
||||
virtual bool is_init()const{return (m_Size.IsInit());};
|
||||
virtual bool has_spec_size()const{return ((is_init()) && (!is<BuSzTx>()));};
|
||||
|
||||
template<class T> AVSINLINE const bool is() const { return m_Size.is<T>(); }
|
||||
template<class T> AVSINLINE T& as() { return m_Size.as<T>(); }
|
||||
template<class T> AVSINLINE const T& as() const { return m_Size.as<T>(); }
|
||||
|
||||
virtual CString toXML()const
|
||||
{
|
||||
if (m_Size.IsInit())
|
||||
return m_Size->toXML();
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (m_Size.is_init())
|
||||
m_Size->toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if (m_Size.is_init())
|
||||
m_Size->toPPTY(pWriter);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
if (pReader->GetPos() == _end_rec)
|
||||
return;
|
||||
|
||||
BYTE _type = pReader->GetUChar();
|
||||
|
||||
if (_type == BULLET_TYPE_SIZE_TX)
|
||||
{
|
||||
m_Size.reset(new Logic::BuSzTx());
|
||||
}
|
||||
else if (_type == BULLET_TYPE_SIZE_PTS)
|
||||
{
|
||||
Logic::BuSzPts* p = new Logic::BuSzPts();
|
||||
pReader->Skip(6);
|
||||
p->val = pReader->GetLong();
|
||||
m_Size.reset(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logic::BuSzPct* p = new Logic::BuSzPct();
|
||||
pReader->Skip(6);
|
||||
p->val = pReader->GetLong();
|
||||
m_Size.reset(p);
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
smart_ptr<WrapperWritingElement> m_Size;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
public:
|
||||
virtual void SetParentPointer(const WrapperWritingElement* pParent)
|
||||
{
|
||||
if(is_init())
|
||||
m_Size->SetParentPointer(pParent);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BULLETSIZE_INCLUDE_H
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BULLETTYPEFACE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BULLETTYPEFACE_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../TextFont.h"
|
||||
#include "BuFontTx.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class BulletTypeface : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BulletTypeface)
|
||||
|
||||
BulletTypeface& operator=(const BulletTypeface& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
m_Typeface = oSrc.m_Typeface;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
CString strName = node.GetName();
|
||||
|
||||
if (strName == _T("a:buFontTx"))
|
||||
m_Typeface.reset(new Logic::BuFontTx(node));
|
||||
else if (strName == _T("a:buFont"))
|
||||
m_Typeface.reset(new Logic::TextFont(node));
|
||||
else m_Typeface.reset();
|
||||
}
|
||||
|
||||
virtual void ReadBulletTypefaceFrom(XmlUtils::CXmlNode& element)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (element.GetNode(_T("a:buFontTx"), oNode))
|
||||
m_Typeface.reset(new Logic::BuFontTx(oNode));
|
||||
else if(element.GetNode(_T("a:buFont"), oNode))
|
||||
m_Typeface.reset(new Logic::TextFont(oNode));
|
||||
else m_Typeface.reset();
|
||||
}
|
||||
|
||||
virtual bool is_init()const{return (m_Typeface.IsInit());};
|
||||
virtual bool has_spec_typeface()const{return is<TextFont>();};
|
||||
|
||||
template<class T> AVSINLINE const bool is() const { return m_Typeface.is<T>(); }
|
||||
template<class T> AVSINLINE T& as() { return m_Typeface.as<T>(); }
|
||||
template<class T> AVSINLINE const T& as() const { return m_Typeface.as<T>(); }
|
||||
|
||||
virtual CString toXML()const
|
||||
{
|
||||
if (m_Typeface.IsInit())
|
||||
return m_Typeface->toXML();
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (m_Typeface.is_init())
|
||||
m_Typeface->toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if (m_Typeface.is_init())
|
||||
{
|
||||
if (m_Typeface.is<Logic::TextFont>())
|
||||
{
|
||||
pWriter->StartRecord(BULLET_TYPE_TYPEFACE_BUFONT);
|
||||
m_Typeface->toPPTY(pWriter);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Typeface->toPPTY(pWriter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
if (pReader->GetPos() == _end_rec)
|
||||
return;
|
||||
|
||||
BYTE _type = pReader->GetUChar();
|
||||
|
||||
if (_type == BULLET_TYPE_TYPEFACE_BUFONT)
|
||||
{
|
||||
Logic::TextFont* p = new Logic::TextFont();
|
||||
p->m_name = _T("a:buFont");
|
||||
p->fromPPTY(pReader);
|
||||
m_Typeface.reset(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Typeface.reset(new Logic::BuFontTx());
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
smart_ptr<WrapperWritingElement> m_Typeface;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
public:
|
||||
virtual void SetParentPointer(const WrapperWritingElement* pParent)
|
||||
{
|
||||
if(is_init())
|
||||
m_Typeface->SetParentPointer(pParent);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BULLETTYPEFACE_INCLUDE_H
|
||||
319
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvCxnSpPr.h
Normal file
319
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvCxnSpPr.h
Normal file
@@ -0,0 +1,319 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CNVCXNSPPR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CNVCXNSPPR_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class CNvCxnSpPr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(CNvCxnSpPr)
|
||||
|
||||
CNvCxnSpPr& operator=(const CNvCxnSpPr& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
noAdjustHandles = oSrc.noAdjustHandles;
|
||||
noChangeArrowheads = oSrc.noChangeArrowheads;
|
||||
noChangeAspect = oSrc.noChangeAspect;
|
||||
noChangeShapeType = oSrc.noChangeShapeType;
|
||||
noEditPoints = oSrc.noEditPoints;
|
||||
noGrp = oSrc.noGrp;
|
||||
noMove = oSrc.noMove;
|
||||
noResize = oSrc.noResize;
|
||||
noRot = oSrc.noRot;
|
||||
noSelect = oSrc.noSelect;
|
||||
|
||||
stCxn_id = oSrc.stCxn_id;
|
||||
stCxn_idx = oSrc.stCxn_idx;
|
||||
endCxn_id = oSrc.endCxn_id;
|
||||
endCxn_idx = oSrc.endCxn_idx;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNode l_Locks;
|
||||
if (node.GetNode(_T("a:cxnSpLocks"), l_Locks))
|
||||
{
|
||||
l_Locks.ReadAttributeBase(L"noAdjustHandles", noAdjustHandles);
|
||||
l_Locks.ReadAttributeBase(L"noChangeArrowheads", noChangeArrowheads);
|
||||
l_Locks.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
|
||||
l_Locks.ReadAttributeBase(L"noChangeShapeType", noChangeShapeType);
|
||||
l_Locks.ReadAttributeBase(L"noEditPoints", noEditPoints);
|
||||
l_Locks.ReadAttributeBase(L"noGrp", noGrp);
|
||||
l_Locks.ReadAttributeBase(L"noMove", noMove);
|
||||
l_Locks.ReadAttributeBase(L"noResize", noResize);
|
||||
l_Locks.ReadAttributeBase(L"noRot", noRot);
|
||||
l_Locks.ReadAttributeBase(L"noSelect", noSelect);
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode l_Cxn;
|
||||
if (node.GetNode(_T("a:stCxn"), l_Cxn))
|
||||
{
|
||||
l_Cxn.ReadAttributeBase(L"id", stCxn_id);
|
||||
l_Cxn.ReadAttributeBase(L"idx", stCxn_idx);
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode l_endCxn;
|
||||
if (node.GetNode(_T("a:endCxn"), l_endCxn))
|
||||
{
|
||||
l_endCxn.ReadAttributeBase(L"id", endCxn_id);
|
||||
l_endCxn.ReadAttributeBase(L"idx", endCxn_idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr1;
|
||||
oAttr1.Write(_T("noAdjustHandles"), noAdjustHandles);
|
||||
oAttr1.Write(_T("noChangeArrowheads"), noChangeArrowheads);
|
||||
oAttr1.Write(_T("noChangeAspect"), noChangeAspect);
|
||||
oAttr1.Write(_T("noChangeShapeType"), noChangeShapeType);
|
||||
oAttr1.Write(_T("noEditPoints"), noEditPoints);
|
||||
oAttr1.Write(_T("noGrp"), noGrp);
|
||||
oAttr1.Write(_T("noMove"), noMove);
|
||||
oAttr1.Write(_T("noResize"), noResize);
|
||||
oAttr1.Write(_T("noRot"), noRot);
|
||||
oAttr1.Write(_T("noSelect"), noSelect);
|
||||
|
||||
XmlUtils::CAttribute oAttr2;
|
||||
oAttr2.Write(_T("id"), stCxn_id);
|
||||
oAttr2.Write(_T("idx"), stCxn_idx);
|
||||
|
||||
XmlUtils::CAttribute oAttr3;
|
||||
oAttr3.Write(_T("id"), endCxn_id);
|
||||
oAttr3.Write(_T("idx"), endCxn_idx);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.m_strValue += XmlUtils::CreateNode(_T("a:cxnSpLocks"), oAttr1);
|
||||
|
||||
if (_T("") != oAttr2.m_strValue)
|
||||
oValue.m_strValue += XmlUtils::CreateNode(_T("a:stCxn"), oAttr2);
|
||||
if (_T("") != oAttr3.m_strValue)
|
||||
oValue.m_strValue += XmlUtils::CreateNode(_T("a:endCxn"), oAttr3);
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:cNvCxnSpPr"), oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("p:cNvCxnSpPr"));
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(_T("a:cxnSpLocks"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("noAdjustHandles"), noAdjustHandles);
|
||||
pWriter->WriteAttribute(_T("noChangeArrowheads"), noChangeArrowheads);
|
||||
pWriter->WriteAttribute(_T("noChangeAspect"), noChangeAspect);
|
||||
pWriter->WriteAttribute(_T("noChangeShapeType"), noChangeShapeType);
|
||||
pWriter->WriteAttribute(_T("noEditPoints"), noEditPoints);
|
||||
pWriter->WriteAttribute(_T("noGrp"), noGrp);
|
||||
pWriter->WriteAttribute(_T("noMove"), noMove);
|
||||
pWriter->WriteAttribute(_T("noResize"), noResize);
|
||||
pWriter->WriteAttribute(_T("noRot"), noRot);
|
||||
pWriter->WriteAttribute(_T("noSelect"), noSelect);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:cxnSpLocks"));
|
||||
|
||||
if (stCxn_id.is_init() || stCxn_idx.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("a:stCxn"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("id"), stCxn_id);
|
||||
pWriter->WriteAttribute(_T("idx"), stCxn_idx);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:stCxn"));
|
||||
}
|
||||
|
||||
if (endCxn_id.is_init() || endCxn_idx.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("a:endCxn"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("id"), endCxn_id);
|
||||
pWriter->WriteAttribute(_T("idx"), endCxn_idx);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:endCxn"));
|
||||
}
|
||||
|
||||
pWriter->EndNode(_T("p:cNvCxnSpPr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteBool2(0, noAdjustHandles);
|
||||
pWriter->WriteBool2(1, noChangeArrowheads);
|
||||
pWriter->WriteBool2(2, noChangeAspect);
|
||||
pWriter->WriteBool2(3, noChangeShapeType);
|
||||
pWriter->WriteBool2(4, noEditPoints);
|
||||
pWriter->WriteBool2(5, noGrp);
|
||||
pWriter->WriteBool2(6, noMove);
|
||||
pWriter->WriteBool2(7, noResize);
|
||||
pWriter->WriteBool2(8, noRot);
|
||||
pWriter->WriteBool2(9, noSelect);
|
||||
|
||||
pWriter->WriteInt2(10, stCxn_id);
|
||||
pWriter->WriteInt2(11, stCxn_idx);
|
||||
pWriter->WriteInt2(12, endCxn_id);
|
||||
pWriter->WriteInt2(13, endCxn_idx);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
noAdjustHandles = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
noChangeArrowheads = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
noChangeAspect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
noChangeShapeType = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
noEditPoints = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
noGrp = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
noMove = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
noResize = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
noRot = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
noSelect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
stCxn_id = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
stCxn_idx = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
{
|
||||
endCxn_id = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
endCxn_idx = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_bool noAdjustHandles;
|
||||
nullable_bool noChangeArrowheads;
|
||||
nullable_bool noChangeAspect;
|
||||
nullable_bool noChangeShapeType;
|
||||
nullable_bool noEditPoints;
|
||||
nullable_bool noGrp;
|
||||
nullable_bool noMove;
|
||||
nullable_bool noResize;
|
||||
nullable_bool noRot;
|
||||
nullable_bool noSelect;
|
||||
|
||||
nullable_int stCxn_id;
|
||||
nullable_int stCxn_idx;
|
||||
nullable_int endCxn_id;
|
||||
nullable_int endCxn_idx;
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
stCxn_id.normalize_positive();
|
||||
stCxn_idx.normalize_positive();
|
||||
endCxn_id.normalize_positive();
|
||||
endCxn_idx.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CNVCXNSPPR_INCLUDE_H
|
||||
199
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvGraphicFramePr.h
Normal file
199
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvGraphicFramePr.h
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CNVGRAPHICFRAMESPPR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CNVGRAPHICFRAMESPPR_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class CNvGraphicFramePr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(CNvGraphicFramePr)
|
||||
|
||||
CNvGraphicFramePr& operator=(const CNvGraphicFramePr& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
noChangeAspect = oSrc.noChangeAspect;
|
||||
noDrilldown = oSrc.noDrilldown;
|
||||
noGrp = oSrc.noGrp;
|
||||
noMove = oSrc.noMove;
|
||||
noResize = oSrc.noResize;
|
||||
noSelect = oSrc.noSelect;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (node.GetNode(_T("a:graphicFrameLocks"), oNode))
|
||||
{
|
||||
oNode.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
|
||||
oNode.ReadAttributeBase(L"noDrilldown", noDrilldown);
|
||||
oNode.ReadAttributeBase(L"noGrp", noGrp);
|
||||
oNode.ReadAttributeBase(L"noMove", noMove);
|
||||
oNode.ReadAttributeBase(L"noResize", noResize);
|
||||
oNode.ReadAttributeBase(L"noSelect", noSelect);
|
||||
}
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
|
||||
oAttr.Write(_T("noDrilldown"), noDrilldown);
|
||||
oAttr.Write(_T("noGrp"), noGrp);
|
||||
oAttr.Write(_T("noMove"), noMove);
|
||||
oAttr.Write(_T("noResize"), noResize);
|
||||
oAttr.Write(_T("noSelect"), noSelect);
|
||||
|
||||
if (_T("") == oAttr.m_strValue)
|
||||
return _T("<p:cNvGraphicFramePr/>");
|
||||
|
||||
return _T("<p:cNvGraphicFramePr>") + XmlUtils::CreateNode(_T("a:graphicFrameLocks"), oAttr) + _T("</p:cNvGraphicFramePr>");
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->StartNode(_T("xdr:cNvGraphicFramePr"));
|
||||
else
|
||||
pWriter->StartNode(_T("p:cNvGraphicFramePr"));
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(_T("a:graphicFrameLocks"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(_T("noChangeAspect"), noChangeAspect);
|
||||
pWriter->WriteAttribute(_T("noDrilldown"), noDrilldown);
|
||||
pWriter->WriteAttribute(_T("noGrp"), noGrp);
|
||||
pWriter->WriteAttribute(_T("noMove"), noMove);
|
||||
pWriter->WriteAttribute(_T("noResize"), noResize);
|
||||
pWriter->WriteAttribute(_T("noSelect"), noSelect);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->EndNode(_T("a:graphicFrameLocks"));
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->EndNode(_T("xdr:cNvGraphicFramePr"));
|
||||
else
|
||||
pWriter->EndNode(_T("p:cNvGraphicFramePr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteBool2(0, noChangeAspect);
|
||||
pWriter->WriteBool2(1, noDrilldown);
|
||||
pWriter->WriteBool2(2, noGrp);
|
||||
pWriter->WriteBool2(3, noMove);
|
||||
pWriter->WriteBool2(4, noResize);
|
||||
pWriter->WriteBool2(5, noSelect);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
noChangeAspect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
noDrilldown = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
noGrp = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
noMove = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
noResize = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
noSelect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_bool noChangeAspect;
|
||||
nullable_bool noDrilldown;
|
||||
nullable_bool noGrp;
|
||||
nullable_bool noMove;
|
||||
nullable_bool noResize;
|
||||
nullable_bool noSelect;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CNVGRAPHICFRAMESPPR_INCLUDE_H
|
||||
96
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvGrpSpPr.cpp
Normal file
96
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvGrpSpPr.cpp
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include "CNvGrpSpPr.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
CNvGrpSpPr::CNvGrpSpPr()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CNvGrpSpPr::~CNvGrpSpPr()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CNvGrpSpPr::CNvGrpSpPr(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
}
|
||||
|
||||
|
||||
const CNvGrpSpPr& CNvGrpSpPr::operator =(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void CNvGrpSpPr::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (node.GetNode(_T("a:grpSpLocks"), oNode))
|
||||
{
|
||||
oNode.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
|
||||
oNode.ReadAttributeBase(L"noGrp", noGrp);
|
||||
oNode.ReadAttributeBase(L"noMove", noMove);
|
||||
oNode.ReadAttributeBase(L"noResize", noResize);
|
||||
oNode.ReadAttributeBase(L"noRot", noRot);
|
||||
oNode.ReadAttributeBase(L"noSelect", noSelect);
|
||||
oNode.ReadAttributeBase(L"noUngrp", noUngrp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CString CNvGrpSpPr::toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
|
||||
oAttr.Write(_T("noGrp"), noGrp);
|
||||
oAttr.Write(_T("noMove"), noMove);
|
||||
oAttr.Write(_T("noResize"), noResize);
|
||||
oAttr.Write(_T("noRot"), noRot);
|
||||
oAttr.Write(_T("noSelect"), noSelect);
|
||||
oAttr.Write(_T("noUngrp"), noUngrp);
|
||||
|
||||
if (_T("") == oAttr.m_strValue)
|
||||
return _T("<p:cNvGrpSpPr/>");
|
||||
|
||||
return _T("<p:cNvGrpSpPr>") + XmlUtils::CreateNode(_T("a:grpSpLocks"), oAttr) + _T("</p:cNvGrpSpPr>");
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace PPTX
|
||||
248
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvGrpSpPr.h
Normal file
248
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvGrpSpPr.h
Normal file
@@ -0,0 +1,248 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CNVGRPSPPR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CNVGRPSPPR_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class CNvGrpSpPr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(CNvGrpSpPr)
|
||||
|
||||
CNvGrpSpPr& operator=(const CNvGrpSpPr& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
noChangeAspect = oSrc.noChangeAspect;
|
||||
noGrp = oSrc.noGrp;
|
||||
noMove = oSrc.noMove;
|
||||
noResize = oSrc.noResize;
|
||||
noRot = oSrc.noRot;
|
||||
noSelect = oSrc.noSelect;
|
||||
noUngrp = oSrc.noUngrp;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (node.GetNode(_T("a:grpSpLocks"), oNode))
|
||||
{
|
||||
oNode.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
|
||||
oNode.ReadAttributeBase(L"noGrp", noGrp);
|
||||
oNode.ReadAttributeBase(L"noMove", noMove);
|
||||
oNode.ReadAttributeBase(L"noResize", noResize);
|
||||
oNode.ReadAttributeBase(L"noRot", noRot);
|
||||
oNode.ReadAttributeBase(L"noSelect", noSelect);
|
||||
oNode.ReadAttributeBase(L"noUngrp", noUngrp);
|
||||
}
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
|
||||
oAttr.Write(_T("noGrp"), noGrp);
|
||||
oAttr.Write(_T("noMove"), noMove);
|
||||
oAttr.Write(_T("noResize"), noResize);
|
||||
oAttr.Write(_T("noRot"), noRot);
|
||||
oAttr.Write(_T("noSelect"), noSelect);
|
||||
oAttr.Write(_T("noUngrp"), noUngrp);
|
||||
|
||||
if (_T("") == oAttr.m_strValue)
|
||||
return _T("<p:cNvGrpSpPr/>");
|
||||
|
||||
return _T("<p:cNvGrpSpPr>") + XmlUtils::CreateNode(_T("a:grpSpLocks"), oAttr) + _T("</p:cNvGrpSpPr>");
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (!noChangeAspect.is_init() &&
|
||||
!noGrp.is_init() &&
|
||||
!noMove.is_init() &&
|
||||
!noResize.is_init() &&
|
||||
!noRot.is_init() &&
|
||||
!noSelect.is_init() &&
|
||||
!noUngrp.is_init())
|
||||
{
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->WriteString(_T("<xdr:cNvGrpSpPr/>"));
|
||||
else
|
||||
pWriter->WriteString(_T("<p:cNvGrpSpPr/>"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->WriteString(_T("<xdr:cNvGrpSpPr>"));
|
||||
else
|
||||
pWriter->WriteString(_T("<p:cNvGrpSpPr>"));
|
||||
|
||||
pWriter->StartNode(_T("a:grpSpLocks"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("noChangeAspect"), noChangeAspect);
|
||||
pWriter->WriteAttribute(_T("noGrp"), noGrp);
|
||||
pWriter->WriteAttribute(_T("noMove"), noMove);
|
||||
pWriter->WriteAttribute(_T("noResize"), noResize);
|
||||
pWriter->WriteAttribute(_T("noRot"), noRot);
|
||||
pWriter->WriteAttribute(_T("noSelect"), noSelect);
|
||||
pWriter->WriteAttribute(_T("noUngrp"), noUngrp);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->EndNode(_T("a:grpSpLocks"));
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->WriteString(_T("</xdr:cNvGrpSpPr>"));
|
||||
else
|
||||
pWriter->WriteString(_T("</p:cNvGrpSpPr>"));
|
||||
}
|
||||
|
||||
void toXmlWriter2(const CString& strNS, NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (!noChangeAspect.is_init() &&
|
||||
!noGrp.is_init() &&
|
||||
!noMove.is_init() &&
|
||||
!noResize.is_init() &&
|
||||
!noRot.is_init() &&
|
||||
!noSelect.is_init() &&
|
||||
!noUngrp.is_init())
|
||||
{
|
||||
pWriter->WriteString(_T("<") + strNS + _T(":cNvGrpSpPr/>"));
|
||||
return;
|
||||
}
|
||||
|
||||
pWriter->StartNode(strNS + _T(":cNvGrpSpPr"));
|
||||
pWriter->StartNode(_T("a:grpSpLocks"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("noChangeAspect"), noChangeAspect);
|
||||
pWriter->WriteAttribute(_T("noGrp"), noGrp);
|
||||
pWriter->WriteAttribute(_T("noMove"), noMove);
|
||||
pWriter->WriteAttribute(_T("noResize"), noResize);
|
||||
pWriter->WriteAttribute(_T("noRot"), noRot);
|
||||
pWriter->WriteAttribute(_T("noSelect"), noSelect);
|
||||
pWriter->WriteAttribute(_T("noUngrp"), noUngrp);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->EndNode(_T("a:grpSpLocks"));
|
||||
pWriter->EndNode(strNS + _T(":cNvGrpSpPr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteBool2(0, noChangeAspect);
|
||||
pWriter->WriteBool2(1, noGrp);
|
||||
pWriter->WriteBool2(2, noMove);
|
||||
pWriter->WriteBool2(3, noResize);
|
||||
pWriter->WriteBool2(4, noRot);
|
||||
pWriter->WriteBool2(5, noSelect);
|
||||
pWriter->WriteBool2(6, noUngrp);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
noChangeAspect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
noGrp = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
noMove = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
noResize = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
noRot = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
noSelect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
noUngrp = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_bool noChangeAspect;
|
||||
nullable_bool noGrp;
|
||||
nullable_bool noMove;
|
||||
nullable_bool noResize;
|
||||
nullable_bool noRot;
|
||||
nullable_bool noSelect;
|
||||
nullable_bool noUngrp;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CNVGRPSPPR_INCLUDE_H
|
||||
284
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvPicPr.h
Normal file
284
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvPicPr.h
Normal file
@@ -0,0 +1,284 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CNVPICPR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CNVPICPR_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class CNvPicPr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(CNvPicPr)
|
||||
|
||||
CNvPicPr& operator=(const CNvPicPr& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
preferRelativeResize = oSrc.preferRelativeResize;
|
||||
|
||||
noAdjustHandles = oSrc.noAdjustHandles;
|
||||
noChangeArrowheads = oSrc.noChangeArrowheads;
|
||||
noChangeAspect = oSrc.noChangeAspect;
|
||||
noChangeShapeType = oSrc.noChangeShapeType;
|
||||
noCrop = oSrc.noCrop;
|
||||
noEditPoints = oSrc.noEditPoints;
|
||||
noGrp = oSrc.noGrp;
|
||||
noMove = oSrc.noMove;
|
||||
noResize = oSrc.noResize;
|
||||
noRot = oSrc.noRot;
|
||||
noSelect = oSrc.noSelect;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"preferRelativeResize", preferRelativeResize);
|
||||
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (node.GetNode(_T("a:picLocks"), oNode))
|
||||
{
|
||||
oNode.ReadAttributeBase(L"noAdjustHandles", noAdjustHandles);
|
||||
oNode.ReadAttributeBase(L"noChangeArrowheads", noChangeArrowheads);
|
||||
oNode.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
|
||||
oNode.ReadAttributeBase(L"noChangeShapeType", noChangeShapeType);
|
||||
oNode.ReadAttributeBase(L"noCrop", noCrop);
|
||||
oNode.ReadAttributeBase(L"noEditPoints", noEditPoints);
|
||||
oNode.ReadAttributeBase(L"noGrp", noGrp);
|
||||
oNode.ReadAttributeBase(L"noMove", noMove);
|
||||
oNode.ReadAttributeBase(L"noResize", noResize);
|
||||
oNode.ReadAttributeBase(L"noRot", noRot);
|
||||
oNode.ReadAttributeBase(L"noSelect", noSelect);
|
||||
}
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("noAdjustHandles"), noAdjustHandles);
|
||||
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
|
||||
oAttr.Write(_T("noChangeArrowheads"), noChangeArrowheads);
|
||||
oAttr.Write(_T("noChangeShapeType"), noChangeShapeType);
|
||||
oAttr.Write(_T("noEditPoints"), noEditPoints);
|
||||
oAttr.Write(_T("noGrp"), noGrp);
|
||||
oAttr.Write(_T("noMove"), noMove);
|
||||
oAttr.Write(_T("noResize"), noResize);
|
||||
oAttr.Write(_T("noRot"), noRot);
|
||||
oAttr.Write(_T("noSelect"), noSelect);
|
||||
oAttr.Write(_T("noCrop"), noCrop);
|
||||
|
||||
XmlUtils::CAttribute oAttr2;
|
||||
oAttr2.Write(_T("preferRelativeResize"), preferRelativeResize);
|
||||
|
||||
if (_T("") == oAttr.m_strValue)
|
||||
{
|
||||
return XmlUtils::CreateNode(_T("p:cNvPicPr"), oAttr2);
|
||||
}
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:cNvPicPr"), oAttr2, XmlUtils::CreateNode(_T("a:picLocks"), oAttr));
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
pWriter->StartNode(_T("pic:cNvPicPr"));
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->StartNode(_T("xdr:cNvPicPr"));
|
||||
else
|
||||
pWriter->StartNode(_T("p:cNvPicPr"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("preferRelativeResize"), preferRelativeResize);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
if (noAdjustHandles.is_init() ||
|
||||
noChangeAspect.is_init() ||
|
||||
noChangeArrowheads.is_init() ||
|
||||
noChangeShapeType.is_init() ||
|
||||
noEditPoints.is_init() ||
|
||||
noGrp.is_init() ||
|
||||
noMove.is_init() ||
|
||||
noResize.is_init() ||
|
||||
noRot.is_init() ||
|
||||
noSelect.is_init() ||
|
||||
noCrop.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("a:picLocks"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("noAdjustHandles"), noAdjustHandles);
|
||||
pWriter->WriteAttribute(_T("noChangeAspect"), noChangeAspect);
|
||||
pWriter->WriteAttribute(_T("noChangeArrowheads"), noChangeArrowheads);
|
||||
pWriter->WriteAttribute(_T("noChangeShapeType"), noChangeShapeType);
|
||||
pWriter->WriteAttribute(_T("noEditPoints"), noEditPoints);
|
||||
pWriter->WriteAttribute(_T("noGrp"), noGrp);
|
||||
pWriter->WriteAttribute(_T("noMove"), noMove);
|
||||
pWriter->WriteAttribute(_T("noResize"), noResize);
|
||||
pWriter->WriteAttribute(_T("noRot"), noRot);
|
||||
pWriter->WriteAttribute(_T("noSelect"), noSelect);
|
||||
pWriter->WriteAttribute(_T("noCrop"), noCrop);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:picLocks"));
|
||||
}
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
pWriter->EndNode(_T("pic:cNvPicPr"));
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->EndNode(_T("xdr:cNvPicPr"));
|
||||
else
|
||||
pWriter->EndNode(_T("p:cNvPicPr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteBool2(0, preferRelativeResize);
|
||||
pWriter->WriteBool2(1, noAdjustHandles);
|
||||
pWriter->WriteBool2(2, noChangeArrowheads);
|
||||
pWriter->WriteBool2(3, noChangeAspect);
|
||||
pWriter->WriteBool2(4, noChangeShapeType);
|
||||
pWriter->WriteBool2(5, noCrop);
|
||||
pWriter->WriteBool2(6, noEditPoints);
|
||||
pWriter->WriteBool2(7, noGrp);
|
||||
pWriter->WriteBool2(8, noMove);
|
||||
pWriter->WriteBool2(9, noResize);
|
||||
pWriter->WriteBool2(10, noRot);
|
||||
pWriter->WriteBool2(11, noSelect);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
preferRelativeResize = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
noAdjustHandles = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
noChangeArrowheads = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
noChangeAspect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
noChangeShapeType = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
noCrop = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
noEditPoints = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
noGrp = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
noMove = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
noResize = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
noRot = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
noSelect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_bool preferRelativeResize;
|
||||
|
||||
nullable_bool noAdjustHandles;
|
||||
nullable_bool noChangeArrowheads;
|
||||
nullable_bool noChangeAspect;
|
||||
nullable_bool noChangeShapeType;
|
||||
nullable_bool noCrop;
|
||||
nullable_bool noEditPoints;
|
||||
nullable_bool noGrp;
|
||||
nullable_bool noMove;
|
||||
nullable_bool noResize;
|
||||
nullable_bool noRot;
|
||||
nullable_bool noSelect;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CNVPICPR_INCLUDE_H
|
||||
248
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvPr.h
Normal file
248
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvPr.h
Normal file
@@ -0,0 +1,248 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_C_NV_PROPERTIES_INCLUDE_H_
|
||||
#define PPTX_LOGIC_C_NV_PROPERTIES_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "Hyperlink.h"
|
||||
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class CNvPr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(CNvPr)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
id = node.ReadAttributeInt(L"id");
|
||||
name = node.GetAttribute(L"name");
|
||||
node.ReadAttributeBase(L"descr", descr);
|
||||
node.ReadAttributeBase(L"hidden", hidden);
|
||||
node.ReadAttributeBase(L"title", title);
|
||||
|
||||
hlinkClick = node.ReadNode(_T("a:hlinkClick"));
|
||||
hlinkHover = node.ReadNode(_T("a:hlinkHover"));
|
||||
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("id"), id);
|
||||
oAttr.Write(_T("name"), name);
|
||||
oAttr.Write(_T("descr"), descr);
|
||||
oAttr.Write(_T("hidden"), hidden);
|
||||
oAttr.Write(_T("title"), title);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(hlinkClick);
|
||||
oValue.WriteNullable(hlinkHover);
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:cNvPr"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
pWriter->StartNode(_T("pic:cNvPr"));
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->StartNode(_T("xdr:cNvPr"));
|
||||
else
|
||||
pWriter->StartNode(_T("p:cNvPr"));
|
||||
|
||||
int _id = id;
|
||||
if (_id < 0)
|
||||
{
|
||||
_id = pWriter->m_lObjectId;
|
||||
++pWriter->m_lObjectId;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pWriter->m_lObjectId <= _id)
|
||||
{
|
||||
pWriter->m_lObjectId = _id + 1;
|
||||
}
|
||||
}
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("id"), _id);
|
||||
pWriter->WriteAttribute(_T("name"), name);
|
||||
pWriter->WriteAttribute(_T("descr"), descr);
|
||||
pWriter->WriteAttribute(_T("hidden"), hidden);
|
||||
pWriter->WriteAttribute(_T("title"), title);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->Write(hlinkClick);
|
||||
pWriter->Write(hlinkHover);
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
pWriter->EndNode(_T("pic:cNvPr"));
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->EndNode(_T("xdr:cNvPr"));
|
||||
else
|
||||
pWriter->EndNode(_T("p:cNvPr"));
|
||||
}
|
||||
void toXmlWriter2(const CString& strNS, NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
|
||||
|
||||
|
||||
pWriter->StartNode(strNS + _T(":cNvPr"));
|
||||
|
||||
int _id = id;
|
||||
if (_id < 0)
|
||||
{
|
||||
_id = pWriter->m_lObjectId;
|
||||
++pWriter->m_lObjectId;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pWriter->m_lObjectId <= _id)
|
||||
{
|
||||
pWriter->m_lObjectId = _id + 1;
|
||||
}
|
||||
}
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("id"), _id);
|
||||
pWriter->WriteAttribute(_T("name"), name);
|
||||
pWriter->WriteAttribute(_T("descr"), descr);
|
||||
pWriter->WriteAttribute(_T("hidden"), hidden);
|
||||
pWriter->WriteAttribute(_T("title"), title);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->Write(hlinkClick);
|
||||
pWriter->Write(hlinkHover);
|
||||
|
||||
pWriter->EndNode(strNS + _T(":cNvPr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt1(0, id);
|
||||
pWriter->WriteString1(1, name);
|
||||
pWriter->WriteBool2(2, hidden);
|
||||
pWriter->WriteString2(3, title);
|
||||
pWriter->WriteString2(4, descr);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord2(0, hlinkClick);
|
||||
pWriter->WriteRecord2(1, hlinkHover);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
id = 1;
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
id = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = pReader->GetString2();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
hidden = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
title = pReader->GetString2();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
descr = pReader->GetString2();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
int id;
|
||||
CString name;
|
||||
nullable_string descr;
|
||||
nullable_bool hidden;
|
||||
nullable_string title;
|
||||
nullable<Hyperlink> hlinkClick;
|
||||
nullable<Hyperlink> hlinkHover;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(hlinkClick.IsInit())
|
||||
hlinkClick->SetParentPointer(this);
|
||||
if(hlinkHover.IsInit())
|
||||
hlinkHover->SetParentPointer(this);
|
||||
}
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
if (id < 0)
|
||||
id = 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_C_NV_PROPERTIES_INCLUDE_H
|
||||
316
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvSpPr.h
Normal file
316
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CNvSpPr.h
Normal file
@@ -0,0 +1,316 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CNVSPPR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CNVSPPR_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class CNvSpPr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(CNvSpPr)
|
||||
|
||||
CNvSpPr& operator=(const CNvSpPr& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
txBox = oSrc.txBox;
|
||||
noAdjustHandles = oSrc.noAdjustHandles;
|
||||
noChangeArrowheads = oSrc.noChangeArrowheads;
|
||||
noChangeAspect = oSrc.noChangeAspect;
|
||||
noChangeShapeType = oSrc.noChangeShapeType;
|
||||
noEditPoints = oSrc.noEditPoints;
|
||||
noGrp = oSrc.noGrp;
|
||||
noMove = oSrc.noMove;
|
||||
noResize = oSrc.noResize;
|
||||
noRot = oSrc.noRot;
|
||||
noSelect = oSrc.noSelect;
|
||||
noTextEdit = oSrc.noTextEdit;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"txBox", txBox);
|
||||
|
||||
XmlUtils::CXmlNode l_Locks;
|
||||
if (node.GetNode(_T("a:spLocks"), l_Locks))
|
||||
{
|
||||
l_Locks.ReadAttributeBase(L"noAdjustHandles", noAdjustHandles);
|
||||
l_Locks.ReadAttributeBase(L"noChangeArrowheads", noChangeArrowheads);
|
||||
l_Locks.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
|
||||
l_Locks.ReadAttributeBase(L"noChangeShapeType", noChangeShapeType);
|
||||
l_Locks.ReadAttributeBase(L"noEditPoints", noEditPoints);
|
||||
l_Locks.ReadAttributeBase(L"noGrp", noGrp);
|
||||
l_Locks.ReadAttributeBase(L"noMove", noMove);
|
||||
l_Locks.ReadAttributeBase(L"noResize", noResize);
|
||||
l_Locks.ReadAttributeBase(L"noRot", noRot);
|
||||
l_Locks.ReadAttributeBase(L"noSelect", noSelect);
|
||||
l_Locks.ReadAttributeBase(L"noTextEdit", noTextEdit);
|
||||
}
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr1;
|
||||
oAttr1.Write(_T("txBox"), txBox);
|
||||
|
||||
XmlUtils::CAttribute oAttr2;
|
||||
oAttr2.Write(_T("noAdjustHandles"), noAdjustHandles);
|
||||
oAttr2.Write(_T("noChangeArrowheads"), noChangeArrowheads);
|
||||
oAttr2.Write(_T("noChangeAspect"), noChangeAspect);
|
||||
oAttr2.Write(_T("noChangeShapeType"), noChangeShapeType);
|
||||
oAttr2.Write(_T("noEditPoints"), noEditPoints);
|
||||
oAttr2.Write(_T("noGrp"), noGrp);
|
||||
oAttr2.Write(_T("noMove"), noMove);
|
||||
oAttr2.Write(_T("noResize"), noResize);
|
||||
oAttr2.Write(_T("noRot"), noRot);
|
||||
oAttr2.Write(_T("noSelect"), noSelect);
|
||||
oAttr2.Write(_T("noTextEdit"), noTextEdit);
|
||||
|
||||
if (_T("") == oAttr2.m_strValue)
|
||||
return XmlUtils::CreateNode(_T("p:cNvSpPr"), oAttr1);
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:cNvSpPr"), oAttr1, XmlUtils::CreateNode(_T("a:spLocks"), oAttr2));
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->StartNode(_T("xdr:cNvSpPr"));
|
||||
else
|
||||
pWriter->StartNode(_T("p:cNvSpPr"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("txBox"), txBox);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
if (noAdjustHandles.is_init() ||
|
||||
noChangeArrowheads.is_init() ||
|
||||
noChangeAspect.is_init() ||
|
||||
noChangeShapeType.is_init() ||
|
||||
noEditPoints.is_init() ||
|
||||
noGrp.is_init() ||
|
||||
noMove.is_init() ||
|
||||
noResize.is_init() ||
|
||||
noRot.is_init() ||
|
||||
noSelect.is_init() ||
|
||||
noTextEdit.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("a:spLocks"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("noAdjustHandles"), noAdjustHandles);
|
||||
pWriter->WriteAttribute(_T("noChangeArrowheads"), noChangeArrowheads);
|
||||
pWriter->WriteAttribute(_T("noChangeAspect"), noChangeAspect);
|
||||
pWriter->WriteAttribute(_T("noChangeShapeType"), noChangeShapeType);
|
||||
pWriter->WriteAttribute(_T("noEditPoints"), noEditPoints);
|
||||
pWriter->WriteAttribute(_T("noGrp"), noGrp);
|
||||
pWriter->WriteAttribute(_T("noMove"), noMove);
|
||||
pWriter->WriteAttribute(_T("noResize"), noResize);
|
||||
pWriter->WriteAttribute(_T("noRot"), noRot);
|
||||
pWriter->WriteAttribute(_T("noSelect"), noSelect);
|
||||
pWriter->WriteAttribute(_T("noTextEdit"), noTextEdit);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->EndNode(_T("a:spLocks"));
|
||||
}
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pWriter->EndNode(_T("xdr:cNvSpPr"));
|
||||
else
|
||||
pWriter->EndNode(_T("p:cNvSpPr"));
|
||||
}
|
||||
|
||||
void toXmlWriter2(const CString& strNS, NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(strNS + _T(":cNvSpPr"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("txBox"), txBox);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
if (noAdjustHandles.is_init() ||
|
||||
noChangeArrowheads.is_init() ||
|
||||
noChangeAspect.is_init() ||
|
||||
noChangeShapeType.is_init() ||
|
||||
noEditPoints.is_init() ||
|
||||
noGrp.is_init() ||
|
||||
noMove.is_init() ||
|
||||
noResize.is_init() ||
|
||||
noRot.is_init() ||
|
||||
noSelect.is_init() ||
|
||||
noTextEdit.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("a:spLocks"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("noAdjustHandles"), noAdjustHandles);
|
||||
pWriter->WriteAttribute(_T("noChangeArrowheads"), noChangeArrowheads);
|
||||
pWriter->WriteAttribute(_T("noChangeAspect"), noChangeAspect);
|
||||
pWriter->WriteAttribute(_T("noChangeShapeType"), noChangeShapeType);
|
||||
pWriter->WriteAttribute(_T("noEditPoints"), noEditPoints);
|
||||
pWriter->WriteAttribute(_T("noGrp"), noGrp);
|
||||
pWriter->WriteAttribute(_T("noMove"), noMove);
|
||||
pWriter->WriteAttribute(_T("noResize"), noResize);
|
||||
pWriter->WriteAttribute(_T("noRot"), noRot);
|
||||
pWriter->WriteAttribute(_T("noSelect"), noSelect);
|
||||
pWriter->WriteAttribute(_T("noTextEdit"), noTextEdit);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->EndNode(_T("a:spLocks"));
|
||||
}
|
||||
|
||||
pWriter->EndNode(strNS + _T(":cNvSpPr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteBool2(0, txBox);
|
||||
pWriter->WriteBool2(1, noAdjustHandles);
|
||||
pWriter->WriteBool2(2, noChangeArrowheads);
|
||||
pWriter->WriteBool2(3, noChangeAspect);
|
||||
pWriter->WriteBool2(4, noChangeShapeType);
|
||||
pWriter->WriteBool2(5, noEditPoints);
|
||||
pWriter->WriteBool2(6, noGrp);
|
||||
pWriter->WriteBool2(7, noMove);
|
||||
pWriter->WriteBool2(8, noResize);
|
||||
pWriter->WriteBool2(9, noRot);
|
||||
pWriter->WriteBool2(10, noSelect);
|
||||
pWriter->WriteBool2(11, noTextEdit);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
txBox = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
noAdjustHandles = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
noChangeArrowheads = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
noChangeAspect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
noChangeShapeType = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
noEditPoints = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
noGrp = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
noMove = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
noResize = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
noRot = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
noSelect = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
noTextEdit = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_bool txBox;
|
||||
nullable_bool noAdjustHandles;
|
||||
nullable_bool noChangeArrowheads;
|
||||
nullable_bool noChangeAspect;
|
||||
nullable_bool noChangeShapeType;
|
||||
nullable_bool noEditPoints;
|
||||
nullable_bool noGrp;
|
||||
nullable_bool noMove;
|
||||
nullable_bool noResize;
|
||||
nullable_bool noRot;
|
||||
nullable_bool noSelect;
|
||||
nullable_bool noTextEdit;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CNVSPPR_INCLUDE_H
|
||||
158
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CSld.h
Normal file
158
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CSld.h
Normal file
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_SLIDES_COMMON_SLIDE_DATA_INCLUDE_H_
|
||||
#define PPTX_SLIDES_COMMON_SLIDE_DATA_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "Bg.h"
|
||||
#include "SpTree.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class CSld : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(CSld)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"name", attrName);
|
||||
bg = node.ReadNode(_T("p:bg"));
|
||||
spTree = node.ReadNodeNoNS(_T("spTree"));
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("name"), attrName);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(bg);
|
||||
oValue.Write(spTree);
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:cSld"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("p:cSld"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute2(_T("name"), attrName);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->Write(bg);
|
||||
spTree.toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(_T("p:cSld"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString2(0, attrName);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord2(0, bg);
|
||||
pWriter->WriteRecord1(1, spTree);
|
||||
}
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
if (0 == _at)
|
||||
attrName = pReader->GetString2();
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
bg = new Bg();
|
||||
bg->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
spTree.m_name = _T("p:spTree");
|
||||
spTree.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
pReader->Seek(_end_rec);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_string attrName;
|
||||
|
||||
nullable<Bg> bg;
|
||||
SpTree spTree;
|
||||
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(bg.IsInit())
|
||||
bg->SetParentPointer(this);
|
||||
spTree.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_SLIDES_COMMON_SLIDE_DATA_INCLUDE_H_
|
||||
95
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Camera.h
Normal file
95
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Camera.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CAMERA_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CAMERA_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "Rot.h"
|
||||
#include "./../Limit/CameraType.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Camera : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Camera)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
prst = node.GetAttribute(_T("prst"));
|
||||
node.ReadAttributeBase(L"fov", fov);
|
||||
node.ReadAttributeBase(L"zoom", zoom);
|
||||
|
||||
rot = node.ReadNode(_T("a:rot"));
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("prst"), prst.get());
|
||||
oAttr.Write(_T("fov"), fov);
|
||||
oAttr.Write(_T("zoom"), zoom);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(rot);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:camera"), oAttr, oValue);
|
||||
}
|
||||
public:
|
||||
nullable<Rot> rot;
|
||||
|
||||
Limit::CameraType prst;
|
||||
nullable_int fov;
|
||||
nullable_int zoom;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(rot.IsInit())
|
||||
rot->SetParentPointer(this);
|
||||
}
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
fov.normalize(0, 10800000);
|
||||
zoom.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CAMERA_INCLUDE_H_
|
||||
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Cell3D.h
Normal file
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Cell3D.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CELL3D_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CELL3D_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "./../Limit/Material.h"
|
||||
#include "Bevel.h"
|
||||
#include "LightRig.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class Cell3D : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Cell3D)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"prstMaterial", prstMaterial);
|
||||
|
||||
bevel = node.ReadNodeNoNS(_T("bevel"));
|
||||
lightRig = node.ReadNode(_T("a:lightRig"));
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.WriteLimitNullable(_T("prstMaterial"), prstMaterial);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(bevel);
|
||||
oValue.WriteNullable(lightRig);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:cell3D"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_limit<Limit::Material> prstMaterial;
|
||||
|
||||
nullable<Bevel> bevel;
|
||||
nullable<LightRig> lightRig;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(bevel.IsInit())
|
||||
bevel->SetParentPointer(this);
|
||||
if(lightRig.IsInit())
|
||||
lightRig->SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CELL3D_INCLUDE_H_
|
||||
196
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ClrMap.h
Normal file
196
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ClrMap.h
Normal file
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CLRMAP_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CLRMAP_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "./../Limit/ColorSchemeIndex.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class ClrMap : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(ClrMap)
|
||||
|
||||
ClrMap& operator=(const ClrMap& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
m_name = oSrc.m_name;
|
||||
|
||||
ColorMap.RemoveAll();
|
||||
POSITION pos = oSrc.ColorMap.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
const CAtlMap<CString, Limit::ColorSchemeIndex>::CPair* pPair = oSrc.ColorMap.GetNext(pos);
|
||||
ColorMap.SetAt(pPair->m_key, pPair->m_value);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = node.GetName();
|
||||
|
||||
ColorMap.RemoveAll();
|
||||
|
||||
Limit::ColorSchemeIndex lColorIndex;
|
||||
|
||||
lColorIndex._set(node.GetAttribute(_T("accent1"))); ColorMap.SetAt(_T("accent1"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("accent2"))); ColorMap.SetAt(_T("accent2"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("accent3"))); ColorMap.SetAt(_T("accent3"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("accent4"))); ColorMap.SetAt(_T("accent4"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("accent5"))); ColorMap.SetAt(_T("accent5"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("accent6"))); ColorMap.SetAt(_T("accent6"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("bg1"))); ColorMap.SetAt(_T("bg1"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("bg2"))); ColorMap.SetAt(_T("bg2"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("tx1"))); ColorMap.SetAt(_T("tx1"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("tx2"))); ColorMap.SetAt(_T("tx2"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("folHlink")));ColorMap.SetAt(_T("folHlink"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("hlink"))); ColorMap.SetAt(_T("hlink"), lColorIndex);
|
||||
}
|
||||
|
||||
void fromXMLW(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = node.GetName();
|
||||
|
||||
ColorMap.RemoveAll();
|
||||
|
||||
Limit::ColorSchemeIndex lColorIndex;
|
||||
|
||||
lColorIndex._set(node.GetAttribute(_T("w:accent1"))); ColorMap.SetAt(_T("accent1"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:accent2"))); ColorMap.SetAt(_T("accent2"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:accent3"))); ColorMap.SetAt(_T("accent3"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:accent4"))); ColorMap.SetAt(_T("accent4"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:accent5"))); ColorMap.SetAt(_T("accent5"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:accent6"))); ColorMap.SetAt(_T("accent6"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:bg1"))); ColorMap.SetAt(_T("bg1"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:bg2"))); ColorMap.SetAt(_T("bg2"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:t1"))); ColorMap.SetAt(_T("tx1"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:t2"))); ColorMap.SetAt(_T("tx2"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:followedHyperlink"))); ColorMap.SetAt(_T("folHlink"), lColorIndex);
|
||||
lColorIndex._set(node.GetAttribute(_T("w:hyperlink"))); ColorMap.SetAt(_T("hlink"), lColorIndex);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
|
||||
POSITION pos = ColorMap.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
oAttr.Write(ColorMap.GetKeyAt(pos), ColorMap.GetValueAt(pos).get());
|
||||
ColorMap.GetNext(pos);
|
||||
}
|
||||
|
||||
return XmlUtils::CreateNode(m_name, oAttr);
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(m_name);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
POSITION pos = ColorMap.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
pWriter->WriteAttribute(ColorMap.GetKeyAt(pos), ColorMap.GetValueAt(pos).get());
|
||||
ColorMap.GetNext(pos);
|
||||
}
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->EndNode(m_name);
|
||||
}
|
||||
|
||||
virtual CString GetColorSchemeIndex(const CString& str)const
|
||||
{
|
||||
const CAtlMap<CString, Limit::ColorSchemeIndex>::CPair* pPair = ColorMap.Lookup(str);
|
||||
if (NULL != pPair)
|
||||
return pPair->m_value.get();
|
||||
return str;
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
|
||||
POSITION pos = ColorMap.GetStartPosition();
|
||||
|
||||
while (NULL != pos)
|
||||
{
|
||||
const CAtlMap<CString, Limit::ColorSchemeIndex>::CPair* pPair = ColorMap.GetNext(pos);
|
||||
pWriter->WriteLimit1(SchemeClr_GetBYTECode(pPair->m_key), pPair->m_value);
|
||||
}
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _e = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
BYTE ind = pReader->GetUChar();
|
||||
Limit::ColorSchemeIndex _index;
|
||||
_index.SetStringCode(ind);
|
||||
|
||||
ColorMap.SetAt(SchemeClr_GetStringCode(_at), _index);
|
||||
}
|
||||
|
||||
pReader->Seek(_e);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
CAtlMap<CString, Limit::ColorSchemeIndex> ColorMap;
|
||||
|
||||
public:
|
||||
CString m_name;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CLRMAP_INCLUDE_H_
|
||||
109
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ClrMapOvr.h
Normal file
109
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ClrMapOvr.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_SLIDES_CLRMAPOVR_INCLUDE_H_
|
||||
#define PPTX_SLIDES_CLRMAPOVR_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "ClrMap.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class ClrMapOvr : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(ClrMapOvr)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
overrideClrMapping = node.ReadNodeNoNS(_T("overrideClrMapping"));
|
||||
if (overrideClrMapping.is_init())
|
||||
overrideClrMapping->m_name = _T("a:overrideClrMapping");
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
if (overrideClrMapping.IsInit())
|
||||
return _T("<p:clrMapOvr>") + overrideClrMapping->toXML() + _T("</p:clrMapOvr>");
|
||||
return _T("<p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr>");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteRecord2(0, overrideClrMapping);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (overrideClrMapping.is_init())
|
||||
{
|
||||
pWriter->WriteString(_T("<p:clrMapOvr>"));
|
||||
overrideClrMapping->m_name = _T("a:overrideClrMapping");
|
||||
overrideClrMapping->toXmlWriter(pWriter);
|
||||
pWriter->WriteString(_T("</p:clrMapOvr>"));
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->WriteString(_T("<p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr>"));
|
||||
}
|
||||
}
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _e = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
if (pReader->GetPos() < _e)
|
||||
{
|
||||
pReader->Skip(1);
|
||||
overrideClrMapping = new Logic::ClrMap();
|
||||
overrideClrMapping->fromPPTY(pReader);
|
||||
}
|
||||
|
||||
pReader->Seek(_e);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<ClrMap> overrideClrMapping;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(overrideClrMapping.IsInit())
|
||||
overrideClrMapping->SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_SLIDES_CLRMAPOVR_INCLUDE_H_
|
||||
610
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/ColorBase.h
Normal file
610
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/ColorBase.h
Normal file
@@ -0,0 +1,610 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_COLORBASE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_COLORBASE_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "ColorModifier.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
const double cd16 = 1.0/6.0;
|
||||
const double cd13 = 1.0/3.0;
|
||||
const double cd23 = 2.0/3.0;
|
||||
|
||||
namespace Logic
|
||||
{
|
||||
class ColorBase : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
ColorBase()
|
||||
{
|
||||
alpha = 255;
|
||||
red = 0;
|
||||
green = 0;
|
||||
blue = 0;
|
||||
hue = 0;
|
||||
saturation = 0;
|
||||
luminance = 0;
|
||||
}
|
||||
ColorBase(const ColorBase& oSrc)
|
||||
{
|
||||
*this = oSrc;
|
||||
}
|
||||
ColorBase& operator=(const ColorBase& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
alpha = oSrc.alpha;
|
||||
red = oSrc.red;
|
||||
green = oSrc.green;
|
||||
blue = oSrc.blue;
|
||||
hue = oSrc.hue;
|
||||
saturation = oSrc.saturation;
|
||||
luminance = oSrc.luminance;
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual ~ColorBase()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
virtual DWORD ColorBase::GetRGBA(DWORD RGBA) const
|
||||
{
|
||||
return ApplyModifiers(ctRGBA);
|
||||
}
|
||||
|
||||
virtual DWORD ColorBase::GetARGB(DWORD ARGB) const
|
||||
{
|
||||
return ApplyModifiers(ctARGB);
|
||||
}
|
||||
|
||||
virtual DWORD ColorBase::GetBGRA(DWORD BGRA) const
|
||||
{
|
||||
return ApplyModifiers(ctBGRA);
|
||||
}
|
||||
|
||||
virtual DWORD ColorBase::GetABGR(DWORD ABGR) const
|
||||
{
|
||||
return ApplyModifiers(ctABGR);
|
||||
}
|
||||
|
||||
virtual DWORD GetRGBColor(NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap, DWORD ARGB = 0)
|
||||
{
|
||||
return GetARGB(ARGB);
|
||||
}
|
||||
|
||||
void SetRGB(const BYTE& R, const BYTE& G, const BYTE& B)
|
||||
{
|
||||
red = R;
|
||||
green = G;
|
||||
blue = B;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
unsigned char alpha;
|
||||
unsigned char red;
|
||||
unsigned char green;
|
||||
unsigned char blue;
|
||||
unsigned char hue;
|
||||
unsigned char saturation;
|
||||
unsigned char luminance;
|
||||
|
||||
enum ColorType {ctRGBA, ctARGB, ctBGRA, ctABGR};
|
||||
virtual DWORD ApplyModifiers(const ColorType ct)const
|
||||
{
|
||||
unsigned char components[7];
|
||||
components[0] = alpha;
|
||||
components[1] = red;
|
||||
components[2] = green;
|
||||
components[3] = blue;
|
||||
components[4] = hue;
|
||||
components[5] = saturation;
|
||||
components[6] = luminance;
|
||||
|
||||
size_t nCount = Modifiers.GetCount();
|
||||
for (size_t i = 0; i != nCount; ++i)
|
||||
{
|
||||
const Logic::ColorModifier* colorMod = &Modifiers[i];
|
||||
double val = colorMod->val.get_value_or(0)/100000.0;
|
||||
|
||||
CString name = XmlUtils::GetNameNoNS(colorMod->name);
|
||||
if (_T("") == name)
|
||||
continue;
|
||||
|
||||
switch((CHAR)name[0])
|
||||
{
|
||||
case 'a':
|
||||
if(name == _T("alpha"))
|
||||
{
|
||||
if(val > 1)
|
||||
components[0] = 255;
|
||||
else
|
||||
components[0] = static_cast<unsigned char>(255*val);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case 'b':
|
||||
if(name == _T("blue"))
|
||||
{
|
||||
if(val > 1)
|
||||
components[3] = 255;
|
||||
else
|
||||
components[3] = static_cast<unsigned char>(255*val);
|
||||
break;
|
||||
}
|
||||
if(name == _T("blueMod"))
|
||||
{
|
||||
if(components[3]*val > 255)
|
||||
components[3] = 255;
|
||||
else
|
||||
components[3] = static_cast<unsigned char>(components[3]*val);
|
||||
break;
|
||||
}
|
||||
if(name == _T("blueOff"))
|
||||
{
|
||||
if(components[3] + val*255 < 0)
|
||||
components[3] = 0;
|
||||
else if(components[3] + val*255 > 255)
|
||||
components[3] = 255;
|
||||
else components[3] = static_cast<unsigned char>(components[3] + val*255);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '<EFBFBD>':
|
||||
|
||||
break;
|
||||
case 'g':
|
||||
|
||||
|
||||
if(name == _T("green"))
|
||||
{
|
||||
if(val > 1)
|
||||
components[2] = 255;
|
||||
else
|
||||
components[2] = static_cast<unsigned char>(255*val);
|
||||
break;
|
||||
}
|
||||
if(name == _T("greenMod"))
|
||||
{
|
||||
if(components[2]*val > 255)
|
||||
components[2] = 255;
|
||||
else
|
||||
components[2] = static_cast<unsigned char>(components[2]*val);
|
||||
break;
|
||||
}
|
||||
if(name == _T("greenOff"))
|
||||
{
|
||||
if(components[2] + val*255 < 0)
|
||||
components[2] = 0;
|
||||
else if(components[2] + val*255 > 255)
|
||||
components[2] = 255;
|
||||
else components[2] = static_cast<unsigned char>(components[2] + val*255);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'h':
|
||||
|
||||
|
||||
if(name == _T("hueOff"))
|
||||
{
|
||||
RGB2HSL(&components[1], &components[4]);
|
||||
int res = (int)(components[4] + (val * 10.0) / 9.0);
|
||||
while(res > 240)
|
||||
res = res - 240;
|
||||
while(res < 0)
|
||||
res += 240;
|
||||
components[4] = static_cast<unsigned char>(res);
|
||||
HSL2RGB(&components[4], &components[1]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
if(name == _T("inv"))
|
||||
{
|
||||
components[1] = components[1] ^ 0xFF;
|
||||
components[2] = components[2] ^ 0xFF;
|
||||
components[3] = components[3] ^ 0xFF;
|
||||
}
|
||||
|
||||
break;
|
||||
case 'l':
|
||||
|
||||
if(name == _T("lumMod"))
|
||||
{
|
||||
RGB2HSL(&components[1], &components[4]);
|
||||
if(components[6]*val > 240)
|
||||
components[6] = 240;
|
||||
else
|
||||
components[6] = static_cast<unsigned char>(components[6]*val);
|
||||
HSL2RGB(&components[4], &components[1]);
|
||||
break;
|
||||
}
|
||||
if(name == _T("lumOff"))
|
||||
{
|
||||
RGB2HSL(&components[1], &components[4]);
|
||||
int res = (int)(components[6] + val * 240);
|
||||
if(res > 240)
|
||||
res = 240;
|
||||
if(res < 0)
|
||||
res = 0;
|
||||
components[6] = static_cast<unsigned char>(res);
|
||||
HSL2RGB(&components[4], &components[1]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
if(name == _T("red"))
|
||||
{
|
||||
if(val > 1)
|
||||
components[1] = 255;
|
||||
else
|
||||
components[1] = static_cast<unsigned char>(255*val);
|
||||
break;
|
||||
}
|
||||
if(name == _T("redMod"))
|
||||
{
|
||||
if(components[1]*val > 255)
|
||||
components[1] = 255;
|
||||
else
|
||||
components[1] = static_cast<unsigned char>(components[1]*val);
|
||||
break;
|
||||
}
|
||||
if(name == _T("redOff"))
|
||||
{
|
||||
if(components[1] + val*255 < 0)
|
||||
components[1] = 0;
|
||||
else if(components[1] + val*255 > 255)
|
||||
components[1] = 255;
|
||||
else components[1] = static_cast<unsigned char>(components[1] + val*255);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
|
||||
if(name == _T("satMod"))
|
||||
{
|
||||
RGB2HSL(&components[1], &components[4]);
|
||||
if(components[5]*val > 240)
|
||||
components[5] = 240;
|
||||
else
|
||||
components[5] = static_cast<unsigned char>(components[5]*val);
|
||||
HSL2RGB(&components[4], &components[1]);
|
||||
break;
|
||||
}
|
||||
if(name == _T("satOff"))
|
||||
{
|
||||
RGB2HSL(&components[1], &components[4]);
|
||||
int res = (int)(components[5] + val * 240);
|
||||
if(res > 240)
|
||||
res = 240;
|
||||
if(res < 0)
|
||||
res = 0;
|
||||
components[5] = static_cast<unsigned char>(res);
|
||||
HSL2RGB(&components[4], &components[1]);
|
||||
break;
|
||||
}
|
||||
if(name == _T("shade"))
|
||||
{
|
||||
components[1] = static_cast<unsigned char>(components[1]*val);
|
||||
components[2] = static_cast<unsigned char>(components[2]*val);
|
||||
components[3] = static_cast<unsigned char>(components[3]*val);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
if(name == _T("tint"))
|
||||
{
|
||||
components[1] = static_cast<unsigned char>(255-(255-components[1])*val);
|
||||
components[2] = static_cast<unsigned char>(255-(255-components[2])*val);
|
||||
components[3] = static_cast<unsigned char>(255-(255-components[3])*val);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(ct == ctARGB)
|
||||
{
|
||||
DWORD ARGB = components[0];
|
||||
ARGB = ARGB<<8;
|
||||
ARGB += components[1];
|
||||
ARGB = ARGB<<8;
|
||||
ARGB += components[2];
|
||||
ARGB = ARGB<<8;
|
||||
ARGB += components[3];
|
||||
return ARGB;
|
||||
}
|
||||
else if(ct == ctRGBA)
|
||||
{
|
||||
DWORD RGBA = components[1];
|
||||
RGBA = RGBA<<8;
|
||||
RGBA += components[2];
|
||||
RGBA = RGBA<<8;
|
||||
RGBA += components[3];
|
||||
RGBA = RGBA<<8;
|
||||
RGBA += components[0];
|
||||
return RGBA;
|
||||
}
|
||||
else if(ct == ctBGRA)
|
||||
{
|
||||
DWORD BGRA = components[3];
|
||||
BGRA = BGRA<<8;
|
||||
BGRA += components[2];
|
||||
BGRA = BGRA<<8;
|
||||
BGRA += components[1];
|
||||
BGRA = BGRA<<8;
|
||||
BGRA += components[0];
|
||||
return BGRA;
|
||||
}
|
||||
else if(ct == ctABGR)
|
||||
{
|
||||
DWORD ABGR = components[0];
|
||||
ABGR = ABGR<<8;
|
||||
ABGR += components[3];
|
||||
ABGR = ABGR<<8;
|
||||
ABGR += components[2];
|
||||
ABGR = ABGR<<8;
|
||||
ABGR += components[1];
|
||||
return ABGR;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void SetRGB2HSL()
|
||||
{
|
||||
int iMin = min( red, min(green, blue));
|
||||
int iMax = max( red, max(green, blue));
|
||||
int iDelta = iMax - iMin;
|
||||
double dMax = ( iMax + iMin )/255.0;
|
||||
double dDelta = iDelta/255.0;
|
||||
double H,S,L;
|
||||
|
||||
L = dMax / 2.0;
|
||||
|
||||
if ( iDelta == 0 )
|
||||
{
|
||||
H = 0.0;
|
||||
S = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( L < 0.5 ) S = dDelta / dMax;
|
||||
else S = dDelta / ( 2.0 - dMax );
|
||||
|
||||
dDelta = dDelta * 1530.0;
|
||||
double dR = ( iMax - red ) / dDelta;
|
||||
double dG = ( iMax - green ) / dDelta;
|
||||
double dB = ( iMax - blue ) / dDelta;
|
||||
|
||||
if ( red == iMax ) H = dB - dG;
|
||||
else if ( green == iMax ) H = cd13 + dR - dB;
|
||||
else if ( blue == iMax ) H = cd23 + dG - dR;
|
||||
|
||||
if ( H < 0.0 ) H += 1.0;
|
||||
if ( H > 1.0 ) H -= 1.0;
|
||||
}
|
||||
|
||||
hue = static_cast<unsigned char>(H * 240.0);
|
||||
saturation = static_cast<unsigned char>(S * 240.0);
|
||||
luminance = static_cast<unsigned char>(L * 240.0);
|
||||
}
|
||||
void SetHSL2RGB()
|
||||
{
|
||||
if ( saturation == 0 )
|
||||
{
|
||||
red = luminance;
|
||||
green = luminance;
|
||||
blue = luminance;
|
||||
}
|
||||
else
|
||||
{
|
||||
double H = double(hue)/240.0;
|
||||
double S = double(saturation)/240.0;
|
||||
double L = double(luminance)/240.0;
|
||||
double v2;
|
||||
if ( L < 0.5 ) v2 = L * ( 1.0 + S );
|
||||
else v2 = L + S - S*L;
|
||||
|
||||
double v1 = 2.0 * L - v2;
|
||||
|
||||
red = static_cast<unsigned char>(255 * Hue_2_RGB( v1, v2, H + cd13 ) );
|
||||
green = static_cast<unsigned char>(255 * Hue_2_RGB( v1, v2, H ) );
|
||||
blue = static_cast<unsigned char>(255 * Hue_2_RGB( v1, v2, H - cd13 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void RGB2HSL(unsigned char* RGB, unsigned char* HSL)
|
||||
{
|
||||
int iMin = min( RGB[0], min(RGB[1], RGB[2]));
|
||||
int iMax = max( RGB[0], max(RGB[1], RGB[2]));
|
||||
int iDelta = iMax - iMin;
|
||||
double dMax = ( iMax + iMin )/255.0;
|
||||
double dDelta = iDelta/255.0;
|
||||
double H,S,L;
|
||||
|
||||
L = dMax / 2.0;
|
||||
|
||||
if ( iDelta == 0 )
|
||||
{
|
||||
H = 0.0;
|
||||
S = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( L < 0.5 ) S = dDelta / dMax;
|
||||
else S = dDelta / ( 2.0 - dMax );
|
||||
|
||||
dDelta = dDelta * 1530.0;
|
||||
double dR = ( iMax - RGB[0] ) / dDelta;
|
||||
double dG = ( iMax - RGB[1] ) / dDelta;
|
||||
double dB = ( iMax - RGB[2] ) / dDelta;
|
||||
|
||||
if ( RGB[0] == iMax ) H = dB - dG;
|
||||
else if ( RGB[1] == iMax ) H = cd13 + dR - dB;
|
||||
else if ( RGB[2] == iMax ) H = cd23 + dG - dR;
|
||||
|
||||
if ( H < 0.0 ) H += 1.0;
|
||||
if ( H > 1.0 ) H -= 1.0;
|
||||
}
|
||||
|
||||
HSL[0] = static_cast<unsigned char>(H * 240.0);
|
||||
HSL[1] = static_cast<unsigned char>(S * 240.0);
|
||||
HSL[2] = static_cast<unsigned char>(L * 240.0);
|
||||
}
|
||||
|
||||
static void HSL2RGB(unsigned char* HSL, unsigned char* RGB)
|
||||
{
|
||||
if ( HSL[1] == 0 )
|
||||
{
|
||||
RGB[0] = HSL[2];
|
||||
RGB[1] = HSL[2];
|
||||
RGB[2] = HSL[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
double H = double(HSL[0])/240.0;
|
||||
double S = double(HSL[1])/240.0;
|
||||
double L = double(HSL[2])/240.0;
|
||||
double v2;
|
||||
if ( L < 0.5 ) v2 = L * ( 1.0 + S );
|
||||
else v2 = L + S - S*L;
|
||||
|
||||
double v1 = 2.0 * L - v2;
|
||||
|
||||
RGB[0] = static_cast<unsigned char>(255 * Hue_2_RGB( v1, v2, H + cd13 ) );
|
||||
RGB[1] = static_cast<unsigned char>(255 * Hue_2_RGB( v1, v2, H ) );
|
||||
RGB[2] = static_cast<unsigned char>(255 * Hue_2_RGB( v1, v2, H - cd13 ) );
|
||||
}
|
||||
}
|
||||
|
||||
static double Hue_2_RGB(double v1,double v2,double vH)
|
||||
{
|
||||
if ( vH < 0.0 ) vH += 1.0;
|
||||
if ( vH > 1.0 ) vH -= 1.0;
|
||||
if ( vH < cd16 ) return v1 + ( v2 - v1 ) * 6.0 * vH;
|
||||
if ( vH < 0.5 ) return v2;
|
||||
if ( vH < cd23 ) return v1 + ( v2 - v1 ) * ( cd23 - vH ) * 6.0;
|
||||
return v1;
|
||||
}
|
||||
const int HexChar2Int(const char value)
|
||||
{
|
||||
if (value >= '0' && value <= '9')
|
||||
return value - '0';
|
||||
if (value >= 'a' && value <= 'f')
|
||||
return 10 + value - 'a';
|
||||
if (value >= 'A' && value <= 'F')
|
||||
return 10 + value - 'A';
|
||||
return 0;
|
||||
}
|
||||
|
||||
const int HexString2Int(const CString& value)
|
||||
{
|
||||
int summa = 0;
|
||||
for (int i = 0; i != value.GetLength(); ++i)
|
||||
summa += HexChar2Int((char)value[i]) << (4 * (value.GetLength() - i - 1));
|
||||
return summa;
|
||||
}
|
||||
public:
|
||||
CAtlArray<ColorModifier> Modifiers;
|
||||
|
||||
public:
|
||||
void ReadModsFromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _start = pReader->GetPos();
|
||||
LONG _end = _start + pReader->GetLong() + 4;
|
||||
|
||||
ULONG _count = pReader->GetULong();
|
||||
for (ULONG i = 0; i < _count; ++i)
|
||||
{
|
||||
if (pReader->GetPos() > _end)
|
||||
break;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
LONG _s1 = pReader->GetPos();
|
||||
LONG _e1 = _s1 + pReader->GetLong() + 4;
|
||||
|
||||
if (_s1 < _e1)
|
||||
{
|
||||
pReader->Skip(1);
|
||||
|
||||
ColorModifier _mod;
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _type = pReader->GetUChar();
|
||||
|
||||
if (0 == _type)
|
||||
{
|
||||
CString _name = pReader->GetString2();
|
||||
int _find = _name.Find(_T(":"));
|
||||
if (_find >= 0 && _find < (_name.GetLength() - 1))
|
||||
_name = _name.Mid(_find + 1);
|
||||
|
||||
_mod.name = _T("a:") + _name;
|
||||
}
|
||||
else if (1 == _type)
|
||||
_mod.val = pReader->GetLong();
|
||||
else if (NSBinPptxRW::g_nodeAttributeEnd == _type)
|
||||
break;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
Modifiers.Add(_mod);
|
||||
}
|
||||
|
||||
pReader->Seek(_e1);
|
||||
}
|
||||
|
||||
pReader->Seek(_end);
|
||||
}
|
||||
|
||||
friend class UniColor;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_COLORBASE_INCLUDE_H
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_COLORMODIFIER_INCLUDE_H_
|
||||
#define PPTX_LOGIC_COLORMODIFIER_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class ColorModifier : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(ColorModifier)
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
name = node.GetName();
|
||||
node.ReadAttributeBase(L"val", val);
|
||||
|
||||
if (name == _T("a:alpha"))
|
||||
{
|
||||
nullable_string sTmp;
|
||||
node.ReadAttributeBase(L"val", sTmp);
|
||||
|
||||
if (val.is_init() && sTmp.is_init() && sTmp->Find(TCHAR('%')) != -1)
|
||||
*val = (*val) * 1000;
|
||||
}
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("val"), val);
|
||||
return XmlUtils::CreateNode(name, oAttr);
|
||||
}
|
||||
|
||||
ColorModifier& operator=(const ColorModifier& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
name = oSrc.name;
|
||||
val = oSrc.val;
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, name);
|
||||
pWriter->WriteInt2(1, val);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(name);
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("val"), val);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(name);
|
||||
}
|
||||
|
||||
public:
|
||||
CString name;
|
||||
nullable_int val;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_COLORMODIFIER_INCLUDE_H
|
||||
390
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/PrstClr.h
Normal file
390
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/PrstClr.h
Normal file
@@ -0,0 +1,390 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_PRSTCLR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_PRSTCLR_INCLUDE_H_
|
||||
|
||||
#include "./../../Limit/PrstClrVal.h"
|
||||
#include "ColorBase.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class PrstClr : public ColorBase
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(PrstClr)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
val = node.GetAttribute(_T("val"));
|
||||
Modifiers.RemoveAll();
|
||||
node.LoadArray(_T("*"), Modifiers);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("val"), val.get());
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(Modifiers);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:prstClr"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:prstClr"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("val"), val.get());
|
||||
pWriter->EndAttributes();
|
||||
|
||||
size_t nCount = Modifiers.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
Modifiers[i].toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(_T("a:prstClr"));
|
||||
}
|
||||
|
||||
virtual DWORD PrstClr::GetRGBA(DWORD RGBA) const
|
||||
{
|
||||
PrstClr* pColor = const_cast<PrstClr*>(this);
|
||||
pColor->FillRGBFromVal();
|
||||
return ColorBase::GetRGBA(RGBA);
|
||||
}
|
||||
|
||||
virtual DWORD PrstClr::GetARGB(DWORD ARGB) const
|
||||
{
|
||||
PrstClr* pColor = const_cast<PrstClr*>(this);
|
||||
pColor->FillRGBFromVal();
|
||||
return ColorBase::GetARGB(ARGB);
|
||||
}
|
||||
|
||||
virtual DWORD GetBGRA(DWORD BGRA) const
|
||||
{
|
||||
PrstClr* pColor = const_cast<PrstClr*>(this);
|
||||
pColor->FillRGBFromVal();
|
||||
return ColorBase::GetBGRA(BGRA);
|
||||
}
|
||||
|
||||
virtual DWORD GetABGR(DWORD ABGR) const
|
||||
{
|
||||
PrstClr* pColor = const_cast<PrstClr*>(this);
|
||||
pColor->FillRGBFromVal();
|
||||
return ColorBase::GetABGR(ABGR);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(COLOR_TYPE_PRST);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, val.get());
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
ULONG len = (ULONG)Modifiers.GetCount();
|
||||
if (len != 0)
|
||||
{
|
||||
pWriter->StartRecord(0);
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(1, Modifiers[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
private:
|
||||
void FillRGBFromVal()
|
||||
{
|
||||
DWORD RGB = 0;
|
||||
CString str = val.get();
|
||||
if(str != _T(""))
|
||||
{
|
||||
switch(str[0])
|
||||
{
|
||||
case 'a':
|
||||
if(str == _T("aliceBlue")) {RGB = 0xF0F8FF; break;}
|
||||
if(str == _T("antiqueWhite")) {RGB = 0xFAEBD7; break;}
|
||||
if(str == _T("aqua")) {RGB = 0x00FFFF; break;}
|
||||
if(str == _T("aquamarine")) {RGB = 0x7FFFD4; break;}
|
||||
if(str == _T("azure")) {RGB = 0xF0FFFF; break;}
|
||||
break;
|
||||
case 'b':
|
||||
if(str == _T("beige")) {RGB = 0xF5F5DC; break;}
|
||||
if(str == _T("bisque")) {RGB = 0xFFE4C4; break;}
|
||||
if(str == _T("black")) {RGB = 0x000000; break;}
|
||||
if(str == _T("blanchedAlmond")) {RGB = 0xFFEBCD; break;}
|
||||
if(str == _T("blue")) {RGB = 0x0000FF; break;}
|
||||
if(str == _T("blueViolet")) {RGB = 0x8A2BE2; break;}
|
||||
if(str == _T("brown")) {RGB = 0xA52A2A; break;}
|
||||
if(str == _T("burlyWood")) {RGB = 0xDEB887; break;}
|
||||
break;
|
||||
case 'c':
|
||||
if(str == _T("cadetBlue")) {RGB = 0x5F9EA0; break;}
|
||||
if(str == _T("chartreuse")) {RGB = 0x7FFF00; break;}
|
||||
if(str == _T("chocolate")) {RGB = 0xD2691E; break;}
|
||||
if(str == _T("coral")) {RGB = 0xFF7F50; break;}
|
||||
if(str == _T("cornflowerBlue")) {RGB = 0x6495ED; break;}
|
||||
if(str == _T("cornsilk")) {RGB = 0xFFF8DC; break;}
|
||||
if(str == _T("crimson")) {RGB = 0xDC143C; break;}
|
||||
if(str == _T("cyan")) {RGB = 0x00FFFF; break;}
|
||||
break;
|
||||
case 'd':
|
||||
if(str == _T("darkBlue")) {RGB = 0x00008B; break;}
|
||||
if(str == _T("darkCyan")) {RGB = 0x008B8B; break;}
|
||||
if(str == _T("darkGoldenrod")) {RGB = 0xB8860B; break;}
|
||||
if(str == _T("darkGray")) {RGB = 0xA9A9A9; break;}
|
||||
if(str == _T("darkGreen")) {RGB = 0x006400; break;}
|
||||
if(str == _T("darkGrey")) {RGB = 0xA9A9A9; break;}
|
||||
if(str == _T("darkKhaki")) {RGB = 0xBDB76B; break;}
|
||||
if(str == _T("darkMagenta")) {RGB = 0x8B008B; break;}
|
||||
if(str == _T("darkOliveGreen")) {RGB = 0x556B2F; break;}
|
||||
if(str == _T("darkOrange")) {RGB = 0xFF8C00; break;}
|
||||
if(str == _T("darkOrchid")) {RGB = 0x9932CC; break;}
|
||||
if(str == _T("darkRed")) {RGB = 0x8B0000; break;}
|
||||
if(str == _T("darkSalmon")) {RGB = 0xE9967A; break;}
|
||||
if(str == _T("darkSeaGreen")) {RGB = 0x8FBC8F; break;}
|
||||
if(str == _T("darkSlateBlue")) {RGB = 0x483D8B; break;}
|
||||
if(str == _T("darkSlateGray")) {RGB = 0x2F4F4F; break;}
|
||||
if(str == _T("darkSlateGrey")) {RGB = 0x2F4F4F; break;}
|
||||
if(str == _T("darkTurquoise")) {RGB = 0x00CED1; break;}
|
||||
if(str == _T("darkViolet")) {RGB = 0x9400D3; break;}
|
||||
if(str == _T("deepPink")) {RGB = 0xFF1493; break;}
|
||||
if(str == _T("deepSkyBlue")) {RGB = 0x00BFFF; break;}
|
||||
if(str == _T("dimGray")) {RGB = 0x696969; break;}
|
||||
if(str == _T("dimGrey")) {RGB = 0x696969; break;}
|
||||
if(str == _T("dkBlue")) {RGB = 0x00008B; break;}
|
||||
if(str == _T("dkCyan")) {RGB = 0x008B8B; break;}
|
||||
if(str == _T("dkGoldenrod")) {RGB = 0xB8860B; break;}
|
||||
if(str == _T("dkGray")) {RGB = 0xA9A9A9; break;}
|
||||
if(str == _T("dkGreen")) {RGB = 0x006400; break;}
|
||||
if(str == _T("dkGrey")) {RGB = 0xA9A9A9; break;}
|
||||
if(str == _T("dkKhaki")) {RGB = 0xBDB76B; break;}
|
||||
if(str == _T("dkMagenta")) {RGB = 0x8B008B; break;}
|
||||
if(str == _T("dkOliveGreen")) {RGB = 0x556B2F; break;}
|
||||
if(str == _T("dkOrange")) {RGB = 0xFF8C00; break;}
|
||||
if(str == _T("dkOrchid")) {RGB = 0x9932CC; break;}
|
||||
if(str == _T("dkRed")) {RGB = 0x8B0000; break;}
|
||||
if(str == _T("dkSalmon")) {RGB = 0xE9967A; break;}
|
||||
if(str == _T("dkSeaGreen")) {RGB = 0x8FBC8B; break;}
|
||||
if(str == _T("dkSlateBlue")) {RGB = 0x483D8B; break;}
|
||||
if(str == _T("dkSlateGray")) {RGB = 0x2F4F4F; break;}
|
||||
if(str == _T("dkSlateGrey")) {RGB = 0x2F4F4F; break;}
|
||||
if(str == _T("dkTurquoise")) {RGB = 0x00CED1; break;}
|
||||
if(str == _T("dkViolet")) {RGB = 0x9400D3; break;}
|
||||
if(str == _T("dodgerBlue")) {RGB = 0x1E90FF; break;}
|
||||
break;
|
||||
case 'f':
|
||||
if(str == _T("firebrick")) {RGB = 0xB22222; break;}
|
||||
if(str == _T("floralWhite")) {RGB = 0xFFFAF0; break;}
|
||||
if(str == _T("forestGreen")) {RGB = 0x228B22; break;}
|
||||
if(str == _T("fuchsia")) {RGB = 0xFF00FF; break;}
|
||||
break;
|
||||
case 'g':
|
||||
if(str == _T("gainsboro")) {RGB = 0xDCDCDC; break;}
|
||||
if(str == _T("ghostWhite")) {RGB = 0xF8F8FF; break;}
|
||||
if(str == _T("gold")) {RGB = 0xFFD700; break;}
|
||||
if(str == _T("goldenrod")) {RGB = 0xDAA520; break;}
|
||||
if(str == _T("gray")) {RGB = 0x808080; break;}
|
||||
if(str == _T("green")) {RGB = 0x8000; break;}
|
||||
if(str == _T("greenYellow")) {RGB = 0xADFF2F; break;}
|
||||
if(str == _T("grey")) {RGB = 0x808080; break;}
|
||||
break;
|
||||
case 'h':
|
||||
if(str == _T("honeydew")) {RGB = 0xF0FFF0; break;}
|
||||
if(str == _T("hotPink")) {RGB = 0xFF69B4; break;}
|
||||
break;
|
||||
case 'i':
|
||||
if(str == _T("indianRed")) {RGB = 0xCD5C5C; break;}
|
||||
if(str == _T("indigo")) {RGB = 0x4B0082; break;}
|
||||
if(str == _T("ivory")) {RGB = 0xFFFFF0; break;}
|
||||
break;
|
||||
case 'k':
|
||||
if(str == _T("khaki")) {RGB = 0xF0E68C; break;}
|
||||
break;
|
||||
case 'l':
|
||||
if(str == _T("lavender")) {RGB = 0xE6E6FA; break;}
|
||||
if(str == _T("lavenderBlush")) {RGB = 0xFFF0F5; break;}
|
||||
if(str == _T("lawnGreen")) {RGB = 0x7CFC00; break;}
|
||||
if(str == _T("lemonChiffon")) {RGB = 0xFFFACD; break;}
|
||||
if(str == _T("lightBlue")) {RGB = 0xADD8E6; break;}
|
||||
if(str == _T("lightCoral")) {RGB = 0xF08080; break;}
|
||||
if(str == _T("lightCyan")) {RGB = 0xE0FFFF; break;}
|
||||
if(str==_T("lightGoldenrodYellow")){RGB = 0xFAFAD2;break;}
|
||||
if(str == _T("lightGray")) {RGB = 0xD3D3D3; break;}
|
||||
if(str == _T("lightGreen")) {RGB = 0x90EE90; break;}
|
||||
if(str == _T("lightGrey")) {RGB = 0xD3D3D3; break;}
|
||||
if(str == _T("lightPink")) {RGB = 0xFFB6C1; break;}
|
||||
if(str == _T("lightSalmon")) {RGB = 0xFFA07A; break;}
|
||||
if(str == _T("lightSeaGreen")) {RGB = 0x20B2AA; break;}
|
||||
if(str == _T("lightSkyBlue")) {RGB = 0x87CEFA; break;}
|
||||
if(str == _T("lightSlateGray")) {RGB = 0x778899; break;}
|
||||
if(str == _T("lightSlateGrey")) {RGB = 0x778899; break;}
|
||||
if(str == _T("lightSteelBlue")) {RGB = 0xB0C4DE; break;}
|
||||
if(str == _T("lightYellow")) {RGB = 0xFFFFE0; break;}
|
||||
if(str == _T("lime")) {RGB = 0x00FF00; break;}
|
||||
if(str == _T("limeGreen")) {RGB = 0x32CD32; break;}
|
||||
if(str == _T("linen")) {RGB = 0xFAF0E6; break;}
|
||||
if(str == _T("ltBlue")) {RGB = 0xADD8E6; break;}
|
||||
if(str == _T("ltCoral")) {RGB = 0xF08080; break;}
|
||||
if(str == _T("ltCyan")) {RGB = 0xE0FFFF; break;}
|
||||
if(str == _T("ltGoldenrodYellow")){RGB = 0xFAFA78; break;}
|
||||
if(str == _T("ltGray")) {RGB = 0xD3D3D3; break;}
|
||||
if(str == _T("ltGreen")) {RGB = 0x90EE90; break;}
|
||||
if(str == _T("ltGrey")) {RGB = 0xD3D3D3; break;}
|
||||
if(str == _T("ltPink")) {RGB = 0xFFB6C1; break;}
|
||||
if(str == _T("ltSalmon")) {RGB = 0xFFA07A; break;}
|
||||
if(str == _T("ltSeaGreen")) {RGB = 0x20B2AA; break;}
|
||||
if(str == _T("ltSkyBlue")) {RGB = 0x87CEFA; break;}
|
||||
if(str == _T("ltSlateGray")) {RGB = 0x778899; break;}
|
||||
if(str == _T("ltSlateGrey")) {RGB = 0x778899; break;}
|
||||
if(str == _T("ltSteelBlue")) {RGB = 0xB0C4DE; break;}
|
||||
if(str == _T("ltYellow")) {RGB = 0xFFFFE0; break;}
|
||||
break;
|
||||
case 'm':
|
||||
if(str == _T("magenta")) {RGB = 0xFF00FF; break;}
|
||||
if(str == _T("maroon")) {RGB = 0x800000; break;}
|
||||
if(str == _T("medAquamarine")) {RGB = 0x66CDAA; break;}
|
||||
if(str == _T("medBlue")) {RGB = 0x0000CD; break;}
|
||||
if(str == _T("mediumAquamarine")) {RGB = 0x66CDAA; break;}
|
||||
if(str == _T("mediumBlue")) {RGB = 0x0000CD; break;}
|
||||
if(str == _T("mediumOrchid")) {RGB = 0xBA55D3; break;}
|
||||
if(str == _T("mediumPurple")) {RGB = 0x9370DB; break;}
|
||||
if(str == _T("mediumSeaGreen")) {RGB = 0x3CB371; break;}
|
||||
if(str == _T("mediumSlateBlue")){RGB = 0x7B68EE; break;}
|
||||
if(str == _T("mediumSpringGreen")){RGB = 0x00FA9A; break;}
|
||||
if(str == _T("mediumTurquoise")){RGB = 0x48D1CC; break;}
|
||||
if(str == _T("mediumVioletRed")){RGB = 0xC71585; break;}
|
||||
if(str == _T("medOrchid")) {RGB = 0xBA55D3; break;}
|
||||
if(str == _T("medPurple")) {RGB = 0x9370DB; break;}
|
||||
if(str == _T("medSeaGreen")) {RGB = 0x3CB371; break;}
|
||||
if(str == _T("medSlateBlue")) {RGB = 0x7B68EE; break;}
|
||||
if(str == _T("medSpringGreen")) {RGB = 0x00FA9A; break;}
|
||||
if(str == _T("medTurquoise")) {RGB = 0x48D1CC; break;}
|
||||
if(str == _T("medVioletRed")) {RGB = 0xC71585; break;}
|
||||
if(str == _T("midnightBlue")) {RGB = 0x191970; break;}
|
||||
if(str == _T("mintCream")) {RGB = 0xF5FFFA; break;}
|
||||
if(str == _T("mistyRose")) {RGB = 0xFFE4FF; break;}
|
||||
if(str == _T("moccasin")) {RGB = 0xFFE4B5; break;}
|
||||
break;
|
||||
case 'n':
|
||||
if(str == _T("navajoWhite")) {RGB = 0xFFDEAD; break;}
|
||||
if(str == _T("navy")) {RGB = 0x000080; break;}
|
||||
break;
|
||||
case 'o':
|
||||
if(str == _T("oldLace")) {RGB = 0xFDF5E6; break;}
|
||||
if(str == _T("olive")) {RGB = 0x808000; break;}
|
||||
if(str == _T("oliveDrab")) {RGB = 0x6B8E23; break;}
|
||||
if(str == _T("orange")) {RGB = 0xFFA500; break;}
|
||||
if(str == _T("orangeRed")) {RGB = 0xFF4500; break;}
|
||||
if(str == _T("orchid")) {RGB = 0xDA70D6; break;}
|
||||
break;
|
||||
case 'p':
|
||||
if(str == _T("paleGoldenrod")) {RGB = 0xEEE8AA; break;}
|
||||
if(str == _T("paleGreen")) {RGB = 0x98FB98; break;}
|
||||
if(str == _T("paleTurquoise")) {RGB = 0xAFEEEE; break;}
|
||||
if(str == _T("paleVioletRed")) {RGB = 0xDB7093; break;}
|
||||
if(str == _T("papayaWhip")) {RGB = 0xFFEFD5; break;}
|
||||
if(str == _T("peachPuff")) {RGB = 0xFFDAB9; break;}
|
||||
if(str == _T("peru")) {RGB = 0xCD853F; break;}
|
||||
if(str == _T("pink")) {RGB = 0xFFC0CB; break;}
|
||||
if(str == _T("plum")) {RGB = 0xD3A0D3; break;}
|
||||
if(str == _T("powderBlue")) {RGB = 0xB0E0E6; break;}
|
||||
if(str == _T("purple")) {RGB = 0x800080; break;}
|
||||
break;
|
||||
case 'r':
|
||||
if(str == _T("red")) {RGB = 0xFF0000; break;}
|
||||
if(str == _T("rosyBrown")) {RGB = 0xBC8F8F; break;}
|
||||
if(str == _T("royalBlue")) {RGB = 0x4169E1; break;}
|
||||
break;
|
||||
case 's':
|
||||
if(str == _T("saddleBrown")) {RGB = 0x8B4513; break;}
|
||||
if(str == _T("salmon")) {RGB = 0xFA8072; break;}
|
||||
if(str == _T("sandyBrown")) {RGB = 0xF4A460; break;}
|
||||
if(str == _T("seaGreen")) {RGB = 0x2E8B57; break;}
|
||||
if(str == _T("seaShell")) {RGB = 0xFFF5EE; break;}
|
||||
if(str == _T("sienna")) {RGB = 0xA0522D; break;}
|
||||
if(str == _T("silver")) {RGB = 0xC0C0C0; break;}
|
||||
if(str == _T("skyBlue")) {RGB = 0x87CEEB; break;}
|
||||
if(str == _T("slateBlue")) {RGB = 0x6A5AEB; break;}
|
||||
if(str == _T("slateGray")) {RGB = 0x708090; break;}
|
||||
if(str == _T("slateGrey")) {RGB = 0x708090; break;}
|
||||
if(str == _T("snow")) {RGB = 0xFFFAFA; break;}
|
||||
if(str == _T("springGreen")) {RGB = 0x00FF7F; break;}
|
||||
if(str == _T("steelBlue")) {RGB = 0x4682B4; break;}
|
||||
break;
|
||||
case 't':
|
||||
if(str == _T("tan")) {RGB = 0xD2B48C; break;}
|
||||
if(str == _T("teal")) {RGB = 0x008080; break;}
|
||||
if(str == _T("thistle")) {RGB = 0xD8BFD8; break;}
|
||||
if(str == _T("tomato")) {RGB = 0xFF7347; break;}
|
||||
if(str == _T("turquoise")) {RGB = 0x40E0D0; break;}
|
||||
break;
|
||||
case 'v':
|
||||
if(str == _T("violet")) {RGB = 0xEE82EE; break;}
|
||||
break;
|
||||
case 'w':
|
||||
if(str == _T("wheat")) {RGB = 0xF5DEB3; break;}
|
||||
if(str == _T("white")) {RGB = 0xFFFFFF; break;}
|
||||
if(str == _T("whiteSmoke")) {RGB = 0xF5F5F5; break;}
|
||||
break;
|
||||
case 'y':
|
||||
if(str == _T("yellow")) {RGB = 0xFFFF00; break;}
|
||||
if(str == _T("yellowGreen")) {RGB = 0x9ACD32; break;}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
blue = static_cast<unsigned char>(RGB & 0xFF);
|
||||
green = static_cast<unsigned char>((RGB & 0xFF00)>>8);
|
||||
red = static_cast<unsigned char>((RGB & 0xFF0000)>>16);
|
||||
}
|
||||
protected:
|
||||
Limit::PrstClrVal val;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
friend class UniColor;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_PRSTCLR_INCLUDE_H
|
||||
166
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.cpp
Normal file
166
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.cpp
Normal file
@@ -0,0 +1,166 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include "./stdafx.h"
|
||||
|
||||
#include "SchemeClr.h"
|
||||
#include "./../../Slide.h"
|
||||
#include "./../../SlideLayout.h"
|
||||
#include "./../../SlideMaster.h"
|
||||
#include "./../../Theme.h"
|
||||
#include "./../../TableStyles.h"
|
||||
#include "./../../Presentation.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
void SchemeClr::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
val = node.GetAttribute(_T("val"));
|
||||
Modifiers.RemoveAll();
|
||||
node.LoadArray(_T("*"), Modifiers);
|
||||
}
|
||||
|
||||
CString SchemeClr::toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("val"), val.get());
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(Modifiers);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:schemeClr"), oAttr, oValue);
|
||||
}
|
||||
|
||||
DWORD SchemeClr::GetRGBA(DWORD RGBA) const
|
||||
{
|
||||
SchemeClr* pColor = const_cast<SchemeClr*>(this);
|
||||
|
||||
DWORD A = RGBA & 0xFF;
|
||||
A = A << 24;
|
||||
pColor->FillRGBFromVal((RGBA >> 8) + A);
|
||||
return ColorBase::GetRGBA(RGBA);
|
||||
}
|
||||
|
||||
DWORD SchemeClr::GetARGB(DWORD ARGB) const
|
||||
{
|
||||
SchemeClr* pColor = const_cast<SchemeClr*>(this);
|
||||
|
||||
pColor->FillRGBFromVal(ARGB);
|
||||
return ColorBase::GetARGB(ARGB);
|
||||
}
|
||||
|
||||
DWORD SchemeClr::GetBGRA(DWORD BGRA) const
|
||||
{
|
||||
SchemeClr* pColor = const_cast<SchemeClr*>(this);
|
||||
|
||||
DWORD ARGB = (BGRA & 0xFF) << 24;
|
||||
ARGB += (BGRA & 0xFF00) << 8;
|
||||
ARGB += (BGRA & 0xFF0000) >> 8;
|
||||
ARGB += (BGRA & 0xFF000000) >> 24;
|
||||
pColor->FillRGBFromVal(ARGB);
|
||||
return ColorBase::GetBGRA(BGRA);
|
||||
}
|
||||
|
||||
DWORD SchemeClr::GetABGR(DWORD ABGR) const
|
||||
{
|
||||
SchemeClr* pColor = const_cast<SchemeClr*>(this);
|
||||
|
||||
DWORD ARGB = ABGR & 0xFF00FF00;
|
||||
ARGB += (ABGR & 0xFF) << 16;
|
||||
ARGB += (ABGR & 0xFF0000) >> 16;
|
||||
pColor->FillRGBFromVal(ARGB);
|
||||
return ColorBase::GetABGR(ABGR);
|
||||
}
|
||||
|
||||
DWORD SchemeClr::GetRGBColor(NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap, DWORD ARGB)
|
||||
{
|
||||
DWORD RGB = 0;
|
||||
|
||||
CString str = val.get();
|
||||
if (str == _T("phClr"))
|
||||
RGB = ARGB;
|
||||
else
|
||||
{
|
||||
smart_ptr<PPTX::Theme> oTheme = _oTheme.smart_dynamic_cast<PPTX::Theme>();
|
||||
smart_ptr<PPTX::Logic::ClrMap> oClrMap = _oClrMap.smart_dynamic_cast<PPTX::Logic::ClrMap>();
|
||||
|
||||
if (oTheme.is_init())
|
||||
{
|
||||
if (oClrMap.is_init())
|
||||
str = oClrMap->GetColorSchemeIndex(str);
|
||||
|
||||
RGB = oTheme->GetARGBFromScheme(str);
|
||||
}
|
||||
}
|
||||
|
||||
blue = static_cast<unsigned char>(RGB & 0xFF);
|
||||
green = static_cast<unsigned char>((RGB & 0xFF00)>>8);
|
||||
red = static_cast<unsigned char>((RGB & 0xFF0000)>>16);
|
||||
alpha = static_cast<unsigned char>((RGB & 0xFF000000)>>24);
|
||||
|
||||
return ColorBase::GetARGB(ARGB);
|
||||
}
|
||||
|
||||
void SchemeClr::FillRGBFromVal(DWORD rgb)
|
||||
{
|
||||
DWORD RGB = 0;
|
||||
|
||||
CString str = val.get();
|
||||
if(str == _T("phClr"))
|
||||
RGB = rgb;
|
||||
else
|
||||
if(parentFileIs<Slide>())
|
||||
RGB = parentFileAs<Slide>().GetARGBFromMap(str);
|
||||
else if(parentFileIs<SlideLayout>())
|
||||
RGB = parentFileAs<SlideLayout>().GetARGBFromMap(str);
|
||||
else if(parentFileIs<SlideMaster>())
|
||||
RGB = parentFileAs<SlideMaster>().GetARGBFromMap(str);
|
||||
else if(parentFileIs<TableStyles>())
|
||||
RGB = parentFileAs<TableStyles>().GetARGBFromMap(str);
|
||||
else if(parentFileIs<Theme>())
|
||||
RGB = parentFileAs<Theme>().GetARGBFromMap(str);
|
||||
else if(parentFileIs<Presentation>())
|
||||
RGB = parentFileAs<Presentation>().GetARGBFromMap(str);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
blue = static_cast<unsigned char>(RGB & 0xFF);
|
||||
green = static_cast<unsigned char>((RGB & 0xFF00)>>8);
|
||||
red = static_cast<unsigned char>((RGB & 0xFF0000)>>16);
|
||||
alpha = static_cast<unsigned char>((RGB & 0xFF000000)>>24);
|
||||
}
|
||||
}
|
||||
} // namespace PPTX
|
||||
111
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.h
Normal file
111
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_SCHEMECLR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_SCHEMECLR_INCLUDE_H_
|
||||
|
||||
#include "./../../Limit/SchemeClrVal.h"
|
||||
#include "./../../Theme/ClrScheme.h"
|
||||
#include "ColorBase.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class SchemeClr : public ColorBase
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(SchemeClr)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual CString toXML() const;
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:schemeClr"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("val"), val.get());
|
||||
pWriter->EndAttributes();
|
||||
|
||||
size_t nCount = Modifiers.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
Modifiers[i].toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(_T("a:schemeClr"));
|
||||
}
|
||||
|
||||
virtual DWORD GetRGBA(DWORD RGBA) const;
|
||||
virtual DWORD GetARGB(DWORD ARGB) const;
|
||||
virtual DWORD GetBGRA(DWORD BGRA) const;
|
||||
virtual DWORD GetABGR(DWORD ABGR) const;
|
||||
|
||||
virtual DWORD GetRGBColor(NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap, DWORD ARGB = 0);
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(COLOR_TYPE_SCHEME);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit1(0, val);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
ULONG len = (ULONG)Modifiers.GetCount();
|
||||
if (len != 0)
|
||||
{
|
||||
pWriter->StartRecord(0);
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(1, Modifiers[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
Limit::SchemeClrVal val;
|
||||
private:
|
||||
void FillRGBFromVal(DWORD rgb);
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_SCHEMECLR_INCLUDE_H
|
||||
124
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SrgbClr.h
Normal file
124
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SrgbClr.h
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_SRGBCLR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_SRGBCLR_INCLUDE_H_
|
||||
|
||||
#include "ColorBase.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class SrgbClr : public ColorBase
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(SrgbClr)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
CString val = node.GetAttribute(_T("val"));
|
||||
red = HexString2Int(val.Mid(0, 2));
|
||||
green = HexString2Int(val.Mid(2, 2));
|
||||
blue = HexString2Int(val.Mid(4, 2));
|
||||
|
||||
Modifiers.RemoveAll();
|
||||
node.LoadArray(_T("*"), Modifiers);
|
||||
}
|
||||
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
CString str = _T("");
|
||||
str.Format(_T("%.02X%.02X%.02X"), red, green, blue);
|
||||
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("val"), str);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(Modifiers);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:srgbClr"), oAttr, oValue);
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:srgbClr"));
|
||||
|
||||
CString str = _T("");
|
||||
str.Format(_T("%.02X%.02X%.02X"), red, green, blue);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("val"), str);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
size_t nCount = Modifiers.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
Modifiers[i].toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(_T("a:srgbClr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(COLOR_TYPE_SRGB);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteBYTE(0); pWriter->WriteBYTE(red);
|
||||
pWriter->WriteBYTE(1); pWriter->WriteBYTE(green);
|
||||
pWriter->WriteBYTE(2); pWriter->WriteBYTE(blue);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
ULONG len = (ULONG)Modifiers.GetCount();
|
||||
if (len != 0)
|
||||
{
|
||||
pWriter->StartRecord(0);
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(1, Modifiers[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_SRGBCLR_INCLUDE_H
|
||||
230
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SysClr.h
Normal file
230
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SysClr.h
Normal file
@@ -0,0 +1,230 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_SYSCLR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_SYSCLR_INCLUDE_H_
|
||||
|
||||
#include "ColorBase.h"
|
||||
#include "./../../Limit/SysClrVal.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class SysClr : public ColorBase
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(SysClr)
|
||||
|
||||
virtual DWORD GetRGBA(DWORD RGBA) const
|
||||
{
|
||||
SysClr* pColor = const_cast<SysClr*>(this);
|
||||
pColor->FillRGBFromVal();
|
||||
return ColorBase::GetRGBA(RGBA);
|
||||
}
|
||||
|
||||
virtual DWORD GetARGB(DWORD ARGB) const
|
||||
{
|
||||
SysClr* pColor = const_cast<SysClr*>(this);
|
||||
pColor->FillRGBFromVal();
|
||||
return ColorBase::GetARGB(ARGB);
|
||||
}
|
||||
|
||||
virtual DWORD GetBGRA(DWORD BGRA) const
|
||||
{
|
||||
SysClr* pColor = const_cast<SysClr*>(this);
|
||||
pColor->FillRGBFromVal();
|
||||
return ColorBase::GetBGRA(BGRA);
|
||||
}
|
||||
|
||||
virtual DWORD GetABGR(DWORD ABGR) const
|
||||
{
|
||||
SysClr* pColor = const_cast<SysClr*>(this);
|
||||
pColor->FillRGBFromVal();
|
||||
return ColorBase::GetABGR(ABGR);
|
||||
}
|
||||
private:
|
||||
void FillRGBFromVal()
|
||||
{
|
||||
DWORD RGB = 0;
|
||||
CString str = val.get();
|
||||
if(str != "")
|
||||
{
|
||||
switch((CHAR)str[0])
|
||||
{
|
||||
case '3':
|
||||
if(str == _T("3dDkShadow")) { RGB = ::GetSysColor(COLOR_3DDKSHADOW); break;}
|
||||
if(str == _T("3dLight")) { RGB = ::GetSysColor(COLOR_3DLIGHT); break;}
|
||||
break;
|
||||
case 'a':
|
||||
if(str == _T("activeBorder")) { RGB = ::GetSysColor(COLOR_ACTIVEBORDER); break;}
|
||||
if(str == _T("activeCaption")) { RGB = ::GetSysColor(COLOR_ACTIVECAPTION); break;}
|
||||
if(str == _T("appWorkspace")) { RGB = ::GetSysColor(COLOR_APPWORKSPACE); break;}
|
||||
break;
|
||||
case 'b':
|
||||
if(str == _T("background")) { RGB = ::GetSysColor(COLOR_BACKGROUND); break;}
|
||||
if(str == _T("btnFace")) { RGB = ::GetSysColor(COLOR_BTNFACE); break;}
|
||||
if(str == _T("btnHighlight")) { RGB = ::GetSysColor(COLOR_BTNHIGHLIGHT); break;}
|
||||
if(str == _T("btnShadow")) { RGB = ::GetSysColor(COLOR_BTNSHADOW); break;}
|
||||
if(str == _T("btnText")) { RGB = ::GetSysColor(COLOR_BTNTEXT); break;}
|
||||
break;
|
||||
case 'c':
|
||||
if(str == _T("captionText")) { RGB = ::GetSysColor(COLOR_CAPTIONTEXT); break;}
|
||||
break;
|
||||
case 'g':
|
||||
if(str == _T("gradientActiveCaption")) { RGB = ::GetSysColor(COLOR_GRADIENTACTIVECAPTION); break;}
|
||||
if(str == _T("gradientInactiveCaption")) { RGB = ::GetSysColor(COLOR_GRADIENTINACTIVECAPTION); break;}
|
||||
if(str == _T("grayText")) { RGB = ::GetSysColor(COLOR_GRAYTEXT); break;}
|
||||
break;
|
||||
case 'h':
|
||||
if(str == _T("highlight")) { RGB = ::GetSysColor(COLOR_HIGHLIGHT); break;}
|
||||
if(str == _T("highlightText")) { RGB = ::GetSysColor(COLOR_HIGHLIGHTTEXT); break;}
|
||||
if(str == _T("hotLight")) { RGB = ::GetSysColor(COLOR_HOTLIGHT); break;}
|
||||
break;
|
||||
case 'i':
|
||||
if(str == _T("inactiveBorder")) { RGB = ::GetSysColor(COLOR_INACTIVEBORDER); break;}
|
||||
if(str == _T("inactiveCaption")) { RGB = ::GetSysColor(COLOR_INACTIVECAPTION); break;}
|
||||
if(str == _T("inactiveCaptionText")) { RGB = ::GetSysColor(COLOR_INACTIVECAPTIONTEXT); break;}
|
||||
if(str == _T("infoBk")) { RGB = ::GetSysColor(COLOR_INFOBK); break;}
|
||||
if(str == _T("infoText")) { RGB = ::GetSysColor(COLOR_INFOTEXT); break;}
|
||||
break;
|
||||
case 'm':
|
||||
if(str == _T("menu")) { RGB = ::GetSysColor(COLOR_MENU); break;}
|
||||
if(str == _T("menuBar")) { RGB = ::GetSysColor(COLOR_MENUBAR); break;}
|
||||
if(str == _T("menuHighlight")) { RGB = ::GetSysColor(COLOR_MENUHILIGHT); break;}
|
||||
if(str == _T("menuText")) { RGB = ::GetSysColor(COLOR_MENUTEXT); break;}
|
||||
break;
|
||||
case 's':
|
||||
if(str == _T("scrollBar")) { RGB = ::GetSysColor(COLOR_SCROLLBAR); break;}
|
||||
break;
|
||||
case 'w':
|
||||
if(str == _T("window")) { RGB = ::GetSysColor(COLOR_WINDOW); break;}
|
||||
if(str == _T("windowFrame")) { RGB = ::GetSysColor(COLOR_WINDOWFRAME); break;}
|
||||
if(str == _T("windowText")) { RGB = ::GetSysColor(COLOR_WINDOWTEXT); break;}
|
||||
break;
|
||||
}
|
||||
}
|
||||
blue = static_cast<unsigned char>(RGB & 0xFF);
|
||||
green = static_cast<unsigned char>((RGB & 0xFF00)>>8);
|
||||
red = static_cast<unsigned char>((RGB & 0xFF0000)>>16);
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
val = node.GetAttribute(_T("val"));
|
||||
Modifiers.RemoveAll();
|
||||
node.LoadArray(_T("*"), Modifiers);
|
||||
}
|
||||
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
CString str = _T("");
|
||||
str.Format(_T("%.02X%.02X%.02X"), red, green, blue);
|
||||
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("val"), val.get());
|
||||
oAttr.Write(_T("lastClr"), str);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(Modifiers);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:sysClr"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:sysClr"));
|
||||
|
||||
CString str = _T("");
|
||||
str.Format(_T("%.02X%.02X%.02X"), red, green, blue);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("val"), val.get());
|
||||
pWriter->WriteAttribute(_T("lastClr"), str);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
size_t nCount = Modifiers.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
Modifiers[i].toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(_T("a:sysClr"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(COLOR_TYPE_SYS);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, val.get());
|
||||
|
||||
SysClr* pColor = const_cast<SysClr*>(this);
|
||||
pColor->FillRGBFromVal();
|
||||
|
||||
pWriter->WriteBYTE(1);
|
||||
pWriter->WriteBYTE(red);
|
||||
pWriter->WriteBYTE(2);
|
||||
pWriter->WriteBYTE(green);
|
||||
pWriter->WriteBYTE(3);
|
||||
pWriter->WriteBYTE(blue);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
ULONG len = (ULONG)Modifiers.GetCount();
|
||||
if (len != 0)
|
||||
{
|
||||
pWriter->StartRecord(0);
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(1, Modifiers[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
protected:
|
||||
Limit::SysClrVal val;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
friend class UniColor;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_SYSCLR_INCLUDE_H
|
||||
32
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ContentPart.cpp
Normal file
32
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ContentPart.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
32
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ContentPart.h
Normal file
32
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ContentPart.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
236
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CustGeom.h
Normal file
236
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CustGeom.h
Normal file
@@ -0,0 +1,236 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CUSTGEOM_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CUSTGEOM_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "Gd.h"
|
||||
#include "Rect.h"
|
||||
#include "Path2D.h"
|
||||
#include "AhBase.h"
|
||||
#include "Cxn.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class CustGeom : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(CustGeom)
|
||||
|
||||
CustGeom& operator=(const CustGeom& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
avLst.Copy(oSrc.avLst);
|
||||
gdLst.Copy(oSrc.gdLst);
|
||||
ahLst.Copy(oSrc.ahLst);
|
||||
cxnLst.Copy(oSrc.cxnLst);
|
||||
pathLst.Copy(oSrc.pathLst);
|
||||
|
||||
rect = oSrc.rect;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (node.GetNode(_T("a:avLst"), oNode))
|
||||
oNode.LoadArray(_T("a:gd"), avLst);
|
||||
if (node.GetNode(_T("a:gdLst"), oNode))
|
||||
oNode.LoadArray(_T("a:gd"), gdLst);
|
||||
|
||||
if (node.GetNode(_T("a:ahLst"), oNode))
|
||||
{
|
||||
oNode.LoadArray(_T("a:ahPolar"), ahLst);
|
||||
oNode.LoadArray(_T("a:ahXY"), ahLst);
|
||||
}
|
||||
|
||||
if (node.GetNode(_T("a:cxnLst"), oNode))
|
||||
oNode.LoadArray(_T("a:cxn"), cxnLst);
|
||||
|
||||
if (node.GetNode(_T("a:pathLst"), oNode))
|
||||
oNode.LoadArray(_T("a:path"), pathLst);
|
||||
|
||||
rect = node.ReadNodeNoNS(_T("rect"));
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(_T("a:avLst"), avLst);
|
||||
oValue.WriteArray(_T("a:gdLst"), gdLst);
|
||||
oValue.WriteArray(_T("a:ahLst"), ahLst);
|
||||
oValue.WriteArray(_T("a:cxnLst"), cxnLst);
|
||||
oValue.WriteNullable(rect);
|
||||
oValue.WriteArray(_T("a:pathLst"), pathLst);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:custGeom"), oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:custGeom"));
|
||||
pWriter->EndAttributes();
|
||||
|
||||
if (avLst.GetCount() == 0)
|
||||
pWriter->WriteString(_T("<a:avLst/>"));
|
||||
else
|
||||
pWriter->WriteArray(_T("a:avLst"), avLst);
|
||||
|
||||
if (gdLst.GetCount() == 0)
|
||||
pWriter->WriteString(_T("<a:gdLst/>"));
|
||||
else
|
||||
pWriter->WriteArray(_T("a:gdLst"), gdLst);
|
||||
|
||||
if (ahLst.GetCount() == 0)
|
||||
pWriter->WriteString(_T("<a:ahLst/>"));
|
||||
else
|
||||
pWriter->WriteArray(_T("a:ahLst"), ahLst);
|
||||
|
||||
if (cxnLst.GetCount() == 0)
|
||||
pWriter->WriteString(_T("<a:cxnLst/>"));
|
||||
else
|
||||
pWriter->WriteArray(_T("a:cxnLst"), cxnLst);
|
||||
|
||||
if (rect.is_init())
|
||||
pWriter->Write(rect);
|
||||
else
|
||||
pWriter->WriteString(_T("<a:rect l=\"0\" t=\"0\" r=\"r\" b=\"b\"/>"));
|
||||
pWriter->WriteArray(_T("a:pathLst"), pathLst);
|
||||
|
||||
pWriter->EndNode(_T("a:custGeom"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(GEOMETRY_TYPE_CUSTOM);
|
||||
|
||||
pWriter->WriteRecordArray(0, 1, avLst);
|
||||
pWriter->WriteRecordArray(1, 1, gdLst);
|
||||
pWriter->WriteRecordArray(2, 1, ahLst);
|
||||
pWriter->WriteRecordArray(3, 1, cxnLst);
|
||||
pWriter->WriteRecordArray(4, 1, pathLst);
|
||||
pWriter->WriteRecord2(5, rect);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
CAtlArray<Gd> avLst;
|
||||
CAtlArray<Gd> gdLst;
|
||||
CAtlArray<AhBase> ahLst;
|
||||
CAtlArray<Cxn> cxnLst;
|
||||
nullable<Rect> rect;
|
||||
CAtlArray<Path2D> pathLst;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
size_t count = 0;
|
||||
|
||||
count = avLst.GetCount();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
avLst[i].SetParentPointer(this);
|
||||
|
||||
count = gdLst.GetCount();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
gdLst[i].SetParentPointer(this);
|
||||
|
||||
count = ahLst.GetCount();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
ahLst[i].SetParentPointer(this);
|
||||
|
||||
count = cxnLst.GetCount();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
cxnLst[i].SetParentPointer(this);
|
||||
|
||||
count = pathLst.GetCount();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
pathLst[i].SetParentPointer(this);
|
||||
|
||||
if (rect.IsInit())
|
||||
rect->SetParentPointer(this);
|
||||
}
|
||||
public:
|
||||
virtual CString GetODString() const
|
||||
{
|
||||
CString strXml = _T("");
|
||||
|
||||
size_t nCount = 0;
|
||||
|
||||
strXml += _T("<avLst>");
|
||||
nCount = avLst.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
strXml += avLst[i].GetODString();
|
||||
strXml += _T("</avLst>");
|
||||
|
||||
strXml += _T("<gdLst>");
|
||||
nCount = gdLst.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
strXml += gdLst[i].GetODString();
|
||||
strXml += _T("</gdLst>");
|
||||
|
||||
strXml += _T("<ahLst>");
|
||||
nCount = ahLst.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
strXml += ahLst[i].GetODString();
|
||||
strXml += _T("</ahLst>");
|
||||
|
||||
strXml += _T("<cxnLst>");
|
||||
nCount = cxnLst.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
strXml += cxnLst[i].GetODString();
|
||||
strXml += _T("</cxnLst>");
|
||||
|
||||
strXml += _T("<pathLst>");
|
||||
nCount = pathLst.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
strXml += pathLst[i].GetODString();
|
||||
strXml += _T("</pathLst>");
|
||||
|
||||
if (rect.IsInit())
|
||||
strXml += rect->GetODString();
|
||||
|
||||
return XmlUtils::CreateNode(_T("ooxml-shape"), strXml);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CUSTGEOM_INCLUDE_H
|
||||
119
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Cxn.h
Normal file
119
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Cxn.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CXN_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CXN_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Cxn : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Cxn)
|
||||
|
||||
Cxn& operator=(const Cxn& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
x = oSrc.x;
|
||||
y = oSrc.y;
|
||||
ang = oSrc.ang;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
ang = node.GetAttribute(_T("ang"));
|
||||
|
||||
XmlUtils::CXmlNode oPos;
|
||||
if (node.GetNode(_T("a:pos"), oPos))
|
||||
{
|
||||
x = oPos.GetAttribute(_T("x"));
|
||||
y = oPos.GetAttribute(_T("y"));
|
||||
}
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:cxn ang=\"") + ang + _T("\"><a:pos x=\"") + x + _T("\" y=\"") + y + _T("\" /></a:cxn>");
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:cxn"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("ang"), ang);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(_T("a:pos"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("x"), x);
|
||||
pWriter->WriteAttribute(_T("y"), y);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:pos"));
|
||||
|
||||
pWriter->EndNode(_T("a:cxn"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, x);
|
||||
pWriter->WriteString1(1, y);
|
||||
pWriter->WriteString1(2, ang);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
public:
|
||||
CString x;
|
||||
CString y;
|
||||
CString ang;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
public:
|
||||
CString GetODString()const
|
||||
{
|
||||
return _T("<cxn ang=\"") + ang + _T("\"><pos x=\"") + x + _T("\" y=\"") + y + _T("\" /></cxn>");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CXN_INCLUDE_H_
|
||||
169
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.cpp
Normal file
169
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.cpp
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include "./stdafx.h"
|
||||
|
||||
#include "CxnSp.h"
|
||||
#include "SpTree.h"
|
||||
#include "./../SlideLayout.h"
|
||||
#include "./../SlideMaster.h"
|
||||
#include "./../Slide.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
CxnSp::CxnSp()
|
||||
{
|
||||
}
|
||||
|
||||
CxnSp::~CxnSp()
|
||||
{
|
||||
}
|
||||
|
||||
CxnSp::CxnSp(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
}
|
||||
|
||||
const CxnSp& CxnSp::operator =(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void CxnSp::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
CString strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if (_T("nvCxnSpPr") == strName)
|
||||
nvCxnSpPr = oNode;
|
||||
else if (_T("spPr") == strName)
|
||||
spPr = oNode;
|
||||
else if (_T("style") == strName)
|
||||
style = oNode;
|
||||
}
|
||||
}
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
CString CxnSp::toXML() const
|
||||
{
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(nvCxnSpPr);
|
||||
oValue.Write(spPr);
|
||||
oValue.WriteNullable(style);
|
||||
|
||||
return XmlUtils::CreateNode(_T("<p:cxnSp>"), oValue);
|
||||
}
|
||||
|
||||
void CxnSp::FillParentPointersForChilds()
|
||||
{
|
||||
nvCxnSpPr.SetParentPointer(this);
|
||||
spPr.SetParentPointer(this);
|
||||
if(style.is_init())
|
||||
style->SetParentPointer(this);
|
||||
}
|
||||
|
||||
void CxnSp::GetRect(RECT& pRect)const
|
||||
{
|
||||
pRect.bottom = 0;
|
||||
pRect.left = 0;
|
||||
pRect.right = 0;
|
||||
pRect.top = 0;
|
||||
|
||||
if(spPr.xfrm.IsInit())
|
||||
{
|
||||
pRect.left = spPr.xfrm->offX.get();
|
||||
pRect.top = spPr.xfrm->offY.get();
|
||||
pRect.right = pRect.left + spPr.xfrm->extX.get_value_or(0);
|
||||
pRect.bottom = pRect.top + spPr.xfrm->extY.get_value_or(0);
|
||||
}
|
||||
if(parentIs<Logic::SpTree>())
|
||||
parentAs<Logic::SpTree>().NormalizeRect(pRect);
|
||||
}
|
||||
|
||||
DWORD CxnSp::GetLine(Ln& line)const
|
||||
{
|
||||
DWORD BGRA = 0;
|
||||
line.SetParentFilePointer(parentFile);
|
||||
|
||||
if(style.is_init())
|
||||
{
|
||||
if(parentFileIs<PPTX::Slide>())
|
||||
parentFileAs<PPTX::Slide>().Theme->GetLineStyle(style->lnRef.idx.get_value_or(0), line);
|
||||
else if(parentFileIs<PPTX::SlideLayout>())
|
||||
parentFileAs<PPTX::SlideLayout>().Theme->GetLineStyle(style->lnRef.idx.get_value_or(0), line);
|
||||
else if(parentFileIs<PPTX::SlideMaster>())
|
||||
parentFileAs<PPTX::SlideMaster>().Theme->GetLineStyle(style->lnRef.idx.get_value_or(0), line);
|
||||
|
||||
BGRA = style->lnRef.Color.GetBGRA();
|
||||
}
|
||||
|
||||
if(spPr.ln.is_init())
|
||||
spPr.ln->Merge(line);
|
||||
return BGRA;
|
||||
}
|
||||
|
||||
DWORD CxnSp::GetFill(UniFill& fill)const
|
||||
{
|
||||
DWORD BGRA = 0;
|
||||
fill.SetParentFilePointer(parentFile);
|
||||
|
||||
if (style.IsInit())
|
||||
{
|
||||
if(parentFileIs<PPTX::Slide>())
|
||||
parentFileAs<PPTX::Slide>().Theme->GetFillStyle(style->fillRef.idx.get_value_or(0), fill);
|
||||
else if(parentFileIs<PPTX::SlideLayout>())
|
||||
parentFileAs<PPTX::SlideLayout>().Theme->GetFillStyle(style->fillRef.idx.get_value_or(0), fill);
|
||||
else if(parentFileIs<PPTX::SlideMaster>())
|
||||
parentFileAs<PPTX::SlideMaster>().Theme->GetFillStyle(style->fillRef.idx.get_value_or(0), fill);
|
||||
|
||||
BGRA = style->fillRef.Color.GetBGRA();
|
||||
}
|
||||
|
||||
if(spPr.Fill.is_init())
|
||||
spPr.Fill.Merge(fill);
|
||||
return BGRA;
|
||||
}
|
||||
}
|
||||
} // namespace PPTX
|
||||
131
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.h
Normal file
131
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.h
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CXNSP_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CXNSP_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "NvCxnSpPr.h"
|
||||
#include "SpPr.h"
|
||||
#include "ShapeStyle.h"
|
||||
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class CxnSp : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
CxnSp();
|
||||
virtual ~CxnSp();
|
||||
explicit CxnSp(XmlUtils::CXmlNode& node);
|
||||
const CxnSp& operator =(XmlUtils::CXmlNode& node);
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual CString toXML() const;
|
||||
virtual void GetRect(RECT& pRect)const;
|
||||
|
||||
DWORD GetLine(Ln& line)const;
|
||||
DWORD GetFill(UniFill& fill)const;
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_CXNSP);
|
||||
|
||||
pWriter->WriteRecord1(0, nvCxnSpPr);
|
||||
pWriter->WriteRecord1(1, spPr);
|
||||
pWriter->WriteRecord2(2, style);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("p:cxnSp"));
|
||||
pWriter->EndAttributes();
|
||||
|
||||
nvCxnSpPr.toXmlWriter(pWriter);
|
||||
spPr.toXmlWriter(pWriter);
|
||||
pWriter->Write(style);
|
||||
|
||||
pWriter->EndNode(_T("p:cxnSp"));
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
nvCxnSpPr.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
spPr.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
style = new ShapeStyle();
|
||||
style->m_ns = _T("p");
|
||||
style->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
NvCxnSpPr nvCxnSpPr;
|
||||
SpPr spPr;
|
||||
nullable<ShapeStyle> style;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CXNSP_INCLUDE_H
|
||||
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_DEFAULTSHAPEDEFINITION_INCLUDE_H_
|
||||
#define PPTX_LOGIC_DEFAULTSHAPEDEFINITION_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "SpPr.h"
|
||||
#include "BodyPr.h"
|
||||
#include "TextListStyle.h"
|
||||
#include "ShapeStyle.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class DefaultShapeDefinition : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(DefaultShapeDefinition)
|
||||
|
||||
DefaultShapeDefinition& operator=(const DefaultShapeDefinition& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
spPr = oSrc.spPr;
|
||||
bodyPr = oSrc.bodyPr;
|
||||
lstStyle = oSrc.lstStyle;
|
||||
style = oSrc.style;
|
||||
m_name = oSrc.m_name;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int count = oNodes.GetCount();
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
CString strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if (_T("spPr") == strName)
|
||||
spPr = oNode;
|
||||
else if (_T("bodyPr") == strName)
|
||||
bodyPr = oNode;
|
||||
else if (_T("lstStyle") == strName)
|
||||
lstStyle = oNode;
|
||||
else if (_T("style") == strName)
|
||||
style = oNode;
|
||||
}
|
||||
}
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(spPr);
|
||||
oValue.Write(bodyPr);
|
||||
oValue.Write(lstStyle);
|
||||
oValue.WriteNullable(style);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:") + m_name, oValue);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteRecord1(0, spPr);
|
||||
pWriter->WriteRecord1(1, bodyPr);
|
||||
pWriter->WriteRecord1(2, lstStyle);
|
||||
pWriter->WriteRecord2(3, style);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
spPr.m_namespace = _T("a");
|
||||
spPr.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
bodyPr.m_namespace = _T("a");
|
||||
bodyPr.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
lstStyle.m_name = _T("a:lstStyle");
|
||||
lstStyle.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
style = new ShapeStyle();
|
||||
style->m_ns = _T("a");
|
||||
style->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:") + m_name);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
spPr.toXmlWriter(pWriter);
|
||||
bodyPr.toXmlWriter(pWriter);
|
||||
lstStyle.toXmlWriter(pWriter);
|
||||
pWriter->Write(style);
|
||||
|
||||
pWriter->EndNode(_T("a:") + m_name);
|
||||
}
|
||||
|
||||
public:
|
||||
SpPr spPr;
|
||||
BodyPr bodyPr;
|
||||
TextListStyle lstStyle;
|
||||
nullable<ShapeStyle> style;
|
||||
public:
|
||||
CString m_name;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
spPr.SetParentPointer(this);
|
||||
bodyPr.SetParentPointer(this);
|
||||
lstStyle.SetParentPointer(this);
|
||||
if(style.IsInit())
|
||||
style->SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_DEFAULTSHAPEDEFINITION_INCLUDE_H
|
||||
87
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectDag.cpp
Normal file
87
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectDag.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include "EffectDag.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
EffectDag::EffectDag()
|
||||
{
|
||||
}
|
||||
|
||||
EffectDag::~EffectDag()
|
||||
{
|
||||
}
|
||||
|
||||
EffectDag::EffectDag(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
}
|
||||
|
||||
const EffectDag& EffectDag::operator =(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void EffectDag::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = node.GetName();
|
||||
node.ReadAttributeBase(L"name", name);
|
||||
node.ReadAttributeBase(L"type", type);
|
||||
Effects.RemoveAll();
|
||||
node.LoadArray(_T("*"), Effects);
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
CString EffectDag::toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("name"), name);
|
||||
oAttr.WriteLimitNullable(_T("type"), type);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(Effects);
|
||||
|
||||
return XmlUtils::CreateNode(m_name, oAttr, oValue);
|
||||
}
|
||||
|
||||
void EffectDag::FillParentPointersForChilds()
|
||||
{
|
||||
size_t count = Effects.GetCount();
|
||||
for(size_t i = 0; i < count; ++i)
|
||||
Effects[i].SetParentPointer(this);
|
||||
}
|
||||
}
|
||||
} // namespace PPTX
|
||||
126
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectDag.h
Normal file
126
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectDag.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_EFFECTDAG_INCLUDE_H_
|
||||
#define PPTX_LOGIC_EFFECTDAG_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "UniEffect.h"
|
||||
#include "./../Limit/EffectContainerType.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class EffectDag : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(EffectDag)
|
||||
|
||||
EffectDag& operator=(const EffectDag& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Effects.Copy(oSrc.Effects);
|
||||
name = oSrc.name;
|
||||
type = oSrc.type;
|
||||
m_name = oSrc.m_name;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = node.GetName();
|
||||
node.ReadAttributeBase(L"name", name);
|
||||
node.ReadAttributeBase(L"type", type);
|
||||
Effects.RemoveAll();
|
||||
node.LoadArray(_T("*"), Effects);
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("name"), name);
|
||||
oAttr.WriteLimitNullable(_T("type"), type);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(Effects);
|
||||
|
||||
return XmlUtils::CreateNode(m_name, oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_DAG);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString2(0, name);
|
||||
pWriter->WriteLimit2(1, type);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->StartRecord(0);
|
||||
ULONG len = (ULONG)Effects.GetCount();
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(1, Effects[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
CAtlArray<UniEffect> Effects;
|
||||
nullable_string name;
|
||||
nullable_limit<Limit::EffectContainerType> type;
|
||||
CString m_name;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
size_t count = Effects.GetCount();
|
||||
for(size_t i = 0; i < count; ++i)
|
||||
Effects[i].SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_EFFECTDAG_INCLUDE_H_
|
||||
108
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectLst.cpp
Normal file
108
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectLst.cpp
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include "EffectLst.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
EffectLst::EffectLst()
|
||||
{
|
||||
}
|
||||
|
||||
EffectLst::~EffectLst()
|
||||
{
|
||||
}
|
||||
|
||||
EffectLst::EffectLst(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
}
|
||||
|
||||
const EffectLst& EffectLst::operator =(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void EffectLst::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
blur = node.ReadNode(_T("a:blur"));
|
||||
fillOverlay = node.ReadNode(_T("a:fillOverlay"));
|
||||
glow = node.ReadNode(_T("a:glow"));
|
||||
innerShdw = node.ReadNode(_T("a:innerShdw"));
|
||||
outerShdw = node.ReadNode(_T("a:outerShdw"));
|
||||
prstShdw = node.ReadNode(_T("a:prstShdw"));
|
||||
reflection = node.ReadNode(_T("a:reflection"));
|
||||
softEdge = node.ReadNode(_T("a:softEdge"));
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
CString EffectLst::toXML() const
|
||||
{
|
||||
CString str = _T("<a:effectLst>");
|
||||
if (blur.IsInit()) str += blur->toXML();
|
||||
if (fillOverlay.IsInit()) str += fillOverlay->toXML();
|
||||
if (glow.IsInit()) str += glow->toXML();
|
||||
if (innerShdw.IsInit()) str += innerShdw->toXML();
|
||||
if (outerShdw.IsInit()) str += outerShdw->toXML();
|
||||
if (prstShdw.IsInit()) str += prstShdw->toXML();
|
||||
if (reflection.IsInit()) str += reflection->toXML();
|
||||
if (softEdge.IsInit()) str += softEdge->toXML();
|
||||
|
||||
str += _T("</a:effectLst>");
|
||||
return str;
|
||||
}
|
||||
|
||||
void EffectLst::FillParentPointersForChilds()
|
||||
{
|
||||
if(blur.IsInit())
|
||||
blur->SetParentPointer(this);
|
||||
if(fillOverlay.IsInit())
|
||||
fillOverlay->SetParentPointer(this);
|
||||
if(glow.IsInit())
|
||||
glow->SetParentPointer(this);
|
||||
if(innerShdw.IsInit())
|
||||
innerShdw->SetParentPointer(this);
|
||||
if(outerShdw.IsInit())
|
||||
outerShdw->SetParentPointer(this);
|
||||
if(prstShdw.IsInit())
|
||||
prstShdw->SetParentPointer(this);
|
||||
if(reflection.IsInit())
|
||||
reflection->SetParentPointer(this);
|
||||
if(softEdge.IsInit())
|
||||
softEdge->SetParentPointer(this);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace PPTX
|
||||
154
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectLst.h
Normal file
154
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectLst.h
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_EFFECTLST_INCLUDE_H_
|
||||
#define PPTX_LOGIC_EFFECTLST_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "Effects\Blur.h"
|
||||
#include "Effects\Glow.h"
|
||||
#include "Effects\OuterShdw.h"
|
||||
#include "Effects\PrstShdw.h"
|
||||
#include "Effects\InnerShdw.h"
|
||||
#include "Effects\Reflection.h"
|
||||
#include "Effects\SoftEdge.h"
|
||||
#include "Effects\FillOverlay.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class EffectLst : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(EffectLst)
|
||||
|
||||
EffectLst& operator=(const EffectLst& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
blur = oSrc.blur;
|
||||
fillOverlay = oSrc.fillOverlay;
|
||||
glow = oSrc.glow;
|
||||
innerShdw = oSrc.innerShdw;
|
||||
outerShdw = oSrc.outerShdw;
|
||||
prstShdw = oSrc.prstShdw;
|
||||
reflection = oSrc.reflection;
|
||||
softEdge = oSrc.softEdge;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
blur = node.ReadNode(_T("a:blur"));
|
||||
fillOverlay = node.ReadNode(_T("a:fillOverlay"));
|
||||
glow = node.ReadNode(_T("a:glow"));
|
||||
innerShdw = node.ReadNode(_T("a:innerShdw"));
|
||||
outerShdw = node.ReadNode(_T("a:outerShdw"));
|
||||
prstShdw = node.ReadNode(_T("a:prstShdw"));
|
||||
reflection = node.ReadNode(_T("a:reflection"));
|
||||
softEdge = node.ReadNode(_T("a:softEdge"));
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
CString str = _T("<a:effectLst>");
|
||||
if (blur.IsInit()) str += blur->toXML();
|
||||
if (fillOverlay.IsInit()) str += fillOverlay->toXML();
|
||||
if (glow.IsInit()) str += glow->toXML();
|
||||
if (innerShdw.IsInit()) str += innerShdw->toXML();
|
||||
if (outerShdw.IsInit()) str += outerShdw->toXML();
|
||||
if (prstShdw.IsInit()) str += prstShdw->toXML();
|
||||
if (reflection.IsInit()) str += reflection->toXML();
|
||||
if (softEdge.IsInit()) str += softEdge->toXML();
|
||||
|
||||
str += _T("</a:effectLst>");
|
||||
return str;
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECTPROPERTIES_TYPE_LIST);
|
||||
|
||||
pWriter->WriteRecord2(0, blur);
|
||||
pWriter->WriteRecord2(1, fillOverlay);
|
||||
pWriter->WriteRecord2(2, glow);
|
||||
pWriter->WriteRecord2(3, innerShdw);
|
||||
pWriter->WriteRecord2(4, outerShdw);
|
||||
pWriter->WriteRecord2(5, prstShdw);
|
||||
pWriter->WriteRecord2(6, reflection);
|
||||
pWriter->WriteRecord2(7, softEdge);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<Blur> blur;
|
||||
nullable<FillOverlay> fillOverlay;
|
||||
nullable<Glow> glow;
|
||||
nullable<InnerShdw> innerShdw;
|
||||
nullable<OuterShdw> outerShdw;
|
||||
nullable<PrstShdw> prstShdw;
|
||||
nullable<Reflection> reflection;
|
||||
nullable<SoftEdge> softEdge;
|
||||
protected:
|
||||
virtual void EffectLst::FillParentPointersForChilds()
|
||||
{
|
||||
if(blur.IsInit())
|
||||
blur->SetParentPointer(this);
|
||||
if(fillOverlay.IsInit())
|
||||
fillOverlay->SetParentPointer(this);
|
||||
if(glow.IsInit())
|
||||
glow->SetParentPointer(this);
|
||||
if(innerShdw.IsInit())
|
||||
innerShdw->SetParentPointer(this);
|
||||
if(outerShdw.IsInit())
|
||||
outerShdw->SetParentPointer(this);
|
||||
if(prstShdw.IsInit())
|
||||
prstShdw->SetParentPointer(this);
|
||||
if(reflection.IsInit())
|
||||
reflection->SetParentPointer(this);
|
||||
if(softEdge.IsInit())
|
||||
softEdge->SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_EFFECTLST_INCLUDE_H_
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include "EffectProperties.h"
|
||||
#include "EffectLst.h"
|
||||
#include "EffectDag.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
EffectProperties::EffectProperties()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
EffectProperties::~EffectProperties()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
EffectProperties::EffectProperties(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
}
|
||||
|
||||
|
||||
const EffectProperties& EffectProperties::operator =(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
} // namespace PPTX
|
||||
123
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectProperties.h
Normal file
123
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectProperties.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_EFFECTPROPERTIES_INCLUDE_H_
|
||||
#define PPTX_LOGIC_EFFECTPROPERTIES_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "EffectLst.h"
|
||||
#include "EffectDag.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class EffectProperties : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(EffectProperties)
|
||||
|
||||
EffectProperties& operator=(const EffectProperties& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
virtual bool is_init() const {return (List.IsInit());};
|
||||
|
||||
template<class T> const bool is() const { return (!List.IsInit())?false:(typeid(*List) == typeid(T));}
|
||||
template<class T> T& as() {return static_cast<T&>(*List);}
|
||||
template<class T> const T& as() const {return static_cast<const T&>(*List);}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
CString strName = XmlUtils::GetNameNoNS(node.GetName());
|
||||
|
||||
if (strName == _T("effectLst"))
|
||||
List.reset(new Logic::EffectLst(node));
|
||||
else if(strName == _T("effectDag"))
|
||||
List.reset(new Logic::EffectDag(node));
|
||||
else List.reset();
|
||||
}
|
||||
|
||||
virtual void GetEffectListFrom(XmlUtils::CXmlNode& element)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode = element.ReadNodeNoNS(_T("effectLst"));
|
||||
if (oNode.IsValid())
|
||||
{
|
||||
List.reset(new Logic::EffectLst(oNode));
|
||||
return;
|
||||
}
|
||||
oNode = element.ReadNodeNoNS(_T("effectDag"));
|
||||
if (oNode.IsValid())
|
||||
List.reset(new Logic::EffectDag(oNode));
|
||||
else List.reset();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
if (!List.IsInit())
|
||||
return _T("");
|
||||
return List->toXML();
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if (List.is_init())
|
||||
List->toPPTY(pWriter);
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (List.is_init())
|
||||
List->toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
nullable<WrapperWritingElement> List;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
public:
|
||||
virtual void SetParentPointer(const WrapperWritingElement* pParent)
|
||||
{
|
||||
if(is_init())
|
||||
List->SetParentPointer(pParent);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_EFFECTPROPERTIES_INCLUDE_H
|
||||
92
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectStyle.cpp
Normal file
92
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectStyle.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include "EffectStyle.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
EffectStyle::EffectStyle()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
EffectStyle::~EffectStyle()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
EffectStyle::EffectStyle(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
}
|
||||
|
||||
|
||||
const EffectStyle& EffectStyle::operator =(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
fromXML(node);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void EffectStyle::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
EffectList.GetEffectListFrom(node);
|
||||
scene3d = node.ReadNode(_T("a:scene3d"));
|
||||
sp3d = node.ReadNode(_T("a:sp3d"));
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
|
||||
CString EffectStyle::toXML() const
|
||||
{
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(EffectList);
|
||||
oValue.WriteNullable(scene3d);
|
||||
oValue.WriteNullable(sp3d);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:effectStyle"), oValue);
|
||||
}
|
||||
|
||||
void EffectStyle::FillParentPointersForChilds()
|
||||
{
|
||||
EffectList.SetParentPointer(this);
|
||||
if(scene3d.IsInit())
|
||||
scene3d->SetParentPointer(this);
|
||||
if(sp3d.IsInit())
|
||||
sp3d->SetParentPointer(this);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace PPTX
|
||||
111
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectStyle.h
Normal file
111
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/EffectStyle.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_EFFECTSTYLE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_EFFECTSTYLE_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "EffectProperties.h"
|
||||
#include "Scene3d.h"
|
||||
#include "Sp3d.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class EffectStyle : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(EffectStyle)
|
||||
|
||||
EffectStyle& operator=(const EffectStyle& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
EffectList = oSrc.EffectList;
|
||||
scene3d = oSrc.scene3d;
|
||||
sp3d = oSrc.sp3d;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
EffectList.GetEffectListFrom(node);
|
||||
scene3d = node.ReadNode(_T("a:scene3d"));
|
||||
sp3d = node.ReadNode(_T("a:sp3d"));
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(EffectList);
|
||||
oValue.WriteNullable(scene3d);
|
||||
oValue.WriteNullable(sp3d);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:effectStyle"), oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:effectStyle"));
|
||||
pWriter->EndAttributes();
|
||||
|
||||
EffectList.toXmlWriter(pWriter);
|
||||
pWriter->Write(scene3d);
|
||||
pWriter->Write(sp3d);
|
||||
|
||||
pWriter->EndNode(_T("a:effectStyle"));
|
||||
}
|
||||
|
||||
public:
|
||||
EffectProperties EffectList;
|
||||
nullable<Scene3d> scene3d;
|
||||
nullable<Sp3d> sp3d;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
EffectList.SetParentPointer(this);
|
||||
if(scene3d.IsInit())
|
||||
scene3d->SetParentPointer(this);
|
||||
if(sp3d.IsInit())
|
||||
sp3d->SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_EFFECTSTYLE_INCLUDE_H_
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_ALPHABILEVEL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_ALPHABILEVEL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AlphaBiLevel : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(AlphaBiLevel)
|
||||
|
||||
AlphaBiLevel& operator=(const AlphaBiLevel& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
thresh = oSrc.thresh;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"thresh", thresh);
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("thresh"), thresh);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:alphaBiLevel"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_ALPHABILEVEL);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, thresh);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_int thresh;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
thresh.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_ALPHABILEVEL_INCLUDE_H_
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_ALPHACEILING_INCLUDE_H_
|
||||
#define PPTX_LOGIC_ALPHACEILING_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AlphaCeiling : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(AlphaCeiling)
|
||||
|
||||
AlphaCeiling& operator=(const AlphaCeiling& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_ALPHACEILING);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:alphaCeiling/>");
|
||||
}
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_ALPHACEILING_INCLUDE_H_
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_ALPHAFLOOR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_ALPHAFLOOR_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AlphaFloor : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(AlphaFloor)
|
||||
|
||||
AlphaFloor& operator=(const AlphaFloor& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:alphaFloor/>");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_ALPHAFLOOR);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_ALPHAFLOOR_INCLUDE_H_
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_ALPHAINV_INCLUDE_H_
|
||||
#define PPTX_LOGIC_ALPHAINV_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AlphaInv : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(AlphaInv)
|
||||
|
||||
AlphaInv& operator=(const AlphaInv& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Color = oSrc.Color;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Color.GetColorFrom(node);
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:alphaInv>") + Color.toXML() + _T("</a:alphaInv>");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_ALPHAINV);
|
||||
|
||||
pWriter->WriteRecord1(0, Color);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniColor Color;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(Color.is_init())
|
||||
Color.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_ALPHAINV_INCLUDE_H_
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_ALPHAMOD_INCLUDE_H_
|
||||
#define PPTX_LOGIC_ALPHAMOD_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../EffectDag.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AlphaMod : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(AlphaMod)
|
||||
|
||||
AlphaMod& operator=(const AlphaMod& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
cont = oSrc.cont;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
cont = node.ReadNode(_T("a:cont"));
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:alphaMod>") + cont.toXML() + _T("</a:alphaMod>");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_ALPHAMOD);
|
||||
|
||||
pWriter->WriteRecord1(0, cont);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
EffectDag cont;
|
||||
protected:
|
||||
virtual void AlphaMod::FillParentPointersForChilds()
|
||||
{
|
||||
cont.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_ALPHAMOD_INCLUDE_H_
|
||||
112
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/AlphaModFix.h
Normal file
112
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/AlphaModFix.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_ALPHAMODFIX_INCLUDE_H_
|
||||
#define PPTX_LOGIC_ALPHAMODFIX_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AlphaModFix : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(AlphaModFix)
|
||||
|
||||
AlphaModFix& operator=(const AlphaModFix& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
amt = oSrc.amt;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"amt", amt);
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
if (amt.IsInit())
|
||||
{
|
||||
CString strRes = _T("");
|
||||
strRes.Format(_T("<a:alphaModFix amt=\"%d\" />"), *amt);
|
||||
return strRes;
|
||||
}
|
||||
|
||||
return _T("<a:alphaModFix/>");
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
if (amt.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("a:alphaModFix"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("amt"), amt);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("a:alphaModFix"));
|
||||
}
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_ALPHAMODFIX);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, amt);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
public:
|
||||
nullable_int amt;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
amt.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_ALPHAMODFIX_INCLUDE_H_
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_ALPHAOUTSET_INCLUDE_H_
|
||||
#define PPTX_LOGIC_ALPHAOUTSET_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AlphaOutset : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(AlphaOutset)
|
||||
|
||||
AlphaOutset& operator=(const AlphaOutset& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
rad = oSrc.rad;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"rad", rad);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
if (rad.IsInit())
|
||||
{
|
||||
CString str = _T("");
|
||||
str.Format(_T("<a:alphaOutset rad=\"%u\" />"), *rad);
|
||||
return str;
|
||||
}
|
||||
|
||||
return _T("<a:alphaOutset/>");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_ALPHAOUTSET);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteSize_t2(0, rad);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_sizet rad;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_ALPHAOUTSET_INCLUDE_H_
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_ALPHAREPL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_ALPHAREPL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class AlphaRepl : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(AlphaRepl)
|
||||
|
||||
AlphaRepl& operator=(const AlphaRepl& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
a = oSrc.a;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"a", a);
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
if (!a.IsInit())
|
||||
return _T("<a:alphaRepl/>");
|
||||
|
||||
CString str = _T("");
|
||||
str.Format(_T("<a:alphaRepl a=\"%d\" />"), *a);
|
||||
return str;
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_ALPHAREPL);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, a);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_int a;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
a.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_ALPHAREPL_INCLUDE_H_
|
||||
96
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/BiLevel.h
Normal file
96
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/BiLevel.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BILEVEL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BILEVEL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class BiLevel : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(BiLevel)
|
||||
|
||||
BiLevel& operator=(const BiLevel& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
thresh = oSrc.thresh;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"thresh", thresh);
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("thresh"), thresh);
|
||||
return XmlUtils::CreateNode(_T("a:biLevel"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_BILEVEL);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, thresh);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_int thresh;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
thresh.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BILEVEL_INCLUDE_H_
|
||||
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Blend.h
Normal file
99
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Blend.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BLEND_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BLEND_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../EffectDag.h"
|
||||
#include "./../../Limit/BlendMode.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Blend : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(Blend)
|
||||
|
||||
Blend& operator=(const Blend& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
cont = oSrc.cont;
|
||||
blend = oSrc.blend;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
cont = node.ReadNode(_T("a:cont"));
|
||||
blend = node.GetAttribute(_T("blend"));
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:blend blend=\"") + blend.get() + _T("\">") + cont.toXML() + _T("</a:blend>");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_BLEND);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit1(0, blend);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, cont);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
EffectDag cont;
|
||||
Limit::BlendMode blend;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
cont.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BLEND_INCLUDE_H_
|
||||
95
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Blur.h
Normal file
95
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Blur.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BLUR_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BLUR_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class Blur : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(Blur)
|
||||
|
||||
Blur& operator=(const Blur& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
rad = oSrc.rad;
|
||||
grow = oSrc.grow;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"rad", rad);
|
||||
node.ReadAttributeBase(L"grow", grow);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("rad"), rad);
|
||||
oAttr.Write(_T("grow"), grow);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:blur"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_BLUR);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteSize_t2(0, rad);
|
||||
pWriter->WriteBool2(1, grow);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_sizet rad;
|
||||
nullable_bool grow;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BLUR_INCLUDE_H_
|
||||
109
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/ClrChange.h
Normal file
109
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/ClrChange.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CLRCHANGE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CLRCHANGE_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class ClrChange : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(ClrChange)
|
||||
|
||||
ClrChange& operator=(const ClrChange& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
ClrFrom = oSrc.ClrFrom;
|
||||
ClrTo = oSrc.ClrTo;
|
||||
useA = oSrc.useA;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
ClrFrom.GetColorFrom(node.ReadNode(_T("a:clrFrom")));
|
||||
ClrTo.GetColorFrom(node.ReadNode(_T("a:clrTo")));
|
||||
node.ReadAttributeBase(L"useA", useA);
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("useA"), useA);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(_T("a:clrFrom"), ClrFrom);
|
||||
oValue.Write(_T("a:clrTo"), ClrTo);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:clrChange"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_CLRCHANGE);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteBool2(0, useA);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, ClrFrom);
|
||||
pWriter->WriteRecord1(1, ClrTo);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniColor ClrFrom;
|
||||
UniColor ClrTo;
|
||||
nullable_bool useA;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
ClrFrom.SetParentPointer(this);
|
||||
ClrTo.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CLRCHANGE_INCLUDE_H_
|
||||
91
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/ClrRepl.h
Normal file
91
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/ClrRepl.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_CLRREPL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_CLRREPL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class ClrRepl : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(ClrRepl)
|
||||
|
||||
ClrRepl& operator=(const ClrRepl& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Color = oSrc.Color;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Color.GetColorFrom(node);
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:clrRepl>") + Color.toXML() + _T("</a:clrRepl>");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_CLRREPL);
|
||||
|
||||
pWriter->WriteRecord1(0, Color);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniColor Color;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Color.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_CLRREPL_INCLUDE_H_
|
||||
101
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Duotone.h
Normal file
101
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Duotone.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_DUOTONE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_DUOTONE_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class Duotone : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Duotone)
|
||||
|
||||
Duotone& operator=(const Duotone& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Colors.Copy(oSrc.Colors);
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Colors.RemoveAll();
|
||||
node.LoadArray(_T("*"), Colors);
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(Colors);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:duotone"), oValue);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_DUOTONE);
|
||||
|
||||
ULONG len = (ULONG)Colors.GetCount();
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(0, Colors[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
CAtlArray<UniColor> Colors;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
size_t count = Colors.GetCount();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
Colors[i].SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_DUOTONE_INCLUDE_H_
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_EFFECTELEMENT_INCLUDE_H_
|
||||
#define PPTX_LOGIC_EFFECTELEMENT_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class EffectElement : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(EffectElement)
|
||||
|
||||
EffectElement& operator=(const EffectElement& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
ref = oSrc.ref;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"ref", ref);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
if (!ref.IsInit())
|
||||
return _T("<a:effect/>");
|
||||
|
||||
return _T("<a:effect ref=\"") + *ref + _T("\" />");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_ELEMENT);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString2(0, ref);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_string ref;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_EFFECTELEMENT_INCLUDE_H_
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_FILLEFFECT_INCLUDE_H_
|
||||
#define PPTX_LOGIC_FILLEFFECT_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniFill.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class FillEffect : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(FillEffect)
|
||||
|
||||
FillEffect& operator=(const FillEffect& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Fill = oSrc.Fill;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Fill.GetFillFrom(node);
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:fill>") + Fill.toXML() + _T("</a:fill>");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_FILL);
|
||||
|
||||
pWriter->WriteRecord1(0, Fill);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniFill Fill;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Fill.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_FILLEFFECT_INCLUDE_H_
|
||||
104
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/FillOverlay.h
Normal file
104
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/FillOverlay.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_FILLOVERLAY_INCLUDE_H_
|
||||
#define PPTX_LOGIC_FILLOVERLAY_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniFill.h"
|
||||
#include "./../../Limit/BlendMode.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class FillOverlay : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
|
||||
PPTX_LOGIC_BASE(FillOverlay)
|
||||
|
||||
FillOverlay& operator=(const FillOverlay& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Fill = oSrc.Fill;
|
||||
blend = oSrc.blend;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Fill.GetFillFrom(node);
|
||||
blend = node.GetAttribute(_T("blend"));
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
CString str = _T("<a:fillOverlay blend=\"") + blend.get() + _T("\">");
|
||||
str += Fill.toXML();
|
||||
str += _T("</a:fillOverlay>");
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_FILLOVERLAY);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit1(0, blend);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, Fill);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniFill Fill;
|
||||
Limit::BlendMode blend;
|
||||
protected:
|
||||
virtual void FillOverlay::FillParentPointersForChilds()
|
||||
{
|
||||
Fill.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_FILLOVERLAY_INCLUDE_H_
|
||||
107
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Glow.h
Normal file
107
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Glow.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_GLOW_INCLUDE_H_
|
||||
#define PPTX_LOGIC_GLOW_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Glow : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Glow)
|
||||
|
||||
Glow& operator=(const Glow& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Color = oSrc.Color;
|
||||
rad = oSrc.rad;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Color.GetColorFrom(node);
|
||||
node.ReadAttributeBase(L"rad", rad);
|
||||
FillParentPointersForChilds();
|
||||
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("rad"), rad);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:glow"), oAttr, Color.toXML());
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_GLOW);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, rad);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, Color);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniColor Color;
|
||||
nullable_int rad;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Color.SetParentPointer(this);
|
||||
}
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
rad.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_GLOW_INCLUDE_H_
|
||||
78
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Grayscl.h
Normal file
78
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Grayscl.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_GRAYSCL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_GRAYSCL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Grayscl : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Grayscl)
|
||||
|
||||
Grayscl& operator=(const Grayscl& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:grayscl/>");
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_GRAYSCL);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_GRAYSCL_INCLUDE_H_
|
||||
106
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/HslEffect.h
Normal file
106
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/HslEffect.h
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_HSLEFFECT_INCLUDE_H_
|
||||
#define PPTX_LOGIC_HSLEFFECT_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class HslEffect : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(HslEffect)
|
||||
|
||||
HslEffect& operator=(const HslEffect& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
hue = oSrc.hue;
|
||||
lum = oSrc.lum;
|
||||
sat = oSrc.sat;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"hue", hue);
|
||||
node.ReadAttributeBase(L"sat", sat);
|
||||
node.ReadAttributeBase(L"lum", lum);
|
||||
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("hue"), hue);
|
||||
oAttr.Write(_T("sat"), sat);
|
||||
oAttr.Write(_T("lum"), lum);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:hsl"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_HSL);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, hue);
|
||||
pWriter->WriteInt2(0, lum);
|
||||
pWriter->WriteInt2(0, sat);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
public:
|
||||
nullable_int hue;
|
||||
nullable_int lum;
|
||||
nullable_int sat;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
hue.normalize(0, 21600000);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_HSLEFFECT_INCLUDE_H_
|
||||
121
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/InnerShdw.h
Normal file
121
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/InnerShdw.h
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_INNERSHDW_INCLUDE_H_
|
||||
#define PPTX_LOGIC_INNERSHDW_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class InnerShdw : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(InnerShdw)
|
||||
|
||||
InnerShdw& operator=(const InnerShdw& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Color = oSrc.Color;
|
||||
blurRad = oSrc.blurRad;
|
||||
dir = oSrc.dir;
|
||||
dist = oSrc.dist;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Color.GetColorFrom(node);
|
||||
node.ReadAttributeBase(L"blurRad", blurRad);
|
||||
node.ReadAttributeBase(L"dir", dir);
|
||||
node.ReadAttributeBase(L"dist", dist);
|
||||
|
||||
FillParentPointersForChilds();
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("blurRad"), blurRad);
|
||||
oAttr.Write(_T("dist"), dist);
|
||||
oAttr.Write(_T("dir"), dir);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:innerShdw"), oAttr, Color.toXML());
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_INNERSHDW);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, dir);
|
||||
pWriter->WriteInt2(1, dist);
|
||||
pWriter->WriteInt2(2, blurRad);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, Color);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniColor Color;
|
||||
|
||||
nullable_int blurRad;
|
||||
nullable_int dir;
|
||||
nullable_int dist;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Color.SetParentPointer(this);
|
||||
}
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
blurRad.normalize_positive();
|
||||
dist.normalize_positive();
|
||||
|
||||
dir.normalize(0, 21600000);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_INNERSHDW_INCLUDE_H_
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_LUMEFFECT_INCLUDE_H_
|
||||
#define PPTX_LOGIC_LUMEFFECT_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class LumEffect : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(LumEffect)
|
||||
|
||||
LumEffect& operator=(const LumEffect& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
bright = oSrc.bright;
|
||||
contrast = oSrc.contrast;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"bright", bright);
|
||||
node.ReadAttributeBase(L"contrast", contrast);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("bright"), bright);
|
||||
oAttr.Write(_T("contrast"), contrast);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:lum"), oAttr);
|
||||
}
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_LUM);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, bright);
|
||||
pWriter->WriteInt2(0, contrast);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
public:
|
||||
nullable_int bright;
|
||||
nullable_int contrast;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_LUMEFFECT_INCLUDE_H_
|
||||
160
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/OuterShdw.h
Normal file
160
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/OuterShdw.h
Normal file
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_OUTERSHDW_INCLUDE_H_
|
||||
#define PPTX_LOGIC_OUTERSHDW_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
#include "./../../Limit/RectAlign.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class OuterShdw : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(OuterShdw)
|
||||
|
||||
OuterShdw& operator=(const OuterShdw& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Color = oSrc.Color;
|
||||
|
||||
algn = oSrc.algn;
|
||||
blurRad = oSrc.blurRad;
|
||||
dir = oSrc.dir;
|
||||
dist = oSrc.dist;
|
||||
kx = oSrc.kx;
|
||||
ky = oSrc.ky;
|
||||
rotWithShape = oSrc.rotWithShape;
|
||||
sx = oSrc.sx;
|
||||
sy = oSrc.sy;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Color.GetColorFrom(node);
|
||||
node.ReadAttributeBase(L"algn", algn);
|
||||
node.ReadAttributeBase(L"blurRad", blurRad);
|
||||
node.ReadAttributeBase(L"dir", dir);
|
||||
node.ReadAttributeBase(L"dist", dist);
|
||||
node.ReadAttributeBase(L"kx", kx);
|
||||
node.ReadAttributeBase(L"ky", ky);
|
||||
node.ReadAttributeBase(L"rotWithShape", rotWithShape);
|
||||
node.ReadAttributeBase(L"sx", sx);
|
||||
node.ReadAttributeBase(L"sy", sy);
|
||||
|
||||
Normalize();
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("blurRad"), blurRad);
|
||||
oAttr.Write(_T("dir"), dist);
|
||||
oAttr.Write(_T("dist"), dir);
|
||||
oAttr.Write(_T("sx"), sx);
|
||||
oAttr.Write(_T("sy"), sy);
|
||||
oAttr.Write(_T("kx"), kx);
|
||||
oAttr.Write(_T("ky"), ky);
|
||||
oAttr.WriteLimitNullable(_T("algn"), algn);
|
||||
oAttr.Write(_T("rotWithShape"), rotWithShape);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(Color);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:outerShdw"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_OUTERSHDW);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, algn);
|
||||
pWriter->WriteInt2(1, blurRad);
|
||||
pWriter->WriteInt2(2, dir);
|
||||
pWriter->WriteInt2(3, dist);
|
||||
pWriter->WriteInt2(4, kx);
|
||||
pWriter->WriteInt2(5, ky);
|
||||
pWriter->WriteInt2(6, sx);
|
||||
pWriter->WriteInt2(7, sy);
|
||||
pWriter->WriteBool2(8, rotWithShape);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, Color);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniColor Color;
|
||||
|
||||
nullable_limit<Limit::RectAlign> algn;
|
||||
nullable_int blurRad;
|
||||
nullable_int dir;
|
||||
nullable_int dist;
|
||||
nullable_int kx;
|
||||
nullable_int ky;
|
||||
nullable_bool rotWithShape;
|
||||
nullable_int sx;
|
||||
nullable_int sy;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Color.SetParentPointer(this);
|
||||
}
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
blurRad.normalize_positive();
|
||||
dist.normalize_positive();
|
||||
|
||||
dir.normalize(0, 21600000);
|
||||
kx.normalize(-5400000, 5400000);
|
||||
ky.normalize(-5400000, 5400000);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_OUTERSHDW_INCLUDE_H_
|
||||
124
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/PrstShdw.h
Normal file
124
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/PrstShdw.h
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_PRSTSHDW_INCLUDE_H_
|
||||
#define PPTX_LOGIC_PRSTSHDW_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
#include "./../../Limit/PresetShadowVal.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class PrstShdw : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(PrstShdw)
|
||||
|
||||
PrstShdw& operator=(const PrstShdw& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Color = oSrc.Color;
|
||||
|
||||
prst = oSrc.prst;
|
||||
dir = oSrc.dir;
|
||||
dist = oSrc.dist;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Color.GetColorFrom(node);
|
||||
prst = node.GetAttribute(L"prst");
|
||||
node.ReadAttributeBase(L"dir", dir);
|
||||
node.ReadAttributeBase(L"dist", dist);
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("prst"), prst.get());
|
||||
oAttr.Write(_T("dist"), dist);
|
||||
oAttr.Write(_T("dir"), dir);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(Color);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:prstShdw"), oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_PRSTSHDW);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, dir);
|
||||
pWriter->WriteInt2(1, dist);
|
||||
pWriter->WriteLimit1(2, prst);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, Color);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
UniColor Color;
|
||||
|
||||
Limit::PresetShadowVal prst;
|
||||
nullable_int dir;
|
||||
nullable_int dist;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Color.SetParentPointer(this);
|
||||
}
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
dir.normalize(0, 21600000);
|
||||
dist.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_PRSTSHDW_INCLUDE_H_
|
||||
175
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Reflection.h
Normal file
175
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/Reflection.h
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_REFLECTION_INCLUDE_H_
|
||||
#define PPTX_LOGIC_REFLECTION_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../../Limit/RectAlign.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Reflection : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Reflection)
|
||||
|
||||
Reflection& operator=(const Reflection& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
algn = oSrc.algn;
|
||||
blurRad = oSrc.blurRad;
|
||||
stA = oSrc.stA;
|
||||
endA = oSrc.endA;
|
||||
stPos = oSrc.stPos;
|
||||
endPos = oSrc.endPos;
|
||||
dir = oSrc.dir;
|
||||
fadeDir = oSrc.fadeDir;
|
||||
dist = oSrc.dist;
|
||||
kx = oSrc.kx;
|
||||
ky = oSrc.ky;
|
||||
rotWithShape = oSrc.rotWithShape;
|
||||
sx = oSrc.sx;
|
||||
sy = oSrc.sy;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"algn", algn);
|
||||
node.ReadAttributeBase(L"blurRad", blurRad);
|
||||
node.ReadAttributeBase(L"dir", dir);
|
||||
node.ReadAttributeBase(L"dist", dist);
|
||||
node.ReadAttributeBase(L"kx", kx);
|
||||
node.ReadAttributeBase(L"ky", ky);
|
||||
node.ReadAttributeBase(L"rotWithShape", rotWithShape);
|
||||
node.ReadAttributeBase(L"sx", sx);
|
||||
node.ReadAttributeBase(L"sy", sy);
|
||||
node.ReadAttributeBase(L"stA", stA);
|
||||
node.ReadAttributeBase(L"endA", endA);
|
||||
node.ReadAttributeBase(L"stPos", stPos);
|
||||
node.ReadAttributeBase(L"endPos", endPos);
|
||||
node.ReadAttributeBase(L"fadeDir", fadeDir);
|
||||
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("blurRad"), blurRad);
|
||||
oAttr.Write(_T("stA"), stA);
|
||||
oAttr.Write(_T("stPos"), stPos);
|
||||
oAttr.Write(_T("endA"), endA);
|
||||
oAttr.Write(_T("endPos"), endPos);
|
||||
oAttr.Write(_T("dist"), dist);
|
||||
oAttr.Write(_T("dir"), dir);
|
||||
oAttr.Write(_T("fadeDir"), fadeDir);
|
||||
oAttr.Write(_T("sx"), sx);
|
||||
oAttr.Write(_T("sy"), sy);
|
||||
oAttr.Write(_T("kx"), kx);
|
||||
oAttr.Write(_T("ky"), ky);
|
||||
oAttr.WriteLimitNullable(_T("algn"), algn);
|
||||
oAttr.Write(_T("rotWithShape"), rotWithShape);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:reflection"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_REFLECTION);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, algn);
|
||||
pWriter->WriteInt2(1, blurRad);
|
||||
pWriter->WriteInt2(2, stA);
|
||||
pWriter->WriteInt2(3, endA);
|
||||
pWriter->WriteInt2(4, stPos);
|
||||
pWriter->WriteInt2(5, endPos);
|
||||
pWriter->WriteInt2(6, dir);
|
||||
pWriter->WriteInt2(7, fadeDir);
|
||||
pWriter->WriteInt2(8, dist);
|
||||
pWriter->WriteInt2(9, kx);
|
||||
pWriter->WriteInt2(10, ky);
|
||||
pWriter->WriteInt2(11, sx);
|
||||
pWriter->WriteInt2(12, sy);
|
||||
pWriter->WriteBool2(13, rotWithShape);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_limit<Limit::RectAlign> algn;
|
||||
nullable_int blurRad;
|
||||
nullable_int stA;
|
||||
nullable_int endA;
|
||||
nullable_int stPos;
|
||||
nullable_int endPos;
|
||||
nullable_int dir;
|
||||
nullable_int fadeDir;
|
||||
nullable_int dist;
|
||||
nullable_int kx;
|
||||
nullable_int ky;
|
||||
nullable_bool rotWithShape;
|
||||
nullable_int sx;
|
||||
nullable_int sy;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
blurRad.normalize_positive();
|
||||
stA.normalize_positive();
|
||||
endA.normalize_positive();
|
||||
stPos.normalize_positive();
|
||||
endPos.normalize_positive();
|
||||
dist.normalize_positive();
|
||||
|
||||
dir.normalize(0, 2100000);
|
||||
fadeDir.normalize(0, 2100000);
|
||||
|
||||
kx.normalize(-5400000, 5400000);
|
||||
ky.normalize(-5400000, 5400000);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_REFLECTION_INCLUDE_H_
|
||||
95
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/RelOff.h
Normal file
95
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/RelOff.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_RELOFF_INCLUDE_H_
|
||||
#define PPTX_LOGIC_RELOFF_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class RelOff : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(RelOff)
|
||||
|
||||
RelOff& operator=(const RelOff& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
tx = oSrc.tx;
|
||||
ty = oSrc.ty;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"tx", tx);
|
||||
node.ReadAttributeBase(L"ty", ty);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("tx"), tx);
|
||||
oAttr.Write(_T("ty"), ty);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:relOff"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_RELOFF);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, tx);
|
||||
pWriter->WriteInt2(0, ty);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_int tx;
|
||||
nullable_int ty;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_RELOFF_INCLUDE_H_
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_SOFTEDGE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_SOFTEDGE_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class SoftEdge : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(SoftEdge)
|
||||
|
||||
SoftEdge& operator=(const SoftEdge& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
rad = oSrc.rad;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"rad", rad);
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("rad"), rad);
|
||||
return XmlUtils::CreateNode(_T("a:softEdge"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_SOFTEDGE);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteSize_t2(0, rad);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
public:
|
||||
nullable_sizet rad;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_SOFTEDGE_INCLUDE_H_
|
||||
102
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/TintEffect.h
Normal file
102
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/TintEffect.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_TINTEFFECT_INCLUDE_H_
|
||||
#define PPTX_LOGIC_TINTEFFECT_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class TintEffect : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(TintEffect)
|
||||
|
||||
TintEffect& operator=(const TintEffect& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
amt = oSrc.amt;
|
||||
hue = oSrc.hue;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"amt", amt);
|
||||
node.ReadAttributeBase(L"hue", hue);
|
||||
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("hue"), hue);
|
||||
oAttr.Write(_T("amt"), amt);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:tint"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_TINTEFFECT);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, amt);
|
||||
pWriter->WriteInt2(0, hue);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_int amt;
|
||||
nullable_int hue;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
hue.normalize(0, 21600000);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_TINTEFFECT_INCLUDE_H_
|
||||
124
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/XfrmEffect.h
Normal file
124
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Effects/XfrmEffect.h
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_XFRMEFFECT_INCLUDE_H_
|
||||
#define PPTX_LOGIC_XFRMEFFECT_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class XfrmEffect : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(XfrmEffect)
|
||||
|
||||
XfrmEffect& operator=(const XfrmEffect& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
kx = oSrc.kx;
|
||||
ky = oSrc.ky;
|
||||
sx = oSrc.sx;
|
||||
sy = oSrc.sy;
|
||||
tx = oSrc.tx;
|
||||
ty = oSrc.ty;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"kx", kx);
|
||||
node.ReadAttributeBase(L"ky", ky);
|
||||
node.ReadAttributeBase(L"sx", sx);
|
||||
node.ReadAttributeBase(L"sy", sy);
|
||||
node.ReadAttributeBase(L"tx", tx);
|
||||
node.ReadAttributeBase(L"ty", ty);
|
||||
|
||||
Normalize();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("sx"), sx);
|
||||
oAttr.Write(_T("sy"), sy);
|
||||
oAttr.Write(_T("kx"), kx);
|
||||
oAttr.Write(_T("ky"), ky);
|
||||
oAttr.Write(_T("tx"), tx);
|
||||
oAttr.Write(_T("ty"), ty);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:xfrm"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(EFFECT_TYPE_XFRM);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, kx);
|
||||
pWriter->WriteInt2(1, ky);
|
||||
pWriter->WriteInt2(2, sx);
|
||||
pWriter->WriteInt2(3, sy);
|
||||
pWriter->WriteSize_t2(4, tx);
|
||||
pWriter->WriteSize_t2(5, tx);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_int kx;
|
||||
nullable_int ky;
|
||||
nullable_int sx;
|
||||
nullable_int sy;
|
||||
nullable_sizet tx;
|
||||
nullable_sizet ty;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
kx.normalize(-5400000, 5400000);
|
||||
ky.normalize(-5400000, 5400000);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_XFRMEFFECT_INCLUDE_H_
|
||||
107
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ExtP.h
Normal file
107
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/ExtP.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#ifndef PPTX_LOGIC_EXTP_PROPERTIES_INCLUDE_H_
|
||||
#define PPTX_LOGIC_EXTP_PROPERTIES_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "../DocxFormat/RId.h"
|
||||
|
||||
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class Ext : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Ext)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNode media;
|
||||
if (node.GetNode(_T("p14:media"), media))
|
||||
{
|
||||
link = media.GetAttribute(_T("r:embed"));
|
||||
|
||||
CString xmkl = media.GetXml();
|
||||
|
||||
XmlUtils::CXmlNode trim;
|
||||
if (media.GetNode(_T("p14:trim"), trim))
|
||||
{
|
||||
trim.ReadAttributeBase(_T("st"), st);
|
||||
trim.ReadAttributeBase(_T("end"), end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
XmlUtils::CNodeValue oValue;
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:ext"), oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
link.toPPTY(0, pWriter);
|
||||
pWriter->WriteDouble2(1, st);
|
||||
pWriter->WriteDouble2(2, end);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
OOX::RId link;
|
||||
|
||||
|
||||
nullable_double st;
|
||||
nullable_double end;
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
109
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/FillStyle.h
Normal file
109
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/FillStyle.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_FILLSTYLE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_FILLSTYLE_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "UniFill.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class FillStyle: public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(FillStyle)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
Fill.GetFillFrom(node);
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("<a:fill>") + Fill.toXML() + _T("</a:fill>");
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:fill"));
|
||||
pWriter->EndAttributes();
|
||||
|
||||
Fill.toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(_T("a:fill"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteRecord1(0, Fill);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Fill.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
UniFill Fill;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Fill.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_FILLSTYLE_INCLUDE_H
|
||||
125
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.cpp
Normal file
125
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.cpp
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include "./stdafx.h"
|
||||
|
||||
#include "Blip.h"
|
||||
#include "./../../Slide.h"
|
||||
#include "./../../SlideMaster.h"
|
||||
#include "./../../SlideLayout.h"
|
||||
#include "./../../Theme.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
void Blip::fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
|
||||
node.ReadAttributeBase(L"r:embed", embed);
|
||||
node.ReadAttributeBase(L"r:link", link);
|
||||
node.ReadAttributeBase(L"cstate", cstate);
|
||||
|
||||
Effects.RemoveAll();
|
||||
node.LoadArray(_T("*"), Effects);
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
CString Blip::toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
|
||||
if (embed.IsInit())
|
||||
oAttr.Write(_T("r:embed"), embed->ToString());
|
||||
if (link.IsInit())
|
||||
oAttr.Write(_T("r:link"), link->ToString());
|
||||
oAttr.WriteLimitNullable(_T("cstate"), cstate);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(Effects);
|
||||
|
||||
CString strName = (_T("") == m_namespace) ? _T("blip") : (m_namespace + _T(":blip"));
|
||||
return XmlUtils::CreateNode(strName, oAttr, oValue);
|
||||
}
|
||||
|
||||
void Blip::FillParentPointersForChilds()
|
||||
{
|
||||
size_t count = Effects.GetCount();
|
||||
for(size_t i = 0; i < count; ++i)
|
||||
Effects[i].SetParentPointer(this);
|
||||
}
|
||||
|
||||
CString Blip::GetFullPicName(FileContainer* pRels)const
|
||||
{
|
||||
if(embed.IsInit())
|
||||
{
|
||||
if (pRels != NULL)
|
||||
{
|
||||
smart_ptr<OOX::Image> p = pRels->image(*embed);
|
||||
if (p.is_init())
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
|
||||
if(parentFileIs<Slide>())
|
||||
return parentFileAs<Slide>().GetMediaFullPathNameFromRId(*embed);
|
||||
else if(parentFileIs<SlideLayout>())
|
||||
return parentFileAs<SlideLayout>().GetMediaFullPathNameFromRId(*embed);
|
||||
else if(parentFileIs<SlideMaster>())
|
||||
return parentFileAs<SlideMaster>().GetMediaFullPathNameFromRId(*embed);
|
||||
else if(parentFileIs<Theme>())
|
||||
return parentFileAs<Theme>().GetMediaFullPathNameFromRId(*embed);
|
||||
return _T("");
|
||||
}
|
||||
else if(link.IsInit())
|
||||
{
|
||||
if (pRels != NULL)
|
||||
{
|
||||
smart_ptr<OOX::Image> p = pRels->image(*link);
|
||||
if (p.is_init())
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
|
||||
if(parentFileIs<Slide>())
|
||||
return parentFileAs<Slide>().GetMediaFullPathNameFromRId(*link);
|
||||
else if(parentFileIs<SlideLayout>())
|
||||
return parentFileAs<SlideLayout>().GetMediaFullPathNameFromRId(*link);
|
||||
else if(parentFileIs<SlideMaster>())
|
||||
return parentFileAs<SlideMaster>().GetMediaFullPathNameFromRId(*link);
|
||||
else if(parentFileIs<Theme>())
|
||||
return parentFileAs<Theme>().GetMediaFullPathNameFromRId(*link);
|
||||
return _T("");
|
||||
}
|
||||
return _T("");
|
||||
}
|
||||
}
|
||||
} // namespace PPTX
|
||||
155
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h
Normal file
155
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Blip.h
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BLIP_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BLIP_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../../Limit/BlipCompression.h"
|
||||
#include "./../UniEffect.h"
|
||||
#include "../../DocxFormat/RId.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class Blip : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Blip)
|
||||
|
||||
Blip& operator=(const Blip& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Effects.Copy(oSrc.Effects);
|
||||
|
||||
cstate = oSrc.cstate;
|
||||
embed = oSrc.embed;
|
||||
link = oSrc.link;
|
||||
|
||||
m_namespace = oSrc.m_namespace;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual CString toXML() const;
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
CString strName = (_T("") == m_namespace) ? _T("blip") : (m_namespace + _T(":blip"));
|
||||
pWriter->StartNode(strName);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
if (embed.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:embed"), embed->ToString());
|
||||
if (link.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:link"), link->ToString());
|
||||
pWriter->WriteAttribute(_T("cstate"), cstate);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
|
||||
size_t nCount = Effects.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
Effects[i].toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
pWriter->EndNode(strName);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, cstate);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
|
||||
|
||||
|
||||
if (embed.is_init())
|
||||
pWriter->WriteString1(10, embed->get());
|
||||
if (link.is_init())
|
||||
pWriter->WriteString1(11, link->get());
|
||||
|
||||
pWriter->StartRecord(2);
|
||||
ULONG len = (ULONG)Effects.GetCount();
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(3, Effects[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
|
||||
double dX = 0;
|
||||
double dY = 0;
|
||||
double dW = pWriter->GetWidthMM();
|
||||
double dH = pWriter->GetHeightMM();
|
||||
|
||||
FileContainer* pRels = NULL;
|
||||
if (pWriter->m_pCommonRels.is_init())
|
||||
pRels = pWriter->m_pCommonRels.operator ->();
|
||||
|
||||
NSShapeImageGen::CImageInfo oId = pWriter->m_oCommon.m_oImageManager.WriteImage(this->GetFullPicName(pRels), dX, dY, dW, dH);
|
||||
CString s = oId.GetPath2();
|
||||
|
||||
pWriter->StartRecord(3);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, s);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
public:
|
||||
virtual CString GetFullPicName(FileContainer* pRels = NULL)const;
|
||||
public:
|
||||
CAtlArray<UniEffect> Effects;
|
||||
|
||||
nullable_limit<Limit::BlipCompression> cstate;
|
||||
nullable<OOX::RId> embed;
|
||||
nullable<OOX::RId> link;
|
||||
|
||||
public:
|
||||
CString m_namespace;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BLIP_INCLUDE_H_
|
||||
433
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h
Normal file
433
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h
Normal file
@@ -0,0 +1,433 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_BLIPFILL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_BLIPFILL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../Rect.h"
|
||||
#include "Blip.h"
|
||||
#include "Tile.h"
|
||||
#include "Stretch.h"
|
||||
#include "../Effects/AlphaModFix.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class BlipFill : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(BlipFill)
|
||||
|
||||
BlipFill& operator=(const BlipFill& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
blip = oSrc.blip;
|
||||
srcRect = oSrc.srcRect;
|
||||
tile = oSrc.tile;
|
||||
stretch = oSrc.stretch;
|
||||
|
||||
dpi = oSrc.dpi;
|
||||
rotWithShape = oSrc.rotWithShape;
|
||||
|
||||
m_namespace = oSrc.m_namespace;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
|
||||
node.ReadAttributeBase(L"dpi", dpi);
|
||||
node.ReadAttributeBase(L"rotWithShape", rotWithShape);
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
CString strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
if (_T("blip") == strName)
|
||||
{
|
||||
if (!blip.IsInit())
|
||||
blip = oNode;
|
||||
}
|
||||
else if (_T("srcRect") == strName)
|
||||
{
|
||||
if (!srcRect.IsInit())
|
||||
srcRect = oNode;
|
||||
}
|
||||
else if (_T("tile") == strName)
|
||||
{
|
||||
if (!tile.IsInit())
|
||||
tile = oNode;
|
||||
}
|
||||
else if (_T("stretch") == strName)
|
||||
{
|
||||
if (!stretch.IsInit())
|
||||
stretch = oNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("dpi"), dpi);
|
||||
oAttr.Write(_T("rotWithShape"), rotWithShape);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(blip);
|
||||
oValue.WriteNullable(srcRect);
|
||||
oValue.WriteNullable(tile);
|
||||
oValue.WriteNullable(stretch);
|
||||
|
||||
CString strName = (_T("") == m_namespace) ? _T("blipFill") : (m_namespace + _T(":blipFill"));
|
||||
return XmlUtils::CreateNode(strName, oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
CString strName = (_T("") == m_namespace) ? _T("blipFill") : (m_namespace + _T(":blipFill"));
|
||||
pWriter->StartNode(strName);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("dpi"), dpi);
|
||||
pWriter->WriteAttribute(_T("rotWithShape"), rotWithShape);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->Write(blip);
|
||||
|
||||
if (srcRect.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("a:srcRect"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("l"), srcRect->l);
|
||||
pWriter->WriteAttribute(_T("t"), srcRect->t);
|
||||
pWriter->WriteAttribute(_T("r"), srcRect->r);
|
||||
pWriter->WriteAttribute(_T("b"), srcRect->b);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->EndNode(_T("a:srcRect"));
|
||||
}
|
||||
|
||||
pWriter->Write(tile);
|
||||
pWriter->Write(stretch);
|
||||
|
||||
pWriter->EndNode(strName);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(FILL_TYPE_BLIP);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, dpi);
|
||||
pWriter->WriteBool2(1, rotWithShape);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord2(0, blip);
|
||||
pWriter->WriteRecord2(1, srcRect);
|
||||
pWriter->WriteRecord2(2, tile);
|
||||
pWriter->WriteRecord2(3, stretch);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
pReader->Skip(4);
|
||||
BYTE _type = pReader->GetUChar();
|
||||
LONG _e = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
dpi = pReader->GetLong();
|
||||
break;
|
||||
case 1:
|
||||
rotWithShape = pReader->GetBool();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while (pReader->GetPos() < _e)
|
||||
{
|
||||
BYTE rec = pReader->GetUChar();
|
||||
|
||||
switch (rec)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
LONG _s2 = pReader->GetPos();
|
||||
LONG _e2 = _s2 + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (NSBinPptxRW::g_nodeAttributeEnd == _at)
|
||||
break;
|
||||
|
||||
if (_at == 0)
|
||||
pReader->Skip(1);
|
||||
}
|
||||
|
||||
while (pReader->GetPos() < _e2)
|
||||
{
|
||||
BYTE _t = pReader->GetUChar();
|
||||
|
||||
switch (_t)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
{
|
||||
|
||||
pReader->Skip(4);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
case 11:
|
||||
{
|
||||
|
||||
pReader->GetString2();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
pReader->Skip(4);
|
||||
ULONG count_effects = pReader->GetULong();
|
||||
for (ULONG _eff = 0; _eff < count_effects; ++_eff)
|
||||
{
|
||||
pReader->Skip(1);
|
||||
ULONG rec_len = pReader->GetULong();
|
||||
if (0 == rec_len)
|
||||
continue;
|
||||
|
||||
BYTE rec = pReader->GetUChar();
|
||||
|
||||
if (rec == EFFECT_TYPE_ALPHAMODFIX)
|
||||
{
|
||||
|
||||
LONG _e22 = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
PPTX::Logic::AlphaModFix* pEffect = new PPTX::Logic::AlphaModFix();
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (NSBinPptxRW::g_nodeAttributeEnd == _at)
|
||||
break;
|
||||
|
||||
if (_at == 0)
|
||||
pEffect->amt = pReader->GetLong();
|
||||
}
|
||||
|
||||
if (!blip.is_init())
|
||||
blip = new PPTX::Logic::Blip();
|
||||
|
||||
blip->Effects.Add();
|
||||
blip->Effects[0].InitPointer(pEffect);
|
||||
|
||||
pReader->Seek(_e22);
|
||||
}
|
||||
else
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
pReader->Skip(6);
|
||||
|
||||
|
||||
CString strUrl = pReader->GetString2();
|
||||
CString strTempFile = _T("");
|
||||
CString strOrigBase64 = _T("");
|
||||
|
||||
if (0 == strUrl.Find(_T("data:")))
|
||||
{
|
||||
strOrigBase64 = strUrl;
|
||||
int nFind = strUrl.Find(_T(","));
|
||||
strUrl.Delete(0, nFind + 1);
|
||||
|
||||
CStringA __s = (CStringA)strUrl;
|
||||
int len = __s.GetLength();
|
||||
int dstLenTemp = Base64DecodeGetRequiredLength(len);
|
||||
|
||||
BYTE* pDstBuffer = new BYTE[dstLenTemp];
|
||||
int dstLen = dstLenTemp;
|
||||
Base64Decode(__s.GetBuffer(), len, pDstBuffer, &dstLen);
|
||||
|
||||
strTempFile = pReader->m_strFolder + _T("\\media\\temp.jpg");
|
||||
CFile oTempFile;
|
||||
oTempFile.CreateFile(strTempFile);
|
||||
oTempFile.WriteFile((void*)pDstBuffer, (DWORD)dstLen);
|
||||
oTempFile.CloseFile();
|
||||
|
||||
strUrl = strTempFile;
|
||||
RELEASEARRAYOBJECTS(pDstBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 != strUrl.Find(_T("http:")) &&
|
||||
0 != strUrl.Find(_T("https:")) &&
|
||||
0 != strUrl.Find(_T("ftp:")) &&
|
||||
0 != strUrl.Find(_T("file:")))
|
||||
{
|
||||
if (0 == strUrl.Find(_T("theme")))
|
||||
{
|
||||
strUrl = pReader->m_strFolderThemes + _T("\\") + strUrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
strUrl = pReader->m_strFolder + _T("\\media\\") + strUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LONG lId = pReader->m_oRels.WriteImage(strUrl, strOrigBase64);
|
||||
|
||||
|
||||
if (strTempFile != _T(""))
|
||||
{
|
||||
::DeleteFile(strTempFile);
|
||||
}
|
||||
|
||||
|
||||
if (!blip.is_init())
|
||||
blip = new PPTX::Logic::Blip();
|
||||
|
||||
blip->embed = new OOX::RId((size_t)lId);
|
||||
|
||||
pReader->Skip(1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_e2);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
srcRect = new PPTX::Logic::Rect();
|
||||
srcRect->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
tile = new PPTX::Logic::Tile();
|
||||
pReader->SkipRecord();
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
stretch = new PPTX::Logic::Stretch();
|
||||
pReader->SkipRecord();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
|
||||
pReader->SkipRecord();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_e);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<Blip> blip;
|
||||
nullable<Rect> srcRect;
|
||||
nullable<Tile> tile;
|
||||
nullable<Stretch> stretch;
|
||||
|
||||
nullable_int dpi;
|
||||
nullable_bool rotWithShape;
|
||||
|
||||
mutable CString m_namespace;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(blip.IsInit())
|
||||
blip->SetParentPointer(this);
|
||||
if(srcRect.IsInit())
|
||||
srcRect->SetParentPointer(this);
|
||||
if(tile.IsInit())
|
||||
tile->SetParentPointer(this);
|
||||
if(stretch.IsInit())
|
||||
stretch->SetParentPointer(this);
|
||||
}
|
||||
|
||||
AVSINLINE void Normalize()
|
||||
{
|
||||
dpi.normalize_positive();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_BLIPFILL_INCLUDE_H_
|
||||
236
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/GradFill.h
Normal file
236
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/GradFill.h
Normal file
@@ -0,0 +1,236 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_GRADFILL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_GRADFILL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../../Limit/Flip.h"
|
||||
#include "./../Rect.h"
|
||||
#include "./../Gs.h"
|
||||
#include "./../Lin.h"
|
||||
#include "./../Path.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class GradFill : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(GradFill)
|
||||
|
||||
GradFill& operator=(const GradFill& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
flip = oSrc.flip;
|
||||
rotWithShape = oSrc.rotWithShape;
|
||||
|
||||
GsLst.Copy(oSrc.GsLst);
|
||||
lin = oSrc.lin;
|
||||
path = oSrc.path;
|
||||
tileRect = oSrc.tileRect;
|
||||
|
||||
m_namespace = oSrc.m_namespace;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
|
||||
node.ReadAttributeBase(L"flip", flip);
|
||||
node.ReadAttributeBase(L"rotWithShape", rotWithShape);
|
||||
|
||||
node.LoadArray(_T("a:gsLst"), _T("a:gs"), GsLst);
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
CString strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if (_T("path") == strName)
|
||||
{
|
||||
if (!path.IsInit())
|
||||
path = oNode;
|
||||
}
|
||||
else if (_T("lin") == strName)
|
||||
{
|
||||
if (!lin.IsInit())
|
||||
lin = oNode;
|
||||
}
|
||||
else if (_T("tileRect") == strName)
|
||||
{
|
||||
if (!tileRect.IsInit())
|
||||
tileRect = oNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.WriteLimitNullable(_T("flip"), flip);
|
||||
oAttr.Write(_T("rotWithShape"), rotWithShape);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(_T("a:gsLst"), GsLst);
|
||||
oValue.WriteNullable(path);
|
||||
oValue.WriteNullable(lin);
|
||||
oValue.WriteNullable(tileRect);
|
||||
|
||||
CString strName = (_T("") == m_namespace) ? _T("gradFill") : (m_namespace + _T(":gradFill"));
|
||||
return XmlUtils::CreateNode(strName, oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
CString strName = (_T("") == m_namespace) ? _T("gradFill") : (m_namespace + _T(":gradFill"));
|
||||
pWriter->StartNode(strName);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("flip"), flip);
|
||||
pWriter->WriteAttribute(_T("rotWithShape"), rotWithShape);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->WriteArray(_T("a:gsLst"), GsLst);
|
||||
pWriter->Write(path);
|
||||
pWriter->Write(lin);
|
||||
pWriter->Write(tileRect);
|
||||
|
||||
pWriter->EndNode(strName);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(FILL_TYPE_GRAD);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, flip);
|
||||
pWriter->WriteBool2(1, rotWithShape);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->StartRecord(0);
|
||||
|
||||
ULONG len = (ULONG)GsLst.GetCount();
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(0, GsLst[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
|
||||
pWriter->WriteRecord2(1, lin);
|
||||
pWriter->WriteRecord2(2, path);
|
||||
pWriter->WriteRecord2(3, tileRect);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
void Merge(GradFill& fill)const
|
||||
{
|
||||
if(flip.IsInit())
|
||||
fill.flip = *flip;
|
||||
if(rotWithShape.IsInit())
|
||||
fill.rotWithShape = *rotWithShape;
|
||||
if(tileRect.IsInit())
|
||||
fill.tileRect = tileRect;
|
||||
if(0 != GsLst.GetCount())
|
||||
{
|
||||
fill.GsLst.RemoveAll();
|
||||
fill.GsLst.Copy(GsLst);
|
||||
}
|
||||
|
||||
if(lin.IsInit())
|
||||
{
|
||||
fill.lin = lin;
|
||||
fill.path.reset();
|
||||
}
|
||||
if(path.IsInit())
|
||||
{
|
||||
fill.path = path;
|
||||
fill.lin.reset();
|
||||
}
|
||||
}
|
||||
|
||||
UniColor GetFrontColor()const
|
||||
{
|
||||
if (0 == GsLst.GetCount())
|
||||
return UniColor();
|
||||
return GsLst[0].color;
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_limit<Limit::Flip> flip;
|
||||
nullable_bool rotWithShape;
|
||||
|
||||
CAtlArray<Gs> GsLst;
|
||||
nullable<Lin> lin;
|
||||
nullable<Path> path;
|
||||
nullable<Rect> tileRect;
|
||||
|
||||
CString m_namespace;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
size_t count = GsLst.GetCount();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
GsLst[i].SetParentPointer(this);
|
||||
|
||||
if(lin.IsInit())
|
||||
lin->SetParentPointer(this);
|
||||
if(path.IsInit())
|
||||
path->SetParentPointer(this);
|
||||
if(tileRect.IsInit())
|
||||
tileRect->SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_GRADFILL_INCLUDE_H_
|
||||
86
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/NoFill.h
Normal file
86
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/NoFill.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_NOFILL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_NOFILL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class NoFill : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(NoFill)
|
||||
|
||||
NoFill& operator=(const NoFill& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
m_namespace = oSrc.m_namespace;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
if (_T("") == m_namespace)
|
||||
return _T("<noFill/>");
|
||||
return _T("<") + m_namespace + _T(":noFill/>");
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteString(_T("<a:noFill/>"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(FILL_TYPE_NOFILL);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
public:
|
||||
CString m_namespace;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_NOFILL_INCLUDE_H_
|
||||
145
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/PattFill.h
Normal file
145
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/PattFill.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_PATTFILL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_PATTFILL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../../Limit/PattFillVal.h"
|
||||
#include "./../UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class PattFill : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(PattFill)
|
||||
|
||||
PattFill& operator=(const PattFill& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
prst = oSrc.prst;
|
||||
|
||||
fgClr = oSrc.fgClr;
|
||||
bgClr = oSrc.bgClr;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
|
||||
node.ReadAttributeBase(L"prst", prst);
|
||||
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (node.GetNode(_T("a:fgClr"), oNode))
|
||||
fgClr.GetColorFrom(oNode);
|
||||
if (node.GetNode(_T("a:bgClr"), oNode))
|
||||
bgClr.GetColorFrom(oNode);
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.WriteLimitNullable(_T("prst"), prst);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(_T("a:fgClr"), fgClr);
|
||||
oValue.Write(_T("a:bgClr"), bgClr);
|
||||
|
||||
CString strName = (_T("") == m_namespace) ? _T("pattFill") : (m_namespace + _T(":pattFill"));
|
||||
return XmlUtils::CreateNode(strName, oAttr, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
CString strName = (_T("") == m_namespace) ? _T("pattFill") : (m_namespace + _T(":pattFill"));
|
||||
pWriter->StartNode(strName);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("prst"), prst);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(_T("a:fgClr"));
|
||||
pWriter->EndAttributes();
|
||||
fgClr.toXmlWriter(pWriter);
|
||||
pWriter->EndNode(_T("a:fgClr"));
|
||||
|
||||
pWriter->StartNode(_T("a:bgClr"));
|
||||
pWriter->EndAttributes();
|
||||
bgClr.toXmlWriter(pWriter);
|
||||
pWriter->EndNode(_T("a:bgClr"));
|
||||
|
||||
pWriter->EndNode(strName);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(FILL_TYPE_PATT);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, prst);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, fgClr);
|
||||
pWriter->WriteRecord1(1, bgClr);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_limit<Limit::PattFillVal> prst;
|
||||
|
||||
UniColor fgClr;
|
||||
UniColor bgClr;
|
||||
|
||||
CString m_namespace;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
fgClr.SetParentPointer(this);
|
||||
bgClr.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_PATTFILL_INCLUDE_H_
|
||||
115
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/SolidFill.h
Normal file
115
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/SolidFill.h
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_SOLIDFILL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_SOLIDFILL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class SolidFill : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(SolidFill)
|
||||
|
||||
SolidFill& operator=(const SolidFill& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
Color = oSrc.Color;
|
||||
m_namespace = oSrc.m_namespace;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_namespace = XmlUtils::GetNamespace(node.GetName());
|
||||
Color.GetColorFrom(node);
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
CString strName = (_T("") == m_namespace) ? _T("solidFill") : (m_namespace + _T(":solidFill"));
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(Color);
|
||||
|
||||
return XmlUtils::CreateNode(strName, oValue);
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
CString strName = (_T("") == m_namespace) ? _T("solidFill") : (m_namespace + _T(":solidFill"));
|
||||
pWriter->StartNode(strName);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
if (Color.is_init())
|
||||
Color.toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(strName);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(FILL_TYPE_SOLID);
|
||||
|
||||
pWriter->WriteRecord1(0, Color);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
void Merge(SolidFill& fill)const
|
||||
{
|
||||
if(Color.is_init())
|
||||
fill.Color = Color;
|
||||
}
|
||||
public:
|
||||
UniColor Color;
|
||||
|
||||
CString m_namespace;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Color.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_SOLIDFILL_INCLUDE_H_
|
||||
111
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Stretch.h
Normal file
111
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Stretch.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_STRETCH_INCLUDE_H_
|
||||
#define PPTX_LOGIC_STRETCH_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../Rect.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Stretch : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Stretch)
|
||||
|
||||
Stretch& operator=(const Stretch& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
fillRect = oSrc.fillRect;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int count = oNodes.GetCount();
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
if (_T("fillRect") == XmlUtils::GetNameNoNS(oNode.GetName()))
|
||||
fillRect = oNode;
|
||||
}
|
||||
}
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteNullable(fillRect);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:stretch"), oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:stretch"));
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->Write(fillRect);
|
||||
|
||||
pWriter->EndNode(_T("a:stretch"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteRecord2(0, fillRect);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<Rect> fillRect;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
if(fillRect.IsInit())
|
||||
fillRect->SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_STRETCH_INCLUDE_H_
|
||||
129
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Tile.h
Normal file
129
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/Tile.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_TILE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_TILE_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "./../../Limit/RectAlign.h"
|
||||
#include "./../../Limit/Flip.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class Tile : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(Tile)
|
||||
|
||||
Tile& operator=(const Tile& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
algn = oSrc.algn;
|
||||
flip = oSrc.flip;
|
||||
sx = oSrc.sx;
|
||||
sy = oSrc.sy;
|
||||
tx = oSrc.tx;
|
||||
ty = oSrc.ty;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"algn", algn);
|
||||
node.ReadAttributeBase(L"flip", flip);
|
||||
node.ReadAttributeBase(L"sx", sx);
|
||||
node.ReadAttributeBase(L"sy", sy);
|
||||
node.ReadAttributeBase(L"tx", tx);
|
||||
node.ReadAttributeBase(L"ty", ty);
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.WriteLimitNullable(_T("algn"), algn);
|
||||
oAttr.WriteLimitNullable(_T("flip"), flip);
|
||||
oAttr.Write(_T("sx"), sx);
|
||||
oAttr.Write(_T("sy"), sy);
|
||||
oAttr.Write(_T("tx"), tx);
|
||||
oAttr.Write(_T("ty"), ty);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:tile"), oAttr);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("a:tile"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("algn"), algn);
|
||||
pWriter->WriteAttribute(_T("flip"), flip);
|
||||
pWriter->WriteAttribute(_T("sx"), sx);
|
||||
pWriter->WriteAttribute(_T("sy"), sy);
|
||||
pWriter->WriteAttribute(_T("tx"), tx);
|
||||
pWriter->WriteAttribute(_T("ty"), ty);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->EndNode(_T("a:tile"));
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteInt2(0, sx);
|
||||
pWriter->WriteInt2(1, sy);
|
||||
pWriter->WriteInt2(2, tx);
|
||||
pWriter->WriteInt2(3, ty);
|
||||
pWriter->WriteLimit2(4, algn);
|
||||
pWriter->WriteLimit2(5, flip);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_limit<Limit::RectAlign> algn;
|
||||
nullable_limit<Limit::Flip> flip;
|
||||
nullable_int sx;
|
||||
nullable_int sy;
|
||||
nullable_int tx;
|
||||
nullable_int ty;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_TILE_INCLUDE_H_
|
||||
200
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/FontCollection.h
Normal file
200
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/FontCollection.h
Normal file
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_FONTCOLLECTION_INCLUDE_H_
|
||||
#define PPTX_LOGIC_FONTCOLLECTION_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "TextFont.h"
|
||||
#include "SupplementalFont.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
|
||||
class FontCollection : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(FontCollection)
|
||||
|
||||
FontCollection& operator=(const FontCollection& oSrc)
|
||||
{
|
||||
parentFile = oSrc.parentFile;
|
||||
parentElement = oSrc.parentElement;
|
||||
|
||||
latin = oSrc.latin;
|
||||
ea = oSrc.ea;
|
||||
cs = oSrc.cs;
|
||||
Fonts.Copy(oSrc.Fonts);
|
||||
|
||||
m_name = oSrc.m_name;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = node.GetName();
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
CString strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if (_T("latin") == strName)
|
||||
latin = oNode;
|
||||
else if (_T("ea") == strName)
|
||||
ea = oNode;
|
||||
else if (_T("cs") == strName)
|
||||
cs = oNode;
|
||||
else if (_T("font") == strName)
|
||||
Fonts.Add(SupplementalFont(oNode));
|
||||
}
|
||||
}
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(latin);
|
||||
oValue.Write(ea);
|
||||
oValue.Write(cs);
|
||||
oValue.WriteArray(Fonts);
|
||||
|
||||
return XmlUtils::CreateNode(m_name, oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(m_name);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
latin.toXmlWriter(pWriter);
|
||||
ea.toXmlWriter(pWriter);
|
||||
cs.toXmlWriter(pWriter);
|
||||
|
||||
size_t nCount = Fonts.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
Fonts[i].toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(m_name);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteRecord1(0, latin);
|
||||
pWriter->WriteRecord1(1, ea);
|
||||
pWriter->WriteRecord1(2, cs);
|
||||
pWriter->WriteRecordArray(3, 0, Fonts);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
latin.fromPPTY(pReader);
|
||||
latin.m_name = _T("a:latin");
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
ea.fromPPTY(pReader);
|
||||
ea.m_name = _T("a:ea");
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
cs.fromPPTY(pReader);
|
||||
cs.m_name = _T("a:cs");
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
pReader->Skip(4);
|
||||
ULONG _c = pReader->GetULong();
|
||||
for (ULONG i = 0; i < _c; ++i)
|
||||
{
|
||||
pReader->Skip(1);
|
||||
Fonts.Add();
|
||||
Fonts[i].m_name = _T("a:font");
|
||||
Fonts[i].fromPPTY(pReader);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
TextFont latin;
|
||||
TextFont ea;
|
||||
TextFont cs;
|
||||
CAtlArray<SupplementalFont> Fonts;
|
||||
|
||||
public:
|
||||
CString m_name;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
latin.SetParentPointer(this);
|
||||
ea.SetParentPointer(this);
|
||||
cs.SetParentPointer(this);
|
||||
|
||||
size_t count = Fonts.GetCount();
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
Fonts[i].SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_FONTCOLLECTION_INCLUDE_H_
|
||||
144
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/FontRef.h
Normal file
144
ActiveX/ASCOfficePPTXFile/PPTXFormat/Logic/FontRef.h
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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
|
||||
#ifndef PPTX_LOGIC_SLIDE_FONTREF_INCLUDE_H_
|
||||
#define PPTX_LOGIC_SLIDE_FONTREF_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "./../Limit/FontStyleIndex.h"
|
||||
#include "UniColor.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
class FontRef : public WrapperWritingElement
|
||||
{
|
||||
public:
|
||||
PPTX_LOGIC_BASE(FontRef)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_name = node.GetName();
|
||||
|
||||
node.ReadAttributeBase(L"idx", idx);
|
||||
Color.GetColorFrom(node);
|
||||
|
||||
FillParentPointersForChilds();
|
||||
}
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.WriteLimitNullable(_T("idx"), idx);
|
||||
|
||||
return XmlUtils::CreateNode(m_name, oAttr, Color.toXML());
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(m_name);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("idx"), idx);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
Color.toXmlWriter(pWriter);
|
||||
|
||||
pWriter->EndNode(m_name);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, idx);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->WriteRecord1(0, Color);
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetULong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
if (0 == _at)
|
||||
{
|
||||
idx = new Limit::FontStyleIndex();
|
||||
idx->SetBYTECode(pReader->GetUChar());
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
switch (_at)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Color.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
public:
|
||||
UniColor Color;
|
||||
|
||||
nullable_limit<Limit::FontStyleIndex> idx;
|
||||
|
||||
public:
|
||||
CString m_name;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
Color.SetParentPointer(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // PPTX_LOGIC_SLIDE_FONTREF_INCLUDE_H_
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user