xref: /AOO41X/main/sc/inc/shapeuno.hxx (revision 38d50f7b14e1cf975d8c6468d9633894cd59b523) !
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_SHAPEUNO_HXX
25cdf0e10cSrcweir #define SC_SHAPEUNO_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/solar.h>
28cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyState.hpp>
29cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
30cdf0e10cSrcweir #include <com/sun/star/text/XTextContent.hpp>
31cdf0e10cSrcweir #include <com/sun/star/text/XText.hpp>
32cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp>
33cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
34cdf0e10cSrcweir #include <com/sun/star/document/XEventsSupplier.hpp>
35cdf0e10cSrcweir #include <com/sun/star/container/XChild.hpp>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx>
38cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace com { namespace sun { namespace star {
41cdf0e10cSrcweir     namespace uno {
42cdf0e10cSrcweir         class XAggregation;
43cdf0e10cSrcweir     }
44cdf0e10cSrcweir     namespace drawing {
45cdf0e10cSrcweir         class XShape;
46cdf0e10cSrcweir     }
47cdf0e10cSrcweir }}}
48cdf0e10cSrcweir 
49cdf0e10cSrcweir class SdrObject;
50cdf0e10cSrcweir struct SvEventDescription;
51cdf0e10cSrcweir class ShapeUnoEventAccessImpl;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir //------------------------------------------------------------------------
54cdf0e10cSrcweir 
55cdf0e10cSrcweir //  object which aggregates all svx shape objects,
56cdf0e10cSrcweir //  to add own properties
57cdf0e10cSrcweir 
58cdf0e10cSrcweir typedef ::cppu::WeakImplHelper5 <   ::com::sun::star::beans::XPropertySet
59cdf0e10cSrcweir                                 ,   ::com::sun::star::beans::XPropertyState
60cdf0e10cSrcweir                                 ,   ::com::sun::star::text::XTextContent
61cdf0e10cSrcweir                                 ,   ::com::sun::star::document::XEventsSupplier
62cdf0e10cSrcweir                                 ,   ::com::sun::star::lang::XServiceInfo
63cdf0e10cSrcweir                                 >   ScShapeObj_Base;
64cdf0e10cSrcweir typedef ::cppu::ImplHelper1     <   ::com::sun::star::text::XText
65cdf0e10cSrcweir                                 >   ScShapeObj_TextBase;
66cdf0e10cSrcweir typedef ::cppu::ImplHelper1     <   ::com::sun::star::container::XChild
67cdf0e10cSrcweir                                 >   ScShapeObj_ChildBase;
68cdf0e10cSrcweir class ScShapeObj    :public ScShapeObj_Base
69cdf0e10cSrcweir                     ,public ScShapeObj_TextBase
70cdf0e10cSrcweir                     ,public ScShapeObj_ChildBase
71cdf0e10cSrcweir {
72cdf0e10cSrcweir private:
73cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > mxShapeAgg;
74cdf0e10cSrcweir     // cached pointers to avoid repeated queryAggregation calls:
75cdf0e10cSrcweir     ::com::sun::star::beans::XPropertySet*                                  pShapePropertySet;
76cdf0e10cSrcweir     ::com::sun::star::beans::XPropertyState*                                pShapePropertyState;
77cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > mxPropSetInfo;
78cdf0e10cSrcweir     com::sun::star::uno::Sequence< sal_Int8 >*                              pImplementationId;
79cdf0e10cSrcweir     bool                                                                    bIsTextShape;
80cdf0e10cSrcweir     bool                                                                    bIsNoteCaption;
81cdf0e10cSrcweir     bool                                                                    bInitializedNotifier;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     SdrObject* GetSdrObject() const throw();
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     void                    GetShapePropertySet();
86cdf0e10cSrcweir     void                    GetShapePropertyState();
87cdf0e10cSrcweir 
88cdf0e10cSrcweir friend class ShapeUnoEventAccessImpl;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir public:
91cdf0e10cSrcweir     static const SvEventDescription* GetSupportedMacroItems();
92cdf0e10cSrcweir 
93cdf0e10cSrcweir                             // ctor modifies xShape parameter
94cdf0e10cSrcweir                             ScShapeObj( ::com::sun::star::uno::Reference<
95cdf0e10cSrcweir                                             ::com::sun::star::drawing::XShape > & xShape );
96cdf0e10cSrcweir     virtual                 ~ScShapeObj();
97cdf0e10cSrcweir 
98cdf0e10cSrcweir                             // XInterface
99cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
100cdf0e10cSrcweir                                 const ::com::sun::star::uno::Type & rType )
101cdf0e10cSrcweir                                     throw(::com::sun::star::uno::RuntimeException);
102cdf0e10cSrcweir     virtual void SAL_CALL   acquire() throw();
103cdf0e10cSrcweir     virtual void SAL_CALL   release() throw();
104cdf0e10cSrcweir 
105cdf0e10cSrcweir                             // XPropertySet
106cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
107cdf0e10cSrcweir                             SAL_CALL getPropertySetInfo()
108cdf0e10cSrcweir                                 throw(::com::sun::star::uno::RuntimeException);
109cdf0e10cSrcweir     virtual void SAL_CALL   setPropertyValue( const ::rtl::OUString& aPropertyName,
110cdf0e10cSrcweir                                     const ::com::sun::star::uno::Any& aValue )
111cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
112cdf0e10cSrcweir                                     ::com::sun::star::beans::PropertyVetoException,
113cdf0e10cSrcweir                                     ::com::sun::star::lang::IllegalArgumentException,
114cdf0e10cSrcweir                                     ::com::sun::star::lang::WrappedTargetException,
115cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
116cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
117cdf0e10cSrcweir                                     const ::rtl::OUString& PropertyName )
118cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
119cdf0e10cSrcweir                                     ::com::sun::star::lang::WrappedTargetException,
120cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
121cdf0e10cSrcweir     virtual void SAL_CALL   addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
122cdf0e10cSrcweir                                     const ::com::sun::star::uno::Reference<
123cdf0e10cSrcweir                                         ::com::sun::star::beans::XPropertyChangeListener >& xListener )
124cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
125cdf0e10cSrcweir                                     ::com::sun::star::lang::WrappedTargetException,
126cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
127cdf0e10cSrcweir     virtual void SAL_CALL   removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
128cdf0e10cSrcweir                                     const ::com::sun::star::uno::Reference<
129cdf0e10cSrcweir                                         ::com::sun::star::beans::XPropertyChangeListener >& aListener )
130cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
131cdf0e10cSrcweir                                     ::com::sun::star::lang::WrappedTargetException,
132cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
133cdf0e10cSrcweir     virtual void SAL_CALL   addVetoableChangeListener( const ::rtl::OUString& PropertyName,
134cdf0e10cSrcweir                                     const ::com::sun::star::uno::Reference<
135cdf0e10cSrcweir                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener )
136cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
137cdf0e10cSrcweir                                     ::com::sun::star::lang::WrappedTargetException,
138cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
139cdf0e10cSrcweir     virtual void SAL_CALL   removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
140cdf0e10cSrcweir                                     const ::com::sun::star::uno::Reference<
141cdf0e10cSrcweir                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener )
142cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
143cdf0e10cSrcweir                                     ::com::sun::star::lang::WrappedTargetException,
144cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
145cdf0e10cSrcweir 
146cdf0e10cSrcweir                             // XPropertyState
147cdf0e10cSrcweir     virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(
148cdf0e10cSrcweir                                     const ::rtl::OUString& PropertyName )
149cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
150cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
151cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL
152cdf0e10cSrcweir                             getPropertyStates( const ::com::sun::star::uno::Sequence<
153cdf0e10cSrcweir                                         ::rtl::OUString >& aPropertyName )
154cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
155cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
156cdf0e10cSrcweir     virtual void SAL_CALL   setPropertyToDefault( const ::rtl::OUString& PropertyName )
157cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
158cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
159cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
160cdf0e10cSrcweir                                     const ::rtl::OUString& aPropertyName )
161cdf0e10cSrcweir                                 throw(::com::sun::star::beans::UnknownPropertyException,
162cdf0e10cSrcweir                                     ::com::sun::star::lang::WrappedTargetException,
163cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
164cdf0e10cSrcweir 
165cdf0e10cSrcweir                             // XTextContent
166cdf0e10cSrcweir     virtual void SAL_CALL   attach(const ::com::sun::star::uno::Reference<
167cdf0e10cSrcweir                                     ::com::sun::star::text::XTextRange > & xTextRange)
168cdf0e10cSrcweir                                 throw( ::com::sun::star::lang::IllegalArgumentException,
169cdf0e10cSrcweir                                         ::com::sun::star::uno::RuntimeException );
170cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
171cdf0e10cSrcweir                             getAnchor(void) throw( ::com::sun::star::uno::RuntimeException );
172cdf0e10cSrcweir 
173cdf0e10cSrcweir                             // XComponent
174cdf0e10cSrcweir     virtual void SAL_CALL   dispose(void) throw( ::com::sun::star::uno::RuntimeException );
175cdf0e10cSrcweir     virtual void SAL_CALL   addEventListener(const ::com::sun::star::uno::Reference<
176cdf0e10cSrcweir                                     ::com::sun::star::lang::XEventListener > & aListener)
177cdf0e10cSrcweir                                 throw( ::com::sun::star::uno::RuntimeException );
178cdf0e10cSrcweir     virtual void SAL_CALL   removeEventListener(const ::com::sun::star::uno::Reference<
179cdf0e10cSrcweir                                     ::com::sun::star::lang::XEventListener > & aListener)
180cdf0e10cSrcweir                                 throw( ::com::sun::star::uno::RuntimeException );
181cdf0e10cSrcweir 
182cdf0e10cSrcweir                             // XText
183cdf0e10cSrcweir     virtual void SAL_CALL   insertTextContent( const ::com::sun::star::uno::Reference<
184cdf0e10cSrcweir                                     ::com::sun::star::text::XTextRange >& xRange,
185cdf0e10cSrcweir                                 const ::com::sun::star::uno::Reference<
186cdf0e10cSrcweir                                     ::com::sun::star::text::XTextContent >& xContent,
187cdf0e10cSrcweir                                 sal_Bool bAbsorb )
188cdf0e10cSrcweir                                     throw(::com::sun::star::lang::IllegalArgumentException,
189cdf0e10cSrcweir                                     ::com::sun::star::uno::RuntimeException);
190cdf0e10cSrcweir     virtual void SAL_CALL   removeTextContent( const ::com::sun::star::uno::Reference<
191cdf0e10cSrcweir                                 ::com::sun::star::text::XTextContent >& xContent )
192cdf0e10cSrcweir                                     throw(::com::sun::star::container::NoSuchElementException,
193cdf0e10cSrcweir                                             ::com::sun::star::uno::RuntimeException);
194cdf0e10cSrcweir 
195cdf0e10cSrcweir                             // XSimpleText
196cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
197cdf0e10cSrcweir                             createTextCursor() throw(::com::sun::star::uno::RuntimeException);
198cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL
199cdf0e10cSrcweir                             createTextCursorByRange( const ::com::sun::star::uno::Reference<
200cdf0e10cSrcweir                                         ::com::sun::star::text::XTextRange >& aTextPosition )
201cdf0e10cSrcweir                                     throw(::com::sun::star::uno::RuntimeException);
202cdf0e10cSrcweir     virtual void SAL_CALL   insertString( const ::com::sun::star::uno::Reference<
203cdf0e10cSrcweir                                         ::com::sun::star::text::XTextRange >& xRange,
204cdf0e10cSrcweir                                         const ::rtl::OUString& aString, sal_Bool bAbsorb )
205cdf0e10cSrcweir                                     throw(::com::sun::star::uno::RuntimeException);
206cdf0e10cSrcweir     virtual void SAL_CALL   insertControlCharacter( const ::com::sun::star::uno::Reference<
207cdf0e10cSrcweir                                         ::com::sun::star::text::XTextRange >& xRange,
208cdf0e10cSrcweir                                         sal_Int16 nControlCharacter, sal_Bool bAbsorb )
209cdf0e10cSrcweir                                     throw(::com::sun::star::lang::IllegalArgumentException,
210cdf0e10cSrcweir                                         ::com::sun::star::uno::RuntimeException);
211cdf0e10cSrcweir 
212cdf0e10cSrcweir                             // XTextRange
213cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL
214cdf0e10cSrcweir                             getText() throw(::com::sun::star::uno::RuntimeException);
215cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
216cdf0e10cSrcweir                             getStart() throw(::com::sun::star::uno::RuntimeException);
217cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL
218cdf0e10cSrcweir                             getEnd() throw(::com::sun::star::uno::RuntimeException);
219cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException);
220cdf0e10cSrcweir     virtual void SAL_CALL   setString( const ::rtl::OUString& aString )
221cdf0e10cSrcweir                                     throw(::com::sun::star::uno::RuntimeException);
222cdf0e10cSrcweir 
223cdf0e10cSrcweir     // XChild
224cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent()
225cdf0e10cSrcweir                             throw (::com::sun::star::uno::RuntimeException);
226cdf0e10cSrcweir     virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xParent )
227cdf0e10cSrcweir                             throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
228cdf0e10cSrcweir 
229cdf0e10cSrcweir                             // XTypeProvider
230cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
231cdf0e10cSrcweir                                 throw(::com::sun::star::uno::RuntimeException);
232cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
233cdf0e10cSrcweir                                 throw(::com::sun::star::uno::RuntimeException);
234cdf0e10cSrcweir 
235cdf0e10cSrcweir                             // XEventsSupplier
236cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents()
237cdf0e10cSrcweir                                 throw(::com::sun::star::uno::RuntimeException);
238cdf0e10cSrcweir 
239cdf0e10cSrcweir                             // XServiceInfo
240cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  )
241cdf0e10cSrcweir                                 throw (::com::sun::star::uno::RuntimeException) ;
242cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
243cdf0e10cSrcweir                                 throw (::com::sun::star::uno::RuntimeException);
244cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
245cdf0e10cSrcweir                                 throw (::com::sun::star::uno::RuntimeException);
246cdf0e10cSrcweir };
247cdf0e10cSrcweir 
248cdf0e10cSrcweir #endif
249cdf0e10cSrcweir 
250