LCOV - code coverage report
Current view: top level - connectivity/source/inc/calc - CConnection.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 9 9 100.0 %
Date: 2014-11-03 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          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 INCLUDED_CONNECTIVITY_SOURCE_INC_CALC_CCONNECTION_HXX
      21             : #define INCLUDED_CONNECTIVITY_SOURCE_INC_CALC_CCONNECTION_HXX
      22             : 
      23             : #include "file/FConnection.hxx"
      24             : #include <com/sun/star/uno/DeploymentException.hpp>
      25             : 
      26             : namespace com { namespace sun { namespace star { namespace sheet {
      27             :     class XSpreadsheetDocument;
      28             : } } } }
      29             : 
      30             : 
      31             : namespace connectivity
      32             : {
      33             :     namespace calc
      34             :     {
      35             :         class ODriver;
      36             :         class OCalcConnection : public file::OConnection
      37             :         {
      38             :             // the spreadsheet document:
      39             :             ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument > m_xDoc;
      40             :             OUString m_sPassword;
      41             :             OUString m_aFileName;
      42             :             oslInterlockedCount m_nDocCount;
      43             : 
      44             :         public:
      45             :             OCalcConnection(ODriver* _pDriver);
      46             :             virtual ~OCalcConnection();
      47             : 
      48             :             virtual void construct(const OUString& _rUrl,
      49             :                                    const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo )
      50             :                 throw( css::sdbc::SQLException,
      51             :                        css::uno::RuntimeException,
      52             :                        css::uno::DeploymentException) SAL_OVERRIDE;
      53             : 
      54             :             // XServiceInfo
      55             :             DECLARE_SERVICE_INFO();
      56             : 
      57             :             // OComponentHelper
      58             :             virtual void SAL_CALL disposing(void) SAL_OVERRIDE;
      59             : 
      60             :             // XConnection
      61             :             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, std::exception) SAL_OVERRIDE;
      62             :             virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog() SAL_OVERRIDE;
      63             :             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, std::exception) SAL_OVERRIDE;
      64             :             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, std::exception) SAL_OVERRIDE;
      65             :             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, std::exception) SAL_OVERRIDE;
      66             : 
      67             :             // no interface methods
      68             :             ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> acquireDoc();
      69             :             void releaseDoc();
      70             : 
      71             :             class ODocHolder
      72             :             {
      73             :                 OCalcConnection* m_pConnection;
      74             :                 ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> m_xDoc;
      75             :             public:
      76          12 :                 ODocHolder(OCalcConnection* _pConnection) : m_pConnection(_pConnection)
      77             :                 {
      78          12 :                     m_xDoc = m_pConnection->acquireDoc();
      79          12 :                 }
      80          12 :                 ~ODocHolder()
      81          12 :                 {
      82          12 :                    m_xDoc.clear();
      83          12 :                     m_pConnection->releaseDoc();
      84          12 :                 }
      85           4 :                 ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument> getDoc() const { return m_xDoc; }
      86             :             };
      87             :         };
      88             :     }
      89             : }
      90             : 
      91             : #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_CALC_CCONNECTION_HXX
      92             : 
      93             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10