Update ooo320-m1
[ooovba.git] / svx / source / unodraw / unottabl.cxx
blob172f8a5f6986ef157a1954b6322f68f8183c6843
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unottabl.cxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
33 #include <com/sun/star/awt/Gradient.hpp>
34 #include <svtools/itempool.hxx>
35 #include <svtools/itemset.hxx>
36 #include <svx/xgrad.hxx>
37 #include <svx/xflftrit.hxx>
39 #include <svx/svdmodel.hxx>
40 #include <svx/xflhtit.hxx>
41 #include "unofill.hxx"
42 #include <svx/unomid.hxx>
43 #include "UnoNameItemTable.hxx"
45 using namespace ::com::sun::star;
46 using namespace ::rtl;
47 using namespace ::cppu;
49 class SvxUnoTransGradientTable : public SvxUnoNameItemTable
51 public:
52 SvxUnoTransGradientTable( SdrModel* pModel ) throw();
53 virtual ~SvxUnoTransGradientTable() throw();
55 virtual NameOrIndex* createItem() const throw();
57 // XServiceInfo
58 virtual OUString SAL_CALL getImplementationName( ) throw( uno::RuntimeException );
59 virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw( uno::RuntimeException);
61 // XElementAccess
62 virtual uno::Type SAL_CALL getElementType( ) throw( uno::RuntimeException);
65 SvxUnoTransGradientTable::SvxUnoTransGradientTable( SdrModel* pModel ) throw()
66 : SvxUnoNameItemTable( pModel, XATTR_FILLFLOATTRANSPARENCE, MID_FILLGRADIENT )
70 SvxUnoTransGradientTable::~SvxUnoTransGradientTable() throw()
74 OUString SAL_CALL SvxUnoTransGradientTable::getImplementationName() throw( uno::RuntimeException )
76 return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoTransGradientTable") );
79 uno::Sequence< OUString > SAL_CALL SvxUnoTransGradientTable::getSupportedServiceNames( )
80 throw( uno::RuntimeException )
82 uno::Sequence< OUString > aSNS( 1 );
83 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TransparencyGradientTable" ));
84 return aSNS;
87 NameOrIndex* SvxUnoTransGradientTable::createItem() const throw()
89 XFillFloatTransparenceItem* pNewItem = new XFillFloatTransparenceItem();
90 pNewItem->SetEnabled( TRUE );
91 return pNewItem;
94 // XElementAccess
95 uno::Type SAL_CALL SvxUnoTransGradientTable::getElementType( )
96 throw( uno::RuntimeException )
98 return ::getCppuType((const struct awt::Gradient*)0);
102 * Create a hatchtable
104 uno::Reference< uno::XInterface > SAL_CALL SvxUnoTransGradientTable_createInstance( SdrModel* pModel )
106 return *new SvxUnoTransGradientTable(pModel);