1*caf5cd79SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*caf5cd79SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*caf5cd79SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*caf5cd79SAndrew Rist  * distributed with this work for additional information
6*caf5cd79SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*caf5cd79SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*caf5cd79SAndrew Rist  * "License"); you may not use this file except in compliance
9*caf5cd79SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*caf5cd79SAndrew Rist  *
11*caf5cd79SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*caf5cd79SAndrew Rist  *
13*caf5cd79SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*caf5cd79SAndrew Rist  * software distributed under the License is distributed on an
15*caf5cd79SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*caf5cd79SAndrew Rist  * KIND, either express or implied.  See the License for the
17*caf5cd79SAndrew Rist  * specific language governing permissions and limitations
18*caf5cd79SAndrew Rist  * under the License.
19*caf5cd79SAndrew Rist  *
20*caf5cd79SAndrew Rist  *************************************************************/
21*caf5cd79SAndrew Rist 
22*caf5cd79SAndrew Rist 
23cdf0e10cSrcweir #ifndef _CONNECTIVITY_SDBCX_COLUMN_HXX_
24cdf0e10cSrcweir #define _CONNECTIVITY_SDBCX_COLUMN_HXX_
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
27cdf0e10cSrcweir #include <com/sun/star/container/XNamed.hpp>
28cdf0e10cSrcweir #include <comphelper/IdPropArrayHelper.hxx>
29cdf0e10cSrcweir #include <cppuhelper/compbase2.hxx>
30cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
31cdf0e10cSrcweir #include "connectivity/CommonTools.hxx"
32cdf0e10cSrcweir #include <comphelper/broadcasthelper.hxx>
33cdf0e10cSrcweir #include "connectivity/sdbcx/VDescriptor.hxx"
34cdf0e10cSrcweir #include "connectivity/dbtoolsdllapi.hxx"
35cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir namespace connectivity
38cdf0e10cSrcweir {
39cdf0e10cSrcweir 	namespace sdbcx
40cdf0e10cSrcweir 	{
41cdf0e10cSrcweir 		class OColumn;
42cdf0e10cSrcweir 		typedef ::comphelper::OIdPropertyArrayUsageHelper<OColumn> OColumn_PROP;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir         typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::container::XNamed,
45cdf0e10cSrcweir 												  ::com::sun::star::lang::XServiceInfo> OColumnDescriptor_BASE;
46cdf0e10cSrcweir 		typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XDataDescriptorFactory > OColumn_BASE;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 		class OOO_DLLPUBLIC_DBTOOLS OColumn :
50cdf0e10cSrcweir                                     public comphelper::OBaseMutex,
51cdf0e10cSrcweir 									public OColumn_BASE,
52cdf0e10cSrcweir 									public OColumnDescriptor_BASE,
53cdf0e10cSrcweir 									public OColumn_PROP,
54cdf0e10cSrcweir 									public ODescriptor
55cdf0e10cSrcweir 		{
56cdf0e10cSrcweir 		protected:
57cdf0e10cSrcweir 			::rtl::OUString m_TypeName;
58cdf0e10cSrcweir 			::rtl::OUString m_Description;
59cdf0e10cSrcweir 			::rtl::OUString m_DefaultValue;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 			sal_Int32		m_IsNullable;
62cdf0e10cSrcweir 			sal_Int32		m_Precision;
63cdf0e10cSrcweir 			sal_Int32		m_Scale;
64cdf0e10cSrcweir 			sal_Int32		m_Type;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 			sal_Bool		m_IsAutoIncrement;
67cdf0e10cSrcweir 			sal_Bool		m_IsRowVersion;
68cdf0e10cSrcweir 			sal_Bool		m_IsCurrency;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 			using OColumnDescriptor_BASE::rBHelper;
71cdf0e10cSrcweir 			virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
72cdf0e10cSrcweir 			virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 			virtual ~OColumn();
75cdf0e10cSrcweir 		public:
76cdf0e10cSrcweir 			virtual void	SAL_CALL acquire() throw();
77cdf0e10cSrcweir 			virtual void	SAL_CALL release() throw();
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 			OColumn(	sal_Bool _bCase);
80cdf0e10cSrcweir 			OColumn(	const ::rtl::OUString& _Name,
81cdf0e10cSrcweir 								const ::rtl::OUString& _TypeName,
82cdf0e10cSrcweir 								const ::rtl::OUString& _DefaultValue,
83cdf0e10cSrcweir                                 const ::rtl::OUString& _Description,
84cdf0e10cSrcweir 								sal_Int32		_IsNullable,
85cdf0e10cSrcweir 								sal_Int32		_Precision,
86cdf0e10cSrcweir 								sal_Int32		_Scale,
87cdf0e10cSrcweir 								sal_Int32		_Type,
88cdf0e10cSrcweir 								sal_Bool		_IsAutoIncrement,
89cdf0e10cSrcweir 								sal_Bool		_IsRowVersion,
90cdf0e10cSrcweir 								sal_Bool		_IsCurrency,
91cdf0e10cSrcweir 								sal_Bool		_bCase);
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 			DECLARE_SERVICE_INFO();
94cdf0e10cSrcweir 			//XInterface
95cdf0e10cSrcweir 			virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir 			//XTypeProvider
97cdf0e10cSrcweir 			virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
98cdf0e10cSrcweir 			// ODescriptor
99cdf0e10cSrcweir 			virtual void construct();
100cdf0e10cSrcweir 			// ::cppu::OComponentHelper
101cdf0e10cSrcweir 			virtual void SAL_CALL disposing(void);
102cdf0e10cSrcweir 			// XPropertySet
103cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
104cdf0e10cSrcweir 			// XNamed
105cdf0e10cSrcweir 			virtual ::rtl::OUString SAL_CALL getName(  ) throw(::com::sun::star::uno::RuntimeException);
106cdf0e10cSrcweir 			virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
107cdf0e10cSrcweir 			// XDataDescriptorFactory
108cdf0e10cSrcweir 			virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor(  ) throw(::com::sun::star::uno::RuntimeException);
109cdf0e10cSrcweir 		};
110cdf0e10cSrcweir 	}
111cdf0e10cSrcweir }
112cdf0e10cSrcweir 
113cdf0e10cSrcweir #endif // _CONNECTIVITY_SDBCX_COLUMN_HXX_
114cdf0e10cSrcweir 
115