Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / unoidx.hxx
blob9a2dc640fd9cd01dbcff06a10406baeba03e81d2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unoidx.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _UNOIDX_HXX
31 #define _UNOIDX_HXX
33 #ifndef _COM_SUN_STAR_TEXT_XDOCUMENTINDEXMARK_HPP_
34 #include <com/sun/star/text/XDocumentIndexMark.hpp>
35 #endif
36 #ifndef _COM_SUN_STAR_TEXT_XDOCUMENTINDEX_HPP_
37 #include <com/sun/star/text/XDocumentIndex.hpp>
38 #endif
39 #ifndef _COM_SUN_STAR_CONTAINER_XINDEXREPLACE_HPP_
40 #include <com/sun/star/container/XIndexReplace.hpp>
41 #endif
42 #ifndef _UNOOBJ_HXX
43 #include <unoobj.hxx>
44 #endif
45 #ifndef _UNOCOLL_HXX
46 #include <unocoll.hxx>
47 #endif
48 #ifndef _TOXE_HXX
49 #include <toxe.hxx>
50 #endif
51 namespace binfilter {
52 class SwTOXBaseSection;
53 class SwTOXMark;
54 class SwTOXType;
55 /* -----------------07.12.98 10:08-------------------
57 * --------------------------------------------------*/
58 class SwDocIdxProperties_Impl;
59 class SwXIndexStyleAccess_Impl;
60 class SwXIndexTokenAccess_Impl;
62 class SwXDocumentIndex : public cppu::WeakImplHelper5
64 ::com::sun::star::text::XDocumentIndex,
65 ::com::sun::star::lang::XServiceInfo,
66 ::com::sun::star::beans::XPropertySet,
67 ::com::sun::star::container::XNamed,
68 ::com::sun::star::lang::XUnoTunnel
70 public SwClient
72 friend class SwXIndexStyleAccess_Impl;
73 friend class SwXIndexTokenAccess_Impl;
75 SwEventListenerContainer aLstnrCntnr;
76 const SfxItemPropertyMap* _pMap;
77 SwDoc* m_pDoc;
78 const SwTOXBaseSection* pBase;
79 TOXTypes eTOXType;
81 //Descriptor-Interface
82 sal_Bool bIsDescriptor;
83 SwDocIdxProperties_Impl* pProps;
85 SwXIndexStyleAccess_Impl* pStyleAccess;
86 SwXIndexTokenAccess_Impl* pTokenAccess;
88 SwSectionFmt* GetFmt()const {return (SwSectionFmt*)GetRegisteredIn();}
90 sal_Bool IsDescriptor() const {return bIsDescriptor;}
91 const SwDocIdxProperties_Impl* GetProperties_Impl() const { return pProps;}
92 SwDocIdxProperties_Impl* GetProperties_Impl() { return pProps;}
93 TOXTypes GetTOXType() const {return eTOXType;}
95 SwXIndexStyleAccess_Impl* GetStyleAccess() const {return pStyleAccess;}
96 void SetStyleAccess(SwXIndexStyleAccess_Impl* pSet)
97 {pStyleAccess = pSet;}
99 SwXIndexTokenAccess_Impl* GetTokenAccess() const {return pTokenAccess;}
100 void SetTokenAccess(SwXIndexTokenAccess_Impl* pSet)
101 {pTokenAccess = pSet;}
102 protected:
103 virtual ~SwXDocumentIndex();
104 public:
105 SwXDocumentIndex(const SwTOXBaseSection* = 0, SwDoc* = 0);
106 //Descriptor-Ctor
107 SwXDocumentIndex(TOXTypes eToxType, SwDoc& rDoc);
110 TYPEINFO();
112 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
114 //XUnoTunnel
115 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
117 //XDocumentIndex
118 virtual ::rtl::OUString SAL_CALL getServiceName( ) throw(::com::sun::star::uno::RuntimeException);
119 virtual void SAL_CALL update( ) throw(::com::sun::star::uno::RuntimeException);
121 //XPropertySet
122 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
123 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
124 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
125 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
126 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
127 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
128 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
130 //XTextContent
131 virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
132 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException );
134 //XComponent
135 virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
136 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
137 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
139 //XNamed
140 virtual ::rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException );
141 virtual void SAL_CALL setName(const ::rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException );
143 //XServiceInfo
144 virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
145 virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
146 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
148 //SwClient
149 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
151 void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
153 /* -----------------07.12.98 10:08-------------------
155 * --------------------------------------------------*/
156 class SwXDocumentIndexMark : public cppu::WeakImplHelper4
158 ::com::sun::star::text::XDocumentIndexMark,
159 ::com::sun::star::lang::XServiceInfo,
160 ::com::sun::star::beans::XPropertySet,
161 ::com::sun::star::lang::XUnoTunnel
163 public SwClient
165 SwEventListenerContainer aLstnrCntnr;
166 SwDepend aTypeDepend;
167 SwDoc* m_pDoc;
168 const SwTOXMark* m_pTOXMark;
169 const SfxItemPropertyMap* _pMap;
171 sal_Bool bIsDescriptor;
172 sal_Bool bMainEntry;
173 TOXTypes eType;
174 sal_uInt16 nLevel;
175 String sAltText;
176 String sPrimaryKey;
177 String sSecondaryKey;
178 String sTextReading;
179 String sPrimaryKeyReading;
180 String sSecondaryKeyReading;
181 String sUserIndexName;
183 void InitMap(TOXTypes eToxType);
184 protected:
185 virtual ~SwXDocumentIndexMark();
186 public:
187 SwXDocumentIndexMark(TOXTypes eToxType);
188 SwXDocumentIndexMark(const SwTOXType* pType,
189 const SwTOXMark* pMark,
190 SwDoc* pDc);
193 TYPEINFO();
195 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
197 //XUnoTunnel
198 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
200 virtual ::rtl::OUString SAL_CALL getMarkEntry(void) throw( ::com::sun::star::uno::RuntimeException );
201 virtual void SAL_CALL setMarkEntry(const ::rtl::OUString& aIndexEntry) throw( ::com::sun::star::uno::RuntimeException );
203 //XTextContent
204 virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
205 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException );
207 //XComponent
208 virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
209 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
210 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
212 //XPropertySet
213 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
214 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
215 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
216 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
217 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
218 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
219 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
221 //XServiceInfo
222 virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
223 virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
224 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
226 //SwClient
227 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
229 void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
231 SwTOXType* GetTOXType() const {return (SwTOXType*)aTypeDepend.GetRegisteredIn();}
232 const SwTOXMark* GetTOXMark() const {return m_pTOXMark;}
234 static SwXDocumentIndexMark* GetObject(SwTOXType* pType, const SwTOXMark* pMark,
235 SwDoc* pDoc);
236 void Invalidate();
238 /* -----------------05.05.99 12:27-------------------
240 * --------------------------------------------------*/
242 class SwXDocumentIndexes : public SwCollectionBaseClass,
243 public SwUnoCollection
245 protected:
246 virtual ~SwXDocumentIndexes();
247 public:
248 SwXDocumentIndexes(SwDoc* pDoc);
251 // SMART_UNO_DECLARATION( SwXDocumentIndexes, UsrObject );
253 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
254 // virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void)
256 // throw( ::com::sun::star::uno::RuntimeException );
257 // automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen!
258 // virtual sal_Bool queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rOut );
261 //XNameAccess
262 virtual ::com::sun::star::uno::Any SAL_CALL getByName(const ::rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
263 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException );
264 virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException );
266 //XIndexAccess
267 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
268 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
270 //XElementAccess
271 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
272 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
274 //XServiceInfo
275 virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
276 virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
277 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
279 static SwXDocumentIndex* GetObject(const SwTOXBaseSection* pTOX);
281 /* -----------------13.09.99 16:39-------------------
283 --------------------------------------------------*/
284 class SwXIndexStyleAccess_Impl : public cppu::WeakImplHelper2
286 ::com::sun::star::container::XIndexReplace,
287 ::com::sun::star::lang::XServiceInfo
290 SwXDocumentIndex& rParent;
291 ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndex > xParent;
292 protected:
293 virtual ~SwXIndexStyleAccess_Impl();
294 public:
295 SwXIndexStyleAccess_Impl(SwXDocumentIndex& rParentIdx);
298 //XIndexReplace
299 virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
301 //XIndexAccess
302 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
303 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
305 //XElementAccess
306 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
307 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
309 //XServiceInfo
310 virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
311 virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
312 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
316 /* -----------------13.09.99 16:39-------------------
318 --------------------------------------------------*/
319 class SwXIndexTokenAccess_Impl : public cppu::WeakImplHelper2
321 ::com::sun::star::container::XIndexReplace,
322 ::com::sun::star::lang::XServiceInfo
325 SwXDocumentIndex& rParent;
326 ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndex > xParent;
327 sal_Int32 nCount;
328 protected:
329 virtual ~SwXIndexTokenAccess_Impl();
330 public:
331 SwXIndexTokenAccess_Impl(SwXDocumentIndex& rParentIdx);
335 //XIndexReplace
336 virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
338 //XIndexAccess
339 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
340 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
342 //XElementAccess
343 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
344 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
346 //XServiceInfo
347 virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
348 virtual BOOL SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
349 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
353 } //namespace binfilter
354 #endif