LibreOffice Module writerfilter (master) 1
DomainMapperTableHandler.hxx
Go to the documentation of this file.
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#pragma once
20
21#include "PropertyMap.hxx"
22#include <vector>
23
24#include <com/sun/star/text/XTextAppendAndConvert.hpp>
25
26namespace writerfilter::dmapper {
27
28typedef css::uno::Sequence< css::uno::Reference< css::text::XTextRange > > CellSequence_t;
29typedef css::uno::Sequence<CellSequence_t> RowSequence_t;
30
31typedef css::uno::Sequence< css::uno::Sequence<css::beans::PropertyValues> > CellPropertyValuesSeq_t;
32
33typedef std::vector<PropertyMapPtr> PropertyMapVector1;
34typedef std::vector<PropertyMapVector1> PropertyMapVector2;
35
38struct TableInfo;
39
42{
43 sal_Int32 m_nFirstRow;
44 sal_Int32 m_nFirstCol;
45 sal_Int32 m_nLastRow;
46 sal_Int32 m_nLastCol;
47 HorizontallyMergedCell(sal_Int32 nFirstRow, sal_Int32 nFirstCol)
48 : m_nFirstRow(nFirstRow)
49 , m_nFirstCol(nFirstCol)
50 , m_nLastRow(nFirstRow)
51 , m_nLastCol(-1)
52 {
53 }
54};
55
57class DomainMapperTableHandler final : public virtual SvRefBase
58{
59 css::uno::Reference<css::text::XTextAppendAndConvert> m_xText;
61 std::vector< css::uno::Reference<css::text::XTextRange> > m_aCellRange;
62 std::vector<CellSequence_t> m_aRowRanges;
63 std::vector<RowSequence_t> m_aTableRanges;
64
65 // properties
69
72
74 std::vector<css::beans::PropertyValue>& rFrameProperties,
75 bool bConvertToFloating);
76 CellPropertyValuesSeq_t endTableGetCellProperties(TableInfo & rInfo, std::vector<HorizontallyMergedCell>& rMerges);
77 css::uno::Sequence<css::beans::PropertyValues> endTableGetRowProperties();
78
79public:
81
82 DomainMapperTableHandler(css::uno::Reference<css::text::XTextAppendAndConvert> xText,
83 DomainMapper_Impl& rDMapper_Impl);
85
91 void startTable(const TablePropertyMapPtr& pProps);
92
93 void ApplyParagraphPropertiesFromTableStyle(TableParagraph rParaProp, std::vector< PropertyIds > aAllTableProperties, const css::beans::PropertyValues rCellProperties);
94
96 void endTable(unsigned int nestedTableLevel, bool bTableStartsAtCellStart);
102 void startRow(const TablePropertyMapPtr& pProps);
104 void endRow();
111 void startCell(const css::uno::Reference< css::text::XTextRange > & start, const TablePropertyMapPtr& pProps);
117 void endCell(const css::uno::Reference< css::text::XTextRange > & end);
118
119 void setHadFootOrEndnote(bool bHadFootOrEndnote);
120
122};
123
124}
125
126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Class to handle events generated by TableManager::resolveCurrentTable().
bool m_bHadFootOrEndnote
Did we have a foot or endnote in this table?
void endCell(const css::uno::Reference< css::text::XTextRange > &end)
Handle end of cell.
void ApplyParagraphPropertiesFromTableStyle(TableParagraph rParaProp, std::vector< PropertyIds > aAllTableProperties, const css::beans::PropertyValues rCellProperties)
void startCell(const css::uno::Reference< css::text::XTextRange > &start, const TablePropertyMapPtr &pProps)
Handle start of cell.
TableStyleSheetEntry * endTableGetTableStyle(TableInfo &rInfo, std::vector< css::beans::PropertyValue > &rFrameProperties, bool bConvertToFloating)
css::uno::Reference< css::text::XTextAppendAndConvert > m_xText
std::vector< css::uno::Reference< css::text::XTextRange > > m_aCellRange
tools::SvRef< DomainMapperTableHandler > Pointer_t
void startRow(const TablePropertyMapPtr &pProps)
Handle start of row.
void endTable(unsigned int nestedTableLevel, bool bTableStartsAtCellStart)
Handle end of table.
CellPropertyValuesSeq_t endTableGetCellProperties(TableInfo &rInfo, std::vector< HorizontallyMergedCell > &rMerges)
css::uno::Sequence< css::beans::PropertyValues > endTableGetRowProperties()
void startTable(const TablePropertyMapPtr &pProps)
Handle start of table.
DomainMapperTableHandler(css::uno::Reference< css::text::XTextAppendAndConvert > xText, DomainMapper_Impl &rDMapper_Impl)
css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValues > > CellPropertyValuesSeq_t
css::uno::Sequence< CellSequence_t > RowSequence_t
std::vector< PropertyMapVector1 > PropertyMapVector2
css::uno::Sequence< css::uno::Reference< css::text::XTextRange > > CellSequence_t
std::vector< PropertyMapPtr > PropertyMapVector1
A horizontally merged cell is in fact a range of cells till its merge is performed.
HorizontallyMergedCell(sal_Int32 nFirstRow, sal_Int32 nFirstCol)
Information about a paragraph to be finished after a table end.