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>
28#include <svl/lstner.hxx>
29#include <rtl/ref.hxx>
30#include "address.hxx"
31
32class ScDocShell;
33class SvxUnoText;
34class ScPostIt;
35
36class 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{
44public:
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
93private:
95
96 const ScPostIt* ImplGetNote() const;
97
98private:
102};
103
104/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxUnoText & GetUnoText()
Definition: notesuno.cxx:216
ScAddress aCellPos
Definition: notesuno.hxx:100
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: notesuno.cxx:97
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
XSimpleText.
Definition: notesuno.cxx:105
ScAnnotationObj(ScDocShell *pDocSh, const ScAddress &rPos)
Definition: notesuno.cxx:56
virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getAnnotationShape() override
XSheetAnnotationShapeSupplier.
Definition: notesuno.cxx:206
virtual void SAL_CALL setIsVisible(sal_Bool bIsVisible) override
Definition: notesuno.cxx:197
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
XChild.
Definition: notesuno.cxx:84
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
Definition: notesuno.cxx:132
virtual sal_Bool SAL_CALL getIsVisible() override
Definition: notesuno.cxx:190
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: notesuno.cxx:152
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
XTextRange.
Definition: notesuno.cxx:146
virtual css::table::CellAddress SAL_CALL getPosition() override
XSheetAnnotation.
Definition: notesuno.cxx:166
ScDocShell * pDocShell
Definition: notesuno.hxx:99
virtual OUString SAL_CALL getDate() override
Definition: notesuno.cxx:183
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: notesuno.cxx:158
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: notesuno.cxx:74
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual ~ScAnnotationObj() override
Definition: notesuno.cxx:66
virtual OUString SAL_CALL getImplementationName() override
XServiceInfo.
virtual void SAL_CALL setString(const OUString &aString) override
Definition: notesuno.cxx:126
rtl::Reference< SvxUnoText > pUnoText
Definition: notesuno.hxx:101
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
Definition: notesuno.cxx:112
virtual void SAL_CALL insertControlCharacter(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
Definition: notesuno.cxx:139
virtual OUString SAL_CALL getString() override
Definition: notesuno.cxx:120
const ScPostIt * ImplGetNote() const
Definition: notesuno.cxx:227
virtual OUString SAL_CALL getAuthor() override
Definition: notesuno.cxx:176
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Additional class containing cell annotation data.
Definition: postit.hxx:58
unsigned char sal_Bool