android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / inc / unotext.hxx
blob7429d9f4cb66d86039c2c58e40dd132534e716b0
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/beans/XPropertySet.hpp>
24 #include <com/sun/star/text/XTextCopy.hpp>
25 #include <com/sun/star/text/XTextRangeCompare.hpp>
26 #include <com/sun/star/text/XRelativeTextContentInsert.hpp>
27 #include <com/sun/star/text/XRelativeTextContentRemove.hpp>
28 #include <com/sun/star/text/XTextAppendAndConvert.hpp>
29 #include <sal/types.h>
31 #include "unobaseclass.hxx"
33 namespace com::sun::star {
34 namespace text {
35 class XTextContent;
36 class XText;
40 class SwDoc;
41 class SwStartNode;
42 class SwPaM;
43 class SwXTextCursor;
45 class SAL_DLLPUBLIC_RTTI SwXText
46 : public css::lang::XTypeProvider
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
55 private:
57 class Impl;
58 ::sw::UnoImplPtr<Impl> m_pImpl;
60 virtual void PrepareForAttach(
61 css::uno::Reference< css::text::XTextRange > & xRange,
62 SwPaM const & rPam);
63 /// @throws css::lang::IllegalArgumentException
64 /// @throws css::uno::RuntimeException
65 virtual bool CheckForOwnMemberMeta(
66 const SwPaM & rPam, const bool bAbsorb);
68 protected:
70 bool IsValid() const;
71 void Invalidate();
72 void SetDoc(SwDoc *const pDoc);
74 virtual ~SwXText();
76 public: /*not protected because C++ is retarded*/
77 virtual const SwStartNode *GetStartNode() const;
79 public:
81 SwXText(SwDoc *const pDoc, const CursorType eType);
83 const SwDoc* GetDoc() const;
84 SwDoc* GetDoc();
86 // XInterface
87 virtual css::uno::Any SAL_CALL queryInterface(
88 const css::uno::Type& rType) override;
90 // XTypeProvider
91 virtual css::uno::Sequence< css::uno::Type >
92 SAL_CALL getTypes() override;
94 // XPropertySet
95 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
96 getPropertySetInfo() override;
97 virtual void SAL_CALL setPropertyValue(
98 const OUString& rPropertyName,
99 const css::uno::Any& rValue) override;
100 virtual css::uno::Any SAL_CALL getPropertyValue(
101 const OUString& rPropertyName) override;
102 virtual void SAL_CALL addPropertyChangeListener(
103 const OUString& rPropertyName,
104 const css::uno::Reference<
105 css::beans::XPropertyChangeListener >& xListener) override;
106 virtual void SAL_CALL removePropertyChangeListener(
107 const OUString& rPropertyName,
108 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
109 virtual void SAL_CALL addVetoableChangeListener(
110 const OUString& rPropertyName,
111 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
112 virtual void SAL_CALL removeVetoableChangeListener(
113 const OUString& rPropertyName,
114 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
116 // XTextRange
117 virtual css::uno::Reference< css::text::XText >
118 SAL_CALL getText() override;
119 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override;
120 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override;
121 virtual OUString SAL_CALL getString() override;
122 virtual void SAL_CALL setString(const OUString& rString) override;
124 // XSimpleText
125 virtual void SAL_CALL insertString(
126 const css::uno::Reference< css::text::XTextRange > & xRange,
127 const OUString& aString, sal_Bool bAbsorb) override;
128 virtual void SAL_CALL insertControlCharacter(
129 const css::uno::Reference< css::text::XTextRange > & xRange,
130 sal_Int16 nControlCharacter, sal_Bool bAbsorb) override;
131 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(
132 const ::css::uno::Reference< ::css::text::XTextRange >& aTextPosition ) override final;
133 virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(
134 const ::css::uno::Reference< ::css::text::XTextRange >& aTextPosition ) = 0;
135 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override final;
136 virtual rtl::Reference< SwXTextCursor > createXTextCursor() = 0;
138 // XText
139 virtual void SAL_CALL insertTextContent(
140 const css::uno::Reference< css::text::XTextRange > & xRange,
141 const css::uno::Reference< css::text::XTextContent > & xContent,
142 sal_Bool bAbsorb) override;
143 virtual void SAL_CALL removeTextContent(
144 const css::uno::Reference< css::text::XTextContent > & xContent) override;
146 // XParagraphAppend
147 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
148 finishParagraph(
149 const css::uno::Sequence< css::beans::PropertyValue >& rCharacterAndParagraphProperties) override;
150 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
151 finishParagraphInsert(
152 const css::uno::Sequence< css::beans::PropertyValue >& rCharacterAndParagraphProperties,
153 const css::uno::Reference< css::text::XTextRange >& xInsertPosition) override;
155 // XTextPortionAppend
156 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
157 appendTextPortion(
158 const OUString& rText,
159 const css::uno::Sequence< css::beans::PropertyValue >& rCharacterAndParagraphProperties) override;
161 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
162 insertTextPortion(
163 const OUString& rText,
164 const css::uno::Sequence< css::beans::PropertyValue >& rCharacterAndParagraphProperties,
165 const css::uno::Reference< css::text::XTextRange >& rTextRange) override;
167 // XTextContentAppend
168 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
169 appendTextContent(
170 const css::uno::Reference< css::text::XTextContent >& xTextContent,
171 const css::uno::Sequence< css::beans::PropertyValue >& rCharacterAndParagraphProperties) override;
172 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
173 insertTextContentWithProperties(
174 const css::uno::Reference< css::text::XTextContent >& xTextContent,
175 const css::uno::Sequence< css::beans::PropertyValue >& rCharacterAndParagraphProperties,
176 const css::uno::Reference< css::text::XTextRange >& xInsertPosition) override;
178 // XTextConvert
179 virtual css::uno::Reference< css::text::XTextContent > SAL_CALL
180 convertToTextFrame(
181 const css::uno::Reference< css::text::XTextRange >& xStart,
182 const css::uno::Reference< css::text::XTextRange >& xEnd,
183 const css::uno::Sequence< css::beans::PropertyValue >& xFrameProperties) override;
184 virtual css::uno::Reference<
185 css::text::XTextTable > SAL_CALL
186 convertToTable(
187 css::uno::Sequence<
188 css::uno::Sequence<
189 css::uno::Sequence<
190 css::uno::Reference<
191 css::text::XTextRange > > > > const&
192 rTableRanges,
193 css::uno::Sequence<
194 css::uno::Sequence<
195 css::uno::Sequence<
196 css::beans::PropertyValue > > > const&
197 rCellProperties,
198 css::uno::Sequence<
199 css::uno::Sequence<
200 css::beans::PropertyValue > > const&
201 rRowProperties,
202 css::uno::Sequence<
203 css::beans::PropertyValue > const&
204 rTableProperties) override;
206 // XTextCopy
207 virtual void SAL_CALL copyText(
208 const css::uno::Reference< css::text::XTextCopy >& xSource ) override;
210 // XTextRangeCompare
211 sal_Int16 SAL_CALL compareRegionStarts(
212 const css::uno::Reference< css::text::XTextRange >& xR1,
213 const css::uno::Reference< css::text::XTextRange >& xR2) override;
214 sal_Int16 SAL_CALL compareRegionEnds(
215 const css::uno::Reference< css::text::XTextRange >& xR1,
216 const css::uno::Reference< css::text::XTextRange >& xR2) override;
218 // XRelativeTextContentInsert
219 virtual void SAL_CALL insertTextContentBefore(
220 const css::uno::Reference< css::text::XTextContent>& xNewContent,
221 const css::uno::Reference< css::text::XTextContent>& xSuccessor) override;
222 virtual void SAL_CALL insertTextContentAfter(
223 const css::uno::Reference< css::text::XTextContent>& xNewContent,
224 const css::uno::Reference< css::text::XTextContent>& xPredecessor) override;
226 // XRelativeTextContentRemove
227 virtual void SAL_CALL removeTextContentBefore(
228 const css::uno::Reference< css::text::XTextContent>& xSuccessor) override;
229 virtual void SAL_CALL removeTextContentAfter(
230 const css::uno::Reference< css::text::XTextContent>& xPredecessor) override;
233 #endif // INCLUDED_SW_INC_UNOTEXT_HXX
235 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */