init repo

This commit is contained in:
nikolay ivanov
2014-07-05 18:22:49 +00:00
commit a8be6b9e72
17348 changed files with 9229832 additions and 0 deletions

View 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

View 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

View 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

View 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

View 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

View 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_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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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_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