Branch libreoffice-5-0-4
[LibreOffice.git] / include / connectivity / sdbcx / VDescriptor.hxx
blob4c5ae155580d6646aedb4d4cb89a278481282080
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 INCLUDED_CONNECTIVITY_SDBCX_VDESCRIPTOR_HXX
21 #define INCLUDED_CONNECTIVITY_SDBCX_VDESCRIPTOR_HXX
23 #include <comphelper/propertycontainer.hxx>
24 #include <com/sun/star/beans/PropertyAttribute.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <cppuhelper/typeprovider.hxx>
27 #include <com/sun/star/lang/XUnoTunnel.hpp>
28 #include <comphelper/stl_types.hxx>
29 #include <connectivity/dbtoolsdllapi.hxx>
31 namespace connectivity
33 namespace sdbcx
36 // = ODescriptor
38 typedef ::comphelper::OPropertyContainer ODescriptor_PBASE;
39 class OOO_DLLPUBLIC_DBTOOLS ODescriptor
40 :public ODescriptor_PBASE
41 ,public ::com::sun::star::lang::XUnoTunnel
43 protected:
44 OUString m_Name;
46 /** helper for derived classes to implement OPropertyArrayUsageHelper::createArrayHelper
48 This method just calls describeProperties, and flags all properties as READONLY if and
49 only if we do *not* act as descriptor, but as final object.
51 @seealso isNew
53 ::cppu::IPropertyArrayHelper* doCreateArrayHelper() const;
55 private:
56 comphelper::UStringMixEqual m_aCase;
57 bool m_bNew;
59 public:
60 ODescriptor(::cppu::OBroadcastHelper& _rBHelper, bool _bCase, bool _bNew = false);
62 virtual ~ODescriptor();
64 bool isNew() const { return m_bNew; }
65 bool getNew() const { return m_bNew; }
66 void setNew(bool _bNew);
68 bool isCaseSensitive() const { return m_aCase.isCaseSensitive(); }
70 virtual void construct();
72 // XInterface
73 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception);
76 // compare
77 inline bool operator == ( const OUString & _rRH )
79 return m_aCase(m_Name,_rRH);
82 // com::sun::star::lang::XUnoTunnel
83 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
84 static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
86 static ODescriptor* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxSomeComp );
87 // retrieves the ODescriptor implementation of a given UNO component, and returns its ->isNew flag
88 static bool isNew( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDescriptor );
93 #endif // INCLUDED_CONNECTIVITY_SDBCX_VDESCRIPTOR_HXX
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */