merge the formfield patch from ooo-build
[ooovba.git] / svx / source / unodraw / unogtabl.cxx
blob9e17cc99e3ff69fef1726886b774fa366fa35b0a
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: unogtabl.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 "UnoNameItemTable.hxx"
38 #include <svx/xgrad.hxx>
39 #include <svx/svdmodel.hxx>
40 #include <svx/xdef.hxx>
41 #include <svx/xflgrit.hxx>
42 #include "unofill.hxx"
43 #include <svx/unomid.hxx>
45 using namespace ::com::sun::star;
46 using namespace ::rtl;
47 using namespace ::cppu;
49 class SvxUnoGradientTable : public SvxUnoNameItemTable
51 public:
52 SvxUnoGradientTable( SdrModel* pModel ) throw();
53 virtual ~SvxUnoGradientTable() 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 SvxUnoGradientTable::SvxUnoGradientTable( SdrModel* pModel ) throw()
66 : SvxUnoNameItemTable( pModel, XATTR_FILLGRADIENT, MID_FILLGRADIENT )
70 SvxUnoGradientTable::~SvxUnoGradientTable() throw()
74 OUString SAL_CALL SvxUnoGradientTable::getImplementationName() throw( uno::RuntimeException )
76 return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoGradientTable") );
79 uno::Sequence< OUString > SAL_CALL SvxUnoGradientTable::getSupportedServiceNames( )
80 throw( uno::RuntimeException )
82 uno::Sequence< OUString > aSNS( 1 );
83 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GradientTable" ));
84 return aSNS;
88 // XNameContainer
89 NameOrIndex* SvxUnoGradientTable::createItem() const throw()
91 return new XFillGradientItem();
94 // XElementAccess
95 uno::Type SAL_CALL SvxUnoGradientTable::getElementType( )
96 throw( uno::RuntimeException )
98 return ::getCppuType((const struct awt::Gradient*)0);
102 * Create a gradienttable
104 uno::Reference< uno::XInterface > SAL_CALL SvxUnoGradientTable_createInstance( SdrModel* pModel )
106 return *new SvxUnoGradientTable(pModel);