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/XTextCopy.hpp>
26 #include <com/sun/star/text/XTextRangeCompare.hpp>
27 #include <com/sun/star/text/XRelativeTextContentInsert.hpp>
28 #include <com/sun/star/text/XRelativeTextContentRemove.hpp>
29 #include <com/sun/star/text/XTextAppendAndConvert.hpp>
31 #include "unobaseclass.hxx"
33 namespace com::sun::star
{
45 : public css::lang::XTypeProvider
46 , public css::lang::XUnoTunnel
47 , public css::beans::XPropertySet
48 , public css::text::XTextAppendAndConvert
49 , public css::text::XTextCopy
50 , public css::text::XTextRangeCompare
51 , public css::text::XRelativeTextContentInsert
52 , public css::text::XRelativeTextContentRemove
58 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
60 virtual void PrepareForAttach(
61 css::uno::Reference
< css::text::XTextRange
> & xRange
,
63 /// @throws css::lang::IllegalArgumentException
64 /// @throws css::uno::RuntimeException
65 virtual bool CheckForOwnMemberMeta(
66 const SwPaM
& rPam
, const bool bAbsorb
);
72 void SetDoc(SwDoc
*const pDoc
);
76 public: /*not protected because C++ is retarded*/
77 virtual const SwStartNode
*GetStartNode() const;
81 SwXText(SwDoc
*const pDoc
, const CursorType eType
);
83 const SwDoc
* GetDoc() const;
86 /// @throws css::uno::RuntimeException
87 virtual css::uno::Reference
< css::text::XTextCursor
>
91 virtual css::uno::Any SAL_CALL
queryInterface(
92 const css::uno::Type
& rType
) override
;
95 virtual css::uno::Sequence
< css::uno::Type
>
96 SAL_CALL
getTypes() override
;
98 static const css::uno::Sequence
< sal_Int8
>& getUnoTunnelId();
101 virtual sal_Int64 SAL_CALL
getSomething(
102 const css::uno::Sequence
< sal_Int8
>& rIdentifier
) override
;
105 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
106 getPropertySetInfo() override
;
107 virtual void SAL_CALL
setPropertyValue(
108 const OUString
& rPropertyName
,
109 const css::uno::Any
& rValue
) override
;
110 virtual css::uno::Any SAL_CALL
getPropertyValue(
111 const OUString
& rPropertyName
) override
;
112 virtual void SAL_CALL
addPropertyChangeListener(
113 const OUString
& rPropertyName
,
114 const css::uno::Reference
<
115 css::beans::XPropertyChangeListener
>& xListener
) override
;
116 virtual void SAL_CALL
removePropertyChangeListener(
117 const OUString
& rPropertyName
,
118 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
119 virtual void SAL_CALL
addVetoableChangeListener(
120 const OUString
& rPropertyName
,
121 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& xListener
) override
;
122 virtual void SAL_CALL
removeVetoableChangeListener(
123 const OUString
& rPropertyName
,
124 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& xListener
) override
;
127 virtual css::uno::Reference
< css::text::XText
>
128 SAL_CALL
getText() override
;
129 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
getStart() override
;
130 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
getEnd() override
;
131 virtual OUString SAL_CALL
getString() override
;
132 virtual void SAL_CALL
setString(const OUString
& rString
) override
;
135 virtual void SAL_CALL
insertString(
136 const css::uno::Reference
< css::text::XTextRange
> & xRange
,
137 const OUString
& aString
, sal_Bool bAbsorb
) override
;
138 virtual void SAL_CALL
insertControlCharacter(
139 const css::uno::Reference
< css::text::XTextRange
> & xRange
,
140 sal_Int16 nControlCharacter
, sal_Bool bAbsorb
) override
;
143 virtual void SAL_CALL
insertTextContent(
144 const css::uno::Reference
< css::text::XTextRange
> & xRange
,
145 const css::uno::Reference
< css::text::XTextContent
> & xContent
,
146 sal_Bool bAbsorb
) override
;
147 virtual void SAL_CALL
removeTextContent(
148 const css::uno::Reference
< css::text::XTextContent
> & xContent
) override
;
151 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
153 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
) override
;
154 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
155 finishParagraphInsert(
156 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
,
157 const css::uno::Reference
< css::text::XTextRange
>& xInsertPosition
) override
;
159 // XTextPortionAppend
160 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
162 const OUString
& rText
,
163 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
) override
;
165 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
167 const OUString
& rText
,
168 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
,
169 const css::uno::Reference
< css::text::XTextRange
>& rTextRange
) override
;
171 // XTextContentAppend
172 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
174 const css::uno::Reference
< css::text::XTextContent
>& xTextContent
,
175 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
) override
;
176 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
177 insertTextContentWithProperties(
178 const css::uno::Reference
< css::text::XTextContent
>& xTextContent
,
179 const css::uno::Sequence
< css::beans::PropertyValue
>& rCharacterAndParagraphProperties
,
180 const css::uno::Reference
< css::text::XTextRange
>& xInsertPosition
) override
;
183 virtual css::uno::Reference
< css::text::XTextContent
> SAL_CALL
185 const css::uno::Reference
< css::text::XTextRange
>& xStart
,
186 const css::uno::Reference
< css::text::XTextRange
>& xEnd
,
187 const css::uno::Sequence
< css::beans::PropertyValue
>& xFrameProperties
) override
;
188 virtual css::uno::Reference
<
189 css::text::XTextTable
> SAL_CALL
195 css::text::XTextRange
> > > > const&
200 css::beans::PropertyValue
> > > const&
204 css::beans::PropertyValue
> > const&
207 css::beans::PropertyValue
> const&
208 rTableProperties
) override
;
211 virtual void SAL_CALL
copyText(
212 const css::uno::Reference
< css::text::XTextCopy
>& xSource
) override
;
215 sal_Int16 SAL_CALL
compareRegionStarts(
216 const css::uno::Reference
< css::text::XTextRange
>& xR1
,
217 const css::uno::Reference
< css::text::XTextRange
>& xR2
) override
;
218 sal_Int16 SAL_CALL
compareRegionEnds(
219 const css::uno::Reference
< css::text::XTextRange
>& xR1
,
220 const css::uno::Reference
< css::text::XTextRange
>& xR2
) override
;
222 // XRelativeTextContentInsert
223 virtual void SAL_CALL
insertTextContentBefore(
224 const css::uno::Reference
< css::text::XTextContent
>& xNewContent
,
225 const css::uno::Reference
< css::text::XTextContent
>& xSuccessor
) override
;
226 virtual void SAL_CALL
insertTextContentAfter(
227 const css::uno::Reference
< css::text::XTextContent
>& xNewContent
,
228 const css::uno::Reference
< css::text::XTextContent
>& xPredecessor
) override
;
230 // XRelativeTextContentRemove
231 virtual void SAL_CALL
removeTextContentBefore(
232 const css::uno::Reference
< css::text::XTextContent
>& xSuccessor
) override
;
233 virtual void SAL_CALL
removeTextContentAfter(
234 const css::uno::Reference
< css::text::XTextContent
>& xPredecessor
) override
;
237 #endif // INCLUDED_SW_INC_UNOTEXT_HXX
239 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */