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,173 @@
/*
* (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 OOX_CELLANCHOR_FILE_INCLUDE_H_
#define OOX_CELLANCHOR_FILE_INCLUDE_H_
#include "../CommonInclude.h"
#include "FromTo.h"
#include "Pic.h"
#include "GraphicFrame.h"
#include "Pos.h"
namespace OOX
{
namespace Spreadsheet
{
class CCellAnchor : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CCellAnchor)
CCellAnchor(SimpleTypes::Spreadsheet::CCellAnchorType<>& oAnchorType = SimpleTypes::Spreadsheet::CCellAnchorType<>()):m_oAnchorType(oAnchorType)
{
}
virtual ~CCellAnchor()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(isValid())
{
CString sStart;
CString sEnd;
if(m_oFrom.IsInit() && m_oTo.IsInit())
{
sStart.Format(_T("<xdr:twoCellAnchor editAs=\"%s\">"), m_oAnchorType.ToString());
sEnd = _T("</xdr:twoCellAnchor>");
writer.WriteStringC(sStart);
if(m_oFrom.IsInit())
m_oFrom->toXML2(writer, _T("xdr:from"));
if(m_oTo.IsInit())
m_oTo->toXML2(writer, _T("xdr:to"));
}
else if(m_oFrom.IsInit() && m_oExt.IsInit())
{
sStart.Append(_T("<xdr:oneCellAnchor>"));
sEnd = _T("</xdr:oneCellAnchor>");
writer.WriteStringC(sStart);
if(m_oFrom.IsInit())
m_oFrom->toXML2(writer, _T("xdr:from"));
if(m_oExt.IsInit())
m_oExt->toXML(writer);
}
else if(m_oPos.IsInit() && m_oExt.IsInit())
{
sStart.Append(_T("<xdr:absoluteAnchor>"));
sEnd = _T("</xdr:absoluteAnchor>");
writer.WriteStringC(sStart);
if(m_oPos.IsInit())
m_oPos->toXML(writer);
if(m_oExt.IsInit())
m_oExt->toXML(writer);
}
else
return;
if(m_oXml.IsInit())
writer.WriteStringC(m_oXml.get());
if(m_oGraphicFrame.IsInit())
m_oGraphicFrame->toXML(writer);
writer.WriteStringC(sEnd);
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("xdr:from") == sName )
m_oFrom = oReader;
else if ( _T("xdr:to") == sName )
m_oTo = oReader;
else if ( _T("xdr:pos") == sName )
m_oPos = oReader;
else if ( _T("xdr:ext") == sName )
m_oExt = oReader;
else if ( _T("xdr:graphicFrame") == sName )
m_oGraphicFrame = oReader;
else if ( _T("xdr:pic") == sName || _T("xdr:sp") == sName || _T("xdr:grpSp") == sName || _T("xdr:cxnSp") == sName || _T("mc:AlternateContent") == sName)
m_oXml = oReader.GetOuterXml();
}
}
virtual EElementType getType () const
{
return et_CellAnchor;
}
virtual void setAnchorType (SimpleTypes::Spreadsheet::ECellAnchorType eType)
{
m_oAnchorType.SetValue(eType);
}
virtual SimpleTypes::Spreadsheet::ECellAnchorType getAnchorType () const
{
return m_oAnchorType.GetValue();
}
bool isValid() const
{
SimpleTypes::Spreadsheet::ECellAnchorType eAnchorType = m_oAnchorType.GetValue();
if(!((m_oFrom.IsInit() && m_oTo.IsInit()) || (m_oFrom.IsInit() && m_oExt.IsInit()) || (m_oPos.IsInit() && m_oExt.IsInit())))
return false;
if(false == m_oXml.IsInit() && false == m_oGraphicFrame.IsInit())
return false;
return true;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
SimpleTypes::Spreadsheet::CCellAnchorType<> m_oAnchorType;
nullable<OOX::Spreadsheet::CFromTo> m_oFrom;
nullable<OOX::Spreadsheet::CFromTo> m_oTo;
nullable<OOX::Spreadsheet::CPos> m_oPos;
nullable<OOX::Spreadsheet::CExt> m_oExt;
nullable<OOX::Spreadsheet::CGraphicFrame> m_oGraphicFrame;
nullable<CString> m_oXml;
};
}
}
#endif // OOX_CELLANCHOR_FILE_INCLUDE_H_

View File

@@ -0,0 +1,218 @@
/*
* (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 OOX_DRAWING_FILE_INCLUDE_H_
#define OOX_DRAWING_FILE_INCLUDE_H_
#include "../CommonInclude.h"
#include "Image.h"
#include "CellAnchor.h"
namespace OOX
{
namespace Spreadsheet
{
class CDrawingWorksheet : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CDrawingWorksheet)
CDrawingWorksheet()
{
}
virtual ~CDrawingWorksheet()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(m_oId.IsInit())
{
CString sVal;sVal.Format(_T("<drawing r:id=\"%s\"/>"), m_oId->GetValue());
writer.WriteStringC(sVal);
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_FromTo;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r:id"), m_oId )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CRelationshipId > m_oId;
};
class CDrawing : public OOX::FileGlobalEnumerated, public OOX::Spreadsheet::IFileContainer
{
public:
CDrawing()
{
}
CDrawing(const CPath& oPath)
{
read( oPath );
}
virtual ~CDrawing()
{
}
public:
virtual void read(const CPath& oPath)
{
m_oReadPath = oPath;
IFileContainer::Read( oPath );
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
CWCharWrapper sName = oReader.GetName();
if ( _T("xdr:wsDr") == sName )
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
{
int nStylesDepth = oReader.GetDepth();
while ( oReader.ReadNextSiblingNode( nStylesDepth ) )
{
sName = oReader.GetName();
CCellAnchor *pItem = NULL;
if ( _T("xdr:absoluteAnchor") == sName )
{
pItem = new CCellAnchor( oReader );
pItem->m_oAnchorType.SetValue(SimpleTypes::Spreadsheet::cellanchorAbsolute);
}
else if ( _T("xdr:oneCellAnchor") == sName )
{
pItem = new CCellAnchor( oReader );
pItem->m_oAnchorType.SetValue(SimpleTypes::Spreadsheet::cellanchorOneCell);
}
else if ( _T("xdr:twoCellAnchor") == sName )
{
pItem = new CCellAnchor( oReader );
pItem->m_oAnchorType.SetValue(SimpleTypes::Spreadsheet::cellanchorTwoCell);
}
if ( pItem )
m_arrItems.Add( pItem );
}
}
}
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
CStringWriter sXml;
sXml.WriteStringC(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><xdr:wsDr xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
m_arrItems[i]->toXML(sXml);
sXml.WriteStringC(_T("</xdr:wsDr>"));
CDirectory::SaveToFile( oPath.GetPath(), sXml.GetCString() );
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
IFileContainer::Write(oPath, oDirectory, oContent);
}
virtual const OOX::FileType type() const
{
return OOX::Spreadsheet::FileTypes::Drawings;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return type().DefaultFileName();
}
const CPath& GetReadPath()
{
return m_oReadPath;
}
const OOX::RId AddImage (CString& sSrc)
{
smart_ptr<OOX::File> oImage = smart_ptr<OOX::File>( new OOX::Spreadsheet::Image( sSrc ) );
const OOX::RId rId = Add( oImage );
return rId;
}
private:
CPath m_oReadPath;
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
void ClearItems()
{
for ( int nIndex = 0; nIndex < m_arrItems.GetSize(); nIndex++ )
{
if ( m_arrItems[nIndex] )
delete m_arrItems[nIndex];
m_arrItems[nIndex] = NULL;
}
m_arrItems.RemoveAll();
}
public:
CSimpleArray<CCellAnchor *> m_arrItems;
};
}
}
#endif // OOX_DRAWING_FILE_INCLUDE_H_

View File

@@ -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 OOX_FROMTO_FILE_INCLUDE_H_
#define OOX_FROMTO_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CFromTo : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CFromTo)
CFromTo()
{
}
virtual ~CFromTo()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
}
virtual void toXML2(CStringWriter& writer, CString sName) const
{
CString sStart;sStart.Format(_T("<%s>"), sName);
writer.WriteStringC(sStart);
if(m_oCol.IsInit())
{
CString sVal;sVal.Format(_T("<xdr:col>%d</xdr:col>"), m_oCol->GetValue());
writer.WriteStringC(sVal);
}
if(m_oColOff.IsInit())
{
CString sVal;sVal.Format(_T("<xdr:colOff>%I64d</xdr:colOff>"), m_oColOff->ToEmu());
writer.WriteStringC(sVal);
}
if(m_oRow.IsInit())
{
CString sVal;sVal.Format(_T("<xdr:row>%d</xdr:row>"), m_oRow->GetValue());
writer.WriteStringC(sVal);
}
if(m_oRowOff.IsInit())
{
CString sVal;sVal.Format(_T("<xdr:rowOff>%I64d</xdr:rowOff>"), m_oRowOff->ToEmu());
writer.WriteStringC(sVal);
}
CString sEnd;sEnd.Format(_T("</%s>"), sName);
writer.WriteStringC(sEnd);
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("xdr:col") == sName )
m_oCol = oReader.GetText2();
else if ( _T("xdr:colOff") == sName )
m_oColOff = oReader.GetText2();
else if ( _T("xdr:row") == sName )
m_oRow = oReader.GetText2();
else if ( _T("xdr:rowOff") == sName )
m_oRowOff = oReader.GetText2();
}
}
virtual EElementType getType () const
{
return et_FromTo;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oCol;
nullable<SimpleTypes::CEmu> m_oColOff;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oRow;
nullable<SimpleTypes::CEmu> m_oRowOff;
};
class CExt : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CExt)
CExt()
{
}
virtual ~CExt()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<xdr:ext"));
if(m_oCx.IsInit())
{
CString sVal;sVal.Format(_T(" cx=\"%I64d\""), m_oCx->ToEmu());
writer.WriteStringC(sVal);
}
if(m_oCy.IsInit())
{
CString sVal;sVal.Format(_T(" cy=\"%I64d\""), m_oCy->ToEmu());
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T("/>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_Ext;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("cx"), m_oCx )
WritingElement_ReadAttributes_Read_if ( oReader, _T("cy"), m_oCy )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CEmu> m_oCx;
nullable<SimpleTypes::CEmu> m_oCy;
};
}
}
#endif // OOX_FROMTO_FILE_INCLUDE_H_

View File

@@ -0,0 +1,246 @@
/*
* (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 OOX_GRAPHICFRAME_FILE_INCLUDE_H_
#define OOX_GRAPHICFRAME_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CGraphicChart : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CGraphicChart)
CGraphicChart()
{
}
virtual ~CGraphicChart()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_Blip;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r:id"), m_oRId )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CRelationshipId> m_oRId;
};
class CGraphicData : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CGraphicData)
CGraphicData()
{
}
virtual ~CGraphicData()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("c:chart") == sName )
m_oChart = oReader;
}
}
virtual EElementType getType () const
{
return et_xdr_GraphicData;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
nullable<CGraphicChart> m_oChart;
};
class CChartGraphic : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CChartGraphic)
CChartGraphic()
{
}
virtual ~CChartGraphic()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("a:graphicData") == sName )
m_oGraphicData = oReader;
}
}
virtual EElementType getType () const
{
return et_xdr_GraphicFrame;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
nullable<CGraphicData> m_oGraphicData;
};
class CGraphicFrame : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CGraphicFrame)
CGraphicFrame()
{
}
virtual ~CGraphicFrame()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
CString sRes;
if(m_oChartGraphic.IsInit() && m_oChartGraphic->m_oGraphicData.IsInit() && m_oChartGraphic->m_oGraphicData->m_oChart.IsInit() && m_oChartGraphic->m_oGraphicData->m_oChart->m_oRId.IsInit())
sRes.Format(_T("<xdr:graphicFrame macro=\"\"><xdr:nvGraphicFramePr><xdr:cNvPr id=\"1\" name=\"diagram\"/><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/></xdr:xfrm><a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\"><c:chart xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"%s\"/></a:graphicData></a:graphic></xdr:graphicFrame><xdr:clientData/>"), m_oChartGraphic->m_oGraphicData->m_oChart->m_oRId->ToString());
writer.WriteStringC(sRes);
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
m_sXml.Init();
m_sXml->Append(oReader.GetOuterXml());
CString sXml;
sXml.Format(_T("<root xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">%s</root>"), m_sXml.get());
XmlUtils::CXmlLiteReader oSubReader;
oSubReader.FromString(sXml);
oSubReader.ReadNextNode();
oSubReader.ReadNextNode();
int nCurDepth = oSubReader.GetDepth();
while( oSubReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oSubReader.GetName();
if ( _T("a:graphic") == sName )
m_oChartGraphic = oSubReader;
}
}
virtual EElementType getType () const
{
return et_xdr_GraphicFrame;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
nullable<CChartGraphic> m_oChartGraphic;
nullable<CString> m_sXml;
};
}
}
#endif // OOX_GRAPHICFRAME_FILE_INCLUDE_H_

View File

@@ -0,0 +1,81 @@
/*
* (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 OOX_SPREADSHEETIMAGE_INCLUDE_H_
#define OOX_SPREADSHEETIMAGE_INCLUDE_H_
#include "../CommonInclude.h"
#include "../../DocxFormat/Media/Media.h"
namespace OOX
{
namespace Spreadsheet
{
class Image : public Media
{
public:
Image()
{
}
Image(const CPath& filename)
{
read(filename);
}
virtual ~Image()
{
}
public:
virtual void write(const CPath& filename, const CPath& directory, CContentTypes& content) const
{
content.Registration(type().RelationType(), directory, filename.GetFilename());
}
public:
virtual const FileType type() const
{
return OOX::Spreadsheet::FileTypes::Image;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return m_filename.GetFilename();
}
};
}
}
#endif // OOX_SPREADSHEETIMAGE_INCLUDE_H_

View File

@@ -0,0 +1,191 @@
/*
* (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 OOX_PIC_FILE_INCLUDE_H_
#define OOX_PIC_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CBlip : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CBlip)
CBlip()
{
}
virtual ~CBlip()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_Blip;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r:embed"), m_oEmbed )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CRelationshipId> m_oEmbed;
};
class CBlipFill : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CBlipFill)
CBlipFill()
{
}
virtual ~CBlipFill()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("a:blip") == sName )
m_oBlip = oReader;
}
}
virtual EElementType getType () const
{
return et_BlipFill;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
nullable<CBlip> m_oBlip;
};
class CPic : public WritingElement
{
public:
WritingElementSpreadsheet_AdditionConstructors(CPic)
CPic()
{
}
virtual ~CPic()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
if(m_oBlipFill.IsInit() && m_oBlipFill->m_oBlip.IsInit() && m_oBlipFill->m_oBlip->m_oEmbed.IsInit())
{
CString sRes;sRes.Format(_T("<xdr:pic><xdr:nvPicPr><xdr:cNvPr id=\"1\" name=\"image\"/><xdr:cNvPicPr><a:picLocks noChangeAspect=\"1\"/></xdr:cNvPicPr></xdr:nvPicPr><xdr:blipFill><a:blip xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:embed=\"%s\" cstate=\"print\"><a:extLst><a:ext uri=\"{28A0092B-C50C-407E-A947-70E740481C1C}\"><a14:useLocalDpi xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" val=\"0\"/></a:ext></a:extLst></a:blip><a:stretch><a:fillRect/></a:stretch></xdr:blipFill><xdr:spPr><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></xdr:spPr></xdr:pic><xdr:clientData/>"), m_oBlipFill->m_oBlip->m_oEmbed->GetValue());
writer.WriteStringC(sRes);
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
CWCharWrapper sName = oReader.GetName();
if ( _T("xdr:blipFill") == sName )
m_oBlipFill = oReader;
}
}
virtual EElementType getType () const
{
return et_Pic;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
nullable<CBlipFill> m_oBlipFill;
};
}
}
#endif // OOX_PIC_FILE_INCLUDE_H_

View 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 OOX_POS_FILE_INCLUDE_H_
#define OOX_POS_FILE_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CPos : public WritingElementWithChilds<>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CPos)
CPos()
{
}
virtual ~CPos()
{
}
public:
virtual CString toXML() const
{
return _T("");
}
virtual void toXML(CStringWriter& writer) const
{
writer.WriteStringC(_T("<xdr:pos"));
if(m_oX.IsInit())
{
CString sVal;sVal.Format(_T(" x=\"%I64d\""), m_oX->ToEmu());
writer.WriteStringC(sVal);
}
if(m_oY.IsInit())
{
CString sVal;sVal.Format(_T(" y=\"%I64d\""), m_oY->ToEmu());
writer.WriteStringC(sVal);
}
writer.WriteStringC(_T("/>"));
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual EElementType getType () const
{
return et_FromTo;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), m_oX )
WritingElement_ReadAttributes_Read_if ( oReader, _T("y"), m_oY )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CEmu> m_oX;
nullable<SimpleTypes::CEmu> m_oY;
};
}
}
#endif // OOX_POS_FILE_INCLUDE_H_