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: notesuno.hxx,v $
10 * $Revision: 1.5.128.2 $
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 ************************************************************************/
31 #ifndef SC_NOTESUNO_HXX
32 #define SC_NOTESUNO_HXX
34 #include "address.hxx"
35 #include <svtools/lstner.hxx>
36 #include <com/sun/star/sheet/XSheetAnnotation.hpp>
37 #include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/container/XChild.hpp>
40 #include <com/sun/star/text/XSimpleText.hpp>
41 #include <com/sun/star/text/XTextRangeMover.hpp>
42 #include <com/sun/star/drawing/XShape.hpp>
43 #include <cppuhelper/implbase5.hxx>
44 #include <cppuhelper/implbase10.hxx>
52 class ScAnnotationObj
: public cppu::WeakImplHelper5
<
53 com::sun::star::container::XChild
,
54 com::sun::star::text::XSimpleText
,
55 com::sun::star::sheet::XSheetAnnotation
,
56 com::sun::star::sheet::XSheetAnnotationShapeSupplier
,
57 com::sun::star::lang::XServiceInfo
>,
61 ScAnnotationObj(ScDocShell
* pDocSh
, const ScAddress
& rPos
);
62 virtual ~ScAnnotationObj();
64 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
67 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
68 getParent() throw(::com::sun::star::uno::RuntimeException
);
69 virtual void SAL_CALL
setParent( const ::com::sun::star::uno::Reference
<
70 ::com::sun::star::uno::XInterface
>& Parent
)
71 throw(::com::sun::star::lang::NoSupportException
,
72 ::com::sun::star::uno::RuntimeException
);
75 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextCursor
> SAL_CALL
76 createTextCursor() throw(::com::sun::star::uno::RuntimeException
);
77 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextCursor
> SAL_CALL
78 createTextCursorByRange( const ::com::sun::star::uno::Reference
<
79 ::com::sun::star::text::XTextRange
>& aTextPosition
)
80 throw(::com::sun::star::uno::RuntimeException
);
81 virtual void SAL_CALL
insertString( const ::com::sun::star::uno::Reference
<
82 ::com::sun::star::text::XTextRange
>& xRange
,
83 const ::rtl::OUString
& aString
, sal_Bool bAbsorb
)
84 throw(::com::sun::star::uno::RuntimeException
);
85 virtual void SAL_CALL
insertControlCharacter( const ::com::sun::star::uno::Reference
<
86 ::com::sun::star::text::XTextRange
>& xRange
,
87 sal_Int16 nControlCharacter
, sal_Bool bAbsorb
)
88 throw(::com::sun::star::lang::IllegalArgumentException
,
89 ::com::sun::star::uno::RuntimeException
);
92 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XText
> SAL_CALL
93 getText() throw(::com::sun::star::uno::RuntimeException
);
94 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextRange
> SAL_CALL
95 getStart() throw(::com::sun::star::uno::RuntimeException
);
96 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextRange
> SAL_CALL
97 getEnd() throw(::com::sun::star::uno::RuntimeException
);
98 virtual ::rtl::OUString SAL_CALL
getString() throw(::com::sun::star::uno::RuntimeException
);
99 virtual void SAL_CALL
setString( const ::rtl::OUString
& aString
)
100 throw(::com::sun::star::uno::RuntimeException
);
103 virtual ::com::sun::star::table::CellAddress SAL_CALL
getPosition()
104 throw(::com::sun::star::uno::RuntimeException
);
105 virtual ::rtl::OUString SAL_CALL
getAuthor() throw(::com::sun::star::uno::RuntimeException
);
106 virtual ::rtl::OUString SAL_CALL
getDate() throw(::com::sun::star::uno::RuntimeException
);
107 virtual sal_Bool SAL_CALL
getIsVisible() throw(::com::sun::star::uno::RuntimeException
);
108 virtual void SAL_CALL
setIsVisible( sal_Bool bIsVisible
)
109 throw(::com::sun::star::uno::RuntimeException
);
111 // XSheetAnnotationShapeSupplier
112 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> SAL_CALL
114 throw(::com::sun::star::uno::RuntimeException
);
117 virtual ::rtl::OUString SAL_CALL
getImplementationName()
118 throw(::com::sun::star::uno::RuntimeException
);
119 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
)
120 throw(::com::sun::star::uno::RuntimeException
);
121 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames()
122 throw(::com::sun::star::uno::RuntimeException
);
125 SvxUnoText
& GetUnoText();
127 const ScPostIt
* ImplGetNote() const;
130 ScDocShell
* pDocShell
;
132 SvxUnoText
* pUnoText
;
135 class ScAnnotationShapeObj
: public cppu::WeakImplHelper10
<
136 com::sun::star::lang::XComponent
,
137 com::sun::star::container::XChild
,
138 com::sun::star::text::XText
,
139 com::sun::star::container::XEnumerationAccess
,
140 com::sun::star::text::XTextRangeMover
,
141 com::sun::star::drawing::XShape
,
142 com::sun::star::beans::XPropertySet
,
143 com::sun::star::beans::XMultiPropertySet
,
144 com::sun::star::beans::XPropertyState
,
145 com::sun::star::lang::XServiceInfo
>,
149 ScDocShell
* pDocShell
;
151 SvxUnoText
* pUnoText
;
152 com::sun::star::uno::Reference
< com::sun::star::drawing::XShape
> xShape
;
155 SvxUnoText
& GetUnoText();
156 com::sun::star::uno::Reference
< com::sun::star::drawing::XShape
> GetXShape();
159 ScAnnotationShapeObj(ScDocShell
* pDocSh
, const ScAddress
& rPos
);
160 virtual ~ScAnnotationShapeObj();
162 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
165 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
166 getParent() throw(::com::sun::star::uno::RuntimeException
);
167 virtual void SAL_CALL
setParent( const ::com::sun::star::uno::Reference
<
168 ::com::sun::star::uno::XInterface
>& Parent
)
169 throw(::com::sun::star::lang::NoSupportException
,
170 ::com::sun::star::uno::RuntimeException
);
173 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw (::com::sun::star::uno::RuntimeException
);
174 virtual ::sal_Bool SAL_CALL
hasElements( ) throw (::com::sun::star::uno::RuntimeException
);
176 // XEnumerationAccess
177 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
178 createEnumeration( ) throw (::com::sun::star::uno::RuntimeException
);
181 virtual void SAL_CALL
moveTextRange( const ::com::sun::star::uno::Reference
<
182 ::com::sun::star::text::XTextRange
>& xRange
,
183 ::sal_Int16 nParagraphs
)
184 throw (::com::sun::star::uno::RuntimeException
);
187 virtual void SAL_CALL
insertTextContent( const ::com::sun::star::uno::Reference
<
188 ::com::sun::star::text::XTextRange
>& xRange
,
189 const ::com::sun::star::uno::Reference
<
190 ::com::sun::star::text::XTextContent
>& xContent
,
192 throw (::com::sun::star::lang::IllegalArgumentException
,
193 ::com::sun::star::uno::RuntimeException
);
194 virtual void SAL_CALL
removeTextContent( const ::com::sun::star::uno::Reference
<
195 ::com::sun::star::text::XTextContent
>& xContent
)
196 throw (::com::sun::star::container::NoSuchElementException
,
197 ::com::sun::star::uno::RuntimeException
);
200 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextCursor
> SAL_CALL
201 createTextCursor() throw(::com::sun::star::uno::RuntimeException
);
202 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextCursor
> SAL_CALL
203 createTextCursorByRange( const ::com::sun::star::uno::Reference
<
204 ::com::sun::star::text::XTextRange
>& aTextPosition
)
205 throw(::com::sun::star::uno::RuntimeException
);
206 virtual void SAL_CALL
insertString( const ::com::sun::star::uno::Reference
<
207 ::com::sun::star::text::XTextRange
>& xRange
,
208 const ::rtl::OUString
& aString
, sal_Bool bAbsorb
)
209 throw(::com::sun::star::uno::RuntimeException
);
210 virtual void SAL_CALL
insertControlCharacter( const ::com::sun::star::uno::Reference
<
211 ::com::sun::star::text::XTextRange
>& xRange
,
212 sal_Int16 nControlCharacter
, sal_Bool bAbsorb
)
213 throw(::com::sun::star::lang::IllegalArgumentException
,
214 ::com::sun::star::uno::RuntimeException
);
217 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XText
> SAL_CALL
218 getText() throw(::com::sun::star::uno::RuntimeException
);
219 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextRange
> SAL_CALL
220 getStart() throw(::com::sun::star::uno::RuntimeException
);
221 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::text::XTextRange
> SAL_CALL
222 getEnd() throw(::com::sun::star::uno::RuntimeException
);
223 virtual ::rtl::OUString SAL_CALL
getString() throw(::com::sun::star::uno::RuntimeException
);
224 virtual void SAL_CALL
setString( const ::rtl::OUString
& aString
)
225 throw(::com::sun::star::uno::RuntimeException
);
228 virtual ::rtl::OUString SAL_CALL
getShapeType( ) throw (::com::sun::star::uno::RuntimeException
);
231 virtual ::com::sun::star::awt::Point SAL_CALL
getPosition( ) throw (::com::sun::star::uno::RuntimeException
);
232 virtual void SAL_CALL
setPosition( const ::com::sun::star::awt::Point
& aPosition
) throw (::com::sun::star::uno::RuntimeException
);
233 virtual ::com::sun::star::awt::Size SAL_CALL
getSize( ) throw (::com::sun::star::uno::RuntimeException
);
234 virtual void SAL_CALL
setSize( const ::com::sun::star::awt::Size
& aSize
)
235 throw (::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::uno::RuntimeException
);
238 virtual ::com::sun::star::beans::PropertyState SAL_CALL
getPropertyState( const ::rtl::OUString
& PropertyName
)
239 throw (::com::sun::star::beans::UnknownPropertyException
,
240 ::com::sun::star::uno::RuntimeException
);
241 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyState
> SAL_CALL
getPropertyStates(
242 const ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& aPropertyName
)
243 throw (::com::sun::star::beans::UnknownPropertyException
,
244 ::com::sun::star::uno::RuntimeException
);
245 virtual void SAL_CALL
setPropertyToDefault( const ::rtl::OUString
& PropertyName
)
246 throw (::com::sun::star::beans::UnknownPropertyException
,
247 ::com::sun::star::uno::RuntimeException
);
248 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyDefault( const ::rtl::OUString
& aPropertyName
)
249 throw (::com::sun::star::beans::UnknownPropertyException
,
250 ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
253 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( )
254 throw (::com::sun::star::uno::RuntimeException
);
255 virtual void SAL_CALL
setPropertyValue( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
)
256 throw (::com::sun::star::beans::UnknownPropertyException
,
257 ::com::sun::star::beans::PropertyVetoException
,
258 ::com::sun::star::lang::IllegalArgumentException
,
259 ::com::sun::star::lang::WrappedTargetException
,
260 ::com::sun::star::uno::RuntimeException
);
261 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const ::rtl::OUString
& PropertyName
)
262 throw (::com::sun::star::beans::UnknownPropertyException
,
263 ::com::sun::star::lang::WrappedTargetException
,
264 ::com::sun::star::uno::RuntimeException
);
265 virtual void SAL_CALL
addPropertyChangeListener( const ::rtl::OUString
& aPropertyName
,
266 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
)
267 throw (::com::sun::star::beans::UnknownPropertyException
,
268 ::com::sun::star::lang::WrappedTargetException
,
269 ::com::sun::star::uno::RuntimeException
);
270 virtual void SAL_CALL
removePropertyChangeListener( const ::rtl::OUString
& aPropertyName
,
271 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
)
272 throw (::com::sun::star::beans::UnknownPropertyException
,
273 ::com::sun::star::lang::WrappedTargetException
,
274 ::com::sun::star::uno::RuntimeException
);
275 virtual void SAL_CALL
addVetoableChangeListener( const ::rtl::OUString
& PropertyName
,
276 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
)
277 throw (::com::sun::star::beans::UnknownPropertyException
,
278 ::com::sun::star::lang::WrappedTargetException
,
279 ::com::sun::star::uno::RuntimeException
);
280 virtual void SAL_CALL
removeVetoableChangeListener( const ::rtl::OUString
& PropertyName
,
281 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
)
282 throw (::com::sun::star::beans::UnknownPropertyException
,
283 ::com::sun::star::lang::WrappedTargetException
,
284 ::com::sun::star::uno::RuntimeException
);
287 virtual void SAL_CALL
setPropertyValues( const ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& aPropertyNames
,
288 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aValues
)
289 throw (::com::sun::star::beans::PropertyVetoException
,
290 ::com::sun::star::lang::IllegalArgumentException
,
291 ::com::sun::star::lang::WrappedTargetException
,
292 ::com::sun::star::uno::RuntimeException
);
293 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> SAL_CALL
getPropertyValues(
294 const ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& aPropertyNames
)
295 throw (::com::sun::star::uno::RuntimeException
);
296 virtual void SAL_CALL
addPropertiesChangeListener( const ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& aPropertyNames
,
297 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
)
298 throw (::com::sun::star::uno::RuntimeException
);
299 virtual void SAL_CALL
removePropertiesChangeListener( const ::com::sun::star::uno::Reference
<
300 ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
)
301 throw (::com::sun::star::uno::RuntimeException
);
302 virtual void SAL_CALL
firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& aPropertyNames
,
303 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
)
304 throw (::com::sun::star::uno::RuntimeException
);
307 virtual void SAL_CALL
dispose( ) throw (::com::sun::star::uno::RuntimeException
);
308 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& xListener
)
309 throw (::com::sun::star::uno::RuntimeException
);
310 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
)
311 throw (::com::sun::star::uno::RuntimeException
);
314 virtual ::rtl::OUString SAL_CALL
getImplementationName()
315 throw(::com::sun::star::uno::RuntimeException
);
316 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
)
317 throw(::com::sun::star::uno::RuntimeException
);
318 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames()
319 throw(::com::sun::star::uno::RuntimeException
);