merge the formfield patch from ooo-build
[ooovba.git] / toolkit / source / controls / grid / gridcolumn.cxx
blobbb3152ef6e91d3e19f5b0dd65989fdbb804e48e4
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: treedatamodel.cxx,v $
10 * $Revision: 1.4 $
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_toolkit.hxx"
33 #include "gridcolumn.hxx"
34 #include <comphelper/sequence.hxx>
35 #include <toolkit/helper/servicenames.hxx>
36 #include <rtl/ref.hxx>
38 using ::rtl::OUString;
39 using namespace ::com::sun::star;
40 using namespace ::com::sun::star::uno;
41 using namespace ::com::sun::star::awt;
42 using namespace ::com::sun::star::awt::grid;
43 using namespace ::com::sun::star::lang;
45 namespace toolkit
48 ///////////////////////////////////////////////////////////////////////
49 // class GridColumn
50 ///////////////////////////////////////////////////////////////////////
52 GridColumn::GridColumn()
53 : identifier(Any())
57 //---------------------------------------------------------------------
59 GridColumn::~GridColumn()
63 //---------------------------------------------------------------------
65 //---------------------------------------------------------------------
66 // XGridColumn
67 //---------------------------------------------------------------------
69 ::com::sun::star::uno::Any SAL_CALL GridColumn::getIdentifier() throw (::com::sun::star::uno::RuntimeException)
71 return identifier;
74 //---------------------------------------------------------------------
76 void SAL_CALL GridColumn::setIdentifier(const ::com::sun::star::uno::Any & value) throw (::com::sun::star::uno::RuntimeException)
78 value >>= identifier;
81 //--------------------------------------------------------------------
83 ::sal_Int32 SAL_CALL GridColumn::getColumnWidth() throw (::com::sun::star::uno::RuntimeException)
85 return columnWidth;
88 //--------------------------------------------------------------------
90 void SAL_CALL GridColumn::setColumnWidth(::sal_Int32 value) throw (::com::sun::star::uno::RuntimeException)
92 columnWidth = value;
95 //--------------------------------------------------------------------
97 ::rtl::OUString SAL_CALL GridColumn::getTitle() throw (::com::sun::star::uno::RuntimeException)
99 return title;
102 //--------------------------------------------------------------------
104 void SAL_CALL GridColumn::setTitle(const ::rtl::OUString & value) throw (::com::sun::star::uno::RuntimeException)
106 title = value;
109 //---------------------------------------------------------------------
110 // XComponent
111 //---------------------------------------------------------------------
113 void SAL_CALL GridColumn::dispose() throw (RuntimeException)
117 //---------------------------------------------------------------------
119 void SAL_CALL GridColumn::addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
121 (void) xListener;
124 //---------------------------------------------------------------------
126 void SAL_CALL GridColumn::removeEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException)
128 (void) xListener;
131 //---------------------------------------------------------------------
132 // XServiceInfo
133 //---------------------------------------------------------------------
135 ::rtl::OUString SAL_CALL GridColumn::getImplementationName( ) throw (RuntimeException)
137 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
138 static const OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "toolkit.GridColumn" ) );
139 return aImplName;
142 //---------------------------------------------------------------------
144 sal_Bool SAL_CALL GridColumn::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
146 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
147 return ServiceName.equalsAscii( szServiceName_GridColumn );
150 //---------------------------------------------------------------------
152 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL GridColumn::getSupportedServiceNames( ) throw (RuntimeException)
154 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
155 static const OUString aServiceName( OUString::createFromAscii( szServiceName_GridColumn ) );
156 static const Sequence< OUString > aSeq( &aServiceName, 1 );
157 return aSeq;
162 Reference< XInterface > SAL_CALL GridColumn_CreateInstance( const Reference< XMultiServiceFactory >& )
164 return Reference < XInterface >( ( ::cppu::OWeakObject* ) new ::toolkit::GridColumn );