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 .
19 #ifndef _SVX_UNOWPAGE_HXX
20 #define _SVX_UNOWPAGE_HXX
22 #include <com/sun/star/lang/XComponent.hpp>
23 #include <cppuhelper/interfacecontainer.hxx>
24 #include <com/sun/star/lang/XTypeProvider.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/drawing/XDrawPage.hpp>
28 #include <com/sun/star/drawing/XShapeGrouper.hpp>
29 #include <com/sun/star/drawing/XShapeCombiner.hpp>
30 #include <com/sun/star/drawing/XShapeBinder.hpp>
31 #include <com/sun/star/lang/XUnoTunnel.hpp>
32 #include <cppuhelper/weak.hxx>
33 #include <cppuhelper/weakagg.hxx>
34 #include <svl/lstner.hxx>
35 #include <editeng/mutxhelp.hxx>
36 #include "svx/svxdllapi.h"
38 #include <cppuhelper/implbase5.hxx>
39 #include <comphelper/servicehelper.hxx>
41 #include <svx/unoprov.hxx>
50 class SvxShapeConnector
;
52 /***********************************************************************
53 * Macros fuer Umrechnung Twips<->100tel mm *
54 ***********************************************************************/
55 #define TWIPS_TO_MM(val) ((val * 127 + 36) / 72)
56 #define MM_TO_TWIPS(val) ((val * 72 + 63) / 127)
58 /***********************************************************************
60 ***********************************************************************/
61 class SVX_DLLPUBLIC SvxDrawPage
: public ::cppu::WeakAggImplHelper5
< ::com::sun::star::drawing::XDrawPage
,
62 ::com::sun::star::drawing::XShapeGrouper
,
63 ::com::sun::star::lang::XServiceInfo
,
64 ::com::sun::star::lang::XUnoTunnel
,
65 ::com::sun::star::lang::XComponent
>,
67 protected SvxMutexHelper
70 cppu::OBroadcastHelper mrBHelper
;
76 void _SelectObjectsInView( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
>& aShapes
, SdrPageView
* pPageView
) throw ();
77 void _SelectObjectInView( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
, SdrPageView
* pPageView
) throw();
79 virtual void disposing() throw();
82 SvxDrawPage( SdrPage
* pPage
) throw();
83 virtual ~SvxDrawPage() throw();
86 SdrPage
* GetSdrPage() const { return mpPage
; }
87 void ChangeModel( SdrModel
* pNewModel
);
89 // Erzeugen eines SdrObjects und Einfugen in die SdrPage
90 SdrObject
*CreateSdrObject( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
) throw();
92 // Typ und Inventor bestimmen
93 void GetTypeAndInventor( sal_uInt16
& rType
, sal_uInt32
& rInventor
, const OUString
& aName
) const throw();
95 // Erzeugen eines SdrObjects anhand einer Description. Kann von
96 // abgeleiteten Klassen dazu benutzt werden, eigene Shapes zu
97 // unterstuetzen (z.B. Controls)
98 virtual SdrObject
*_CreateSdrObject( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
) throw();
100 static SvxShape
* CreateShapeByTypeAndInventor( sal_uInt16 nType
, sal_uInt32 nInventor
, SdrObject
*pObj
= NULL
, SvxDrawPage
*pPage
= NULL
) throw();
102 // Die folgende Methode wird gerufen, wenn ein SvxShape-Objekt angelegt
103 // werden soll. abgeleitete Klassen koennen hier eine Ableitung oder
104 // ein ein SvxShape aggregierenden Objekt anlegen.
105 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> _CreateShape( SdrObject
*pObj
) const throw();
107 UNO3_GETIMPLEMENTATION_DECL( SvxDrawPage
)
110 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
113 virtual void SAL_CALL
release() throw();
116 virtual void SAL_CALL
add( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
) throw(::com::sun::star::uno::RuntimeException
);
117 virtual void SAL_CALL
remove( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& xShape
) throw(::com::sun::star::uno::RuntimeException
);
120 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType() throw(::com::sun::star::uno::RuntimeException
);
121 virtual sal_Bool SAL_CALL
hasElements() throw(::com::sun::star::uno::RuntimeException
);
124 virtual sal_Int32 SAL_CALL
getCount() throw(::com::sun::star::uno::RuntimeException
) ;
125 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( sal_Int32 Index
) throw(::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
128 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapeGroup
> SAL_CALL
group( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
>& xShapes
) throw(::com::sun::star::uno::RuntimeException
);
129 virtual void SAL_CALL
ungroup( const ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapeGroup
>& aGroup
) throw(::com::sun::star::uno::RuntimeException
);
132 virtual OUString SAL_CALL
getImplementationName() throw(::com::sun::star::uno::RuntimeException
);
133 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw(::com::sun::star::uno::RuntimeException
);
134 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException
);
137 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
);
138 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw(::com::sun::star::uno::RuntimeException
);
139 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw(::com::sun::star::uno::RuntimeException
);
144 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */