update dev300-m58
[ooovba.git] / sw / inc / unoport.hxx
bloba94f312ebac96033785c5b9ee1736f2762aaf37e
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: unoport.hxx,v $
10 * $Revision: 1.20 $
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 _UNOPORT_HXX
31 #define _UNOPORT_HXX
32 #include <unoevtlstnr.hxx>
33 #include <calbck.hxx>
34 #include <cppuhelper/implbase6.hxx>
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/text/XTextRange.hpp>
37 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
38 #include <com/sun/star/container/XEnumerationAccess.hpp>
39 #include <com/sun/star/beans/XPropertyState.hpp>
40 #include <com/sun/star/beans/XMultiPropertySet.hpp>
41 #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
42 #include <com/sun/star/text/XTextField.hpp>
43 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #include <com/sun/star/lang/XUnoTunnel.hpp>
45 #include <cppuhelper/implbase8.hxx>
46 #include <cppuhelper/implbase9.hxx>
47 #include <svtools/itemprop.hxx>
49 class SwFmtFld;
50 class SwFrmFmt;
51 class SwUnoCrsr;
52 class SwTxtRuby;
53 /* -----------------29.05.98 14:42-------------------
55 * --------------------------------------------------*/
56 enum SwTextPortionType
58 PORTION_TEXT,
59 PORTION_FIELD,
60 PORTION_FRAME,
61 PORTION_FOOTNOTE,
62 PORTION_CONTROL_CHAR,
63 PORTION_REFMARK_START,
64 PORTION_REFMARK_END,
65 PORTION_TOXMARK_START,
66 PORTION_TOXMARK_END,
67 PORTION_BOOKMARK_START,
68 PORTION_BOOKMARK_END,
69 PORTION_REDLINE_START,
70 PORTION_REDLINE_END,
71 PORTION_RUBY_START,
72 PORTION_RUBY_END,
73 PORTION_SOFT_PAGEBREAK,
74 PORTION_FIELD_START,
75 PORTION_FIELD_END,
76 PORTION_FIELD_START_END
79 class SwXRubyPortion;
81 class SwXTextPortion : public cppu::WeakImplHelper9
83 ::com::sun::star::beans::XTolerantMultiPropertySet,
84 ::com::sun::star::beans::XMultiPropertySet,
85 ::com::sun::star::beans::XPropertySet,
86 ::com::sun::star::text::XTextRange,
87 ::com::sun::star::text::XTextField,
88 ::com::sun::star::beans::XPropertyState,
89 ::com::sun::star::container::XContentEnumerationAccess,
90 ::com::sun::star::lang::XUnoTunnel,
91 ::com::sun::star::lang::XServiceInfo
93 public SwClient
95 friend class SwXRubyPortion;
96 SwEventListenerContainer aLstnrCntnr;
97 const SfxItemPropertySet* m_pPropSet;
98 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
99 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xRefMark;
100 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xTOXMark;
101 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xBookmark;
102 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xFootnote;
103 ::com::sun::star::uno::Any* pRubyText;
104 ::com::sun::star::uno::Any* pRubyStyle;
105 ::com::sun::star::uno::Any* pRubyAdjust;
106 ::com::sun::star::uno::Any* pRubyIsAbove;
108 const SwFmtFld* pFmtFld;
109 SwDepend aFrameDepend;
110 SwFrmFmt* pFrameFmt;
111 SwTextPortionType ePortionType;
112 sal_Int16 nControlChar;
114 BOOL bIsCollapsed;
116 SwFmtFld* GetFldFmt(BOOL bInit = sal_False);
117 protected:
118 //SfxItemPropertySet& GetPropSet() { return aPropSet; }
120 void SAL_CALL SetPropertyValues_Impl(
121 const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
122 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
123 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);
124 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl(
125 const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
126 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
128 // ::com::sun::star::uno::Any GetPropertyValue( const SfxItemPropertyMap *pEntry,
129 // SwUnoCrsr *pUnoCrsr,
130 // SfxItemSet *pSet );
131 void GetPropertyValues( const ::rtl::OUString *pPropertyNames,
132 ::com::sun::star::uno::Any *pValues,
133 sal_Int32 nLength );
135 void GetPropertyValue( ::com::sun::star::uno::Any &rVal,
136 const SfxItemPropertySimpleEntry& rEntry, SwUnoCrsr *pUnoCrsr, SfxItemSet *&pSet );
138 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL GetPropertyValuesTolerant_Impl(
139 const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames,
140 sal_Bool bDirectValuesOnly ) throw (::com::sun::star::uno::RuntimeException);
142 virtual ~SwXTextPortion();
143 public:
144 SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwTextPortionType eType );
145 SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwFrmFmt& rFmt );
148 //XTextRange
149 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException );
150 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException );
151 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException );
152 virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException );
153 virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException );
155 //XTolerantMultiPropertySet
156 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
157 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
158 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
160 //XMultiPropertySet
161 // virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
162 virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
163 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException);
164 virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
165 virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
166 virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
168 //XPropertySet
169 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
170 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);
171 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);
172 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);
173 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);
174 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);
175 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);
177 //XPropertyState
178 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
179 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
180 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
181 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
183 //XTextField
184 virtual rtl::OUString SAL_CALL getPresentation(BOOL bShowCommand) throw( ::com::sun::star::uno::RuntimeException );
186 //XTextContent
187 virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
188 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException);
190 //XComponent
191 virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
192 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
193 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
195 //XUnoTunnel
196 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
197 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
199 //XServiceInfo
200 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
201 virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
202 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
204 //XContentEnumerationAccess
205 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException );
206 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
208 //SwClient
209 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
211 void SetRefMark( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xMark)
212 {xRefMark = xMark;}
214 void SetTOXMark( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xMark)
215 {xTOXMark = xMark;}
217 void SetBookmark( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xMark)
218 {xBookmark = xMark;}
220 void SetFootnote( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xMark)
221 {xFootnote = xMark;}
223 void SetControlChar(sal_Int16 nSet) {nControlChar = nSet;}
225 BOOL IsCollapsed() const { return bIsCollapsed;}
226 void SetCollapsed(BOOL bSet) { bIsCollapsed = bSet;}
228 SwTextPortionType GetTextPortionType() const {return ePortionType;}
230 SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); }
232 /* -----------------------------19.02.01 10:46--------------------------------
234 ---------------------------------------------------------------------------*/
235 class SwXRubyPortion : public SwXTextPortion
237 public:
238 SwXRubyPortion(const SwUnoCrsr* pPortionCrsr,
239 SwTxtRuby& rAttr,
240 ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent,
241 sal_Bool bEnd );
242 ~SwXRubyPortion();
244 #endif