2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 22:04:38 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2006-09-17 02:11:53 +00:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
#include "connectivity/sdbcx/VIndexColumn.hxx"
|
2001-05-14 10:42:44 +00:00
|
|
|
#include "TConnection.hxx"
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2001-05-14 10:42:44 +00:00
|
|
|
using namespace connectivity;
|
2000-09-18 15:18:56 +00:00
|
|
|
using namespace connectivity::sdbcx;
|
|
|
|
using namespace ::com::sun::star::beans;
|
2000-10-30 06:55:15 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
2000-11-03 12:36:27 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
::rtl::OUString SAL_CALL OIndexColumn::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
if(isNew())
|
2012-06-02 09:07:17 -05:00
|
|
|
return ::rtl::OUString("com.sun.star.sdbcx.VIndexColumnDescription");
|
|
|
|
return ::rtl::OUString("com.sun.star.sdbcx.VIndex");
|
2000-11-03 12:36:27 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OIndexColumn::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1);
|
|
|
|
if(isNew())
|
2012-06-02 09:07:17 -05:00
|
|
|
aSupported[0] = ::rtl::OUString("com.sun.star.sdbcx.IndexDescription");
|
2000-11-03 12:36:27 +00:00
|
|
|
else
|
2012-06-02 09:07:17 -05:00
|
|
|
aSupported[0] = ::rtl::OUString("com.sun.star.sdbcx.Index");
|
2000-11-03 12:36:27 +00:00
|
|
|
|
|
|
|
return aSupported;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OIndexColumn::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException)
|
|
|
|
{
|
2001-05-17 08:15:34 +00:00
|
|
|
Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
|
2000-11-03 12:36:27 +00:00
|
|
|
const ::rtl::OUString* pSupported = aSupported.getConstArray();
|
2001-05-17 08:15:34 +00:00
|
|
|
const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
|
|
|
|
for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
|
|
|
|
;
|
2000-11-03 12:36:27 +00:00
|
|
|
|
2001-05-17 08:15:34 +00:00
|
|
|
return pSupported != pEnd;
|
2000-11-03 12:36:27 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
OIndexColumn::OIndexColumn(sal_Bool _bCase) : OColumn(_bCase), m_IsAscending(sal_True)
|
|
|
|
{
|
2001-03-16 15:28:45 +00:00
|
|
|
construct();
|
2000-11-03 12:36:27 +00:00
|
|
|
}
|
2001-03-16 15:28:45 +00:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
OIndexColumn::OIndexColumn( sal_Bool _IsAscending,
|
|
|
|
const ::rtl::OUString& _Name,
|
|
|
|
const ::rtl::OUString& _TypeName,
|
|
|
|
const ::rtl::OUString& _DefaultValue,
|
|
|
|
sal_Int32 _IsNullable,
|
|
|
|
sal_Int32 _Precision,
|
|
|
|
sal_Int32 _Scale,
|
|
|
|
sal_Int32 _Type,
|
|
|
|
sal_Bool _IsAutoIncrement,
|
|
|
|
sal_Bool _IsRowVersion,
|
|
|
|
sal_Bool _IsCurrency,
|
|
|
|
sal_Bool _bCase
|
|
|
|
) : OColumn(_Name,
|
|
|
|
_TypeName,
|
|
|
|
_DefaultValue,
|
2010-01-13 08:44:34 +01:00
|
|
|
::rtl::OUString(),
|
2000-09-18 15:18:56 +00:00
|
|
|
_IsNullable,
|
|
|
|
_Precision,
|
|
|
|
_Scale,
|
|
|
|
_Type,
|
|
|
|
_IsAutoIncrement,
|
|
|
|
_IsRowVersion,
|
|
|
|
_IsCurrency,
|
|
|
|
_bCase)
|
|
|
|
, m_IsAscending(_IsAscending)
|
|
|
|
{
|
|
|
|
construct();
|
|
|
|
}
|
2001-03-02 14:26:27 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2006-06-20 01:10:46 +00:00
|
|
|
::cppu::IPropertyArrayHelper* OIndexColumn::createArrayHelper( sal_Int32 /*_nId*/ ) const
|
2001-03-02 14:26:27 +00:00
|
|
|
{
|
2006-06-20 01:10:46 +00:00
|
|
|
return doCreateArrayHelper();
|
2001-03-02 14:26:27 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
::cppu::IPropertyArrayHelper& SAL_CALL OIndexColumn::getInfoHelper()
|
|
|
|
{
|
|
|
|
return *OIndexColumn_PROP::getArrayHelper(isNew() ? 1 : 0);
|
|
|
|
}
|
2000-09-18 15:18:56 +00:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void OIndexColumn::construct()
|
|
|
|
{
|
2000-10-30 06:55:15 +00:00
|
|
|
sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
|
2001-05-14 10:42:44 +00:00
|
|
|
registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISASCENDING), PROPERTY_ID_ISASCENDING, nAttrib,&m_IsAscending, ::getBooleanCppuType());
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
2001-03-02 14:26:27 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|