1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #include <ado/AView.hxx>
21 #include <com/sun/star/lang/DisposedException.hpp>
22 #include <ado/adoimp.hxx>
23 #include <cppuhelper/typeprovider.hxx>
24 #include <ado/Awrapado.hxx>
25 #include <comphelper/types.hxx>
26 #include <TConnection.hxx>
29 using namespace comphelper
;
30 using namespace connectivity::ado
;
31 using namespace com::sun::star::uno
;
32 using namespace com::sun::star::lang
;
33 using namespace com::sun::star::beans
;
34 using namespace com::sun::star::sdbc
;
36 // IMPLEMENT_SERVICE_INFO(OAdoView,"com.sun.star.sdbcx.AView","com.sun.star.sdbcx.View");
38 OAdoView::OAdoView(bool _bCase
,ADOView
* _pView
) : OView_ADO(_bCase
,nullptr)
43 Sequence
< sal_Int8
> OAdoView::getUnoTunnelImplementationId()
45 static ::cppu::OImplementationId implId
;
47 return implId
.getImplementationId();
50 // css::lang::XUnoTunnel
52 sal_Int64
OAdoView::getSomething( const Sequence
< sal_Int8
> & rId
)
54 return (rId
.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId
.getConstArray(), 16 ) )
55 ? reinterpret_cast< sal_Int64
>( this )
56 : OView_ADO::getSomething(rId
);
60 void OAdoView::getFastPropertyValue(Any
& rValue
,sal_Int32 nHandle
) const
66 case PROPERTY_ID_NAME
:
67 rValue
<<= m_aView
.get_Name();
69 case PROPERTY_ID_CATALOGNAME
:
71 case PROPERTY_ID_SCHEMANAME
:
72 // rValue <<= m_aView.get_Type();
74 case PROPERTY_ID_COMMAND
:
77 m_aView
.get_Command(aVar
);
78 if(!aVar
.isNull() && !aVar
.isEmpty())
80 ADOCommand
* pCom
= static_cast<ADOCommand
*>(aVar
.getIDispatch());
82 pCom
->get_CommandText(aBSTR
.getAddress());
83 rValue
<<= aBSTR
.asOUString();
90 OView_ADO::getFastPropertyValue(rValue
,nHandle
);
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */