LibreOffice Module connectivity (master) 1
VView.cxx
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
21#include <com/sun/star/beans/PropertyAttribute.hpp>
24#include <TConnection.hxx>
25#include <utility>
26
27
28using namespace connectivity;
29using namespace connectivity::sdbcx;
30using namespace ::com::sun::star::beans;
31using namespace ::com::sun::star::uno;
32using namespace ::com::sun::star::sdbcx;
33using namespace ::com::sun::star::container;
34using namespace ::com::sun::star::lang;
35
36IMPLEMENT_SERVICE_INFO(OView,"com.sun.star.sdbcx.VView","com.sun.star.sdbcx.View");
37
38OView::OView(bool _bCase,
39 const OUString& Name,
40 css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData,
41 OUString Command,
42 OUString SchemaName,
43 OUString CatalogName) : ODescriptor(::comphelper::OMutexAndBroadcastHelper::m_aBHelper,_bCase)
44 ,m_CatalogName(std::move(CatalogName))
45 ,m_SchemaName(std::move(SchemaName))
46 ,m_Command(std::move(Command))
47 ,m_CheckOption(0)
48 ,m_xMetaData(std::move(_xMetaData))
49
50{
51 m_Name = Name;
52 construct();
53}
54
55OView::OView(bool _bCase, css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData)
56 : ODescriptor(::comphelper::OMutexAndBroadcastHelper::m_aBHelper, _bCase, true)
57 ,m_xMetaData(std::move(_xMetaData))
58{
59 construct();
60}
61
63{
64}
65
67{
69
70 sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
71
76}
77
78Sequence< Type > SAL_CALL OView::getTypes( )
79{
80 return ::comphelper::concatSequences(ODescriptor::getTypes(),OView_BASE::getTypes());
81}
82
83Any SAL_CALL OView::queryInterface( const Type & rType )
84{
85 Any aRet = OView_BASE::queryInterface( rType);
86 return aRet.hasValue() ? aRet : ODescriptor::queryInterface( rType);
87}
88
90{
91 return doCreateArrayHelper();
92}
93
95{
96 return *getArrayHelper(isNew() ? 1 : 0);
97}
98
99OUString SAL_CALL OView::getName()
100{
101 OUString sComposedName;
102 if(m_xMetaData.is())
103 sComposedName = ::dbtools::composeTableName( m_xMetaData, m_CatalogName, m_SchemaName, m_Name, false, ::dbtools::EComposeRule::InDataManipulation );
104 else
105 {
106 Any aValue;
108 aValue >>= sComposedName;
109 }
110 return sComposedName;
111}
112
113css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OView::getPropertySetInfo( )
114{
115 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
116}
117
118void SAL_CALL OView::setName( const OUString& )
119{
120}
121
122void SAL_CALL OView::acquire() noexcept
123{
124 OView_BASE::acquire();
125}
126
127void SAL_CALL OView::release() noexcept
128{
129 OView_BASE::release();
130}
131
132
133/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OptionalString sComposedName
IMPLEMENT_SERVICE_INFO(OView,"com.sun.star.sdbcx.VView","com.sun.star.sdbcx.View")
::cppu::IPropertyArrayHelper * getArrayHelper(sal_Int32 nId)
void registerProperty(const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType)
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
::dbtools::OPropertyMap & getPropMap()
Definition: TConnection.cxx:68
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
Definition: VDescriptor.cxx:94
::cppu::IPropertyArrayHelper * doCreateArrayHelper() const
helper for derived classes to implement OPropertyArrayUsageHelper::createArrayHelper
Definition: VDescriptor.cxx:66
virtual ::cppu::IPropertyArrayHelper * createArrayHelper(sal_Int32 _nId) const override
Definition: VView.cxx:89
virtual void SAL_CALL release() noexcept override
Definition: VView.cxx:127
virtual OUString SAL_CALL getName() override
Definition: VView.cxx:99
virtual void construct() override
Definition: VView.cxx:66
virtual void SAL_CALL acquire() noexcept override
Definition: VView.cxx:122
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData
Definition: VView.hxx:54
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: VView.cxx:113
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: VView.cxx:83
virtual ~OView() override
Definition: VView.cxx:62
OView(bool _bCase, css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData)
Definition: VView.cxx:55
virtual void SAL_CALL setName(const OUString &) override
Definition: VView.cxx:118
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: VView.cxx:78
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: VView.cxx:94
Type
OUString composeTableName(const Reference< XDatabaseMetaData > &_rxMetaData, const OUString &_rCatalog, const OUString &_rSchema, const OUString &_rName, bool _bQuote, EComposeRule _eComposeRule)
Definition: dbtools.cxx:1286
#define PROPERTY_ID_NAME
Definition: propertyids.hxx:50
#define PROPERTY_ID_CATALOGNAME
Definition: propertyids.hxx:70
#define PROPERTY_ID_CHECKOPTION
Definition: propertyids.hxx:73
#define PROPERTY_ID_COMMAND
Definition: propertyids.hxx:72
#define PROPERTY_ID_SCHEMANAME
Definition: propertyids.hxx:69
OUString Name