merge the formfield patch from ooo-build
[ooovba.git] / svx / source / unodraw / unohtabl.cxx
blob329905c31d670d0a0ff36e908cde6ea759c4aa40
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: unohtabl.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/drawing/Hatch.hpp>
34 #include <svtools/itempool.hxx>
35 #include <svtools/itemset.hxx>
36 #include "UnoNameItemTable.hxx"
38 #include <svx/xhatch.hxx>
39 #include <svx/svdmodel.hxx>
40 #include <svx/xdef.hxx>
41 #include <svx/xflhtit.hxx>
42 #include <svx/unomid.hxx>
43 #include "unofill.hxx"
45 using namespace ::com::sun::star;
46 using namespace ::rtl;
47 using namespace ::cppu;
49 class SvxUnoHatchTable : public SvxUnoNameItemTable
51 public:
52 SvxUnoHatchTable( SdrModel* pModel ) throw();
53 virtual ~SvxUnoHatchTable() 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 SvxUnoHatchTable::SvxUnoHatchTable( SdrModel* pModel ) throw()
66 : SvxUnoNameItemTable( pModel, XATTR_FILLHATCH, MID_FILLHATCH )
70 SvxUnoHatchTable::~SvxUnoHatchTable() throw()
74 OUString SAL_CALL SvxUnoHatchTable::getImplementationName() throw( uno::RuntimeException )
76 return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoHatchTable") );
79 uno::Sequence< OUString > SAL_CALL SvxUnoHatchTable::getSupportedServiceNames( )
80 throw( uno::RuntimeException )
82 uno::Sequence< OUString > aSNS( 1 );
83 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.HatchTable" ));
84 return aSNS;
87 NameOrIndex* SvxUnoHatchTable::createItem() const throw()
89 return new XFillHatchItem();
92 // XElementAccess
93 uno::Type SAL_CALL SvxUnoHatchTable::getElementType( )
94 throw( uno::RuntimeException )
96 return ::getCppuType((const struct drawing::Hatch*)0);
99 /**
100 * Create a hatchtable
102 uno::Reference< uno::XInterface > SAL_CALL SvxUnoHatchTable_createInstance( SdrModel* pModel )
104 return *new SvxUnoHatchTable(pModel);