xref: /trunk/main/sc/source/ui/vba/vbacomment.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef SC_VBA_COMMENT_HXX
24 #define SC_VBA_COMMENT_HXX
25 
26 #include <cppuhelper/implbase1.hxx>
27 
28 #include <ooo/vba/excel/XComment.hpp>
29 #include <ooo/vba/excel/XApplication.hpp>
30 #include <ooo/vba/msforms/XShape.hpp>
31 #include <com/sun/star/sheet/XSheetAnnotations.hpp>
32 #include <com/sun/star/sheet/XSheetAnnotation.hpp>
33 #include <com/sun/star/table/XCellRange.hpp>
34 #include <com/sun/star/uno/XComponentContext.hpp>
35 
36 #include <vbahelper/vbahelperinterface.hxx>
37 
38 typedef InheritedHelperInterfaceImpl1< ov::excel::XComment > ScVbaComment_BASE;
39 
40 class ScVbaComment : public ScVbaComment_BASE
41 {
42 	css::uno::Reference< css::frame::XModel > mxModel;
43 	css::uno::Reference< css::table::XCellRange > mxRange;
44 
45 private:
46 	css::uno::Reference< css::sheet::XSheetAnnotation > SAL_CALL getAnnotation() throw (css::uno::RuntimeException);
47 	css::uno::Reference< css::sheet::XSheetAnnotations > SAL_CALL getAnnotations() throw (css::uno::RuntimeException);
48 	sal_Int32 SAL_CALL getAnnotationIndex() throw (css::uno::RuntimeException);
49 	css::uno::Reference< ov::excel::XComment > SAL_CALL getCommentByIndex( sal_Int32 Index ) throw (css::uno::RuntimeException);
50 public:
51     ScVbaComment(
52         const css::uno::Reference< ov::XHelperInterface >& xParent,
53         const css::uno::Reference< css::uno::XComponentContext >& xContext,
54         const css::uno::Reference< css::frame::XModel >& xModel,
55         const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::lang::IllegalArgumentException );
56 
~ScVbaComment()57     virtual ~ScVbaComment() {}
58 
59     // Attributes
60     virtual rtl::OUString SAL_CALL getAuthor() throw (css::uno::RuntimeException);
61     virtual void SAL_CALL setAuthor( const rtl::OUString& _author ) throw (css::uno::RuntimeException);
62     virtual css::uno::Reference< ov::msforms::XShape > SAL_CALL getShape() throw (css::uno::RuntimeException);
63     virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
64     virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
65 
66     // Methods
67     virtual void SAL_CALL Delete() throw (css::uno::RuntimeException);
68     virtual css::uno::Reference< ov::excel::XComment > SAL_CALL Next() throw (css::uno::RuntimeException);
69     virtual css::uno::Reference< ov::excel::XComment > SAL_CALL Previous() throw (css::uno::RuntimeException);
70     virtual rtl::OUString SAL_CALL Text( const css::uno::Any& Text, const css::uno::Any& Start, const css::uno::Any& Overwrite ) throw (css::uno::RuntimeException);
71     // XHelperInterface
72     virtual rtl::OUString& getServiceImplName();
73     virtual css::uno::Sequence<rtl::OUString> getServiceNames();
74 };
75 
76 #endif /* SC_VBA_COMMENT_HXX */
77 
78