xref: /aoo41x/main/sw/inc/unoredline.hxx (revision 1d2dbeb0)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _UNOREDLINE_HXX
24cdf0e10cSrcweir #define _UNOREDLINE_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <unoport.hxx>
27cdf0e10cSrcweir #include <unotext.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class SwRedline;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir /* -----------------------------19.12.00 11:35--------------------------------
33cdf0e10cSrcweir 
34cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
35cdf0e10cSrcweir 
36cdf0e10cSrcweir /**
37cdf0e10cSrcweir  * SwXRedlineText provides an XText which may be used to write
38cdf0e10cSrcweir  * directly into a redline node. It got implemented to enable XML
39cdf0e10cSrcweir  * import of redlines and should not be used directly via the API.
40cdf0e10cSrcweir  */
41cdf0e10cSrcweir class SwXRedlineText :
42cdf0e10cSrcweir 	public SwXText,
43cdf0e10cSrcweir 	public cppu::OWeakObject,
44cdf0e10cSrcweir 	public ::com::sun::star::container::XEnumerationAccess
45cdf0e10cSrcweir {
46cdf0e10cSrcweir 	SwNodeIndex aNodeIndex;
47cdf0e10cSrcweir 	virtual const SwStartNode *GetStartNode() const;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir 	SwXRedlineText(SwDoc* pDoc, SwNodeIndex aNodeIndex);
51cdf0e10cSrcweir 
52cdf0e10cSrcweir     virtual 	::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
acquire()53cdf0e10cSrcweir     virtual void SAL_CALL acquire(  ) throw(){OWeakObject::acquire();}
release()54cdf0e10cSrcweir     virtual void SAL_CALL release(  ) throw(){OWeakObject::release();}
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
57cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 	//XText
60cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >  SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException );
61cdf0e10cSrcweir 	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 );
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	//XEnumerationAccess
64cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >  SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	//XElementAccess (via XEnumerationAccess)
67cdf0e10cSrcweir     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
69cdf0e10cSrcweir };
70cdf0e10cSrcweir /* ---------------------------------------------------------------------------
71cdf0e10cSrcweir 
72cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
73cdf0e10cSrcweir class SwXRedlinePortion : public SwXTextPortion
74cdf0e10cSrcweir {
75cdf0e10cSrcweir 	const SwRedline*	pRedline;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 	void Validate() throw( ::com::sun::star::uno::RuntimeException );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     using SwXTextPortion::GetPropertyValue;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir public:
82cdf0e10cSrcweir 	SwXRedlinePortion(	const SwRedline* pRed,
83cdf0e10cSrcweir 						const SwUnoCrsr* pPortionCrsr,
84cdf0e10cSrcweir 						::com::sun::star::uno::Reference< ::com::sun::star::text::XText >  xParent,
85cdf0e10cSrcweir 						sal_Bool bIsStart);
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 	~SwXRedlinePortion();
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	//XPropertySet
92cdf0e10cSrcweir 	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);
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	static ::com::sun::star::uno::Any  GetPropertyValue( const ::rtl::OUString& PropertyName, const SwRedline& rRedline ) throw();
95cdf0e10cSrcweir     static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > CreateRedlineProperties( const SwRedline& rRedline, sal_Bool bIsStart ) throw();
96cdf0e10cSrcweir 
97cdf0e10cSrcweir };
98cdf0e10cSrcweir /* -----------------------------11.01.01 16:52--------------------------------
99cdf0e10cSrcweir 
100cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
101cdf0e10cSrcweir typedef
102cdf0e10cSrcweir cppu::WeakImplHelper1
103cdf0e10cSrcweir <
104cdf0e10cSrcweir 	::com::sun::star::container::XEnumerationAccess
105cdf0e10cSrcweir >
106cdf0e10cSrcweir SwXRedlineBaseClass;
107cdf0e10cSrcweir class SwXRedline :
108cdf0e10cSrcweir 		public SwXRedlineBaseClass,
109cdf0e10cSrcweir 		public SwXText,
110cdf0e10cSrcweir 		public SwClient
111cdf0e10cSrcweir {
112cdf0e10cSrcweir 	SwDoc* 		pDoc;
113cdf0e10cSrcweir 	SwRedline* 	pRedline;
114cdf0e10cSrcweir public:
115cdf0e10cSrcweir 	SwXRedline(SwRedline& rRedline, SwDoc& rDoc);
116cdf0e10cSrcweir 	~SwXRedline();
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 	TYPEINFO();
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	virtual 	::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
acquire()121cdf0e10cSrcweir     virtual void SAL_CALL acquire(  ) throw(){OWeakObject::acquire();}
release()122cdf0e10cSrcweir     virtual void SAL_CALL release(  ) throw(){OWeakObject::release();}
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
125cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 	//XText
128cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >  SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException );
129cdf0e10cSrcweir 	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 );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	//XPropertySet
132cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
133cdf0e10cSrcweir     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);
134cdf0e10cSrcweir     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);
135cdf0e10cSrcweir     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);
136cdf0e10cSrcweir     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);
137cdf0e10cSrcweir     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);
138cdf0e10cSrcweir     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);
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 	//XEnumerationAccess
141cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >  SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 	//XElementAccess
144cdf0e10cSrcweir     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
145cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
146cdf0e10cSrcweir 
GetRedline() const147cdf0e10cSrcweir 	const SwRedline* 	GetRedline() const {return pRedline;}
148cdf0e10cSrcweir protected:
149cdf0e10cSrcweir 	//SwClient
150cdf0e10cSrcweir    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
151cdf0e10cSrcweir };
152cdf0e10cSrcweir #endif
153