Update ooo320-m1
[ooovba.git] / writerfilter / source / dmapper / DomainMapperTableHandler.hxx
blob833dd3cd8aa9d88557fb8d95f5585b74f84ef853
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DomainMapperTableHandler.hxx,v $
11 * $Revision: 1.8 $
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 {
40 namespace dmapper {
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;
69 Handle_t m_xTableRange;
71 // properties
72 PropertyMapVector2 m_aCellProperties;
73 PropertyMapVector1 m_aRowProperties;
74 TablePropertyMapPtr m_aTableProperties;
76 sal_Int32 m_nCellIndex;
77 sal_Int32 m_nRowIndex;
79 public:
80 typedef boost::shared_ptr<DomainMapperTableHandler> Pointer_t;
82 DomainMapperTableHandler(TextReference_t xText, DomainMapper_Impl& rDMapper_Impl);
83 virtual ~DomainMapperTableHandler();
85 virtual void startTable(unsigned int nRows, unsigned int nDepth,
86 TablePropertyMapPtr pProps);
87 virtual void endTable();
88 virtual void startRow(unsigned int nCells, TablePropertyMapPtr pProps);
89 virtual void endRow();
90 virtual void startCell(const Handle_t & start, TablePropertyMapPtr pProps);
91 virtual void endCell(const Handle_t & end);
93 virtual Handle_t* getTable( )
95 return &m_xTableRange;
101 #endif // INCLUDED_DOMAIN_MAPPER_TABLE_HANDLER_HXX