LOK: tilebench improvements
[LibreOffice.git] / sc / inc / shapeuno.hxx
blob270399377b65144c14cd71c70423eeccfd1e51f5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 {
36 namespace uno {
37 class XAggregation;
39 namespace drawing {
40 class XShape;
42 }}}
44 class SdrObject;
45 struct SvEventDescription;
46 class ShapeUnoEventAccessImpl;
47 class ScMacroInfo;
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
57 > ScShapeObj_Base;
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
66 private:
67 friend ScMacroInfo* ScShapeObj_getShapeHyperMacroInfo( const 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;
73 bool bIsTextShape;
74 bool bIsNoteCaption;
75 bool bInitializedNotifier;
77 SdrObject* GetSdrObject() const throw();
79 void GetShapePropertySet();
80 void GetShapePropertyState();
82 friend class ShapeUnoEventAccessImpl;
84 public:
85 static const SvEventDescription* GetSupportedMacroItems();
87 // ctor modifies xShape parameter
88 ScShapeObj( css::uno::Reference<
89 css::drawing::XShape > & xShape );
90 virtual ~ScShapeObj() override;
92 // XInterface
93 virtual css::uno::Any SAL_CALL queryInterface(
94 const css::uno::Type & rType ) override;
95 virtual void SAL_CALL acquire() throw() override;
96 virtual void SAL_CALL release() throw() override;
98 // XPropertySet
99 virtual css::uno::Reference< css::beans::XPropertySetInfo >
100 SAL_CALL getPropertySetInfo() override;
101 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
102 const css::uno::Any& aValue ) override;
103 virtual css::uno::Any SAL_CALL getPropertyValue(
104 const OUString& PropertyName ) override;
105 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
106 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
107 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
108 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
109 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
110 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
111 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
112 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
114 // XPropertyState
115 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
116 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL
117 getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
118 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
119 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
121 // XTextContent
122 virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
123 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
124 getAnchor() override;
126 // XComponent
127 virtual void SAL_CALL dispose() override;
128 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override;
129 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override;
131 // XText
132 virtual void SAL_CALL insertTextContent( const css::uno::Reference< css::text::XTextRange >& xRange,
133 const css::uno::Reference< css::text::XTextContent >& xContent,
134 sal_Bool bAbsorb ) override;
135 virtual void SAL_CALL removeTextContent( const css::uno::Reference< css::text::XTextContent >& xContent ) override;
137 // XSimpleText
138 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
139 createTextCursor() override;
140 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
141 createTextCursorByRange( const css::uno::Reference< css::text::XTextRange >& aTextPosition ) override;
142 virtual void SAL_CALL insertString( const css::uno::Reference< css::text::XTextRange >& xRange,
143 const OUString& aString, sal_Bool bAbsorb ) override;
144 virtual void SAL_CALL insertControlCharacter( const css::uno::Reference< css::text::XTextRange >& xRange,
145 sal_Int16 nControlCharacter, sal_Bool bAbsorb ) override;
147 // XTextRange
148 virtual css::uno::Reference< css::text::XText > SAL_CALL
149 getText() override;
150 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
151 getStart() override;
152 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL
153 getEnd() override;
154 virtual OUString SAL_CALL getString() override;
155 virtual void SAL_CALL setString( const OUString& aString ) override;
157 // XChild
158 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override;
159 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& xParent ) override;
161 // XTypeProvider
162 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
163 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
165 // XEventsSupplier
166 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override;
168 // XServiceInfo
169 virtual OUString SAL_CALL getImplementationName( ) override ;
170 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
171 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
174 #endif
176 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */