1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef INCLUDED_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX 25 #define INCLUDED_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX 26 27 #include <com/sun/star/graphic/XPrimitiveFactory2D.hpp> 28 #include <cppuhelper/compbase1.hxx> 29 #include <comphelper/broadcasthelper.hxx> 30 31 #include <svx/svxdllapi.h> 32 33 ////////////////////////////////////////////////////////////////////////////// 34 // UNO API helper methods 35 36 namespace drawinglayer 37 { 38 namespace primitive2d 39 { 40 SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL XPrimitiveFactory2DProvider_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception ); 41 } // end of namespace primitive2d 42 } // end of namespace drawinglayer 43 44 ////////////////////////////////////////////////////////////////////////////// 45 // PrimitiveFactory2D class 46 47 namespace drawinglayer 48 { 49 namespace primitive2d 50 { 51 // typedef for PrimitiveFactory2DImplBase 52 typedef cppu::WeakComponentImplHelper1< ::com::sun::star::graphic::XPrimitiveFactory2D > PrimitiveFactory2DImplBase; 53 54 // base class for C++ implementation of com::sun::star::graphic::XPrimitiveFactory2D 55 class PrimitiveFactory2D 56 : protected comphelper::OBaseMutex, 57 public PrimitiveFactory2DImplBase 58 { 59 private: 60 protected: 61 public: 62 // constructor 63 PrimitiveFactory2D(); 64 65 // Methods from XPrimitiveFactory2D 66 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException); 67 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXDrawPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aParms ) throw (::com::sun::star::uno::RuntimeException); 68 69 // UNO API helpers 70 SVX_DLLPUBLIC static rtl::OUString getImplementationName_Static(); 71 SVX_DLLPUBLIC static com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static(); 72 }; 73 } // end of namespace primitive2d 74 } // end of namespace drawinglayer 75 76 ////////////////////////////////////////////////////////////////////////////// 77 78 #endif //INCLUDED_SDR_PRIMITIVE2D_PRIMITIVEFACTORY2D_HXX 79 80 // eof 81