1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unoidx.hxx,v $
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 ************************************************************************/
33 #ifndef _COM_SUN_STAR_TEXT_XDOCUMENTINDEXMARK_HPP_
34 #include <com/sun/star/text/XDocumentIndexMark.hpp>
36 #ifndef _COM_SUN_STAR_TEXT_XDOCUMENTINDEX_HPP_
37 #include <com/sun/star/text/XDocumentIndex.hpp>
39 #ifndef _COM_SUN_STAR_CONTAINER_XINDEXREPLACE_HPP_
40 #include <com/sun/star/container/XIndexReplace.hpp>
46 #include <unocoll.hxx>
52 class SwTOXBaseSection
;
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
72 friend class SwXIndexStyleAccess_Impl
;
73 friend class SwXIndexTokenAccess_Impl
;
75 SwEventListenerContainer aLstnrCntnr
;
76 const SfxItemPropertyMap
* _pMap
;
78 const SwTOXBaseSection
* pBase
;
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
;}
103 virtual ~SwXDocumentIndex();
105 SwXDocumentIndex(const SwTOXBaseSection
* = 0, SwDoc
* = 0);
107 SwXDocumentIndex(TOXTypes eToxType
, SwDoc
& rDoc
);
112 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
115 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
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
);
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
);
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
);
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
);
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
);
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
);
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
165 SwEventListenerContainer aLstnrCntnr
;
166 SwDepend aTypeDepend
;
168 const SwTOXMark
* m_pTOXMark
;
169 const SfxItemPropertyMap
* _pMap
;
171 sal_Bool bIsDescriptor
;
177 String sSecondaryKey
;
179 String sPrimaryKeyReading
;
180 String sSecondaryKeyReading
;
181 String sUserIndexName
;
183 void InitMap(TOXTypes eToxType
);
185 virtual ~SwXDocumentIndexMark();
187 SwXDocumentIndexMark(TOXTypes eToxType
);
188 SwXDocumentIndexMark(const SwTOXType
* pType
,
189 const SwTOXMark
* pMark
,
195 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
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
);
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
);
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
);
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
);
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
);
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
,
238 /* -----------------05.05.99 12:27-------------------
240 * --------------------------------------------------*/
242 class SwXDocumentIndexes
: public SwCollectionBaseClass
,
243 public SwUnoCollection
246 virtual ~SwXDocumentIndexes();
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 );
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
);
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
);
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
);
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
;
293 virtual ~SwXIndexStyleAccess_Impl();
295 SwXIndexStyleAccess_Impl(SwXDocumentIndex
& rParentIdx
);
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
);
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
);
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
);
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
;
329 virtual ~SwXIndexTokenAccess_Impl();
331 SwXIndexTokenAccess_Impl(SwXDocumentIndex
& rParentIdx
);
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
);
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
);
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
);
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