<commit_before>/*************************************************************************
 *
 *  $RCSfile: resultsetmetadata.hxx,v $
 *
 *  $Revision: 1.3 $
 *
 *  last change: $Author: kso $ $Date: 2001-01-26 11:28:30 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (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.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/

#ifndef _UCBHELPER_RESULTSETMETADATA_HXX
#define _UCBHELPER_RESULTSETMETADATA_HXX

#include <vector>

#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
#include <com/sun/star/uno/Reference.hxx>
#endif
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
#include <com/sun/star/uno/Sequence.hxx>
#endif

#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
#include <com/sun/star/lang/XTypeProvider.hpp>
#endif
#ifndef _COM_SUN_STAR_SDBC_COLUMNVALUE_HPP_
#include <com/sun/star/sdbc/ColumnValue.hpp>
#endif
#ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATA_HPP_
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
#endif

#ifndef _CPPUHELPER_WEAK_HXX_
#include <cppuhelper/weak.hxx>
#endif

#ifndef _UCBHELPER_MACROS_HXX
#include <ucbhelper/macros.hxx>
#endif

namespace com { namespace sun { namespace star {
    namespace lang  { class XMultiServiceFactory; }
    namespace beans { struct Property; }
} } }

namespace ucb
{

//=========================================================================

/**
 * This is a structure that holds additional meta data for one column
 * of a resultset. The default values set in the constructor should be a
 * good guess for many UCB use cases.
 */
struct ResultSetColumnData
{
    /** @see ResultSetMetaData::isAutoIncrement */
    sal_Bool        isAutoIncrement;

    /** @see ResultSetMetaData::isCaseSensitive */
    sal_Bool        isCaseSensitive;

    /** @see ResultSetMetaData::isSearchable */
    sal_Bool        isSearchable;

    /** @see ResultSetMetaData::isCurrency */
    sal_Bool        isCurrency;

    /** @see ResultSetMetaData::isNullable */
    sal_Int32       isNullable;

    /** @see ResultSetMetaData::isSigned */
    sal_Bool        isSigned;

    /** @see ResultSetMetaData::getColumnDisplaySize */
    sal_Int32       columnDisplaySize;

    /** @see ResultSetMetaData::getColumnLabel */
    ::rtl::OUString columnLabel;

    /** @see ResultSetMetaData::getSchemaName */
    ::rtl::OUString schemaName;

    /** @see ResultSetMetaData::getPrecision */
    sal_Int32       precision;

    /** @see ResultSetMetaData::getScale */
    sal_Int32       scale;

    /** @see ResultSetMetaData::getTableName */
    ::rtl::OUString tableName;

    /** @see ResultSetMetaData::getCatalogName */
    ::rtl::OUString catalogName;

    /** @see ResultSetMetaData::getColumnTypeName */
    ::rtl::OUString columnTypeName;

    /** @see ResultSetMetaData::isReadOnly */
    sal_Bool        isReadOnly;

    /** @see ResultSetMetaData::isWritable */
    sal_Bool        isWritable;

    /** @see ResultSetMetaData::isDefinitelyWritable */
    sal_Bool        isDefinitelyWritable;

    /** @see ResultSetMetaData::getColumnServiceName */
    ::rtl::OUString columnServiceName;

    inline ResultSetColumnData();
};

// Note: Never change the initial values! Implementations using this struct
//       may havily depend on the behaviour of the default constructor.

ResultSetColumnData::ResultSetColumnData()
: isAutoIncrement( sal_False ),
  isCaseSensitive( sal_True ),
  isSearchable( sal_False ),
  isCurrency( sal_False ),
  isNullable( ::com::sun::star::sdbc::ColumnValue::NULLABLE ),
  isSigned( sal_False ),
  columnDisplaySize( 16 ),
  precision( -1 ),
  scale( 0 ),
  isReadOnly( sal_True ),
  isWritable( sal_False ),
  isDefinitelyWritable( sal_False )
{
}

//=========================================================================

struct ResultSetMetaData_Impl;

/**
 * This is an implementation of the interface XResultSetMetaData. It can be
 * used to implement the interface
 * com::sun::star::sdbc::XResultSetMetaDataSupplier, which is required for
 * implementations of service com.sun.star.ucb.ContentResultSet.
 */
class ResultSetMetaData :
                public ::cppu::OWeakObject,
                public ::com::sun::star::lang::XTypeProvider,
                public ::com::sun::star::sdbc::XResultSetMetaData
{
private:
    ResultSetMetaData_Impl* m_pImpl;

protected:
    ::com::sun::star::uno::Reference<
        ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
    ::com::sun::star::uno::Sequence<
        ::com::sun::star::beans::Property >            m_aProps;
    sal_Bool m_bReadOnly;

public:

    /**
      * Constructor.
      *
      * @param rxSMgr is a Servive Manager.
      * @param rProps is a sequence of properties (partially) describing the
      *        columns of a resultset.
      * @param bReadOnly is used to specify whether the whole(!) resultset
      *        is read-only.
      */
    ResultSetMetaData(
            const ::com::sun::star::uno::Reference<
                ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,<commit_msg>INTEGRATION: CWS visibility02 (1.3.166); FILE MERGED 2004/12/22 04:02:26 mnicel 1.3.166.1: Issue number:38608 Symbol visibility work.<commit_after>/*************************************************************************
 *
 *  $RCSfile: resultsetmetadata.hxx,v $
 *
 *  $Revision: 1.4 $
 *
 *  last change: $Author: vg $ $Date: 2005-02-16 15:46:39 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (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.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/

#ifndef _UCBHELPER_RESULTSETMETADATA_HXX
#define _UCBHELPER_RESULTSETMETADATA_HXX

#include <vector>

#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
#include <com/sun/star/uno/Reference.hxx>
#endif
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
#include <com/sun/star/uno/Sequence.hxx>
#endif

#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
#include <com/sun/star/lang/XTypeProvider.hpp>
#endif
#ifndef _COM_SUN_STAR_SDBC_COLUMNVALUE_HPP_
#include <com/sun/star/sdbc/ColumnValue.hpp>
#endif
#ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATA_HPP_
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
#endif

#ifndef _CPPUHELPER_WEAK_HXX_
#include <cppuhelper/weak.hxx>
#endif

#ifndef _UCBHELPER_MACROS_HXX
#include <ucbhelper/macros.hxx>
#endif
#ifndef INCLUDED_UCBHELPERDLLAPI_H
#include "ucbhelper/ucbhelperdllapi.h"
#endif

namespace com { namespace sun { namespace star {
    namespace lang  { class XMultiServiceFactory; }
    namespace beans { struct Property; }
} } }

namespace ucb
{

//=========================================================================

/**
 * This is a structure that holds additional meta data for one column
 * of a resultset. The default values set in the constructor should be a
 * good guess for many UCB use cases.
 */
struct ResultSetColumnData
{
    /** @see ResultSetMetaData::isAutoIncrement */
    sal_Bool        isAutoIncrement;

    /** @see ResultSetMetaData::isCaseSensitive */
    sal_Bool        isCaseSensitive;

    /** @see ResultSetMetaData::isSearchable */
    sal_Bool        isSearchable;

    /** @see ResultSetMetaData::isCurrency */
    sal_Bool        isCurrency;

    /** @see ResultSetMetaData::isNullable */
    sal_Int32       isNullable;

    /** @see ResultSetMetaData::isSigned */
    sal_Bool        isSigned;

    /** @see ResultSetMetaData::getColumnDisplaySize */
    sal_Int32       columnDisplaySize;

    /** @see ResultSetMetaData::getColumnLabel */
    ::rtl::OUString columnLabel;

    /** @see ResultSetMetaData::getSchemaName */
    ::rtl::OUString schemaName;

    /** @see ResultSetMetaData::getPrecision */
    sal_Int32       precision;

    /** @see ResultSetMetaData::getScale */
    sal_Int32       scale;

    /** @see ResultSetMetaData::getTableName */
    ::rtl::OUString tableName;

    /** @see ResultSetMetaData::getCatalogName */
    ::rtl::OUString catalogName;

    /** @see ResultSetMetaData::getColumnTypeName */
    ::rtl::OUString columnTypeName;

    /** @see ResultSetMetaData::isReadOnly */
    sal_Bool        isReadOnly;

    /** @see ResultSetMetaData::isWritable */
    sal_Bool        isWritable;

    /** @see ResultSetMetaData::isDefinitelyWritable */
    sal_Bool        isDefinitelyWritable;

    /** @see ResultSetMetaData::getColumnServiceName */
    ::rtl::OUString columnServiceName;

    inline ResultSetColumnData();
};

// Note: Never change the initial values! Implementations using this struct
//       may havily depend on the behaviour of the default constructor.

ResultSetColumnData::ResultSetColumnData()
: isAutoIncrement( sal_False ),
  isCaseSensitive( sal_True ),
  isSearchable( sal_False ),
  isCurrency( sal_False ),
  isNullable( ::com::sun::star::sdbc::ColumnValue::NULLABLE ),
  isSigned( sal_False ),
  columnDisplaySize( 16 ),
  precision( -1 ),
  scale( 0 ),
  isReadOnly( sal_True ),
  isWritable( sal_False ),
  isDefinitelyWritable( sal_False )
{
}

//=========================================================================

struct ResultSetMetaData_Impl;

/**
 * This is an implementation of the interface XResultSetMetaData. It can be
 * used to implement the interface
 * com::sun::star::sdbc::XResultSetMetaDataSupplier, which is required for
 * implementations of service com.sun.star.ucb.ContentResultSet.
 */
class UCBHELPER_DLLPUBLIC ResultSetMetaData :
                public ::cppu::OWeakObject,
                public ::com::sun::star::lang::XTypeProvider,
                public ::com::sun::star::sdbc::XResultSetMetaData
{
private:
    ResultSetMetaData_Impl* m_pImpl;

protected:
    ::com::sun::star::uno::Reference<
        ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
    ::com::sun::star::uno::Sequence<
        ::com::sun::star::beans::Property >            m_aProps;
    sal_Bool m_bReadOnly;

public:

    /**
      * Constructor.
      *
      * @param rxSMgr is a Servive Manager.
      * @param rProps is a sequence of properties (partially) describing the
      *        columns of a resultset.
      * @param bReadOnly is used to specify whether the whole(!) resultset
      *        is read-only.
      */
    ResultSetMetaData(
            const ::com::sun::star::uno::Reference<
                ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
{'fraction_non_alphanumeric': 0.14603240548400498, 'fraction_numerical': 0.012463647694225177, 'mean_word_length': 3.7682403433476397, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '519881', 'n_tokens_mistral': 4394, 'n_tokens_neox': 4164, 'n_words': 1209}