1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DomainMapperTableHandler.hxx,v $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
31 #ifndef INCLUDED_DOMAIN_MAPPER_TABLE_HANDLER_HXX
32 #define INCLUDED_DOMAIN_MAPPER_TABLE_HANDLER_HXX
34 #include <resourcemodel/TableManager.hxx>
35 #include <PropertyMap.hxx>
37 #include <com/sun/star/text/XTextAppendAndConvert.hpp>
39 namespace writerfilter
{
42 typedef ::com::sun::star::text::XTextRange TextRange_t
;
43 typedef ::com::sun::star::uno::Reference
< TextRange_t
> Handle_t
;
44 typedef ::com::sun::star::uno::Sequence
< Handle_t
> CellSequence_t
;
45 typedef boost::shared_ptr
<CellSequence_t
> CellSequencePointer_t
;
46 typedef ::com::sun::star::uno::Sequence
< CellSequence_t
> RowSequence_t
;
47 typedef boost::shared_ptr
<RowSequence_t
> RowSequencePointer_t
;
48 typedef ::com::sun::star::uno::Sequence
< RowSequence_t
> TableSequence_t
;
49 typedef boost::shared_ptr
<TableSequence_t
> TableSequencePointer_t
;
50 typedef ::com::sun::star::text::XTextAppendAndConvert Text_t
;
51 typedef ::com::sun::star::uno::Reference
<Text_t
> TextReference_t
;
53 typedef ::com::sun::star::beans::PropertyValues TablePropertyValues_t
;
54 typedef ::com::sun::star::uno::Sequence
< TablePropertyValues_t
> RowPropertyValuesSeq_t
;
55 typedef ::com::sun::star::uno::Sequence
< RowPropertyValuesSeq_t
> CellPropertyValuesSeq_t
;
57 typedef std::vector
<PropertyMapPtr
> PropertyMapVector1
;
58 typedef std::vector
<PropertyMapVector1
> PropertyMapVector2
;
60 class DomainMapper_Impl
;
61 class DomainMapperTableHandler
: public TableDataHandler
<Handle_t
, TablePropertyMapPtr
>
63 TextReference_t m_xText
;
64 DomainMapper_Impl
& m_rDMapper_Impl
;
65 CellSequencePointer_t m_pCellSeq
;
66 RowSequencePointer_t m_pRowSeq
;
67 TableSequencePointer_t m_pTableSeq
;
70 PropertyMapVector2 m_aCellProperties
;
71 PropertyMapVector1 m_aRowProperties
;
72 TablePropertyMapPtr m_aTableProperties
;
74 sal_Int32 m_nCellIndex
;
75 sal_Int32 m_nRowIndex
;
78 typedef boost::shared_ptr
<DomainMapperTableHandler
> Pointer_t
;
80 DomainMapperTableHandler(TextReference_t xText
, DomainMapper_Impl
& rDMapper_Impl
);
81 virtual ~DomainMapperTableHandler();
83 virtual void startTable(unsigned int nRows
, unsigned int nDepth
,
84 TablePropertyMapPtr pProps
);
85 virtual void endTable();
86 virtual void startRow(unsigned int nCells
, TablePropertyMapPtr pProps
);
87 virtual void endRow();
88 virtual void startCell(const Handle_t
& start
, TablePropertyMapPtr pProps
);
89 virtual void endCell(const Handle_t
& end
);
94 #endif // INCLUDED_DOMAIN_MAPPER_TABLE_HANDLER_HXX