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 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_svx.hxx" 26 #include <com/sun/star/drawing/Hatch.hpp> 27 #include <svl/itempool.hxx> 28 #include <svl/itemset.hxx> 29 #include "UnoNameItemTable.hxx" 30 31 #include <svx/xhatch.hxx> 32 #include <svx/svdmodel.hxx> 33 #include <svx/xdef.hxx> 34 #include <svx/xflhtit.hxx> 35 #include <svx/unomid.hxx> 36 #include "svx/unofill.hxx" 37 38 using namespace ::com::sun::star; 39 using namespace ::rtl; 40 using namespace ::cppu; 41 42 class SvxUnoHatchTable : public SvxUnoNameItemTable 43 { 44 public: 45 SvxUnoHatchTable( SdrModel* pModel ) throw(); 46 virtual ~SvxUnoHatchTable() throw(); 47 48 virtual NameOrIndex* createItem() const throw(); 49 50 // XServiceInfo 51 virtual OUString SAL_CALL getImplementationName( ) throw( uno::RuntimeException ); 52 virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw( uno::RuntimeException); 53 54 // XElementAccess 55 virtual uno::Type SAL_CALL getElementType( ) throw( uno::RuntimeException); 56 }; 57 SvxUnoHatchTable(SdrModel * pModel)58SvxUnoHatchTable::SvxUnoHatchTable( SdrModel* pModel ) throw() 59 : SvxUnoNameItemTable( pModel, XATTR_FILLHATCH, MID_FILLHATCH ) 60 { 61 } 62 ~SvxUnoHatchTable()63SvxUnoHatchTable::~SvxUnoHatchTable() throw() 64 { 65 } 66 getImplementationName()67OUString SAL_CALL SvxUnoHatchTable::getImplementationName() throw( uno::RuntimeException ) 68 { 69 return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoHatchTable") ); 70 } 71 getSupportedServiceNames()72uno::Sequence< OUString > SAL_CALL SvxUnoHatchTable::getSupportedServiceNames( ) 73 throw( uno::RuntimeException ) 74 { 75 uno::Sequence< OUString > aSNS( 1 ); 76 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.HatchTable" )); 77 return aSNS; 78 } 79 createItem() const80NameOrIndex* SvxUnoHatchTable::createItem() const throw() 81 { 82 return new XFillHatchItem(); 83 } 84 85 // XElementAccess getElementType()86uno::Type SAL_CALL SvxUnoHatchTable::getElementType( ) 87 throw( uno::RuntimeException ) 88 { 89 return ::getCppuType((const struct drawing::Hatch*)0); 90 } 91 92 /** 93 * Create a hatchtable 94 */ SvxUnoHatchTable_createInstance(SdrModel * pModel)95uno::Reference< uno::XInterface > SAL_CALL SvxUnoHatchTable_createInstance( SdrModel* pModel ) 96 { 97 return *new SvxUnoHatchTable(pModel); 98 } 99 100 101 102