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 INCLUDED_CONNECTIVITY_SDBCX_VDESCRIPTOR_HXX
21 : #define INCLUDED_CONNECTIVITY_SDBCX_VDESCRIPTOR_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 : 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 : bool m_bNew;
58 :
59 : public:
60 : ODescriptor(::cppu::OBroadcastHelper& _rBHelper, bool _bCase, bool _bNew = false);
61 :
62 : virtual ~ODescriptor();
63 :
64 0 : bool isNew() const { return m_bNew; }
65 : bool getNew() const { return m_bNew; }
66 : virtual void setNew(bool _bNew);
67 :
68 0 : 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, 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);
75 :
76 : // compare
77 : inline bool operator == ( const 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, std::exception) SAL_OVERRIDE;
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 bool isNew( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDescriptor );
89 : };
90 : }
91 :
92 : }
93 : #endif // INCLUDED_CONNECTIVITY_SDBCX_VDESCRIPTOR_HXX
94 :
95 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|