1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_INC_UNOTEXT_HXX
21 #define INCLUDED_SW_INC_UNOTEXT_HXX
23 #include <com/sun/star/lang/XUnoTunnel.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/text/XText.hpp>
26 #include <com/sun/star/text/XTextCopy.hpp>
27 #include <com/sun/star/text/XTextRangeCompare.hpp>
28 #include <com/sun/star/text/XRelativeTextContentInsert.hpp>
29 #include <com/sun/star/text/XRelativeTextContentRemove.hpp>
30 #include <com/sun/star/text/XTextAppendAndConvert.hpp>
32 #include <unobaseclass.hxx>
34 namespace com
{ namespace sun
{ namespace star
{
40 class SfxItemPropertySet
;
44 class OTextCursorHelper
;
48 : public css::lang::XTypeProvider
49 , public css::lang::XUnoTunnel
50 , public css::beans::XPropertySet
51 , public css::text::XTextAppendAndConvert
52 , public css::text::XTextCopy
53 , public css::text::XTextRangeCompare
54 , public css::text::XRelativeTextContentInsert
55 , public css::text::XRelativeTextContentRemove
61 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
63 virtual void PrepareForAttach(
64 css::uno::Reference
< css::text::XTextRange
> & xRange
,
66 /// @throws css::lang::IllegalArgumentException
67 /// @throws css::uno::RuntimeException
68 virtual bool CheckForOwnMemberMeta(
69 const SwPaM
& rPam
, const bool bAbsorb
);
75 void SetDoc(SwDoc
*const pDoc
);
79 public: /*not protected because C++ is retarded*/
80 virtual const SwStartNode
*GetStartNode() const;
84 SwXText(SwDoc
*const pDoc
, const CursorType eType
);
86 const SwDoc
* GetDoc() const;
89 /// @throws css::uno::RuntimeException
90 virtual css::uno::Reference
< css::text::XTextCursor
>
94 virtual css::uno::Any SAL_CALL
queryInterface(
95 const css::uno::Type
& rType
) override
;
98 virtual css::uno::Sequence
< css::uno::Type
>
99 SAL_CALL
getTypes() override
;
101 static const css::uno::Sequence
< sal_Int8
>& getUnoTunnelId();
104 virtual sal_Int64 SAL_CALL
getSomething(
105 const css::uno::Sequence
< sal_Int8
>& rIdentifier
) override
;
108 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
109 getPropertySetInfo() override
;
110 virtual void SAL_CALL
setPropertyValue(
111 const OUString
& rPropertyName
,
112 const css::uno::Any
& rValue
) override
;
113 virtual css::uno::Any SAL_CALL
getPropertyValue(
114 const OUString
& rPropertyName
) override
;
115 virtual void SAL_CALL
addPropertyChangeListener(
116 const OUString
& rPropertyName
,
117 const css::uno::Reference
<
118 css::beans::XPropertyChangeListener
>& xListener
) override
;
119 virtual void SAL_CALL
removePropertyChangeListener(
120 const OUString
& rPropertyName
,
121 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
122 virtual void SAL_CALL
addVetoableChangeListener(
123 const OUString
& rPropertyName
,
124 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& xListener
) override
;
125 virtual void SAL_CALL
removeVetoableChangeListener(
126 const OUString
& rPropertyName
,
127 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& xListener
) override
;
130 virtual css::uno::Reference
< css::text::XText
>
131 SAL_CALL
getText() override
;
132 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
getStart() override
;
133 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
getEnd() override
;
134 virtual OUString SAL_CALL
getString() override
;
135 virtual void SAL_CALL
setString(const OUString
& rString
) override
;
138 virtual void SAL_CALL
insertString(
139 const css::uno::Reference
< css::text::XTextRange
> & xRange
,
140 const OUString
& aString
, sal_Bool bAbsorb
) override
;
141 virtual void SAL_CALL
insertControlCharacter(
142 const css::uno::Reference
< css::text::XTextRange
> & xRange
,
143 sal_Int16 nControlCharacter
, sal_Bool bAbsorb
) override
;
146 virtual void SAL_CALL
insertTextContent(
147 const css::uno::Reference
< css::text::XTextRange
> & xRange
,
148 const css::uno::Reference
< css::text::XTextContent
> & xContent
,
149 sal_Bool bAbsorb
) override
;
150 virtual void SAL_CALL
removeTextContent(
151 const css::uno::Reference
< css::text::XTextContent
> & xContent
) override
;
154 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
156 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
) override
;
157 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
158 finishParagraphInsert(
159 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
,
160 const css::uno::Reference
< css::text::XTextRange
>& xInsertPosition
) override
;
162 // XTextPortionAppend
163 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
165 const OUString
& rText
,
166 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
) override
;
168 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
170 const OUString
& rText
,
171 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
,
172 const css::uno::Reference
< css::text::XTextRange
>& rTextRange
) override
;
174 // XTextContentAppend
175 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
177 const css::uno::Reference
< css::text::XTextContent
>& xTextContent
,
178 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
) override
;
179 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
180 insertTextContentWithProperties(
181 const css::uno::Reference
< css::text::XTextContent
>& xTextContent
,
182 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
,
183 const css::uno::Reference
< css::text::XTextRange
>& xInsertPosition
) override
;
186 virtual css::uno::Reference
< css::text::XTextContent
> SAL_CALL
188 const css::uno::Reference
< css::text::XTextRange
>& xStart
,
189 const css::uno::Reference
< css::text::XTextRange
>& xEnd
,
190 const css::uno::Sequence
< css::beans::PropertyValue
>& xFrameProperties
) override
;
191 virtual css::uno::Reference
<
192 css::text::XTextTable
> SAL_CALL
198 css::text::XTextRange
> > > > const&
203 css::beans::PropertyValue
> > > const&
207 css::beans::PropertyValue
> > const&
210 css::beans::PropertyValue
> const&
211 rTableProperties
) override
;
214 virtual void SAL_CALL
copyText(
215 const css::uno::Reference
< css::text::XTextCopy
>& xSource
) override
;
218 sal_Int16 SAL_CALL
compareRegionStarts(
219 const css::uno::Reference
< css::text::XTextRange
>& xR1
,
220 const css::uno::Reference
< css::text::XTextRange
>& xR2
) override
;
221 sal_Int16 SAL_CALL
compareRegionEnds(
222 const css::uno::Reference
< css::text::XTextRange
>& xR1
,
223 const css::uno::Reference
< css::text::XTextRange
>& xR2
) override
;
225 // XRelativeTextContentInsert
226 virtual void SAL_CALL
insertTextContentBefore(
227 const css::uno::Reference
< css::text::XTextContent
>& xNewContent
,
228 const css::uno::Reference
< css::text::XTextContent
>& xSuccessor
) override
;
229 virtual void SAL_CALL
insertTextContentAfter(
230 const css::uno::Reference
< css::text::XTextContent
>& xNewContent
,
231 const css::uno::Reference
< css::text::XTextContent
>& xPredecessor
) override
;
233 // XRelativeTextContentRemove
234 virtual void SAL_CALL
removeTextContentBefore(
235 const css::uno::Reference
< css::text::XTextContent
>& xSuccessor
) override
;
236 virtual void SAL_CALL
removeTextContentAfter(
237 const css::uno::Reference
< css::text::XTextContent
>& xPredecessor
) override
;
240 #endif // INCLUDED_SW_INC_UNOTEXT_HXX
242 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */