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: unoredline.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 ************************************************************************/
30 #ifndef _UNOREDLINE_HXX
31 #define _UNOREDLINE_HXX
33 #include <unoport.hxx>
37 /* -----------------------------19.12.00 11:35--------------------------------
39 ---------------------------------------------------------------------------*/
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
:
48 public cppu::OWeakObject
,
49 public ::com::sun::star::container::XEnumerationAccess
51 SwNodeIndex aNodeIndex
;
52 virtual const SwStartNode
*GetStartNode() const;
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
);
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
);
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
;
87 SwXRedlinePortion( const SwRedline
* pRed
,
88 const SwUnoCrsr
* pPortionCrsr
,
89 ::com::sun::star::uno::Reference
< ::com::sun::star::text::XText
> xParent
,
94 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
);
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 ---------------------------------------------------------------------------*/
107 cppu::WeakImplHelper1
109 ::com::sun::star::container::XEnumerationAccess
113 public SwXRedlineBaseClass
,
120 SwXRedline(SwRedline
& rRedline
, SwDoc
& rDoc
);
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
);
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
);
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
);
146 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException
);
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
);
153 virtual void Modify( SfxPoolItem
*pOld
, SfxPoolItem
*pNew
);
155 const SwRedline
* GetRedline() const {return pRedline
;}