Update ooo320-m1
[ooovba.git] / connectivity / source / inc / calc / CTable.hxx
blob373afc0926999a2f7b2609ff0241410a910d1f17
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: CTable.hxx,v $
10 * $Revision: 1.12 $
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_CALC_TABLE_HXX_
32 #define _CONNECTIVITY_CALC_TABLE_HXX_
34 #include "file/FTable.hxx"
35 #include <tools/date.hxx>
37 namespace com { namespace sun { namespace star { namespace sheet {
38 class XSpreadsheet;
39 class XSpreadsheetDocument;
40 } } } }
42 namespace com { namespace sun { namespace star { namespace util {
43 class XNumberFormats;
44 } } } }
47 namespace connectivity
49 namespace calc
51 typedef file::OFileTable OCalcTable_BASE;
52 class OCalcConnection;
54 typedef ::std::map< ::rtl::OUString,
55 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed>,
56 comphelper::UStringMixLess > OContainer;
58 class OCalcTable : public OCalcTable_BASE
60 private:
61 ::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
62 ::std::vector<sal_Int32> m_aPrecisions; // same as aboth
63 ::std::vector<sal_Int32> m_aScales;
64 ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > m_xSheet;
65 OCalcConnection* m_pConnection;
66 sal_Int32 m_nStartCol;
67 sal_Int32 m_nStartRow;
68 sal_Int32 m_nDataCols;
69 sal_Int32 m_nDataRows;
70 sal_Bool m_bHasHeaders;
71 ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > m_xFormats;
72 ::Date m_aNullDate;
74 void fillColumns();
76 protected:
77 virtual void FileClose();
78 public:
79 virtual void refreshColumns();
80 virtual void refreshIndexes();
82 public:
83 OCalcTable( sdbcx::OCollection* _pTables,OCalcConnection* _pConnection,
84 const ::rtl::OUString& _Name,
85 const ::rtl::OUString& _Type,
86 const ::rtl::OUString& _Description = ::rtl::OUString(),
87 const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
88 const ::rtl::OUString& _CatalogName = ::rtl::OUString()
91 virtual sal_Int32 getCurrentLastPos() const;
92 virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos);
93 virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool _bUseTableDefs,sal_Bool bRetrieveData);
95 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
96 //XTypeProvider
97 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
98 virtual void SAL_CALL disposing(void);
100 // com::sun::star::lang::XUnoTunnel
101 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
102 static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
104 void construct();
109 #endif // _CONNECTIVITY_CALC_TABLE_HXX_