xref: /AOO41X/main/connectivity/inc/connectivity/sdbcx/VView.hxx (revision caf5cd79edad04a48dcaf209068b3b89eae4622e)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _CONNECTIVITY_SDBCX_VIEW_HXX_
25 #define _CONNECTIVITY_SDBCX_VIEW_HXX_
26 
27 #include <osl/diagnose.h>
28 #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
29 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
30 #include <comphelper/proparrhlp.hxx>
31 #include <cppuhelper/compbase1.hxx>
32 #include "connectivity/CommonTools.hxx"
33 #include <cppuhelper/interfacecontainer.h>
34 #include <com/sun/star/container/XNamed.hpp>
35 #include "connectivity/sdbcx/VDescriptor.hxx"
36 #include "connectivity/dbtoolsdllapi.hxx"
37 #include <comphelper/IdPropArrayHelper.hxx>
38 #include <cppuhelper/implbase2.hxx>
39 
40 namespace connectivity
41 {
42     namespace sdbcx
43     {
44 
45         typedef ::cppu::WeakImplHelper2<    ::com::sun::star::lang::XServiceInfo,
46                                         ::com::sun::star::container::XNamed> OView_BASE;
47 
48 
49 
50         class OOO_DLLPUBLIC_DBTOOLS OView :
51                         public ::comphelper::OMutexAndBroadcastHelper,
52                         public OView_BASE,
53                         public ::comphelper::OIdPropertyArrayUsageHelper<OView>,
54                         public ODescriptor
55         {
56         protected:
57             ::rtl::OUString m_CatalogName;
58             ::rtl::OUString m_SchemaName;
59             ::rtl::OUString m_Command;
60             sal_Int32       m_CheckOption;
61             // need for the getName method
62             ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >       m_xMetaData;
63 
64             // OPropertyArrayUsageHelper
65             virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
66             // OPropertySetHelper
67             virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
68 
69         public:
70             DECLARE_SERVICE_INFO();
71 
72             OView(sal_Bool _bCase,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData);
73             OView(  sal_Bool _bCase,
74                     const ::rtl::OUString& _rName,
75                     const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData,
76                     sal_Int32 _nCheckOption = 0,
77                     const ::rtl::OUString& _rCommand = ::rtl::OUString(),
78                     const ::rtl::OUString& _rSchemaName = ::rtl::OUString(),
79                     const ::rtl::OUString& _rCatalogName = ::rtl::OUString());
80             virtual ~OView();
81 
82             // ODescriptor
83             virtual void construct();
84 
85             // ::cppu::OComponentHelper
86             virtual void SAL_CALL disposing(void);
87 
88             // XInterface
89             virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
90             virtual void SAL_CALL acquire() throw();
91             virtual void SAL_CALL release() throw();
92             //XTypeProvider
93             virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
94             // XPropertySet
95             virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
96             // XNamed
97             virtual ::rtl::OUString SAL_CALL getName(  ) throw(::com::sun::star::uno::RuntimeException);
98             virtual void SAL_CALL setName( const ::rtl::OUString& ) throw(::com::sun::star::uno::RuntimeException);
99         };
100     }
101 }
102 
103 #endif // _CONNECTIVITY_SDBCX_VIEW_HXX_
104 
105