Branch data 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 _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
21 : : #define _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
22 : :
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"
30 : :
31 : : namespace connectivity
32 : : {
33 : : namespace sdbcx
34 : : {
35 : : // =========================================================================
36 : : // = ODescriptor
37 : : // =========================================================================
38 : : typedef ::comphelper::OPropertyContainer ODescriptor_PBASE;
39 : : class OOO_DLLPUBLIC_DBTOOLS ODescriptor
40 : : :public ODescriptor_PBASE
41 : : ,public ::com::sun::star::lang::XUnoTunnel
42 : : {
43 : : protected:
44 : : ::rtl::OUString m_Name;
45 : :
46 : : /** helper for derived classes to implement OPropertyArrayUsageHelper::createArrayHelper
47 : :
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.
50 : :
51 : : @seealso isNew
52 : : */
53 : : ::cppu::IPropertyArrayHelper* doCreateArrayHelper() const;
54 : :
55 : : private:
56 : : comphelper::UStringMixEqual m_aCase;
57 : : sal_Bool m_bNew;
58 : :
59 : : public:
60 : : ODescriptor(::cppu::OBroadcastHelper& _rBHelper,sal_Bool _bCase, sal_Bool _bNew = sal_False);
61 : :
62 : : virtual ~ODescriptor();
63 : :
64 : 114696 : sal_Bool isNew() const { return m_bNew; }
65 : : sal_Bool getNew() const { return m_bNew; }
66 : : virtual void setNew(sal_Bool _bNew);
67 : :
68 : 12 : sal_Bool isCaseSensitive() const { return m_aCase.isCaseSensitive(); }
69 : :
70 : : virtual void construct();
71 : :
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);
74 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
75 : :
76 : : // compare
77 : : inline sal_Bool operator == ( const ::rtl::OUString & _rRH )
78 : : {
79 : : return m_aCase(m_Name,_rRH);
80 : : }
81 : :
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);
84 : : static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
85 : :
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 sal_Bool isNew( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDescriptor );
89 : : };
90 : : }
91 : :
92 : : }
93 : : #endif // _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
94 : :
95 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|