init repo
This commit is contained in:
197
ActiveX/Common/DocxFormat/Source/XlsxFormat/Workbook/BookViews.h
Normal file
197
ActiveX/Common/DocxFormat/Source/XlsxFormat/Workbook/BookViews.h
Normal file
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
* (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_BOOKVIEWS_FILE_INCLUDE_H_
|
||||
#define OOX_BOOKVIEWS_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
|
||||
class CWorkbookView : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CWorkbookView)
|
||||
CWorkbookView()
|
||||
{
|
||||
}
|
||||
virtual ~CWorkbookView()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<workbookView"));
|
||||
if(m_oXWindow.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" xWindow=\"%d\""), m_oXWindow->GetValue());
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oYWindow.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" yWindow=\"%d\""), m_oYWindow->GetValue());
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oWindowWidth.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" windowWidth=\"%d\""), m_oWindowWidth->GetValue());
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oWindowHeight.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" windowHeight=\"%d\""), m_oWindowHeight->GetValue());
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oActiveTab.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" activeTab=\"%d\""), m_oActiveTab->GetValue());
|
||||
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_WorkbookView;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("activeTab"), m_oActiveTab )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("autoFilterDateGrouping"), m_oAutoFilterDateGrouping )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("firstSheet"), m_oFirstSheet )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("minimized"), m_oMinimized )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("showHorizontalScroll"), m_oShowHorizontalScroll )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("showSheetTabs"), m_oShowSheetTabs )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("showVerticalScroll"), m_oShowVerticalScroll )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("tabRatio"), m_oTabRatio )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("visibility"), m_oVisibility )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("windowHeight"), m_oWindowHeight )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("windowWidth"), m_oWindowWidth )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("xWindow"), m_oXWindow )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("yWindow"), m_oYWindow )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oActiveTab;
|
||||
nullable<SimpleTypes::COnOff<>> m_oAutoFilterDateGrouping;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oFirstSheet;
|
||||
nullable<SimpleTypes::COnOff<>> m_oMinimized;
|
||||
nullable<SimpleTypes::COnOff<>> m_oShowHorizontalScroll;
|
||||
nullable<SimpleTypes::COnOff<>> m_oShowSheetTabs;
|
||||
nullable<SimpleTypes::COnOff<>> m_oShowVerticalScroll;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oTabRatio;
|
||||
nullable<SimpleTypes::Spreadsheet::CVisibleType<>> m_oVisibility;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oWindowHeight;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oWindowWidth;
|
||||
nullable<SimpleTypes::CDecimalNumber<>> m_oXWindow;
|
||||
nullable<SimpleTypes::CDecimalNumber<>> m_oYWindow;
|
||||
};
|
||||
|
||||
class CBookViews : public WritingElementWithChilds<CWorkbookView>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CBookViews)
|
||||
CBookViews()
|
||||
{
|
||||
}
|
||||
virtual ~CBookViews()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<bookViews>"));
|
||||
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
|
||||
m_arrItems[i]->toXML(writer);
|
||||
writer.WriteStringC(_T("</bookViews>"));
|
||||
}
|
||||
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("workbookView") == sName )
|
||||
m_arrItems.Add( new CWorkbookView( oReader ));
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_BookViews;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_BOOKVIEWS_FILE_INCLUDE_H_
|
||||
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
* (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_DEFINEDNAMES_FILE_INCLUDE_H_
|
||||
#define OOX_DEFINEDNAMES_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
|
||||
class CDefinedName : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CDefinedName)
|
||||
CDefinedName()
|
||||
{
|
||||
}
|
||||
virtual ~CDefinedName()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<definedName"));
|
||||
if(m_oName.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" name=\"%s\""), XmlUtils::EncodeXmlString(m_oName.get()));
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oLocalSheetId.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" localSheetId=\"%d\""), m_oLocalSheetId->GetValue());
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
writer.WriteStringC(_T(">"));
|
||||
if(m_oRef.IsInit())
|
||||
writer.WriteStringC(XmlUtils::EncodeXmlString(m_oRef.get()));
|
||||
writer.WriteStringC(_T("</definedName>"));
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
m_oRef = oReader.GetText2();
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_DefinedName;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("comment"), m_oComment )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("customMenu"), m_oCustomMenu )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("description"), m_oDescription )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("function"), m_oFunction )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("functionGroupId"), m_oFunctionGroupId )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("help"), m_oHelp )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("hidden"), m_oHidden )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("localSheetId"), m_oLocalSheetId )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("name"), m_oName )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("publishToServer"), m_oPublishToServer )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("shortcutKey "), m_oShortcutKey )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("statusBar "), m_oStatusBar )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("vbProcedure "), m_oVbProcedure )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("workbookParameter "), m_oWorkbookParameter )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("xlm "), m_oXlm )
|
||||
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<CString> m_oComment;
|
||||
nullable<CString> m_oCustomMenu;
|
||||
nullable<CString> m_oDescription;
|
||||
nullable<SimpleTypes::COnOff<>> m_oFunction;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oFunctionGroupId;
|
||||
nullable<CString> m_oHelp;
|
||||
nullable<SimpleTypes::COnOff<>> m_oHidden;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oLocalSheetId;
|
||||
nullable<CString> m_oName;
|
||||
nullable<SimpleTypes::COnOff<>> m_oPublishToServer;
|
||||
nullable<CString> m_oShortcutKey;
|
||||
nullable<CString> m_oStatusBar;
|
||||
nullable<SimpleTypes::COnOff<>> m_oVbProcedure;
|
||||
nullable<SimpleTypes::COnOff<>> m_oWorkbookParameter;
|
||||
nullable<SimpleTypes::COnOff<>> m_oXlm;
|
||||
|
||||
nullable<CString> m_oRef;
|
||||
};
|
||||
|
||||
class CDefinedNames : public WritingElementWithChilds<CDefinedName>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CDefinedNames)
|
||||
CDefinedNames()
|
||||
{
|
||||
}
|
||||
virtual ~CDefinedNames()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
if(m_arrItems.GetSize() > 0)
|
||||
{
|
||||
writer.WriteStringC(_T("<definedNames>"));
|
||||
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
|
||||
m_arrItems[i]->toXML(writer);
|
||||
writer.WriteStringC(_T("</definedNames>"));
|
||||
}
|
||||
}
|
||||
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("definedName") == sName )
|
||||
m_arrItems.Add( new CDefinedName( oReader ));
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_BookViews;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_DEFINEDNAMES_FILE_INCLUDE_H_
|
||||
176
ActiveX/Common/DocxFormat/Source/XlsxFormat/Workbook/Sheets.h
Normal file
176
ActiveX/Common/DocxFormat/Source/XlsxFormat/Workbook/Sheets.h
Normal file
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* (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_SHEETS_FILE_INCLUDE_H_
|
||||
#define OOX_SHEETS_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
|
||||
class CSheet : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CSheet)
|
||||
CSheet()
|
||||
{
|
||||
}
|
||||
virtual ~CSheet()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<sheet"));
|
||||
if(m_oName.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" name=\"%s\""), XmlUtils::EncodeXmlString(m_oName.get()));
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oSheetId.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" sheetId=\"%d\""), m_oSheetId->GetValue());
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oState.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" state=\"%s\""), m_oState->ToString());
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oRid.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" r:id=\"%s\""), m_oRid->GetValue());
|
||||
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_Sheet;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("r:id"), m_oRid )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("name"), m_oName )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("sheetId"), m_oSheetId )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("state"), m_oState )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<SimpleTypes::CRelationshipId> m_oRid;
|
||||
nullable<CString> m_oName;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oSheetId;
|
||||
nullable<SimpleTypes::Spreadsheet::CVisibleType<>> m_oState;
|
||||
|
||||
};
|
||||
|
||||
class CSheets : public WritingElementWithChilds<CSheet>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CSheets)
|
||||
CSheets()
|
||||
{
|
||||
}
|
||||
virtual ~CSheets()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<sheets>"));
|
||||
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
|
||||
m_arrItems[i]->toXML(writer);
|
||||
writer.WriteStringC(_T("</sheets>"));
|
||||
}
|
||||
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("sheet") == sName )
|
||||
m_arrItems.Add( new CSheet( oReader ));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_Sheets;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_SHEETS_FILE_INCLUDE_H_
|
||||
203
ActiveX/Common/DocxFormat/Source/XlsxFormat/Workbook/Workbook.h
Normal file
203
ActiveX/Common/DocxFormat/Source/XlsxFormat/Workbook/Workbook.h
Normal file
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
* (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_WORKBOOK_FILE_INCLUDE_H_
|
||||
#define OOX_WORKBOOK_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
#include "BookViews.h"
|
||||
#include "DefinedNames.h"
|
||||
#include "Sheets.h"
|
||||
#include "WorkbookPr.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class CWorkbook : public OOX::File, public OOX::Spreadsheet::IFileContainer
|
||||
{
|
||||
public:
|
||||
CWorkbook()
|
||||
{
|
||||
}
|
||||
CWorkbook(const CPath& oPath)
|
||||
{
|
||||
read(oPath);
|
||||
}
|
||||
virtual ~CWorkbook()
|
||||
{
|
||||
}
|
||||
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("workbook") == sName )
|
||||
{
|
||||
if ( !oReader.IsEmptyNode() )
|
||||
{
|
||||
int nDocumentDepth = oReader.GetDepth();
|
||||
while ( oReader.ReadNextSiblingNode( nDocumentDepth ) )
|
||||
{
|
||||
sName = oReader.GetName();
|
||||
|
||||
if ( _T("bookViews") == sName )
|
||||
m_oBookViews = oReader;
|
||||
else if ( _T("definedNames") == sName )
|
||||
m_oDefinedNames = oReader;
|
||||
else if ( _T("sheets") == sName )
|
||||
m_oSheets = oReader;
|
||||
else if ( _T("workbookPr") == sName )
|
||||
m_oWorkbookPr = oReader;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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\"?><workbook xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">"));
|
||||
|
||||
if(m_oWorkbookPr.IsInit())
|
||||
m_oWorkbookPr->toXML(sXml);
|
||||
if(m_oBookViews.IsInit())
|
||||
m_oBookViews->toXML(sXml);
|
||||
if(m_oSheets.IsInit())
|
||||
m_oSheets->toXML(sXml);
|
||||
if(m_oDefinedNames.IsInit())
|
||||
m_oDefinedNames->toXML(sXml);
|
||||
|
||||
sXml.WriteStringC(_T("<calcPr calcId=\"145621\"/>"));
|
||||
sXml.WriteStringC(_T("</workbook>"));
|
||||
|
||||
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::Workbook;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
const CPath& GetReadPath()
|
||||
{
|
||||
return m_oReadPath;
|
||||
}
|
||||
void PrepareToWrite()
|
||||
{
|
||||
|
||||
if(false == m_oWorkbookPr.IsInit())
|
||||
m_oWorkbookPr.Init();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(false == m_oBookViews.IsInit())
|
||||
m_oBookViews.Init();
|
||||
if(0 == m_oBookViews->m_arrItems.GetSize())
|
||||
m_oBookViews->m_arrItems.Add(new OOX::Spreadsheet::CWorkbookView());
|
||||
OOX::Spreadsheet::CWorkbookView* pWorkbookView = m_oBookViews->m_arrItems[0];
|
||||
if(false == pWorkbookView->m_oXWindow.IsInit())
|
||||
{
|
||||
pWorkbookView->m_oXWindow.Init();
|
||||
pWorkbookView->m_oXWindow->SetValue(360);
|
||||
}
|
||||
if(false == pWorkbookView->m_oYWindow.IsInit())
|
||||
{
|
||||
pWorkbookView->m_oYWindow.Init();
|
||||
pWorkbookView->m_oYWindow->SetValue(15);
|
||||
}
|
||||
if(false == pWorkbookView->m_oWindowWidth.IsInit())
|
||||
{
|
||||
pWorkbookView->m_oWindowWidth.Init();
|
||||
pWorkbookView->m_oWindowWidth->SetValue(20955);
|
||||
}
|
||||
if(false == pWorkbookView->m_oWindowHeight.IsInit())
|
||||
{
|
||||
pWorkbookView->m_oWindowHeight.Init();
|
||||
pWorkbookView->m_oWindowHeight->SetValue(9720);
|
||||
}
|
||||
}
|
||||
private:
|
||||
CPath m_oReadPath;
|
||||
|
||||
public:
|
||||
nullable<OOX::Spreadsheet::CBookViews> m_oBookViews;
|
||||
nullable<OOX::Spreadsheet::CDefinedNames> m_oDefinedNames;
|
||||
nullable<OOX::Spreadsheet::CSheets> m_oSheets;
|
||||
nullable<OOX::Spreadsheet::CWorkbookPr> m_oWorkbookPr;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_WORKBOOK_FILE_INCLUDE_H_
|
||||
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* (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_WORKBOOKPR_FILE_INCLUDE_H_
|
||||
#define OOX_WORKBOOKPR_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
|
||||
class CWorkbookPr : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CWorkbookPr)
|
||||
CWorkbookPr()
|
||||
{
|
||||
}
|
||||
virtual ~CWorkbookPr()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<workbookPr"));
|
||||
if(m_oDefaultThemeVersion.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" defaultThemeVersion=\"%d\""), m_oDefaultThemeVersion->GetValue());
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oDate1904.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" date1904=\"%s\""), m_oDate1904->ToString2(SimpleTypes::onofftostring1));
|
||||
writer.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oDateCompatibility.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" dateCompatibility=\"%s\""), m_oDateCompatibility->ToString2(SimpleTypes::onofftostring1));
|
||||
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_WorkbookPr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("allowRefreshQuery"), m_oAllowRefreshQuery )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("autoCompressPictures"), m_oAutoCompressPictures )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("backupFile"), m_oBackupFile )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("checkCompatibility"), m_oCheckCompatibility )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("codeName"), m_oCodeName )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("date1904"), m_oDate1904 )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("dateCompatibility"), m_oDateCompatibility )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("defaultThemeVersion"), m_oDefaultThemeVersion )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("filterPrivacy"), m_oFilterPrivacy )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("hidePivotFieldList"), m_oHidePivotFieldList )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("promptedSolutions"), m_oPromptedSolutions )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("publishItems"), m_oPublishItems )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("refreshAllConnections"), m_oRefreshAllConnections )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("showBorderUnselectedTables"), m_oShowBorderUnselectedTables )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("showInkAnnotation"), m_oShowInkAnnotation )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("showObjects"), m_oShowObjects )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("showPivotChartFilter"), m_oShowPivotChartFilter )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("updateLinks"), m_oUpdateLinks )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<SimpleTypes::COnOff<>> m_oAllowRefreshQuery;
|
||||
nullable<SimpleTypes::COnOff<>> m_oAutoCompressPictures;
|
||||
nullable<SimpleTypes::COnOff<>> m_oBackupFile;
|
||||
nullable<SimpleTypes::COnOff<>> m_oCheckCompatibility;
|
||||
nullable<SimpleTypes::COnOff<>> m_oCodeName;
|
||||
nullable<SimpleTypes::COnOff<>> m_oDate1904;
|
||||
nullable<SimpleTypes::COnOff<>> m_oDateCompatibility;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oDefaultThemeVersion;
|
||||
nullable<SimpleTypes::COnOff<>> m_oFilterPrivacy;
|
||||
nullable<SimpleTypes::COnOff<>> m_oHidePivotFieldList;
|
||||
nullable<SimpleTypes::COnOff<>> m_oPromptedSolutions;
|
||||
nullable<SimpleTypes::COnOff<>> m_oPublishItems;
|
||||
nullable<SimpleTypes::COnOff<>> m_oRefreshAllConnections;
|
||||
nullable<SimpleTypes::COnOff<>> m_oShowBorderUnselectedTables;
|
||||
nullable<SimpleTypes::COnOff<>> m_oShowInkAnnotation;
|
||||
nullable<SimpleTypes::COnOff<>> m_oShowObjects;
|
||||
nullable<SimpleTypes::COnOff<>> m_oShowPivotChartFilter;
|
||||
nullable<SimpleTypes::Spreadsheet::CUpdateLinksType<>> m_oUpdateLinks;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_WORKBOOKPR_FILE_INCLUDE_H_
|
||||
Reference in New Issue
Block a user