update credits
[LibreOffice.git] / connectivity / source / inc / calc / CConnection.hxx
blob994799f460e4b1aced1280514797b981fec4cf1d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _CONNECTIVITY_CALC_CONNECTION_HXX_
21 #define _CONNECTIVITY_CALC_CONNECTION_HXX_
23 #include "file/FConnection.hxx"
25 namespace com { namespace sun { namespace star { namespace sheet {
26 class XSpreadsheetDocument;
27 } } } }
30 namespace connectivity
32 namespace calc
34 class ODriver;
35 class OCalcConnection : public file::OConnection
37 // the spreadsheet document:
38 ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument > m_xDoc;
39 OUString m_sPassword;
40 String m_aFileName;
41 oslInterlockedCount m_nDocCount;
43 public:
44 OCalcConnection(ODriver* _pDriver);
45 virtual ~OCalcConnection();
47 virtual void construct(const OUString& _rUrl,
48 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo )
49 throw( ::com::sun::star::sdbc::SQLException);
51 // XServiceInfo
52 DECLARE_SERVICE_INFO();
54 // OComponentHelper
55 virtual void SAL_CALL disposing(void);
57 // XConnection
58 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
59 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
60 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
61 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
62 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
64 // no interface methods
65 ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> acquireDoc();
66 void releaseDoc();
68 class ODocHolder
70 OCalcConnection* m_pConnection;
71 ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> m_xDoc;
72 public:
73 ODocHolder(OCalcConnection* _pConnection) : m_pConnection(_pConnection)
75 m_xDoc = m_pConnection->acquireDoc();
77 ~ODocHolder()
79 m_xDoc.clear();
80 m_pConnection->releaseDoc();
82 ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> getDoc() const { return m_xDoc; }
88 #endif // _CONNECTIVITY_CALC_CONNECTION_HXX_
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */