LibreOffice Module connectivity (master) 1
FConnection.hxx
Go to the documentation of this file.
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#pragma once
20
21#include <com/sun/star/ucb/XContent.hpp>
22#include <com/sun/star/beans/PropertyValue.hpp>
24#include <rtl/ustring.hxx>
25#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
26#include <com/sun/star/ucb/XDynamicResultSet.hpp>
27#include <TConnection.hxx>
28#include <file/filedllapi.hxx>
29
30namespace connectivity::file
31 {
32 class ODatabaseMetaData;
33 class OFileDriver;
34
36 {
37 protected:
38
39 // Data attributes
40
41 css::uno::WeakReference< css::sdbcx::XTablesSupplier> m_xCatalog;
42
44 OFileDriver* m_pDriver; // Pointer to the owning
45 // driver object
46 css::uno::Reference< css::ucb::XDynamicResultSet > m_xDir; // directory
47 css::uno::Reference< css::ucb::XContent> m_xContent;
48
55
56
57 void throwUrlNotValid(const OUString & _rsUrl,const OUString & _rsMessage);
58
59 virtual ~OConnection() override;
60 public:
61
62 OConnection(OFileDriver* _pDriver);
63
67 virtual void construct(const OUString& _rUrl, const css::uno::Sequence< css::beans::PropertyValue >& _rInfo );
68
69 // OComponentHelper
70 virtual void SAL_CALL disposing() override;
71
72 // XServiceInfo
74
75 // XConnection
76 virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
77 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
78 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
79 virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
80 virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
81 virtual sal_Bool SAL_CALL getAutoCommit( ) override;
82 virtual void SAL_CALL commit( ) override;
83 virtual void SAL_CALL rollback( ) override;
84 virtual sal_Bool SAL_CALL isClosed( ) override final;
85 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
86 virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
87 virtual sal_Bool SAL_CALL isReadOnly( ) override;
88 virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
89 virtual OUString SAL_CALL getCatalog( ) override;
90 virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
91 virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
92 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
93 virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
94 // XCloseable
95 virtual void SAL_CALL close( ) override final;
96 // XWarningsSupplier
97 virtual css::uno::Any SAL_CALL getWarnings( ) override;
98 virtual void SAL_CALL clearWarnings( ) override;
99 //XUnoTunnel
100 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
101 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
102
103 // no interface methods
104 css::uno::Reference< css::ucb::XDynamicResultSet > getDir() const;
105 const css::uno::Reference< css::ucb::XContent>& getContent() const { return m_xContent; }
106 // create a catalog or return the catalog already created
107 virtual css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog();
108
109 bool matchesExtension( const OUString& _rExt ) const;
110
111 const OUString& getExtension() const { return m_aFilenameExtension; }
112 bool isCaseSensitiveExtension() const { return m_bCaseSensitiveExtension; }
113 OFileDriver* getDriver() const { return m_pDriver; }
114 bool showDeleted() const { return m_bShowDeleted; }
115 bool isCheckEnabled() const { return m_bCheckSQL92; }
116 bool isTextEncodingDefaulted() const { return m_bDefaultTextEncoding; }
117
118 public:
120 {
121 friend class ODatabaseMetaData;
122 private:
124 };
125
126 void setCaseSensitiveExtension( bool _bIsCS, GrantAccess ) { m_bCaseSensitiveExtension = _bIsCS; }
127 };
128
129}
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
uno::Reference< ucb::XContent > m_xContent
css::uno::WeakReference< css::sdbcx::XTablesSupplier > m_xCatalog
Definition: FConnection.hxx:41
css::uno::Reference< css::ucb::XContent > m_xContent
Definition: FConnection.hxx:47
css::uno::Reference< css::ucb::XDynamicResultSet > m_xDir
Definition: FConnection.hxx:46
virtual void construct(const OUString &_rUrl, const css::uno::Sequence< css::beans::PropertyValue > &_rInfo)
void setCaseSensitiveExtension(bool _bIsCS, GrantAccess)
const OUString & getExtension() const
OFileDriver * getDriver() const
#define OOO_DLLPUBLIC_FILE
Definition: filedllapi.hxx:29
unsigned char sal_Bool
signed char sal_Int8