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