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 #pragma once
21 
22 #include <com/sun/star/sheet/XSheetAnnotation.hpp>
23 #include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/container/XChild.hpp>
26 #include <com/sun/star/text/XSimpleText.hpp>
27 #include <cppuhelper/implbase.hxx>
28 #include <svl/lstner.hxx>
29 #include <rtl/ref.hxx>
30 #include "address.hxx"
31 
32 class ScDocShell;
33 class SvxUnoText;
34 class ScPostIt;
35 
36 class ScAnnotationObj final : public cppu::WeakImplHelper<
37  css::container::XChild,
38  css::text::XSimpleText,
39  css::sheet::XSheetAnnotation,
40  css::sheet::XSheetAnnotationShapeSupplier,
41  css::lang::XServiceInfo >,
42  public SfxListener
43 {
44 public:
45  ScAnnotationObj(ScDocShell* pDocSh, const ScAddress& rPos);
46  virtual ~ScAnnotationObj() override;
47 
48  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
49 
51  virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
52  getParent() override;
53  virtual void SAL_CALL setParent( const css::uno::Reference<
54  css::uno::XInterface >& Parent ) override;
55 
57  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
58  createTextCursor() override;
59  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
60  createTextCursorByRange( const css::uno::Reference< css::text::XTextRange >& aTextPosition ) override;
61  virtual void SAL_CALL insertString( const css::uno::Reference<
62  css::text::XTextRange >& xRange,
63  const OUString& aString, sal_Bool bAbsorb ) override;
64  virtual void SAL_CALL insertControlCharacter( const css::uno::Reference< css::text::XTextRange >& xRange,
65  sal_Int16 nControlCharacter, sal_Bool bAbsorb ) override;
66 
68  virtual css::uno::Reference< css::text::XText > SAL_CALL
69  getText() override;
70  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
71  getStart() override;
72  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
73  getEnd() override;
74  virtual OUString SAL_CALL getString() override;
75  virtual void SAL_CALL setString( const OUString& aString ) override;
76 
78  virtual css::table::CellAddress SAL_CALL getPosition() override;
79  virtual OUString SAL_CALL getAuthor() override;
80  virtual OUString SAL_CALL getDate() override;
81  virtual sal_Bool SAL_CALL getIsVisible() override;
82  virtual void SAL_CALL setIsVisible( sal_Bool bIsVisible ) override;
83 
85  virtual css::uno::Reference < css::drawing::XShape > SAL_CALL
86  getAnnotationShape() override;
87 
89  virtual OUString SAL_CALL getImplementationName() override;
90  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
91  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
92 
93 private:
95 
96  const ScPostIt* ImplGetNote() const;
97 
98 private:
102 };
103 
104 /* 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:161
virtual OUString SAL_CALL getString() override
Definition: notesuno.cxx:121
rtl::Reference< SvxUnoText > pUnoText
Definition: notesuno.hxx:101
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:100
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:99
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