xref: /aoo41x/main/sc/inc/notesuno.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_NOTESUNO_HXX
25cdf0e10cSrcweir #define SC_NOTESUNO_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/sheet/XSheetAnnotation.hpp>
28cdf0e10cSrcweir #include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
29cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
30cdf0e10cSrcweir #include <com/sun/star/container/XChild.hpp>
31cdf0e10cSrcweir #include <com/sun/star/text/XSimpleText.hpp>
32cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx>
33cdf0e10cSrcweir #include <svl/lstner.hxx>
34cdf0e10cSrcweir #include "address.hxx"
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class ScDocShell;
37cdf0e10cSrcweir class SvxUnoText;
38cdf0e10cSrcweir class ScPostIt;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class ScAnnotationObj : public cppu::WeakImplHelper5<
42cdf0e10cSrcweir 							com::sun::star::container::XChild,
43cdf0e10cSrcweir 							com::sun::star::text::XSimpleText,
44cdf0e10cSrcweir 							com::sun::star::sheet::XSheetAnnotation,
45cdf0e10cSrcweir                             com::sun::star::sheet::XSheetAnnotationShapeSupplier,
46cdf0e10cSrcweir 							com::sun::star::lang::XServiceInfo >,
47cdf0e10cSrcweir 						public SfxListener
48cdf0e10cSrcweir {
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir 							ScAnnotationObj(ScDocShell* pDocSh, const ScAddress& rPos);
51cdf0e10cSrcweir 	virtual					~ScAnnotationObj();
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 							// XChild
56cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
57cdf0e10cSrcweir 							getParent() throw(::com::sun::star::uno::RuntimeException);
58cdf0e10cSrcweir 	virtual void SAL_CALL	setParent( const ::com::sun::star::uno::Reference<
59cdf0e10cSrcweir 										::com::sun::star::uno::XInterface >& Parent )
60cdf0e10cSrcweir 									throw(::com::sun::star::lang::NoSupportException,
61cdf0e10cSrcweir 											::com::sun::star::uno::RuntimeException);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir                             // XSimpleText
64cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
65cdf0e10cSrcweir 							createTextCursor() throw(::com::sun::star::uno::RuntimeException);
66cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
67cdf0e10cSrcweir 							createTextCursorByRange( const ::com::sun::star::uno::Reference<
68cdf0e10cSrcweir 										::com::sun::star::text::XTextRange >& aTextPosition )
69cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
70cdf0e10cSrcweir 	virtual void SAL_CALL	insertString( const ::com::sun::star::uno::Reference<
71cdf0e10cSrcweir 										::com::sun::star::text::XTextRange >& xRange,
72cdf0e10cSrcweir 										const ::rtl::OUString& aString, sal_Bool bAbsorb )
73cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
74cdf0e10cSrcweir 	virtual void SAL_CALL	insertControlCharacter( const ::com::sun::star::uno::Reference<
75cdf0e10cSrcweir 										::com::sun::star::text::XTextRange >& xRange,
76cdf0e10cSrcweir 										sal_Int16 nControlCharacter, sal_Bool bAbsorb )
77cdf0e10cSrcweir 									throw(::com::sun::star::lang::IllegalArgumentException,
78cdf0e10cSrcweir 										::com::sun::star::uno::RuntimeException);
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 							// XTextRange
81cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL
82cdf0e10cSrcweir 							getText() throw(::com::sun::star::uno::RuntimeException);
83cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
84cdf0e10cSrcweir 							getStart() throw(::com::sun::star::uno::RuntimeException);
85cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
86cdf0e10cSrcweir 							getEnd() throw(::com::sun::star::uno::RuntimeException);
87cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
88cdf0e10cSrcweir 	virtual void SAL_CALL	setString( const ::rtl::OUString& aString )
89cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 							// XSheetAnnotation
92cdf0e10cSrcweir 	virtual ::com::sun::star::table::CellAddress SAL_CALL getPosition()
93cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
94cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getAuthor() throw(::com::sun::star::uno::RuntimeException);
95cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getDate() throw(::com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL getIsVisible() throw(::com::sun::star::uno::RuntimeException);
97cdf0e10cSrcweir 	virtual void SAL_CALL setIsVisible( sal_Bool bIsVisible )
98cdf0e10cSrcweir 									throw(::com::sun::star::uno::RuntimeException);
99cdf0e10cSrcweir 
100cdf0e10cSrcweir                             // XSheetAnnotationShapeSupplier
101cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > SAL_CALL
102cdf0e10cSrcweir                             getAnnotationShape()
103cdf0e10cSrcweir                                 throw(::com::sun::star::uno::RuntimeException);
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 							// XServiceInfo
106cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getImplementationName()
107cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
108cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
109cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
110cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
111cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException);
112cdf0e10cSrcweir 
113cdf0e10cSrcweir private:
114cdf0e10cSrcweir 	SvxUnoText&         GetUnoText();
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     const ScPostIt*     ImplGetNote() const;
117cdf0e10cSrcweir 
118cdf0e10cSrcweir private:
119cdf0e10cSrcweir 	ScDocShell*				pDocShell;
120cdf0e10cSrcweir 	ScAddress				aCellPos;
121cdf0e10cSrcweir 	SvxUnoText*				pUnoText;
122cdf0e10cSrcweir };
123cdf0e10cSrcweir 
124cdf0e10cSrcweir #endif
125