1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: VIndexColumn.cxx,v $
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_connectivity.hxx"
33 #include "connectivity/sdbcx/VIndexColumn.hxx"
34 #include "TConnection.hxx"
36 using namespace connectivity
;
37 using namespace connectivity::sdbcx
;
38 using namespace ::com::sun::star::beans
;
39 using namespace ::com::sun::star::uno
;
40 // -----------------------------------------------------------------------------
41 ::rtl::OUString SAL_CALL
OIndexColumn::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException
)
44 return ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.VIndexColumnDescription");
45 return ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.VIndex");
47 // -----------------------------------------------------------------------------
48 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
OIndexColumn::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
)
50 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> aSupported(1);
52 aSupported
[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.IndexDescription");
54 aSupported
[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.Index");
58 // -----------------------------------------------------------------------------
59 sal_Bool SAL_CALL
OIndexColumn::supportsService( const ::rtl::OUString
& _rServiceName
) throw(::com::sun::star::uno::RuntimeException
)
61 Sequence
< ::rtl::OUString
> aSupported(getSupportedServiceNames());
62 const ::rtl::OUString
* pSupported
= aSupported
.getConstArray();
63 const ::rtl::OUString
* pEnd
= pSupported
+ aSupported
.getLength();
64 for (;pSupported
!= pEnd
&& !pSupported
->equals(_rServiceName
); ++pSupported
)
67 return pSupported
!= pEnd
;
69 // -----------------------------------------------------------------------------
70 OIndexColumn::OIndexColumn(sal_Bool _bCase
) : OColumn(_bCase
), m_IsAscending(sal_True
)
75 // -------------------------------------------------------------------------
76 OIndexColumn::OIndexColumn( sal_Bool _IsAscending
,
77 const ::rtl::OUString
& _Name
,
78 const ::rtl::OUString
& _TypeName
,
79 const ::rtl::OUString
& _DefaultValue
,
80 sal_Int32 _IsNullable
,
84 sal_Bool _IsAutoIncrement
,
85 sal_Bool _IsRowVersion
,
99 , m_IsAscending(_IsAscending
)
103 // -----------------------------------------------------------------------------
104 ::cppu::IPropertyArrayHelper
* OIndexColumn::createArrayHelper( sal_Int32
/*_nId*/ ) const
106 return doCreateArrayHelper();
108 // -----------------------------------------------------------------------------
109 ::cppu::IPropertyArrayHelper
& SAL_CALL
OIndexColumn::getInfoHelper()
111 return *OIndexColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
113 // -------------------------------------------------------------------------
114 void OIndexColumn::construct()
116 sal_Int32 nAttrib
= isNew() ? 0 : PropertyAttribute::READONLY
;
117 registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING
), PROPERTY_ID_ISASCENDING
, nAttrib
,&m_IsAscending
, ::getBooleanCppuType());
119 // -----------------------------------------------------------------------------