xref: /trunk/main/sw/inc/unoredlines.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _UNOREDLINES_HXX
28 #define _UNOREDLINES_HXX
29 
30 #include <unocoll.hxx>
31 #include <unobaseclass.hxx>
32 #include <com/sun/star/container/XEnumerationAccess.hpp>
33 
34 class SwRedline;
35 namespace com{ namespace sun{ namespace star{
36 		namespace beans{
37 			class XPropertySet;
38 		}
39 }}}
40 typedef
41 cppu::WeakImplHelper3
42 <
43 	::com::sun::star::container::XIndexAccess,
44 	::com::sun::star::container::XEnumerationAccess,
45 	::com::sun::star::lang::XServiceInfo
46 >
47 SwRedlinesBaseClass;
48 class SwXRedlines : public SwRedlinesBaseClass,
49 	public SwUnoCollection
50 {
51 protected:
52 	virtual ~SwXRedlines();
53 public:
54 	SwXRedlines(SwDoc* pDoc);
55 
56 
57 	//XIndexAccess
58     virtual sal_Int32 SAL_CALL getCount(  ) throw(::com::sun::star::uno::RuntimeException);
59 	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 );
60 
61 	//XEnumerationAccess - frueher XParagraphEnumerationAccess
62 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >  SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
63 
64 	//XElementAccess
65     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
66     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
67 
68 	//XServiceInfo
69 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
70 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
71 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
72 
73 	static ::com::sun::star::beans::XPropertySet* 			GetObject( SwRedline& rRedline, SwDoc& rDoc );
74 };
75 /* -----------------------------12.01.01 14:58--------------------------------
76 
77  ---------------------------------------------------------------------------*/
78 class SwXRedlineEnumeration
79     : public SwSimpleEnumeration_Base
80     , public SwClient
81 {
82 	SwDoc* pDoc;
83 	sal_uInt16 nCurrentIndex;
84 protected:
85 	virtual ~SwXRedlineEnumeration();
86 public:
87 	SwXRedlineEnumeration(SwDoc& rDoc);
88 
89 
90 	//XEnumeration
91 	virtual sal_Bool SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException );
92 	virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
93 
94 	//XServiceInfo
95 	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
96 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
97 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
98 protected:
99 	//SwClient
100    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
101 };
102 
103 
104 #endif
105 
106