xref: /aoo42x/main/sw/inc/unoidx.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _UNOIDX_HXX
24 #define _UNOIDX_HXX
25 
26 #include <com/sun/star/lang/XUnoTunnel.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/container/XNamed.hpp>
29 #include <com/sun/star/text/XDocumentIndexMark.hpp>
30 #include <com/sun/star/text/XDocumentIndex.hpp>
31 
32 #include <cppuhelper/implbase4.hxx>
33 #include <cppuhelper/implbase5.hxx>
34 
35 #include <sfx2/Metadatable.hxx>
36 
37 #include <unocoll.hxx>
38 #include <toxe.hxx>
39 
40 
41 class SwTOXBaseSection;
42 class SwTOXMark;
43 class SwTOXType;
44 
45 /* -----------------07.12.98 10:08-------------------
46  *
47  * --------------------------------------------------*/
48 
49 typedef ::cppu::ImplInheritanceHelper5
50 <   ::sfx2::MetadatableMixin
51 ,   ::com::sun::star::lang::XUnoTunnel
52 ,   ::com::sun::star::lang::XServiceInfo
53 ,   ::com::sun::star::beans::XPropertySet
54 ,   ::com::sun::star::container::XNamed
55 ,   ::com::sun::star::text::XDocumentIndex
56 > SwXDocumentIndex_Base;
57 
58 class SwXDocumentIndex
59     : public SwXDocumentIndex_Base
60 {
61 
62 private:
63 
64     class StyleAccess_Impl;
65     class TokenAccess_Impl;
66 
67     class Impl;
68     ::sw::UnoImplPtr<Impl> m_pImpl;
69 
70 	virtual ~SwXDocumentIndex();
71 
72     SwXDocumentIndex(SwTOXBaseSection const&, SwDoc &);
73 
74 public:
75 
76     /// descriptor
77     SwXDocumentIndex(const TOXTypes eToxType, SwDoc& rDoc);
78 
79     static ::com::sun::star::uno::Reference<
80             ::com::sun::star::text::XDocumentIndex>
81         CreateXDocumentIndex(SwDoc & rDoc, SwTOXBaseSection const& rSection);
82 
83     // MetadatableMixin
84     virtual ::sfx2::Metadatable* GetCoreObject();
85     virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
86         GetModel();
87 
88 	static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
89 
90     // XUnoTunnel
91     virtual sal_Int64 SAL_CALL getSomething(
92             const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier)
93         throw (::com::sun::star::uno::RuntimeException);
94 
95     // XServiceInfo
96     virtual ::rtl::OUString SAL_CALL getImplementationName()
97         throw (::com::sun::star::uno::RuntimeException);
98     virtual sal_Bool SAL_CALL supportsService(
99             const ::rtl::OUString& rServiceName)
100         throw (::com::sun::star::uno::RuntimeException);
101     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
102         getSupportedServiceNames()
103         throw (::com::sun::star::uno::RuntimeException);
104 
105     // XComponent
106     virtual void SAL_CALL dispose()
107         throw (::com::sun::star::uno::RuntimeException);
108     virtual void SAL_CALL addEventListener(
109             const ::com::sun::star::uno::Reference<
110                 ::com::sun::star::lang::XEventListener > & xListener)
111         throw (::com::sun::star::uno::RuntimeException);
112     virtual void SAL_CALL removeEventListener(
113             const ::com::sun::star::uno::Reference<
114                 ::com::sun::star::lang::XEventListener > & xListener)
115         throw (::com::sun::star::uno::RuntimeException);
116 
117     // XPropertySet
118     virtual ::com::sun::star::uno::Reference<
119                 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
120         getPropertySetInfo()
121         throw (::com::sun::star::uno::RuntimeException);
122     virtual void SAL_CALL setPropertyValue(
123             const ::rtl::OUString& rPropertyName,
124             const ::com::sun::star::uno::Any& rValue)
125         throw (::com::sun::star::beans::UnknownPropertyException,
126                 ::com::sun::star::beans::PropertyVetoException,
127                 ::com::sun::star::lang::IllegalArgumentException,
128                 ::com::sun::star::lang::WrappedTargetException,
129                 ::com::sun::star::uno::RuntimeException);
130     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
131             const ::rtl::OUString& rPropertyName)
132         throw (::com::sun::star::beans::UnknownPropertyException,
133                 ::com::sun::star::lang::WrappedTargetException,
134                 ::com::sun::star::uno::RuntimeException);
135     virtual void SAL_CALL addPropertyChangeListener(
136             const ::rtl::OUString& rPropertyName,
137             const ::com::sun::star::uno::Reference<
138                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
139         throw (::com::sun::star::beans::UnknownPropertyException,
140                 ::com::sun::star::lang::WrappedTargetException,
141                 ::com::sun::star::uno::RuntimeException);
142     virtual void SAL_CALL removePropertyChangeListener(
143             const ::rtl::OUString& rPropertyName,
144             const ::com::sun::star::uno::Reference<
145                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
146         throw (::com::sun::star::beans::UnknownPropertyException,
147                 ::com::sun::star::lang::WrappedTargetException,
148                 ::com::sun::star::uno::RuntimeException);
149     virtual void SAL_CALL addVetoableChangeListener(
150             const ::rtl::OUString& rPropertyName,
151             const ::com::sun::star::uno::Reference<
152                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
153         throw (::com::sun::star::beans::UnknownPropertyException,
154                 ::com::sun::star::lang::WrappedTargetException,
155                 ::com::sun::star::uno::RuntimeException);
156     virtual void SAL_CALL removeVetoableChangeListener(
157             const ::rtl::OUString& rPropertyName,
158             const ::com::sun::star::uno::Reference<
159                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
160         throw (::com::sun::star::beans::UnknownPropertyException,
161                 ::com::sun::star::lang::WrappedTargetException,
162                 ::com::sun::star::uno::RuntimeException);
163 
164     // XNamed
165     virtual ::rtl::OUString SAL_CALL getName()
166         throw (::com::sun::star::uno::RuntimeException);
167     virtual void SAL_CALL setName(const ::rtl::OUString& rName)
168         throw (::com::sun::star::uno::RuntimeException);
169 
170     // XTextContent
171     virtual void SAL_CALL attach(
172             const ::com::sun::star::uno::Reference<
173                 ::com::sun::star::text::XTextRange > & xTextRange)
174         throw (::com::sun::star::lang::IllegalArgumentException,
175                 ::com::sun::star::uno::RuntimeException);
176     virtual ::com::sun::star::uno::Reference<
177                 ::com::sun::star::text::XTextRange > SAL_CALL getAnchor()
178         throw (::com::sun::star::uno::RuntimeException);
179 
180 
181     // XDocumentIndex
182     virtual ::rtl::OUString SAL_CALL getServiceName()
183         throw (::com::sun::star::uno::RuntimeException);
184     virtual void SAL_CALL update()
185         throw (::com::sun::star::uno::RuntimeException);
186 
187 };
188 
189 /* -----------------07.12.98 10:08-------------------
190  *
191  * --------------------------------------------------*/
192 typedef ::cppu::WeakImplHelper4
193 <   ::com::sun::star::lang::XUnoTunnel
194 ,   ::com::sun::star::lang::XServiceInfo
195 ,   ::com::sun::star::beans::XPropertySet
196 ,   ::com::sun::star::text::XDocumentIndexMark
197 > SwXDocumentIndexMark_Base;
198 
199 class SwXDocumentIndexMark
200     : public SwXDocumentIndexMark_Base
201 {
202 
203 private:
204 
205     class Impl;
206     ::sw::UnoImplPtr<Impl> m_pImpl;
207 
208 	virtual ~SwXDocumentIndexMark();
209 
210     SwXDocumentIndexMark(SwDoc & rDoc,
211                 SwTOXType & rType, SwTOXMark & rMark);
212 
213 public:
214 
215     /// descriptor
216     SwXDocumentIndexMark(const TOXTypes eToxType);
217 
218     static ::com::sun::star::uno::Reference<
219             ::com::sun::star::text::XDocumentIndexMark>
220         CreateXDocumentIndexMark(SwDoc & rDoc,
221                 SwTOXType & rType, SwTOXMark & rMark);
222 
223 	static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
224 
225     // XUnoTunnel
226     virtual sal_Int64 SAL_CALL getSomething(
227             const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier)
228         throw (::com::sun::star::uno::RuntimeException);
229 
230     // XServiceInfo
231     virtual ::rtl::OUString SAL_CALL getImplementationName()
232         throw (::com::sun::star::uno::RuntimeException);
233     virtual sal_Bool SAL_CALL supportsService(
234             const ::rtl::OUString& rServiceName)
235         throw (::com::sun::star::uno::RuntimeException);
236     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
237         getSupportedServiceNames()
238         throw (::com::sun::star::uno::RuntimeException);
239 
240     // XComponent
241     virtual void SAL_CALL dispose()
242         throw (::com::sun::star::uno::RuntimeException);
243     virtual void SAL_CALL addEventListener(
244             const ::com::sun::star::uno::Reference<
245                 ::com::sun::star::lang::XEventListener > & xListener)
246         throw (::com::sun::star::uno::RuntimeException);
247     virtual void SAL_CALL removeEventListener(
248             const ::com::sun::star::uno::Reference<
249                 ::com::sun::star::lang::XEventListener > & xListener)
250         throw (::com::sun::star::uno::RuntimeException);
251 
252     // XPropertySet
253     virtual ::com::sun::star::uno::Reference<
254                 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
255         getPropertySetInfo()
256         throw (::com::sun::star::uno::RuntimeException);
257     virtual void SAL_CALL setPropertyValue(
258             const ::rtl::OUString& rPropertyName,
259             const ::com::sun::star::uno::Any& rValue)
260         throw (::com::sun::star::beans::UnknownPropertyException,
261                 ::com::sun::star::beans::PropertyVetoException,
262                 ::com::sun::star::lang::IllegalArgumentException,
263                 ::com::sun::star::lang::WrappedTargetException,
264                 ::com::sun::star::uno::RuntimeException);
265     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
266             const ::rtl::OUString& rPropertyName)
267         throw (::com::sun::star::beans::UnknownPropertyException,
268                 ::com::sun::star::lang::WrappedTargetException,
269                 ::com::sun::star::uno::RuntimeException);
270     virtual void SAL_CALL addPropertyChangeListener(
271             const ::rtl::OUString& rPropertyName,
272             const ::com::sun::star::uno::Reference<
273                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
274         throw (::com::sun::star::beans::UnknownPropertyException,
275                 ::com::sun::star::lang::WrappedTargetException,
276                 ::com::sun::star::uno::RuntimeException);
277     virtual void SAL_CALL removePropertyChangeListener(
278             const ::rtl::OUString& rPropertyName,
279             const ::com::sun::star::uno::Reference<
280                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
281         throw (::com::sun::star::beans::UnknownPropertyException,
282                 ::com::sun::star::lang::WrappedTargetException,
283                 ::com::sun::star::uno::RuntimeException);
284     virtual void SAL_CALL addVetoableChangeListener(
285             const ::rtl::OUString& rPropertyName,
286             const ::com::sun::star::uno::Reference<
287                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
288         throw (::com::sun::star::beans::UnknownPropertyException,
289                 ::com::sun::star::lang::WrappedTargetException,
290                 ::com::sun::star::uno::RuntimeException);
291     virtual void SAL_CALL removeVetoableChangeListener(
292             const ::rtl::OUString& rPropertyName,
293             const ::com::sun::star::uno::Reference<
294                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
295         throw (::com::sun::star::beans::UnknownPropertyException,
296                 ::com::sun::star::lang::WrappedTargetException,
297                 ::com::sun::star::uno::RuntimeException);
298 
299     // XTextContent
300     virtual void SAL_CALL attach(
301             const ::com::sun::star::uno::Reference<
302                 ::com::sun::star::text::XTextRange > & xTextRange)
303         throw (::com::sun::star::lang::IllegalArgumentException,
304                 ::com::sun::star::uno::RuntimeException);
305     virtual ::com::sun::star::uno::Reference<
306                 ::com::sun::star::text::XTextRange > SAL_CALL getAnchor()
307         throw (::com::sun::star::uno::RuntimeException);
308 
309     // XDocumentIndexMark
310     virtual rtl::OUString SAL_CALL getMarkEntry()
311         throw (::com::sun::star::uno::RuntimeException);
312     virtual void SAL_CALL setMarkEntry(const rtl::OUString& rIndexEntry)
313         throw (::com::sun::star::uno::RuntimeException);
314 
315 };
316 
317 /* -----------------05.05.99 12:27-------------------
318  *
319  * --------------------------------------------------*/
320 class SwXDocumentIndexes
321     : public SwCollectionBaseClass
322     , public SwUnoCollection
323 {
324 
325 private:
326 
327 	virtual ~SwXDocumentIndexes();
328 
329 public:
330 
331     SwXDocumentIndexes(SwDoc *const pDoc);
332 
333     // XServiceInfo
334     virtual ::rtl::OUString SAL_CALL getImplementationName()
335         throw (::com::sun::star::uno::RuntimeException);
336     virtual sal_Bool SAL_CALL supportsService(
337             const ::rtl::OUString& rServiceName)
338         throw (::com::sun::star::uno::RuntimeException);
339     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
340         getSupportedServiceNames()
341         throw (::com::sun::star::uno::RuntimeException);
342 
343     // XElementAccess
344     virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
345         throw (::com::sun::star::uno::RuntimeException);
346     virtual sal_Bool SAL_CALL hasElements()
347         throw (::com::sun::star::uno::RuntimeException);
348 
349     // XIndexAccess
350     virtual sal_Int32 SAL_CALL getCount()
351         throw (::com::sun::star::uno::RuntimeException);
352     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex)
353         throw (::com::sun::star::lang::IndexOutOfBoundsException,
354                 ::com::sun::star::lang::WrappedTargetException,
355                 ::com::sun::star::uno::RuntimeException);
356 
357     // XNameAccess
358     virtual ::com::sun::star::uno::Any SAL_CALL getByName(
359             const ::rtl::OUString& rName)
360         throw (::com::sun::star::container::NoSuchElementException,
361                 ::com::sun::star::lang::WrappedTargetException,
362                 ::com::sun::star::uno::RuntimeException);
363     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
364         getElementNames() throw (::com::sun::star::uno::RuntimeException);
365     virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& rName)
366         throw (::com::sun::star::uno::RuntimeException);
367 
368 };
369 
370 #endif
371 
372