xref: /aoo41x/main/sc/source/ui/vba/vbacomment.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef SC_VBA_COMMENT_HXX
28 #define SC_VBA_COMMENT_HXX
29 
30 #include <cppuhelper/implbase1.hxx>
31 
32 #include <ooo/vba/excel/XComment.hpp>
33 #include <ooo/vba/excel/XApplication.hpp>
34 #include <ooo/vba/msforms/XShape.hpp>
35 #include <com/sun/star/sheet/XSheetAnnotations.hpp>
36 #include <com/sun/star/sheet/XSheetAnnotation.hpp>
37 #include <com/sun/star/table/XCellRange.hpp>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 
40 #include <vbahelper/vbahelperinterface.hxx>
41 
42 typedef InheritedHelperInterfaceImpl1< ov::excel::XComment > ScVbaComment_BASE;
43 
44 class ScVbaComment : public ScVbaComment_BASE
45 {
46 	css::uno::Reference< css::frame::XModel > mxModel;
47 	css::uno::Reference< css::table::XCellRange > mxRange;
48 
49 private:
50 	css::uno::Reference< css::sheet::XSheetAnnotation > SAL_CALL getAnnotation() throw (css::uno::RuntimeException);
51 	css::uno::Reference< css::sheet::XSheetAnnotations > SAL_CALL getAnnotations() throw (css::uno::RuntimeException);
52 	sal_Int32 SAL_CALL getAnnotationIndex() throw (css::uno::RuntimeException);
53 	css::uno::Reference< ov::excel::XComment > SAL_CALL getCommentByIndex( sal_Int32 Index ) throw (css::uno::RuntimeException);
54 public:
55     ScVbaComment(
56         const css::uno::Reference< ov::XHelperInterface >& xParent,
57         const css::uno::Reference< css::uno::XComponentContext >& xContext,
58         const css::uno::Reference< css::frame::XModel >& xModel,
59         const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::lang::IllegalArgumentException );
60 
61     virtual ~ScVbaComment() {}
62 
63     // Attributes
64     virtual rtl::OUString SAL_CALL getAuthor() throw (css::uno::RuntimeException);
65     virtual void SAL_CALL setAuthor( const rtl::OUString& _author ) throw (css::uno::RuntimeException);
66     virtual css::uno::Reference< ov::msforms::XShape > SAL_CALL getShape() throw (css::uno::RuntimeException);
67     virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
68     virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
69 
70     // Methods
71     virtual void SAL_CALL Delete() throw (css::uno::RuntimeException);
72     virtual css::uno::Reference< ov::excel::XComment > SAL_CALL Next() throw (css::uno::RuntimeException);
73     virtual css::uno::Reference< ov::excel::XComment > SAL_CALL Previous() throw (css::uno::RuntimeException);
74     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);
75     // XHelperInterface
76     virtual rtl::OUString& getServiceImplName();
77     virtual css::uno::Sequence<rtl::OUString> getServiceNames();
78 };
79 
80 #endif /* SC_VBA_COMMENT_HXX */
81 
82