LibreOffice Module sw (master) 1
unoflatpara.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
20#ifndef INCLUDED_SW_SOURCE_CORE_INC_UNOFLATPARA_HXX
21#define INCLUDED_SW_SOURCE_CORE_INC_UNOFLATPARA_HXX
22
24
25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/text/XFlatParagraph.hpp>
27#include <com/sun/star/text/XFlatParagraphIterator.hpp>
28#include <svl/listener.hxx>
29#include "unotextmarkup.hxx"
30#include <nodeoffset.hxx>
31
32#include <set>
33
34namespace com::sun::star::container { class XStringKeyMap; }
35namespace com::sun::star::text { class XTextRange; }
36class SwTextNode;
37class SwDoc;
39
40typedef ::cppu::ImplInheritanceHelper
42, css::beans::XPropertySet
43, css::text::XFlatParagraph
45
48{
49public:
50 SwXFlatParagraph( SwTextNode& rTextNode, OUString aExpandText, const ModelToViewHelper& rConversionMap );
51 virtual ~SwXFlatParagraph() override;
52
53 // XPropertySet
54 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
55 getPropertySetInfo() override;
56 virtual void SAL_CALL setPropertyValue(
57 const OUString& rPropertyName,
58 const css::uno::Any& rValue) override;
59 virtual css::uno::Any SAL_CALL getPropertyValue(
60 const OUString& rPropertyName) override;
61 virtual void SAL_CALL addPropertyChangeListener(
62 const OUString& rPropertyName,
63 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
64 virtual void SAL_CALL removePropertyChangeListener(
65 const OUString& rPropertyName,
66 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
67 virtual void SAL_CALL addVetoableChangeListener(
68 const OUString& rPropertyName,
69 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
70 virtual void SAL_CALL removeVetoableChangeListener(
71 const OUString& rPropertyName,
72 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
73
74 // text::XTextMarkup:
75 virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override;
76
77 virtual void SAL_CALL commitStringMarkup(::sal_Int32 nType, const OUString & aIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength,
78 const css::uno::Reference< css::container::XStringKeyMap > & xMarkupInfoContainer) override;
79
80 virtual void SAL_CALL commitTextRangeMarkup(::sal_Int32 nType, const OUString & aIdentifier, const css::uno::Reference< css::text::XTextRange> & xRange,
81 const css::uno::Reference< css::container::XStringKeyMap > & xMarkupInfoContainer) override;
82
83 // text::XFlatParagraph:
84 virtual OUString SAL_CALL getText() override;
85 virtual sal_Bool SAL_CALL isModified() override;
86 virtual void SAL_CALL setChecked(::sal_Int32 nType, sal_Bool bVal) override;
87 virtual sal_Bool SAL_CALL isChecked(::sal_Int32 nType) override;
88 virtual css::lang::Locale SAL_CALL getLanguageOfText(::sal_Int32 nPos, ::sal_Int32 nLen) override;
89 virtual css::lang::Locale SAL_CALL getPrimaryLanguageOfText(::sal_Int32 nPos, ::sal_Int32 nLen) override;
90 virtual void SAL_CALL changeText(::sal_Int32 nPos, ::sal_Int32 nLen, const OUString & aNewText, const css::uno::Sequence< css::beans::PropertyValue > & aAttributes) override;
91 virtual void SAL_CALL changeAttributes(::sal_Int32 nPos, ::sal_Int32 nLen, const css::uno::Sequence< css::beans::PropertyValue > & aAttributes) override;
92 virtual css::uno::Sequence< ::sal_Int32 > SAL_CALL getLanguagePortions() override;
93
95
96private:
99
100 OUString maExpandText;
101};
102
104 public ::cppu::WeakImplHelper
105 <
106 css::text::XFlatParagraphIterator
107 >,
108 public SvtListener
109{
110public:
111 SwXFlatParagraphIterator( SwDoc& rDoc, sal_Int32 nType, bool bAutomatic );
112 virtual ~SwXFlatParagraphIterator() override;
113
114 // text::XFlatParagraphIterator:
115 virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getFirstPara() override;
116 virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getNextPara() override;
117 virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getLastPara() override;
118 virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaBefore(const css::uno::Reference< css::text::XFlatParagraph > & xPara) override;
119 virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaAfter(const css::uno::Reference< css::text::XFlatParagraph > & xPara) override;
120
121 virtual void Notify( const SfxHint& ) override;
122
123private:
126
128 const sal_Int32 mnType;
129 const bool mbAutomatic;
130
131 SwNodeOffset mnCurrentNode; // used for non-automatic mode
132 SwNodeOffset mnEndNode; // used for non-automatic mode
133};
134
135#endif
136
137/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
const sal_Int32 mnType
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaBefore(const css::uno::Reference< css::text::XFlatParagraph > &xPara) override
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getNextPara() override
virtual ~SwXFlatParagraphIterator() override
virtual void Notify(const SfxHint &) override
SwXFlatParagraphIterator(const SwXFlatParagraphIterator &)=delete
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaAfter(const css::uno::Reference< css::text::XFlatParagraph > &xPara) override
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getFirstPara() override
SwXFlatParagraphIterator(SwDoc &rDoc, sal_Int32 nType, bool bAutomatic)
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getLastPara() override
SwXFlatParagraphIterator & operator=(const SwXFlatParagraphIterator &)=delete
virtual ~SwXFlatParagraph() override
Definition: unoflatpara.cxx:74
virtual OUString SAL_CALL getText() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual void SAL_CALL changeText(::sal_Int32 nPos, ::sal_Int32 nLen, const OUString &aNewText, const css::uno::Sequence< css::beans::PropertyValue > &aAttributes) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
SwXFlatParagraph(const SwXFlatParagraph &)=delete
virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoflatpara.cxx:81
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::lang::Locale SAL_CALL getPrimaryLanguageOfText(::sal_Int32 nPos, ::sal_Int32 nLen) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
SwXFlatParagraph(SwTextNode &rTextNode, OUString aExpandText, const ModelToViewHelper &rConversionMap)
Definition: unoflatpara.cxx:68
OUString maExpandText
virtual void SAL_CALL commitStringMarkup(::sal_Int32 nType, const OUString &aIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength, const css::uno::Reference< css::container::XStringKeyMap > &xMarkupInfoContainer) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
virtual sal_Bool SAL_CALL isChecked(::sal_Int32 nType) override
virtual void SAL_CALL commitTextRangeMarkup(::sal_Int32 nType, const OUString &aIdentifier, const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::container::XStringKeyMap > &xMarkupInfoContainer) override
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unoflatpara.cxx:93
virtual sal_Bool SAL_CALL isModified() override
virtual void SAL_CALL setChecked(::sal_Int32 nType, sal_Bool bVal) override
virtual void SAL_CALL changeAttributes(::sal_Int32 nPos, ::sal_Int32 nLen, const css::uno::Sequence< css::beans::PropertyValue > &aAttributes) override
virtual css::lang::Locale SAL_CALL getLanguageOfText(::sal_Int32 nPos, ::sal_Int32 nLen) override
SwXFlatParagraph & operator=(const SwXFlatParagraph &)=delete
virtual css::uno::Sequence< ::sal_Int32 > SAL_CALL getLanguagePortions() override
Implementation of the css::text::XTextMarkup interface.
SwTextNode * GetTextNode()
sal_uInt16 nPos
QPRO_FUNC_TYPE nType
unsigned char sal_Bool
::cppu::ImplInheritanceHelper< SwXTextMarkup, css::beans::XPropertySet, css::text::XFlatParagraph > SwXFlatParagraph_Base
Definition: unoflatpara.hxx:38
sal_Int32 nLength