Files
libreoffice/xmloff/source/style/impastpl.hxx

231 lines
7.8 KiB
C++
Raw Normal View History

2010-10-27 13:11:31 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:07:07 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 16:07:07 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 16:07:07 +00:00
*
************************************************************************/
#ifndef _XMLOFF_XMLASTPL_IMPL_HXX
#define _XMLOFF_XMLASTPL_IMPL_HXX
#include <sal/types.h>
#include <tools/list.hxx>
#include <svl/cntnrsrt.hxx>
2000-09-18 16:07:07 +00:00
#include <rtl/ustring.hxx>
2001-02-01 17:12:00 +00:00
#include <vector>
2000-09-18 16:07:07 +00:00
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <xmloff/maptype.hxx>
#include <xmloff/xmlexppr.hxx>
2000-09-18 16:07:07 +00:00
class SvXMLAutoStylePoolP;
class SvXMLAutoStylePoolParentsP_Impl;
class SvXMLAutoStylePoolNamesP_Impl;
class SvXMLAttributeList;
class SvXMLExportPropertyMapper;
class SvXMLExport;
2000-09-18 16:07:07 +00:00
2000-11-20 09:15:09 +00:00
#define MAX_CACHE_SIZE 65536
2000-09-18 16:07:07 +00:00
///////////////////////////////////////////////////////////////////////////////
//
// Implementationclass for stylefamily-information
//
2000-11-20 09:15:09 +00:00
typedef ::rtl::OUString *OUStringPtr;
DECLARE_LIST( SvXMLAutoStylePoolCache_Impl, OUStringPtr )
2000-09-18 16:07:07 +00:00
class XMLFamilyData_Impl
{
public:
2000-11-20 09:15:09 +00:00
SvXMLAutoStylePoolCache_Impl *pCache;
2000-09-18 16:07:07 +00:00
sal_uInt32 mnFamily;
::rtl::OUString maStrFamilyName;
UniReference < SvXMLExportPropertyMapper > mxMapper;
2000-09-18 16:07:07 +00:00
SvXMLAutoStylePoolParentsP_Impl* mpParentList;
SvXMLAutoStylePoolNamesP_Impl* mpNameList;
sal_uInt32 mnCount;
sal_uInt32 mnName;
::rtl::OUString maStrPrefix;
sal_Bool bAsFamily;
2000-09-18 16:07:07 +00:00
public:
XMLFamilyData_Impl( sal_Int32 nFamily, const ::rtl::OUString& rStrName,
const UniReference < SvXMLExportPropertyMapper > & rMapper,
const ::rtl::OUString& rStrPrefix, sal_Bool bAsFamily = sal_True );
2000-11-20 09:15:09 +00:00
XMLFamilyData_Impl( sal_Int32 nFamily ) :
pCache( 0 ),
2000-11-20 09:15:09 +00:00
mnFamily( nFamily ), mpParentList( NULL ),
mpNameList( NULL ), mnCount( 0 ), mnName( 0 )
2000-09-18 16:07:07 +00:00
{}
~XMLFamilyData_Impl();
friend int XMLFamilyDataSort_Impl( const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2 );
void ClearEntries();
};
DECLARE_CONTAINER_SORT( XMLFamilyDataList_Impl, XMLFamilyData_Impl )
///////////////////////////////////////////////////////////////////////////////
//
//
//
DECLARE_CONTAINER_SORT_DEL( SvXMLAutoStylePoolNamesP_Impl,
::rtl::OUString )
///////////////////////////////////////////////////////////////////////////////
//
// Properties of a pool
//
class SvXMLAutoStylePoolPropertiesP_Impl
{
::rtl::OUString msName;
::std::vector< XMLPropertyState > maProperties;
sal_uInt32 mnPos;
public:
SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties );
~SvXMLAutoStylePoolPropertiesP_Impl()
{
}
const ::rtl::OUString& GetName() const { return msName; }
const ::std::vector< XMLPropertyState >& GetProperties() const { return maProperties; }
sal_uInt32 GetPos() const { return mnPos; }
CWS-TOOLING: integrate CWS calcsheetdata 2009-08-13 16:18:48 +0200 nn r274950 : #i102616# shared/remote files, better handling of formula results 2009-08-12 11:17:30 +0200 nn r274884 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274622 (milestone: DEV300:m54) 2009-08-12 10:30:47 +0200 nn r274881 : #i102616# some clean-up 2009-08-11 19:01:18 +0200 nn r274876 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-11 19:00:49 +0200 nn r274875 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-10 19:12:04 +0200 nn r274835 : #i102616# detective, notes, encoding, error handling 2009-08-07 11:18:46 +0200 nn r274751 : #i102616# use new method SvXMLAutoStylePoolP::AddNamed 2009-08-07 11:18:15 +0200 nn r274750 : #i102616# new method SvXMLAutoStylePoolP::AddNamed 2009-08-06 18:02:42 +0200 nn r274740 : #i102616# modification: shapes, notes, pending row heights; skip sheets in export iterator 2009-08-05 18:41:59 +0200 nn r274694 : #i102616# handle text styles in notes 2009-08-03 18:55:59 +0200 nn r274594 : #i102616# handle text styles in cells 2009-07-31 19:00:06 +0200 nn r274548 : #i102616# handle styles for notes 2009-07-28 16:46:20 +0200 nn r274414 : missed a conflict 2009-07-28 14:01:56 +0200 nn r274404 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274203 (milestone: DEV300:m53) 2009-07-23 18:28:47 +0200 nn r274278 : #i102616# handle table styles 2009-07-22 15:40:24 +0200 nn r274244 : #i102616# handle row styles 2009-07-21 20:09:37 +0200 nn r274211 : #i102616# handle column styles 2009-07-16 13:00:18 +0200 nn r274043 : #i102616# invalidate all stream positions when inserting/deleting sheets 2009-07-15 17:41:15 +0200 nn r274021 : #i102616# don't collect cell styles twice for copied sheets 2009-07-14 18:36:11 +0200 nn r273985 : #i102616# allow to query stream position, clear buffer 2009-07-14 18:32:10 +0200 nn r273984 : #i102616# allow to specify a name for an autostyle 2009-07-09 22:01:23 +0200 nn r273870 : #i102616# copy stream for unchanged sheets 2009-07-08 18:11:42 +0200 nn r273844 : #i102616# store stream positions of sheets 2009-06-24 19:08:18 +0200 nn r273363 : #i102616# detect changed sheets since loading 2009-06-09 15:53:32 +0200 nn r272774 : #i102616# store automatic cell style information after loading
2009-09-07 15:38:19 +00:00
void SetName( const ::rtl::OUString& rNew ) { msName = rNew; }
2000-09-18 16:07:07 +00:00
};
typedef SvXMLAutoStylePoolPropertiesP_Impl *SvXMLAutoStylePoolPropertiesPPtr;
DECLARE_LIST( SvXMLAutoStylePoolPropertiesPList_Impl, SvXMLAutoStylePoolPropertiesPPtr )
///////////////////////////////////////////////////////////////////////////////
//
// Parents of AutoStylePool's
//
class SvXMLAutoStylePoolParentP_Impl
{
::rtl::OUString msParent;
SvXMLAutoStylePoolPropertiesPList_Impl maPropertiesList;
public:
SvXMLAutoStylePoolParentP_Impl( const ::rtl::OUString & rParent ) :
msParent( rParent )
{
}
~SvXMLAutoStylePoolParentP_Impl();
sal_Bool Add( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, ::rtl::OUString& rName, bool bDontSeek = false );
2000-09-18 16:07:07 +00:00
CWS-TOOLING: integrate CWS calcsheetdata 2009-08-13 16:18:48 +0200 nn r274950 : #i102616# shared/remote files, better handling of formula results 2009-08-12 11:17:30 +0200 nn r274884 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274622 (milestone: DEV300:m54) 2009-08-12 10:30:47 +0200 nn r274881 : #i102616# some clean-up 2009-08-11 19:01:18 +0200 nn r274876 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-11 19:00:49 +0200 nn r274875 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-10 19:12:04 +0200 nn r274835 : #i102616# detective, notes, encoding, error handling 2009-08-07 11:18:46 +0200 nn r274751 : #i102616# use new method SvXMLAutoStylePoolP::AddNamed 2009-08-07 11:18:15 +0200 nn r274750 : #i102616# new method SvXMLAutoStylePoolP::AddNamed 2009-08-06 18:02:42 +0200 nn r274740 : #i102616# modification: shapes, notes, pending row heights; skip sheets in export iterator 2009-08-05 18:41:59 +0200 nn r274694 : #i102616# handle text styles in notes 2009-08-03 18:55:59 +0200 nn r274594 : #i102616# handle text styles in cells 2009-07-31 19:00:06 +0200 nn r274548 : #i102616# handle styles for notes 2009-07-28 16:46:20 +0200 nn r274414 : missed a conflict 2009-07-28 14:01:56 +0200 nn r274404 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274203 (milestone: DEV300:m53) 2009-07-23 18:28:47 +0200 nn r274278 : #i102616# handle table styles 2009-07-22 15:40:24 +0200 nn r274244 : #i102616# handle row styles 2009-07-21 20:09:37 +0200 nn r274211 : #i102616# handle column styles 2009-07-16 13:00:18 +0200 nn r274043 : #i102616# invalidate all stream positions when inserting/deleting sheets 2009-07-15 17:41:15 +0200 nn r274021 : #i102616# don't collect cell styles twice for copied sheets 2009-07-14 18:36:11 +0200 nn r273985 : #i102616# allow to query stream position, clear buffer 2009-07-14 18:32:10 +0200 nn r273984 : #i102616# allow to specify a name for an autostyle 2009-07-09 22:01:23 +0200 nn r273870 : #i102616# copy stream for unchanged sheets 2009-07-08 18:11:42 +0200 nn r273844 : #i102616# store stream positions of sheets 2009-06-24 19:08:18 +0200 nn r273363 : #i102616# detect changed sheets since loading 2009-06-09 15:53:32 +0200 nn r272774 : #i102616# store automatic cell style information after loading
2009-09-07 15:38:19 +00:00
sal_Bool AddNamed( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, const ::rtl::OUString& rName );
2000-09-18 16:07:07 +00:00
::rtl::OUString Find( const XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const;
const ::rtl::OUString& GetParent() const { return msParent; }
const SvXMLAutoStylePoolPropertiesPList_Impl& GetPropertiesList() const
{
return maPropertiesList;
}
};
DECLARE_CONTAINER_SORT_DEL( SvXMLAutoStylePoolParentsP_Impl,
SvXMLAutoStylePoolParentP_Impl )
///////////////////////////////////////////////////////////////////////////////
//
// Implementationclass of SvXMLAutoStylePool
//
class SvXMLAutoStylePoolP_Impl
{
SvXMLExport& rExport;
2000-09-18 16:07:07 +00:00
XMLFamilyDataList_Impl maFamilyList;
public:
SvXMLAutoStylePoolP_Impl( SvXMLExport& rExport );
2000-09-18 16:07:07 +00:00
~SvXMLAutoStylePoolP_Impl();
SvXMLExport& GetExport() const { return rExport; }
2000-09-18 16:07:07 +00:00
void AddFamily( sal_Int32 nFamily, const ::rtl::OUString& rStrName,
const UniReference < SvXMLExportPropertyMapper > & rMapper,
const ::rtl::OUString& rStrPrefix, sal_Bool bAsFamily = sal_True );
2000-09-18 16:07:07 +00:00
void RegisterName( sal_Int32 nFamily, const ::rtl::OUString& rName );
void GetRegisteredNames(
com::sun::star::uno::Sequence<sal_Int32>& aFamilies,
com::sun::star::uno::Sequence<rtl::OUString>& aNames );
2000-09-18 16:07:07 +00:00
// ::rtl::OUString Add( sal_Int32 nFamily, const ::rtl::OUString& rParent,
// const ::std::vector< XMLPropertyState >& rProperties,
// sal_Bool bCache = sal_False );
sal_Bool Add( ::rtl::OUString& rName, sal_Int32 nFamily,
const ::rtl::OUString& rParent,
const ::std::vector< XMLPropertyState >& rProperties,
sal_Bool bCache = sal_False,
bool bDontSeek = false );
CWS-TOOLING: integrate CWS calcsheetdata 2009-08-13 16:18:48 +0200 nn r274950 : #i102616# shared/remote files, better handling of formula results 2009-08-12 11:17:30 +0200 nn r274884 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274622 (milestone: DEV300:m54) 2009-08-12 10:30:47 +0200 nn r274881 : #i102616# some clean-up 2009-08-11 19:01:18 +0200 nn r274876 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-11 19:00:49 +0200 nn r274875 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-10 19:12:04 +0200 nn r274835 : #i102616# detective, notes, encoding, error handling 2009-08-07 11:18:46 +0200 nn r274751 : #i102616# use new method SvXMLAutoStylePoolP::AddNamed 2009-08-07 11:18:15 +0200 nn r274750 : #i102616# new method SvXMLAutoStylePoolP::AddNamed 2009-08-06 18:02:42 +0200 nn r274740 : #i102616# modification: shapes, notes, pending row heights; skip sheets in export iterator 2009-08-05 18:41:59 +0200 nn r274694 : #i102616# handle text styles in notes 2009-08-03 18:55:59 +0200 nn r274594 : #i102616# handle text styles in cells 2009-07-31 19:00:06 +0200 nn r274548 : #i102616# handle styles for notes 2009-07-28 16:46:20 +0200 nn r274414 : missed a conflict 2009-07-28 14:01:56 +0200 nn r274404 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274203 (milestone: DEV300:m53) 2009-07-23 18:28:47 +0200 nn r274278 : #i102616# handle table styles 2009-07-22 15:40:24 +0200 nn r274244 : #i102616# handle row styles 2009-07-21 20:09:37 +0200 nn r274211 : #i102616# handle column styles 2009-07-16 13:00:18 +0200 nn r274043 : #i102616# invalidate all stream positions when inserting/deleting sheets 2009-07-15 17:41:15 +0200 nn r274021 : #i102616# don't collect cell styles twice for copied sheets 2009-07-14 18:36:11 +0200 nn r273985 : #i102616# allow to query stream position, clear buffer 2009-07-14 18:32:10 +0200 nn r273984 : #i102616# allow to specify a name for an autostyle 2009-07-09 22:01:23 +0200 nn r273870 : #i102616# copy stream for unchanged sheets 2009-07-08 18:11:42 +0200 nn r273844 : #i102616# store stream positions of sheets 2009-06-24 19:08:18 +0200 nn r273363 : #i102616# detect changed sheets since loading 2009-06-09 15:53:32 +0200 nn r272774 : #i102616# store automatic cell style information after loading
2009-09-07 15:38:19 +00:00
sal_Bool AddNamed( const ::rtl::OUString& rName, sal_Int32 nFamily,
const ::rtl::OUString& rParent,
const ::std::vector< XMLPropertyState >& rProperties );
2000-11-20 09:15:09 +00:00
::rtl::OUString AddToCache( sal_Int32 nFamily,
const ::rtl::OUString& rParent );
2000-09-18 16:07:07 +00:00
::rtl::OUString Find( sal_Int32 nFamily, const ::rtl::OUString& rParent,
const ::std::vector< XMLPropertyState >& rProperties ) const;
2000-11-20 09:15:09 +00:00
::rtl::OUString FindAndRemoveCached( sal_Int32 nFamily ) const;
2000-09-18 16:07:07 +00:00
void exportXML( sal_Int32 nFamily,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
const SvXMLAutoStylePoolP *pAntiImpl) const;
void ClearEntries();
};
struct SvXMLAutoStylePoolPExport_Impl
{
const ::rtl::OUString *mpParent;
const SvXMLAutoStylePoolPropertiesP_Impl *mpProperties;
};
#endif
2010-10-27 13:11:31 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */