Bump version to 4.3-4
[LibreOffice.git] / sc / inc / notesuno.hxx
blobcf5c1ae0adad76619c9f2e764078f2d6d0d5eb7f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_NOTESUNO_HXX
21 #define INCLUDED_SC_INC_NOTESUNO_HXX
23 #include <com/sun/star/sheet/XSheetAnnotation.hpp>
24 #include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/container/XChild.hpp>
27 #include <com/sun/star/text/XSimpleText.hpp>
28 #include <cppuhelper/implbase5.hxx>
29 #include <svl/lstner.hxx>
30 #include "address.hxx"
32 class ScDocShell;
33 class SvxUnoText;
34 class ScPostIt;
37 class ScAnnotationObj : public cppu::WeakImplHelper5<
38 com::sun::star::container::XChild,
39 com::sun::star::text::XSimpleText,
40 com::sun::star::sheet::XSheetAnnotation,
41 com::sun::star::sheet::XSheetAnnotationShapeSupplier,
42 com::sun::star::lang::XServiceInfo >,
43 public SfxListener
45 public:
46 ScAnnotationObj(ScDocShell* pDocSh, const ScAddress& rPos);
47 virtual ~ScAnnotationObj();
49 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
51 /// XChild
52 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
53 getParent() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
54 virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference<
55 ::com::sun::star::uno::XInterface >& Parent )
56 throw(::com::sun::star::lang::NoSupportException,
57 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
59 /// XSimpleText
60 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
61 createTextCursor() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
62 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
63 createTextCursorByRange( const ::com::sun::star::uno::Reference<
64 ::com::sun::star::text::XTextRange >& aTextPosition )
65 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
66 virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference<
67 ::com::sun::star::text::XTextRange >& xRange,
68 const OUString& aString, sal_Bool bAbsorb )
69 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
70 virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference<
71 ::com::sun::star::text::XTextRange >& xRange,
72 sal_Int16 nControlCharacter, sal_Bool bAbsorb )
73 throw(::com::sun::star::lang::IllegalArgumentException,
74 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 /// XTextRange
77 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL
78 getText() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
80 getStart() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
81 virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
82 getEnd() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
83 virtual OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
84 virtual void SAL_CALL setString( const OUString& aString )
85 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 /// XSheetAnnotation
88 virtual ::com::sun::star::table::CellAddress SAL_CALL getPosition()
89 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
90 virtual OUString SAL_CALL getAuthor()
91 throw(::com::sun::star::uno::RuntimeException,
92 std::exception) SAL_OVERRIDE;
93 virtual OUString SAL_CALL getDate()
94 throw(::com::sun::star::uno::RuntimeException,
95 std::exception) SAL_OVERRIDE;
96 virtual sal_Bool SAL_CALL getIsVisible()
97 throw(::com::sun::star::uno::RuntimeException,
98 std::exception) SAL_OVERRIDE;
99 virtual void SAL_CALL setIsVisible( sal_Bool bIsVisible )
100 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 /// XSheetAnnotationShapeSupplier
103 virtual ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > SAL_CALL
104 getAnnotationShape()
105 throw(::com::sun::star::uno::RuntimeException,
106 std::exception) SAL_OVERRIDE;
108 /// XServiceInfo
109 virtual OUString SAL_CALL getImplementationName()
110 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
111 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
112 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
114 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 private:
117 SvxUnoText& GetUnoText();
119 const ScPostIt* ImplGetNote() const;
121 private:
122 ScDocShell* pDocShell;
123 ScAddress aCellPos;
124 SvxUnoText* pUnoText;
127 #endif
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */