xref: /aoo42x/main/svx/source/unodraw/unohtabl.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_svx.hxx"
30 #include <com/sun/star/drawing/Hatch.hpp>
31 #include <svl/itempool.hxx>
32 #include <svl/itemset.hxx>
33 #include "UnoNameItemTable.hxx"
34 
35 #include <svx/xhatch.hxx>
36 #include <svx/svdmodel.hxx>
37 #include <svx/xdef.hxx>
38 #include <svx/xflhtit.hxx>
39 #include <svx/unomid.hxx>
40 #include "svx/unofill.hxx"
41 
42 using namespace ::com::sun::star;
43 using namespace ::rtl;
44 using namespace ::cppu;
45 
46 class SvxUnoHatchTable : public SvxUnoNameItemTable
47 {
48 public:
49 	SvxUnoHatchTable( SdrModel* pModel ) throw();
50 	virtual	~SvxUnoHatchTable() throw();
51 
52 	virtual NameOrIndex* createItem() const throw();
53 
54     // XServiceInfo
55     virtual OUString SAL_CALL getImplementationName(  ) throw( uno::RuntimeException );
56     virtual uno::Sequence<  OUString > SAL_CALL getSupportedServiceNames(  ) throw( uno::RuntimeException);
57 
58 	// XElementAccess
59     virtual uno::Type SAL_CALL getElementType(  ) throw( uno::RuntimeException);
60 };
61 
62 SvxUnoHatchTable::SvxUnoHatchTable( SdrModel* pModel ) throw()
63 : SvxUnoNameItemTable( pModel, XATTR_FILLHATCH, MID_FILLHATCH )
64 {
65 }
66 
67 SvxUnoHatchTable::~SvxUnoHatchTable() throw()
68 {
69 }
70 
71 OUString SAL_CALL SvxUnoHatchTable::getImplementationName() throw( uno::RuntimeException )
72 {
73 	return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoHatchTable") );
74 }
75 
76 uno::Sequence< OUString > SAL_CALL SvxUnoHatchTable::getSupportedServiceNames(  )
77 	throw( uno::RuntimeException )
78 {
79     uno::Sequence< OUString > aSNS( 1 );
80     aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.HatchTable" ));
81     return aSNS;
82 }
83 
84 NameOrIndex* SvxUnoHatchTable::createItem() const throw()
85 {
86 	return new XFillHatchItem();
87 }
88 
89 // XElementAccess
90 uno::Type SAL_CALL SvxUnoHatchTable::getElementType(  )
91 	throw( uno::RuntimeException )
92 {
93 	return ::getCppuType((const struct drawing::Hatch*)0);
94 }
95 
96 /**
97  * Create a hatchtable
98  */
99 uno::Reference< uno::XInterface > SAL_CALL SvxUnoHatchTable_createInstance( SdrModel* pModel )
100 {
101 	return *new SvxUnoHatchTable(pModel);
102 }
103 
104 
105 
106