Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / sw / inc / unotext.hxx
blob65a1ecc94d36994c6504bca42418902b3a1166e3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 {
35 namespace text {
36 class XTextContent;
38 } } }
40 class SfxItemPropertySet;
41 class SwDoc;
42 class SwStartNode;
43 class SwPaM;
44 class OTextCursorHelper;
45 class SwXTextRange;
47 class SwXText
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
58 private:
60 class Impl;
61 ::sw::UnoImplPtr<Impl> m_pImpl;
63 virtual void PrepareForAttach(
64 css::uno::Reference< css::text::XTextRange > & xRange,
65 SwPaM const & rPam);
66 /// @throws css::lang::IllegalArgumentException
67 /// @throws css::uno::RuntimeException
68 virtual bool CheckForOwnMemberMeta(
69 const SwPaM & rPam, const bool bAbsorb);
71 protected:
73 bool IsValid() const;
74 void Invalidate();
75 void SetDoc(SwDoc *const pDoc);
77 virtual ~SwXText();
79 public: /*not protected because C++ is retarded*/
80 virtual const SwStartNode *GetStartNode() const;
82 public:
84 SwXText(SwDoc *const pDoc, const CursorType eType);
86 const SwDoc* GetDoc() const;
87 SwDoc* GetDoc();
89 /// @throws css::uno::RuntimeException
90 virtual css::uno::Reference< css::text::XTextCursor >
91 CreateCursor();
93 // XInterface
94 virtual css::uno::Any SAL_CALL queryInterface(
95 const css::uno::Type& rType) override;
97 // XTypeProvider
98 virtual css::uno::Sequence< css::uno::Type >
99 SAL_CALL getTypes() override;
101 static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
103 // XUnoTunnel
104 virtual sal_Int64 SAL_CALL getSomething(
105 const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
107 // XPropertySet
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;
129 // XTextRange
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;
137 // XSimpleText
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;
145 // XText
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;
153 // XParagraphAppend
154 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
155 finishParagraph(
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
164 appendTextPortion(
165 const OUString& rText,
166 const css::uno::Sequence< css::beans::PropertyValue >& rCharacterAndParagraphProperties) override;
168 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
169 insertTextPortion(
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
176 appendTextContent(
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;
185 // XTextConvert
186 virtual css::uno::Reference< css::text::XTextContent > SAL_CALL
187 convertToTextFrame(
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
193 convertToTable(
194 css::uno::Sequence<
195 css::uno::Sequence<
196 css::uno::Sequence<
197 css::uno::Reference<
198 css::text::XTextRange > > > > const&
199 rTableRanges,
200 css::uno::Sequence<
201 css::uno::Sequence<
202 css::uno::Sequence<
203 css::beans::PropertyValue > > > const&
204 rCellProperties,
205 css::uno::Sequence<
206 css::uno::Sequence<
207 css::beans::PropertyValue > > const&
208 rRowProperties,
209 css::uno::Sequence<
210 css::beans::PropertyValue > const&
211 rTableProperties) override;
213 // XTextCopy
214 virtual void SAL_CALL copyText(
215 const css::uno::Reference< css::text::XTextCopy >& xSource ) override;
217 // XTextRangeCompare
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: */