1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_INC_SHAPEUNO_HXX
21 #define INCLUDED_SC_INC_SHAPEUNO_HXX
23 #include <com/sun/star/beans/XPropertyState.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/text/XTextContent.hpp>
26 #include <com/sun/star/text/XText.hpp>
27 #include <com/sun/star/lang/XTypeProvider.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/document/XEventsSupplier.hpp>
30 #include <com/sun/star/container/XChild.hpp>
32 #include <cppuhelper/implbase.hxx>
33 #include <cppuhelper/implbase1.hxx>
35 namespace com
{ namespace sun
{ namespace star
{
45 struct SvEventDescription
;
46 class ShapeUnoEventAccessImpl
;
49 // object which aggregates all svx shape objects,
50 // to add own properties
52 typedef ::cppu::WeakImplHelper
< css::beans::XPropertySet
53 , css::beans::XPropertyState
54 , css::text::XTextContent
55 , css::document::XEventsSupplier
56 , css::lang::XServiceInfo
58 typedef ::cppu::ImplHelper1
< css::text::XText
59 > ScShapeObj_TextBase
;
60 typedef ::cppu::ImplHelper1
< css::container::XChild
61 > ScShapeObj_ChildBase
;
62 class ScShapeObj
:public ScShapeObj_Base
63 ,public ScShapeObj_TextBase
64 ,public ScShapeObj_ChildBase
67 friend ScMacroInfo
* ScShapeObj_getShapeHyperMacroInfo( ScShapeObj
* pShape
, bool bCreate
);
68 css::uno::Reference
< css::uno::XAggregation
> mxShapeAgg
;
69 // cached pointers to avoid repeated queryAggregation calls:
70 css::beans::XPropertySet
* pShapePropertySet
;
71 css::beans::XPropertyState
* pShapePropertyState
;
72 css::uno::Reference
< css::beans::XPropertySetInfo
> mxPropSetInfo
;
75 bool bInitializedNotifier
;
77 SdrObject
* GetSdrObject() const throw();
79 void GetShapePropertySet();
80 void GetShapePropertyState();
82 friend class ShapeUnoEventAccessImpl
;
85 static const SvEventDescription
* GetSupportedMacroItems();
87 // ctor modifies xShape parameter
88 ScShapeObj( css::uno::Reference
<
89 css::drawing::XShape
> & xShape
);
90 virtual ~ScShapeObj() override
;
93 virtual css::uno::Any SAL_CALL
queryInterface(
94 const css::uno::Type
& rType
)
95 throw(css::uno::RuntimeException
, std::exception
) override
;
96 virtual void SAL_CALL
acquire() throw() override
;
97 virtual void SAL_CALL
release() throw() override
;
100 virtual css::uno::Reference
< css::beans::XPropertySetInfo
>
101 SAL_CALL
getPropertySetInfo()
102 throw(css::uno::RuntimeException
, std::exception
) override
;
103 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
,
104 const css::uno::Any
& aValue
)
105 throw(css::beans::UnknownPropertyException
,
106 css::beans::PropertyVetoException
,
107 css::lang::IllegalArgumentException
,
108 css::lang::WrappedTargetException
,
109 css::uno::RuntimeException
,
110 std::exception
) override
;
111 virtual css::uno::Any SAL_CALL
getPropertyValue(
112 const OUString
& PropertyName
)
113 throw(css::beans::UnknownPropertyException
,
114 css::lang::WrappedTargetException
,
115 css::uno::RuntimeException
,
116 std::exception
) override
;
117 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
,
118 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
)
119 throw(css::beans::UnknownPropertyException
,
120 css::lang::WrappedTargetException
,
121 css::uno::RuntimeException
, std::exception
) override
;
122 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
,
123 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
)
124 throw(css::beans::UnknownPropertyException
,
125 css::lang::WrappedTargetException
,
126 css::uno::RuntimeException
, std::exception
) override
;
127 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
,
128 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
)
129 throw(css::beans::UnknownPropertyException
,
130 css::lang::WrappedTargetException
,
131 css::uno::RuntimeException
, std::exception
) override
;
132 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
,
133 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
)
134 throw(css::beans::UnknownPropertyException
,
135 css::lang::WrappedTargetException
,
136 css::uno::RuntimeException
, std::exception
) override
;
139 virtual css::beans::PropertyState SAL_CALL
getPropertyState( const OUString
& PropertyName
)
140 throw(css::beans::UnknownPropertyException
,
141 css::uno::RuntimeException
, std::exception
) override
;
142 virtual css::uno::Sequence
< css::beans::PropertyState
> SAL_CALL
143 getPropertyStates( const css::uno::Sequence
< OUString
>& aPropertyName
)
144 throw(css::beans::UnknownPropertyException
,
145 css::uno::RuntimeException
, std::exception
) override
;
146 virtual void SAL_CALL
setPropertyToDefault( const OUString
& PropertyName
)
147 throw (css::beans::UnknownPropertyException
,
148 css::uno::RuntimeException
,
149 std::exception
) override
;
150 virtual css::uno::Any SAL_CALL
getPropertyDefault( const OUString
& aPropertyName
)
151 throw(css::beans::UnknownPropertyException
,
152 css::lang::WrappedTargetException
,
153 css::uno::RuntimeException
, std::exception
) override
;
156 virtual void SAL_CALL
attach(const css::uno::Reference
< css::text::XTextRange
> & xTextRange
)
157 throw( css::lang::IllegalArgumentException
,
158 css::uno::RuntimeException
, std::exception
) override
;
159 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
161 throw(css::uno::RuntimeException
,
162 std::exception
) override
;
165 virtual void SAL_CALL
dispose() throw( css::uno::RuntimeException
, std::exception
) override
;
166 virtual void SAL_CALL
addEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
)
167 throw( css::uno::RuntimeException
, std::exception
) override
;
168 virtual void SAL_CALL
removeEventListener(const css::uno::Reference
< css::lang::XEventListener
> & aListener
)
169 throw( css::uno::RuntimeException
, std::exception
) override
;
172 virtual void SAL_CALL
insertTextContent( const css::uno::Reference
< css::text::XTextRange
>& xRange
,
173 const css::uno::Reference
< css::text::XTextContent
>& xContent
,
175 throw(css::lang::IllegalArgumentException
,
176 css::uno::RuntimeException
, std::exception
) override
;
177 virtual void SAL_CALL
removeTextContent( const css::uno::Reference
< css::text::XTextContent
>& xContent
)
178 throw(css::container::NoSuchElementException
,
179 css::uno::RuntimeException
, std::exception
) override
;
182 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
183 createTextCursor() throw(css::uno::RuntimeException
, std::exception
) override
;
184 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
185 createTextCursorByRange( const css::uno::Reference
< css::text::XTextRange
>& aTextPosition
)
186 throw(css::uno::RuntimeException
, std::exception
) override
;
187 virtual void SAL_CALL
insertString( const css::uno::Reference
< css::text::XTextRange
>& xRange
,
188 const OUString
& aString
, sal_Bool bAbsorb
)
189 throw(css::uno::RuntimeException
, std::exception
) override
;
190 virtual void SAL_CALL
insertControlCharacter( const css::uno::Reference
< css::text::XTextRange
>& xRange
,
191 sal_Int16 nControlCharacter
, sal_Bool bAbsorb
)
192 throw(css::lang::IllegalArgumentException
,
193 css::uno::RuntimeException
, std::exception
) override
;
196 virtual css::uno::Reference
< css::text::XText
> SAL_CALL
197 getText() throw(css::uno::RuntimeException
, std::exception
) override
;
198 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
199 getStart() throw(css::uno::RuntimeException
, std::exception
) override
;
200 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
201 getEnd() throw(css::uno::RuntimeException
, std::exception
) override
;
202 virtual OUString SAL_CALL
getString() throw(css::uno::RuntimeException
, std::exception
) override
;
203 virtual void SAL_CALL
setString( const OUString
& aString
)
204 throw(css::uno::RuntimeException
, std::exception
) override
;
207 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getParent()
208 throw (css::uno::RuntimeException
, std::exception
) override
;
209 virtual void SAL_CALL
setParent( const css::uno::Reference
< css::uno::XInterface
>& xParent
)
210 throw (css::lang::NoSupportException
, css::uno::RuntimeException
, std::exception
) override
;
213 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes()
214 throw(css::uno::RuntimeException
, std::exception
) override
;
215 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId()
216 throw(css::uno::RuntimeException
, std::exception
) override
;
219 virtual css::uno::Reference
< css::container::XNameReplace
> SAL_CALL
getEvents()
220 throw(css::uno::RuntimeException
, std::exception
) override
;
223 virtual OUString SAL_CALL
getImplementationName( )
224 throw (css::uno::RuntimeException
, std::exception
) override
;
225 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
226 throw (css::uno::RuntimeException
, std::exception
) override
;
227 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( )
228 throw (css::uno::RuntimeException
, std::exception
) override
;
233 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */