LibreOffice Module sc (master) 1
shapeuno.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/beans/XPropertyState.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <com/sun/star/text/XTextContent.hpp>
25#include <com/sun/star/text/XText.hpp>
26#include <com/sun/star/lang/XServiceInfo.hpp>
27#include <com/sun/star/document/XEventsSupplier.hpp>
28#include <com/sun/star/container/XChild.hpp>
29
32
33namespace com::sun::star {
34 namespace uno {
35 class XAggregation;
36 }
37 namespace drawing {
38 class XShape;
39 }
40}
41
42class SdrObject;
44class ScMacroInfo;
45
46// object which aggregates all svx shape objects,
47// to add own properties
48
49typedef ::cppu::WeakImplHelper < css::beans::XPropertySet
50 , css::beans::XPropertyState
51 , css::text::XTextContent
52 , css::document::XEventsSupplier
53 , css::lang::XServiceInfo
55typedef ::cppu::ImplHelper1 < css::text::XText
57typedef ::cppu::ImplHelper1 < css::container::XChild
59class ScShapeObj final : public ScShapeObj_Base
62{
63private:
64 friend ScMacroInfo* ScShapeObj_getShapeHyperMacroInfo( const ScShapeObj* pShape, bool bCreate );
65 css::uno::Reference< css::uno::XAggregation > mxShapeAgg;
66 // cached pointers to avoid repeated queryAggregation calls:
67 css::beans::XPropertySet* pShapePropertySet;
68 css::beans::XPropertyState* pShapePropertyState;
69 css::uno::Reference< css::beans::XPropertySetInfo > mxPropSetInfo;
72
73 SdrObject* GetSdrObject() const noexcept;
74
77
79
80public:
82
83 // ctor modifies xShape parameter
84 ScShapeObj( css::uno::Reference<
85 css::drawing::XShape > & xShape );
86 virtual ~ScShapeObj() override;
87
88 // XInterface
89 virtual css::uno::Any SAL_CALL queryInterface(
90 const css::uno::Type & rType ) override;
91 virtual void SAL_CALL acquire() noexcept override;
92 virtual void SAL_CALL release() noexcept override;
93
94 // XPropertySet
95 virtual css::uno::Reference< css::beans::XPropertySetInfo >
96 SAL_CALL getPropertySetInfo() override;
97 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
98 const css::uno::Any& aValue ) override;
99 virtual css::uno::Any SAL_CALL getPropertyValue(
100 const OUString& PropertyName ) override;
101 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
102 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
103 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
104 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
105 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
106 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
107 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
108 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
109
110 // XPropertyState
111 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
112 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL
113 getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
114 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
115 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
116
117 // XTextContent
118 virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
119 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
120 getAnchor() override;
121
122 // XComponent
123 virtual void SAL_CALL dispose() override;
124 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override;
125 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override;
126
127 // XText
128 virtual void SAL_CALL insertTextContent( const css::uno::Reference< css::text::XTextRange >& xRange,
129 const css::uno::Reference< css::text::XTextContent >& xContent,
130 sal_Bool bAbsorb ) override;
131 virtual void SAL_CALL removeTextContent( const css::uno::Reference< css::text::XTextContent >& xContent ) override;
132
133 // XSimpleText
134 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
135 createTextCursor() override;
136 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
137 createTextCursorByRange( const css::uno::Reference< css::text::XTextRange >& aTextPosition ) override;
138 virtual void SAL_CALL insertString( const css::uno::Reference< css::text::XTextRange >& xRange,
139 const OUString& aString, sal_Bool bAbsorb ) override;
140 virtual void SAL_CALL insertControlCharacter( const css::uno::Reference< css::text::XTextRange >& xRange,
141 sal_Int16 nControlCharacter, sal_Bool bAbsorb ) override;
142
143 // XTextRange
144 virtual css::uno::Reference< css::text::XText > SAL_CALL
145 getText() override;
146 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
147 getStart() override;
148 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
149 getEnd() override;
150 virtual OUString SAL_CALL getString() override;
151 virtual void SAL_CALL setString( const OUString& aString ) override;
152
153 // XChild
154 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override;
155 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& xParent ) override;
156
157 // XTypeProvider
158 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
159 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
160
161 // XEventsSupplier
162 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override;
163
164 // XServiceInfo
165 virtual OUString SAL_CALL getImplementationName( ) override ;
166 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
167 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
168};
169
170/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: shapeuno.cxx:932
css::beans::XPropertySet * pShapePropertySet
Definition: shapeuno.hxx:67
static const SvEventDescription * GetSupportedMacroItems()
Definition: shapeuno.cxx:69
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: shapeuno.cxx:1227
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: shapeuno.cxx:311
virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override
Definition: shapeuno.cxx:1438
SdrObject * GetSdrObject() const noexcept
Definition: shapeuno.cxx:1336
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: shapeuno.cxx:1089
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: shapeuno.cxx:1331
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: shapeuno.cxx:679
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: shapeuno.cxx:1033
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: shapeuno.cxx:890
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: shapeuno.cxx:1005
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: shapeuno.cxx:976
void GetShapePropertyState()
Definition: shapeuno.cxx:168
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: shapeuno.cxx:1453
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &xParent) override
Definition: shapeuno.cxx:1304
virtual void SAL_CALL release() noexcept override
Definition: shapeuno.cxx:149
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
Definition: shapeuno.cxx:1173
virtual void SAL_CALL acquire() noexcept override
Definition: shapeuno.cxx:144
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
Definition: shapeuno.cxx:1222
void GetShapePropertySet()
Definition: shapeuno.cxx:154
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: shapeuno.cxx:900
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: shapeuno.cxx:1238
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: shapeuno.cxx:910
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
Definition: shapeuno.cxx:1195
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: shapeuno.cxx:1157
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: shapeuno.cxx:1311
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: shapeuno.cxx:920
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: shapeuno.cxx:1028
virtual OUString SAL_CALL getImplementationName() override
Definition: shapeuno.cxx:1443
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: shapeuno.cxx:1273
virtual void SAL_CALL removeTextContent(const css::uno::Reference< css::text::XTextContent > &xContent) override
Definition: shapeuno.cxx:1143
css::uno::Reference< css::beans::XPropertySetInfo > mxPropSetInfo
Definition: shapeuno.hxx:69
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: shapeuno.cxx:216
virtual void SAL_CALL dispose() override
Definition: shapeuno.cxx:1070
friend ScMacroInfo * ScShapeObj_getShapeHyperMacroInfo(const ScShapeObj *pShape, bool bCreate)
Definition: shapeuno.cxx:77
virtual void SAL_CALL insertTextContent(const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::text::XTextContent > &xContent, sal_Bool bAbsorb) override
Definition: shapeuno.cxx:1114
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: shapeuno.cxx:1079
bool bIsNoteCaption
Definition: shapeuno.hxx:71
css::beans::XPropertyState * pShapePropertyState
Definition: shapeuno.hxx:68
virtual void SAL_CALL insertControlCharacter(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
Definition: shapeuno.cxx:1207
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: shapeuno.cxx:128
virtual OUString SAL_CALL getString() override
Definition: shapeuno.cxx:1249
virtual void SAL_CALL setString(const OUString &aString) override
Definition: shapeuno.cxx:1260
css::uno::Reference< css::uno::XAggregation > mxShapeAgg
Definition: shapeuno.hxx:65
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
Definition: shapeuno.cxx:963
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: shapeuno.cxx:1448
bool bIsTextShape
Definition: shapeuno.hxx:70
Type
::cppu::ImplHelper1< css::text::XText > ScShapeObj_TextBase
Definition: shapeuno.hxx:56
::cppu::WeakImplHelper< css::beans::XPropertySet, css::beans::XPropertyState, css::text::XTextContent, css::document::XEventsSupplier, css::lang::XServiceInfo > ScShapeObj_Base
Definition: shapeuno.hxx:44
::cppu::ImplHelper1< css::container::XChild > ScShapeObj_ChildBase
Definition: shapeuno.hxx:58
unsigned char sal_Bool
signed char sal_Int8