Update ooo320-m1
[ooovba.git] / connectivity / source / drivers / evoab / LTable.hxx
blob20a65dba1644818c09a58ab92bb4d5cdd037d054
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: LTable.hxx,v $
10 * $Revision: 1.7 $
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 #ifndef _CONNECTIVITY_EVOAB_LTABLE_HXX_
32 #define _CONNECTIVITY_EVOAB_LTABLE_HXX_
34 #include "file/FTable.hxx"
35 #include "connectivity/sdbcx/VColumn.hxx"
36 #include "connectivity/CommonTools.hxx"
37 #include <tools/urlobj.hxx>
38 #include "file/quotedstring.hxx"
39 #include <vector>
41 namespace connectivity
43 namespace evoab
45 typedef file::OFileTable OEvoabTable_BASE;
46 class OEvoabConnection;
48 typedef ::std::map< ::rtl::OUString,
49 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed>, comphelper::UStringMixLess > OContainer;
51 class OEvoabTable : public OEvoabTable_BASE
53 private:
54 // maps a row postion to a file position
55 ::std::map<sal_Int32,sal_Int32> m_aRowToFilePos;
56 ::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
57 ::std::vector<sal_Int32> m_aPrecisions; // same as aboth
58 ::std::vector<sal_Int32> m_aScales;
59 QuotedTokenizedString m_aCurrentLine;
60 ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xNumberFormatter;
61 sal_Int32 m_nRowPos;
62 sal_Int32 m_nMaxRowCount; // will be set if stream is once eof
63 ::std::vector< ::rtl::OUString> m_aColumnRawNames;
64 sal_Bool setColumnAliases();
65 void fillColumns(const ::com::sun::star::lang::Locale& _aLocale);
66 sal_Bool checkHeaderLine();
67 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet> isUniqueByColumnName(const ::rtl::OUString& _rColName);
69 public:
70 virtual void refreshColumns();
71 virtual void refreshIndexes();
73 public:
74 // DECLARE_CTY_DEFAULTS( OFlatTable_BASE);
75 OEvoabTable( sdbcx::OCollection* _pTables,OEvoabConnection* _pConnection);
76 OEvoabTable( sdbcx::OCollection* _pTables,OEvoabConnection* _pConnection,
77 const ::rtl::OUString& _Name,
78 const ::rtl::OUString& _Type,
79 const ::rtl::OUString& _Description = ::rtl::OUString(),
80 const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
81 const ::rtl::OUString& _CatalogName = ::rtl::OUString()
84 void construct(); // can throw any exception
86 virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos);
87 virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool bIsTable,sal_Bool bRetrieveData);
89 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
90 //XTypeProvider
91 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
92 virtual void SAL_CALL disposing(void);
94 // com::sun::star::lang::XUnoTunnel
95 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
96 static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
98 String getEntry();
102 #endif // _CONNECTIVITY_EVOAB_LTABLE_HXX_