Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _CONNECTIVITY_CALC_TABLE_HXX_
21 : #define _CONNECTIVITY_CALC_TABLE_HXX_
22 :
23 : #include "file/FTable.hxx"
24 : #include <tools/date.hxx>
25 :
26 : namespace com { namespace sun { namespace star { namespace sheet {
27 : class XSpreadsheet;
28 : } } } }
29 :
30 : namespace com { namespace sun { namespace star { namespace util {
31 : class XNumberFormats;
32 : } } } }
33 :
34 :
35 : namespace connectivity
36 : {
37 : namespace calc
38 : {
39 : typedef file::OFileTable OCalcTable_BASE;
40 : class OCalcConnection;
41 :
42 : typedef ::std::map< ::rtl::OUString,
43 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed>,
44 : comphelper::UStringMixLess > OContainer;
45 :
46 0 : class OCalcTable : public OCalcTable_BASE
47 : {
48 : private:
49 : ::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
50 : ::std::vector<sal_Int32> m_aPrecisions; // same as aboth
51 : ::std::vector<sal_Int32> m_aScales;
52 : ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > m_xSheet;
53 : OCalcConnection* m_pConnection;
54 : sal_Int32 m_nStartCol;
55 : sal_Int32 m_nStartRow;
56 : sal_Int32 m_nDataCols;
57 : sal_Int32 m_nDataRows;
58 : sal_Bool m_bHasHeaders;
59 : ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > m_xFormats;
60 : ::Date m_aNullDate;
61 :
62 : void fillColumns();
63 :
64 : protected:
65 : virtual void FileClose();
66 : public:
67 : virtual void refreshColumns();
68 : virtual void refreshIndexes();
69 :
70 : public:
71 : OCalcTable( sdbcx::OCollection* _pTables,OCalcConnection* _pConnection,
72 : const ::rtl::OUString& _Name,
73 : const ::rtl::OUString& _Type,
74 : const ::rtl::OUString& _Description = ::rtl::OUString(),
75 : const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
76 : const ::rtl::OUString& _CatalogName = ::rtl::OUString()
77 : );
78 :
79 : virtual sal_Int32 getCurrentLastPos() const;
80 : virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos);
81 : virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool _bUseTableDefs,sal_Bool bRetrieveData);
82 :
83 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
84 : //XTypeProvider
85 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
86 : virtual void SAL_CALL disposing(void);
87 :
88 : // com::sun::star::lang::XUnoTunnel
89 : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
90 : static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
91 :
92 : void construct();
93 : };
94 : }
95 : }
96 :
97 : #endif // _CONNECTIVITY_CALC_TABLE_HXX_
98 :
99 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|