update dev300-m57
[ooovba.git] / sw / inc / unoredline.hxx
blob508bbb2a7af829816951ab50b9f77e912dcc164e
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: unoredline.hxx,v $
10 * $Revision: 1.13 $
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 _UNOREDLINE_HXX
31 #define _UNOREDLINE_HXX
33 #include <unoport.hxx>
34 #include <unoobj.hxx>
36 class SwRedline;
37 /* -----------------------------19.12.00 11:35--------------------------------
39 ---------------------------------------------------------------------------*/
41 /**
42 * SwXRedlineText provides an XText which may be used to write
43 * directly into a redline node. It got implemented to enable XML
44 * import of redlines and should not be used directly via the API.
46 class SwXRedlineText :
47 public SwXText,
48 public cppu::OWeakObject,
49 public ::com::sun::star::container::XEnumerationAccess
51 SwNodeIndex aNodeIndex;
52 virtual const SwStartNode *GetStartNode() const;
54 public:
55 SwXRedlineText(SwDoc* pDoc, SwNodeIndex aNodeIndex);
57 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
58 virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();}
59 virtual void SAL_CALL release( ) throw(){OWeakObject::release();}
61 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
62 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
64 //XText
65 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException );
66 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException );
68 //XEnumerationAccess
69 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
71 //XElementAccess (via XEnumerationAccess)
72 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
73 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
75 /* ---------------------------------------------------------------------------
77 ---------------------------------------------------------------------------*/
78 class SwXRedlinePortion : public SwXTextPortion
80 const SwRedline* pRedline;
82 void Validate() throw( ::com::sun::star::uno::RuntimeException );
84 using SwXTextPortion::GetPropertyValue;
86 public:
87 SwXRedlinePortion( const SwRedline* pRed,
88 const SwUnoCrsr* pPortionCrsr,
89 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent,
90 BOOL bIsStart);
92 ~SwXRedlinePortion();
94 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
96 //XPropertySet
97 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);
99 static ::com::sun::star::uno::Any GetPropertyValue( const ::rtl::OUString& PropertyName, const SwRedline& rRedline ) throw();
100 static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > CreateRedlineProperties( const SwRedline& rRedline, sal_Bool bIsStart ) throw();
103 /* -----------------------------11.01.01 16:52--------------------------------
105 ---------------------------------------------------------------------------*/
106 typedef
107 cppu::WeakImplHelper1
109 ::com::sun::star::container::XEnumerationAccess
111 SwXRedlineBaseClass;
112 class SwXRedline :
113 public SwXRedlineBaseClass,
114 public SwXText,
115 public SwClient
117 SwDoc* pDoc;
118 SwRedline* pRedline;
119 public:
120 SwXRedline(SwRedline& rRedline, SwDoc& rDoc);
121 ~SwXRedline();
123 TYPEINFO();
125 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
126 virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();}
127 virtual void SAL_CALL release( ) throw(){OWeakObject::release();}
129 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
130 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
132 //XText
133 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException );
134 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException );
136 //XPropertySet
137 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
138 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);
139 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);
140 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);
141 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);
142 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);
143 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);
145 //XEnumerationAccess
146 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
148 //XElementAccess
149 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
150 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
152 //SwClient
153 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
155 const SwRedline* GetRedline() const {return pRedline;}
157 #endif