LibreOffice Module sc (master)  1
notesuno.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SC_INC_NOTESUNO_HXX
21 #define INCLUDED_SC_INC_NOTESUNO_HXX
22 
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/implbase.hxx>
29 #include <svl/lstner.hxx>
30 #include <rtl/ref.hxx>
31 #include "address.hxx"
32 
33 class ScDocShell;
34 class SvxUnoText;
35 class ScPostIt;
36 
37 class ScAnnotationObj final : public cppu::WeakImplHelper<
38  css::container::XChild,
39  css::text::XSimpleText,
40  css::sheet::XSheetAnnotation,
41  css::sheet::XSheetAnnotationShapeSupplier,
42  css::lang::XServiceInfo >,
43  public SfxListener
44 {
45 public:
46  ScAnnotationObj(ScDocShell* pDocSh, const ScAddress& rPos);
47  virtual ~ScAnnotationObj() override;
48 
49  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
50 
52  virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
53  getParent() override;
54  virtual void SAL_CALL setParent( const css::uno::Reference<
55  css::uno::XInterface >& Parent ) override;
56 
58  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
59  createTextCursor() override;
60  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
61  createTextCursorByRange( const css::uno::Reference< css::text::XTextRange >& aTextPosition ) override;
62  virtual void SAL_CALL insertString( const css::uno::Reference<
63  css::text::XTextRange >& xRange,
64  const OUString& aString, sal_Bool bAbsorb ) override;
65  virtual void SAL_CALL insertControlCharacter( const css::uno::Reference< css::text::XTextRange >& xRange,
66  sal_Int16 nControlCharacter, sal_Bool bAbsorb ) override;
67 
69  virtual css::uno::Reference< css::text::XText > SAL_CALL
70  getText() override;
71  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
72  getStart() override;
73  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
74  getEnd() override;
75  virtual OUString SAL_CALL getString() override;
76  virtual void SAL_CALL setString( const OUString& aString ) override;
77 
79  virtual css::table::CellAddress SAL_CALL getPosition() override;
80  virtual OUString SAL_CALL getAuthor() override;
81  virtual OUString SAL_CALL getDate() override;
82  virtual sal_Bool SAL_CALL getIsVisible() override;
83  virtual void SAL_CALL setIsVisible( sal_Bool bIsVisible ) override;
84 
86  virtual css::uno::Reference < css::drawing::XShape > SAL_CALL
87  getAnnotationShape() override;
88 
90  virtual OUString SAL_CALL getImplementationName() override;
91  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
92  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
93 
94 private:
96 
97  const ScPostIt* ImplGetNote() const;
98 
99 private:
103 };
104 
105 #endif
106 
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getAuthor() override
Definition: notesuno.cxx:177
virtual OUString SAL_CALL getImplementationName() override
XServiceInfo.
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: notesuno.cxx:153
virtual css::table::CellAddress SAL_CALL getPosition() override
XSheetAnnotation.
Definition: notesuno.cxx:167
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
XTextRange.
Definition: notesuno.cxx:147
virtual ~ScAnnotationObj() override
Definition: notesuno.cxx:67
Additional class containing cell annotation data.
Definition: postit.hxx:160
virtual OUString SAL_CALL getString() override
Definition: notesuno.cxx:121
rtl::Reference< SvxUnoText > pUnoText
Definition: notesuno.hxx:102
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: notesuno.cxx:75
virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getAnnotationShape() override
XSheetAnnotationShapeSupplier.
Definition: notesuno.cxx:207
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
XChild.
Definition: notesuno.cxx:85
virtual void SAL_CALL setString(const OUString &aString) override
Definition: notesuno.cxx:127
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
XSimpleText.
Definition: notesuno.cxx:106
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
SvxUnoText & GetUnoText()
Definition: notesuno.cxx:217
unsigned char sal_Bool
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
Definition: notesuno.cxx:133
ScAnnotationObj(ScDocShell *pDocSh, const ScAddress &rPos)
Definition: notesuno.cxx:57
ScAddress aCellPos
Definition: notesuno.hxx:101
virtual void SAL_CALL setIsVisible(sal_Bool bIsVisible) override
Definition: notesuno.cxx:198
const ScPostIt * ImplGetNote() const
Definition: notesuno.cxx:228
virtual void SAL_CALL insertControlCharacter(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
Definition: notesuno.cxx:140
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: notesuno.cxx:98
ScDocShell * pDocShell
Definition: notesuno.hxx:100
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: notesuno.cxx:159
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
Definition: notesuno.cxx:113
virtual OUString SAL_CALL getDate() override
Definition: notesuno.cxx:184
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual sal_Bool SAL_CALL getIsVisible() override
Definition: notesuno.cxx:191