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:899
css::beans::XPropertySet * pShapePropertySet
Definition: shapeuno.hxx:67
static const SvEventDescription * GetSupportedMacroItems()
Definition: shapeuno.cxx:66
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: shapeuno.cxx:1194
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: shapeuno.cxx:308
virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override
Definition: shapeuno.cxx:1405
SdrObject * GetSdrObject() const noexcept
Definition: shapeuno.cxx:1303
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: shapeuno.cxx:1056
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: shapeuno.cxx:1298
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: shapeuno.cxx:660
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: shapeuno.cxx:1000
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: shapeuno.cxx:857
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: shapeuno.cxx:972
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: shapeuno.cxx:943
void GetShapePropertyState()
Definition: shapeuno.cxx:165
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: shapeuno.cxx:1420
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &xParent) override
Definition: shapeuno.cxx:1271
virtual void SAL_CALL release() noexcept override
Definition: shapeuno.cxx:146
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
Definition: shapeuno.cxx:1140
virtual void SAL_CALL acquire() noexcept override
Definition: shapeuno.cxx:141
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
Definition: shapeuno.cxx:1189
void GetShapePropertySet()
Definition: shapeuno.cxx:151
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: shapeuno.cxx:867
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: shapeuno.cxx:1205
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: shapeuno.cxx:877
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
Definition: shapeuno.cxx:1162
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: shapeuno.cxx:1124
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: shapeuno.cxx:1278
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: shapeuno.cxx:887
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: shapeuno.cxx:995
virtual OUString SAL_CALL getImplementationName() override
Definition: shapeuno.cxx:1410
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: shapeuno.cxx:1240
virtual void SAL_CALL removeTextContent(const css::uno::Reference< css::text::XTextContent > &xContent) override
Definition: shapeuno.cxx:1110
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:213
virtual void SAL_CALL dispose() override
Definition: shapeuno.cxx:1037
friend ScMacroInfo * ScShapeObj_getShapeHyperMacroInfo(const ScShapeObj *pShape, bool bCreate)
Definition: shapeuno.cxx:74
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:1081
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: shapeuno.cxx:1046
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:1174
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: shapeuno.cxx:125
virtual OUString SAL_CALL getString() override
Definition: shapeuno.cxx:1216
virtual void SAL_CALL setString(const OUString &aString) override
Definition: shapeuno.cxx:1227
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:930
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: shapeuno.cxx:1415
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