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/awt/Gradient.hpp> 27 #include <svl/itempool.hxx> 28 #include <svl/itemset.hxx> 29 #include <svx/xgrad.hxx> 30 #include <svx/xflftrit.hxx> 31 32 #include <svx/svdmodel.hxx> 33 #include <svx/xflhtit.hxx> 34 #include "svx/unofill.hxx" 35 #include <svx/unomid.hxx> 36 #include "UnoNameItemTable.hxx" 37 38 using namespace ::com::sun::star; 39 using namespace ::rtl; 40 using namespace ::cppu; 41 42 class SvxUnoTransGradientTable : public SvxUnoNameItemTable 43 { 44 public: 45 SvxUnoTransGradientTable( SdrModel* pModel ) throw(); 46 virtual ~SvxUnoTransGradientTable() 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 SvxUnoTransGradientTable(SdrModel * pModel)58SvxUnoTransGradientTable::SvxUnoTransGradientTable( SdrModel* pModel ) throw() 59 : SvxUnoNameItemTable( pModel, XATTR_FILLFLOATTRANSPARENCE, MID_FILLGRADIENT ) 60 { 61 } 62 ~SvxUnoTransGradientTable()63SvxUnoTransGradientTable::~SvxUnoTransGradientTable() throw() 64 { 65 } 66 getImplementationName()67OUString SAL_CALL SvxUnoTransGradientTable::getImplementationName() throw( uno::RuntimeException ) 68 { 69 return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoTransGradientTable") ); 70 } 71 getSupportedServiceNames()72uno::Sequence< OUString > SAL_CALL SvxUnoTransGradientTable::getSupportedServiceNames( ) 73 throw( uno::RuntimeException ) 74 { 75 uno::Sequence< OUString > aSNS( 1 ); 76 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TransparencyGradientTable" )); 77 return aSNS; 78 } 79 createItem() const80NameOrIndex* SvxUnoTransGradientTable::createItem() const throw() 81 { 82 XFillFloatTransparenceItem* pNewItem = new XFillFloatTransparenceItem(); 83 pNewItem->SetEnabled( sal_True ); 84 return pNewItem; 85 } 86 87 // XElementAccess getElementType()88uno::Type SAL_CALL SvxUnoTransGradientTable::getElementType( ) 89 throw( uno::RuntimeException ) 90 { 91 return ::getCppuType((const struct awt::Gradient*)0); 92 } 93 94 /** 95 * Create a hatchtable 96 */ SvxUnoTransGradientTable_createInstance(SdrModel * pModel)97uno::Reference< uno::XInterface > SAL_CALL SvxUnoTransGradientTable_createInstance( SdrModel* pModel ) 98 { 99 return *new SvxUnoTransGradientTable(pModel); 100 } 101 102 103 104