fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sw / inc / unotextrange.hxx
blob6d0e8f0f5d0dd55e5d504cc39c4b309c9b7edc4a
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 SW_UNOTEXTRANGE_HXX
21 #define SW_UNOTEXTRANGE_HXX
23 #include <com/sun/star/lang/XUnoTunnel.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/beans/XPropertyState.hpp>
27 #include <com/sun/star/container/XIndexAccess.hpp>
28 #include <com/sun/star/container/XEnumerationAccess.hpp>
29 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
30 #include <com/sun/star/text/XTextRange.hpp>
31 #include <com/sun/star/text/XRedline.hpp>
33 #include <cppuhelper/implbase3.hxx>
34 #include <cppuhelper/implbase8.hxx>
36 #include <pam.hxx>
37 #include <unobaseclass.hxx>
40 class SwDoc;
41 struct SwPosition;
42 class SwPaM;
43 class SwUnoCrsr;
44 class SwFrmFmt;
46 class SW_DLLPUBLIC SwUnoInternalPaM
47 : public SwPaM
50 private:
51 SwUnoInternalPaM(const SwUnoInternalPaM&);
53 public:
54 SwUnoInternalPaM(SwDoc& rDoc);
55 virtual ~SwUnoInternalPaM();
57 SwUnoInternalPaM& operator=(const SwPaM& rPaM);
61 namespace sw {
63 void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget);
65 SW_DLLPUBLIC bool XTextRangeToSwPaM(SwUnoInternalPaM& rToFill,
66 const ::com::sun::star::uno::Reference<
67 ::com::sun::star::text::XTextRange > & xTextRange);
69 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
70 CreateParentXText(SwDoc & rDoc, const SwPosition& rPos);
72 bool GetDefaultTextContentValue(::com::sun::star::uno::Any& rAny,
73 const OUString& rPropertyName, sal_uInt16 nWID = 0);
75 } // namespace sw
78 typedef ::cppu::WeakImplHelper8
79 < ::com::sun::star::lang::XUnoTunnel
80 , ::com::sun::star::lang::XServiceInfo
81 , ::com::sun::star::beans::XPropertySet
82 , ::com::sun::star::beans::XPropertyState
83 , ::com::sun::star::container::XEnumerationAccess
84 , ::com::sun::star::container::XContentEnumerationAccess
85 , ::com::sun::star::text::XTextRange
86 , ::com::sun::star::text::XRedline
87 > SwXTextRange_Base;
89 class SW_DLLPUBLIC SwXTextRange
90 : public SwXTextRange_Base
93 private:
95 friend class SwXText;
97 class Impl;
98 ::sw::UnoImplPtr<Impl> m_pImpl;
100 enum RangePosition
102 RANGE_IN_TEXT, // "ordinary" ::com::sun::star::text::TextRange
103 RANGE_IN_CELL, // position created with a cell that has no uno object
104 RANGE_IS_TABLE, // anchor of a table
107 void SetPositions(SwPaM const& rPam);
108 //TODO: new exception type for protected content
109 void DeleteAndInsert(
110 const OUString& rText, const bool bForceExpandHints)
111 throw (::com::sun::star::uno::RuntimeException);
112 void Invalidate();
114 virtual ~SwXTextRange();
116 public:
118 SwXTextRange(SwPaM& rPam,
119 const ::com::sun::star::uno::Reference<
120 ::com::sun::star::text::XText > & xParent,
121 const enum RangePosition eRange = RANGE_IN_TEXT);
122 // only for RANGE_IS_TABLE
123 SwXTextRange(SwFrmFmt& rTblFmt);
125 const SwDoc* GetDoc() const;
126 SwDoc* GetDoc();
127 bool GetPositions(SwPaM & rToFill) const;
129 static ::com::sun::star::uno::Reference<
130 ::com::sun::star::text::XTextRange > CreateXTextRange(
131 SwDoc & rDoc,
132 const SwPosition& rPos, const SwPosition *const pMark);
134 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
136 // XUnoTunnel
137 virtual sal_Int64 SAL_CALL getSomething(
138 const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier)
139 throw (::com::sun::star::uno::RuntimeException);
141 // XServiceInfo
142 virtual OUString SAL_CALL getImplementationName()
143 throw (::com::sun::star::uno::RuntimeException);
144 virtual sal_Bool SAL_CALL supportsService(
145 const OUString& rServiceName)
146 throw (::com::sun::star::uno::RuntimeException);
147 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
148 getSupportedServiceNames()
149 throw (::com::sun::star::uno::RuntimeException);
151 // XPropertySet
152 virtual ::com::sun::star::uno::Reference<
153 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
154 getPropertySetInfo()
155 throw (::com::sun::star::uno::RuntimeException);
156 virtual void SAL_CALL setPropertyValue(
157 const OUString& rPropertyName,
158 const ::com::sun::star::uno::Any& rValue)
159 throw (::com::sun::star::beans::UnknownPropertyException,
160 ::com::sun::star::beans::PropertyVetoException,
161 ::com::sun::star::lang::IllegalArgumentException,
162 ::com::sun::star::lang::WrappedTargetException,
163 ::com::sun::star::uno::RuntimeException);
164 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
165 const OUString& rPropertyName)
166 throw (::com::sun::star::beans::UnknownPropertyException,
167 ::com::sun::star::lang::WrappedTargetException,
168 ::com::sun::star::uno::RuntimeException);
169 virtual void SAL_CALL addPropertyChangeListener(
170 const OUString& rPropertyName,
171 const ::com::sun::star::uno::Reference<
172 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
173 throw (::com::sun::star::beans::UnknownPropertyException,
174 ::com::sun::star::lang::WrappedTargetException,
175 ::com::sun::star::uno::RuntimeException);
176 virtual void SAL_CALL removePropertyChangeListener(
177 const OUString& rPropertyName,
178 const ::com::sun::star::uno::Reference<
179 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
180 throw (::com::sun::star::beans::UnknownPropertyException,
181 ::com::sun::star::lang::WrappedTargetException,
182 ::com::sun::star::uno::RuntimeException);
183 virtual void SAL_CALL addVetoableChangeListener(
184 const OUString& rPropertyName,
185 const ::com::sun::star::uno::Reference<
186 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
187 throw (::com::sun::star::beans::UnknownPropertyException,
188 ::com::sun::star::lang::WrappedTargetException,
189 ::com::sun::star::uno::RuntimeException);
190 virtual void SAL_CALL removeVetoableChangeListener(
191 const OUString& rPropertyName,
192 const ::com::sun::star::uno::Reference<
193 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
194 throw (::com::sun::star::beans::UnknownPropertyException,
195 ::com::sun::star::lang::WrappedTargetException,
196 ::com::sun::star::uno::RuntimeException);
198 // XPropertyState
199 virtual ::com::sun::star::beans::PropertyState SAL_CALL
200 getPropertyState(const OUString& rPropertyName)
201 throw (::com::sun::star::beans::UnknownPropertyException,
202 ::com::sun::star::uno::RuntimeException);
203 virtual ::com::sun::star::uno::Sequence<
204 ::com::sun::star::beans::PropertyState > SAL_CALL
205 getPropertyStates(
206 const ::com::sun::star::uno::Sequence<
207 OUString >& rPropertyNames)
208 throw (::com::sun::star::beans::UnknownPropertyException,
209 ::com::sun::star::uno::RuntimeException);
210 virtual void SAL_CALL setPropertyToDefault(
211 const OUString& rPropertyName)
212 throw (::com::sun::star::beans::UnknownPropertyException,
213 ::com::sun::star::uno::RuntimeException);
214 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
215 const OUString& rPropertyName)
216 throw (::com::sun::star::beans::UnknownPropertyException,
217 ::com::sun::star::lang::WrappedTargetException,
218 ::com::sun::star::uno::RuntimeException);
220 // XElementAccess
221 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
222 throw (::com::sun::star::uno::RuntimeException);
223 virtual sal_Bool SAL_CALL hasElements()
224 throw (::com::sun::star::uno::RuntimeException);
226 // XEnumerationAccess
227 virtual ::com::sun::star::uno::Reference<
228 ::com::sun::star::container::XEnumeration > SAL_CALL
229 createEnumeration()
230 throw (::com::sun::star::uno::RuntimeException);
232 // XContentEnumerationAccess
233 virtual ::com::sun::star::uno::Reference<
234 ::com::sun::star::container::XEnumeration > SAL_CALL
235 createContentEnumeration(const OUString& rServiceName)
236 throw (::com::sun::star::uno::RuntimeException);
237 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
238 getAvailableServiceNames()
239 throw (::com::sun::star::uno::RuntimeException);
241 // XTextRange
242 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
243 SAL_CALL getText()
244 throw (::com::sun::star::uno::RuntimeException);
245 virtual ::com::sun::star::uno::Reference<
246 ::com::sun::star::text::XTextRange > SAL_CALL getStart()
247 throw (::com::sun::star::uno::RuntimeException);
248 virtual ::com::sun::star::uno::Reference<
249 ::com::sun::star::text::XTextRange > SAL_CALL getEnd()
250 throw (::com::sun::star::uno::RuntimeException);
251 virtual OUString SAL_CALL getString()
252 throw (::com::sun::star::uno::RuntimeException);
253 virtual void SAL_CALL setString(const OUString& rString)
254 throw (::com::sun::star::uno::RuntimeException);
256 // XRedline
257 virtual void SAL_CALL makeRedline(
258 const OUString& rRedlineType,
259 const ::com::sun::star::uno::Sequence<
260 ::com::sun::star::beans::PropertyValue >& RedlineProperties)
261 throw (::com::sun::star::lang::IllegalArgumentException,
262 ::com::sun::star::uno::RuntimeException);
266 typedef ::cppu::WeakImplHelper3
267 < ::com::sun::star::lang::XUnoTunnel
268 , ::com::sun::star::lang::XServiceInfo
269 , ::com::sun::star::container::XIndexAccess
270 > SwXTextRanges_Base;
272 class SwXTextRanges
273 : public SwXTextRanges_Base
276 private:
278 class Impl;
279 ::sw::UnoImplPtr<Impl> m_pImpl;
281 virtual ~SwXTextRanges();
283 public:
285 SwXTextRanges(SwPaM *const pCrsr);
287 const SwUnoCrsr* GetCursor() const;
289 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
291 // XUnoTunnel
292 virtual sal_Int64 SAL_CALL getSomething(
293 const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier)
294 throw (::com::sun::star::uno::RuntimeException);
296 // XServiceInfo
297 virtual OUString SAL_CALL getImplementationName()
298 throw (::com::sun::star::uno::RuntimeException);
299 virtual sal_Bool SAL_CALL supportsService(
300 const OUString& rServiceName)
301 throw (::com::sun::star::uno::RuntimeException);
302 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
303 getSupportedServiceNames()
304 throw (::com::sun::star::uno::RuntimeException);
306 // XElementAccess
307 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
308 throw (::com::sun::star::uno::RuntimeException);
309 virtual sal_Bool SAL_CALL hasElements()
310 throw (::com::sun::star::uno::RuntimeException);
312 // XIndexAccess
313 virtual sal_Int32 SAL_CALL getCount()
314 throw (::com::sun::star::uno::RuntimeException);
315 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex)
316 throw (::com::sun::star::lang::IndexOutOfBoundsException,
317 ::com::sun::star::lang::WrappedTargetException,
318 ::com::sun::star::uno::RuntimeException);
322 #endif // SW_UNOTEXTRANGE_HXX
324 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */