Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_DOMAIN_MAPPER_TABLE_HANDLER_HXX
20 : #define INCLUDED_DOMAIN_MAPPER_TABLE_HANDLER_HXX
21 :
22 : #include <resourcemodel/TableManager.hxx>
23 : #include <PropertyMap.hxx>
24 :
25 : #include <com/sun/star/text/XTextAppendAndConvert.hpp>
26 :
27 : namespace writerfilter {
28 : namespace dmapper {
29 :
30 : typedef ::com::sun::star::text::XTextRange TextRange_t;
31 : typedef ::com::sun::star::uno::Reference< TextRange_t > Handle_t;
32 : typedef ::com::sun::star::uno::Sequence< Handle_t> CellSequence_t;
33 : typedef boost::shared_ptr<CellSequence_t> CellSequencePointer_t;
34 : typedef ::com::sun::star::uno::Sequence< CellSequence_t > RowSequence_t;
35 : typedef boost::shared_ptr<RowSequence_t> RowSequencePointer_t;
36 : typedef ::com::sun::star::uno::Sequence< RowSequence_t> TableSequence_t;
37 : typedef boost::shared_ptr<TableSequence_t> TableSequencePointer_t;
38 : typedef ::com::sun::star::text::XTextAppendAndConvert Text_t;
39 : typedef ::com::sun::star::uno::Reference<Text_t> TextReference_t;
40 :
41 : typedef ::com::sun::star::beans::PropertyValues TablePropertyValues_t;
42 : typedef ::com::sun::star::uno::Sequence< TablePropertyValues_t > RowPropertyValuesSeq_t;
43 : typedef ::com::sun::star::uno::Sequence< RowPropertyValuesSeq_t> CellPropertyValuesSeq_t;
44 :
45 : typedef std::vector<PropertyMapPtr> PropertyMapVector1;
46 : typedef std::vector<PropertyMapVector1> PropertyMapVector2;
47 :
48 : class DomainMapper_Impl;
49 : class TableStyleSheetEntry;
50 : struct TableInfo;
51 : class WRITERFILTER_DLLPRIVATE DomainMapperTableHandler : public TableDataHandler<Handle_t , TablePropertyMapPtr >
52 : {
53 : TextReference_t m_xText;
54 : DomainMapper_Impl& m_rDMapper_Impl;
55 : CellSequencePointer_t m_pCellSeq;
56 : RowSequencePointer_t m_pRowSeq;
57 : TableSequencePointer_t m_pTableSeq;
58 :
59 : Handle_t m_xTableRange;
60 :
61 : // properties
62 : PropertyMapVector2 m_aCellProperties;
63 : PropertyMapVector1 m_aRowProperties;
64 : TablePropertyMapPtr m_aTableProperties;
65 :
66 : sal_Int32 m_nCellIndex;
67 : sal_Int32 m_nRowIndex;
68 :
69 : TableStyleSheetEntry * endTableGetTableStyle(TableInfo & rInfo);
70 : CellPropertyValuesSeq_t endTableGetCellProperties(TableInfo & rInfo);
71 : RowPropertyValuesSeq_t endTableGetRowProperties();
72 :
73 : public:
74 : typedef boost::shared_ptr<DomainMapperTableHandler> Pointer_t;
75 :
76 : DomainMapperTableHandler(TextReference_t xText, DomainMapper_Impl& rDMapper_Impl);
77 : virtual ~DomainMapperTableHandler();
78 :
79 : virtual void startTable(unsigned int nRows, unsigned int nDepth,
80 : TablePropertyMapPtr pProps);
81 : virtual void endTable(unsigned int nestedTableLevel);
82 : virtual void startRow(unsigned int nCells, TablePropertyMapPtr pProps);
83 : virtual void endRow();
84 : virtual void startCell(const Handle_t & start, TablePropertyMapPtr pProps);
85 : virtual void endCell(const Handle_t & end);
86 :
87 0 : virtual Handle_t* getTable( )
88 : {
89 0 : return &m_xTableRange;
90 : };
91 : };
92 :
93 : }}
94 :
95 : #endif // INCLUDED_DOMAIN_MAPPER_TABLE_HANDLER_HXX
96 :
97 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|