Resolves tdf#142513 - Order of ZoomIn and ZoomOut at Print Preview
[LibreOffice.git] / sw / inc / unotext.hxx
blob14d61a5486dc2a55ee4032e5dc3e3d3ceb977337
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/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 {
34 namespace text {
35 class XTextContent;
36 class XText;
40 class SwDoc;
41 class SwStartNode;
42 class SwPaM;
44 class SwXText
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
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 /// @throws css::uno::RuntimeException
87 virtual css::uno::Reference< css::text::XTextCursor >
88 CreateCursor();
90 // XInterface
91 virtual css::uno::Any SAL_CALL queryInterface(
92 const css::uno::Type& rType) override;
94 // XTypeProvider
95 virtual css::uno::Sequence< css::uno::Type >
96 SAL_CALL getTypes() override;
98 static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
100 // XUnoTunnel
101 virtual sal_Int64 SAL_CALL getSomething(
102 const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
104 // XPropertySet
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;
126 // XTextRange
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;
134 // XSimpleText
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;
142 // XText
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;
150 // XParagraphAppend
151 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
152 finishParagraph(
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
161 appendTextPortion(
162 const OUString& rText,
163 const css::uno::Sequence< css::beans::PropertyValue >& rCharacterAndParagraphProperties) override;
165 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
166 insertTextPortion(
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
173 appendTextContent(
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;
182 // XTextConvert
183 virtual css::uno::Reference< css::text::XTextContent > SAL_CALL
184 convertToTextFrame(
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
190 convertToTable(
191 css::uno::Sequence<
192 css::uno::Sequence<
193 css::uno::Sequence<
194 css::uno::Reference<
195 css::text::XTextRange > > > > const&
196 rTableRanges,
197 css::uno::Sequence<
198 css::uno::Sequence<
199 css::uno::Sequence<
200 css::beans::PropertyValue > > > const&
201 rCellProperties,
202 css::uno::Sequence<
203 css::uno::Sequence<
204 css::beans::PropertyValue > > const&
205 rRowProperties,
206 css::uno::Sequence<
207 css::beans::PropertyValue > const&
208 rTableProperties) override;
210 // XTextCopy
211 virtual void SAL_CALL copyText(
212 const css::uno::Reference< css::text::XTextCopy >& xSource ) override;
214 // XTextRangeCompare
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: */