1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef _UNOREDLINE_HXX
28 #define _UNOREDLINE_HXX
30 #include <unoport.hxx>
31 #include <unotext.hxx>
36 /* -----------------------------19.12.00 11:35--------------------------------
38 ---------------------------------------------------------------------------*/
41 * SwXRedlineText provides an XText which may be used to write
42 * directly into a redline node. It got implemented to enable XML
43 * import of redlines and should not be used directly via the API.
45 class SwXRedlineText
:
47 public cppu::OWeakObject
,
48 public ::com::sun::star::container::XEnumerationAccess
50 SwNodeIndex aNodeIndex
;
51 virtual const SwStartNode
*GetStartNode() const;
54 SwXRedlineText(SwDoc
* pDoc
, SwNodeIndex aNodeIndex
);
56 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
) throw(::com::sun::star::uno::RuntimeException
);
57 virtual void SAL_CALL
acquire( ) throw(){OWeakObject::acquire();}
58 virtual void SAL_CALL
release( ) throw(){OWeakObject::release();}
60 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
);
61 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
);
64 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextCursor
> SAL_CALL
createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException
);
65 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 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException
);
70 //XElementAccess (via XEnumerationAccess)
71 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw(::com::sun::star::uno::RuntimeException
);
72 virtual sal_Bool SAL_CALL
hasElements( ) throw(::com::sun::star::uno::RuntimeException
);
74 /* ---------------------------------------------------------------------------
76 ---------------------------------------------------------------------------*/
77 class SwXRedlinePortion
: public SwXTextPortion
79 const SwRedline
* pRedline
;
81 void Validate() throw( ::com::sun::star::uno::RuntimeException
);
83 using SwXTextPortion::GetPropertyValue
;
86 SwXRedlinePortion( const SwRedline
* pRed
,
87 const SwUnoCrsr
* pPortionCrsr
,
88 ::com::sun::star::uno::Reference
< ::com::sun::star::text::XText
> xParent
,
93 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
);
96 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
);
98 static ::com::sun::star::uno::Any
GetPropertyValue( const ::rtl::OUString
& PropertyName
, const SwRedline
& rRedline
) throw();
99 static ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> CreateRedlineProperties( const SwRedline
& rRedline
, sal_Bool bIsStart
) throw();
102 /* -----------------------------11.01.01 16:52--------------------------------
104 ---------------------------------------------------------------------------*/
106 cppu::WeakImplHelper1
108 ::com::sun::star::container::XEnumerationAccess
112 public SwXRedlineBaseClass
,
119 SwXRedline(SwRedline
& rRedline
, SwDoc
& rDoc
);
124 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
) throw(::com::sun::star::uno::RuntimeException
);
125 virtual void SAL_CALL
acquire( ) throw(){OWeakObject::acquire();}
126 virtual void SAL_CALL
release( ) throw(){OWeakObject::release();}
128 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
);
129 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
);
132 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextCursor
> SAL_CALL
createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException
);
133 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 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
137 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
);
138 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
);
139 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
);
140 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
);
141 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
);
142 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 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException
);
148 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw(::com::sun::star::uno::RuntimeException
);
149 virtual sal_Bool SAL_CALL
hasElements( ) throw(::com::sun::star::uno::RuntimeException
);
152 virtual void Modify( SfxPoolItem
*pOld
, SfxPoolItem
*pNew
);
154 const SwRedline
* GetRedline() const {return pRedline
;}