1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef DBAUI_COLUMNMODEL_HXX
28 #define DBAUI_COLUMNMODEL_HXX
29 
30 #ifndef _COM_SUN_STAR_AWT_XCONTROLMODEL_HPP_
31 #include <com/sun/star/awt/XControlModel.hpp>
32 #endif
33 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #endif
36 #ifndef _COM_SUN_STAR_UTIL_XCLONEABLE_HPP_
37 #include <com/sun/star/util/XCloneable.hpp>
38 #endif
39 #ifndef _COM_SUN_STAR_IO_XPERSISTOBJECT_HPP_
40 #include <com/sun/star/io/XPersistObject.hpp>
41 #endif
42 #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
43 #include <com/sun/star/sdbc/XConnection.hpp>
44 #endif
45 #ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
46 #include <comphelper/proparrhlp.hxx>
47 #endif
48 #ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_
49 #include <comphelper/propertycontainer.hxx>
50 #endif
51 #ifndef _COMPHELPER_BROADCASTHELPER_HXX_
52 #include <comphelper/broadcasthelper.hxx>
53 #endif
54 #ifndef _COMPHELPER_UNO3_HXX_
55 #include <comphelper/uno3.hxx>
56 #endif
57 #ifndef _CPPUHELPER_COMPBASE4_HXX_
58 #include <cppuhelper/compbase4.hxx>
59 #endif
60 #ifndef _DBASHARED_APITOOLS_HXX_
61 #include "apitools.hxx"
62 #endif
63 
64 //.........................................................................
65 namespace dbaui
66 {
67 //.........................................................................
68 
69 //==================================================================
70 // OColumnControlModel
71 //==================================================================
72 typedef ::cppu::WeakAggComponentImplHelper4 <	::com::sun::star::awt::XControlModel
73 										,	::com::sun::star::lang::XServiceInfo
74 										,	::com::sun::star::util::XCloneable
75 										,	::com::sun::star::io::XPersistObject
76 										>	OColumnControlModel_BASE;
77 
78 class OColumnControlModel;
79 
80 class OColumnControlModel :  public ::comphelper::OMutexAndBroadcastHelper
81 							,public ::comphelper::OPropertyContainer
82 							,public ::comphelper::OPropertyArrayUsageHelper< OColumnControlModel >
83 							,public OColumnControlModel_BASE
84 {
85 
86 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xORB;
87 // [properties]
88 	::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>			m_xConnection;
89 	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >		m_xColumn;
90 	::rtl::OUString					m_sDefaultControl;
91 	::com::sun::star::uno::Any		m_aTabStop;
92 	sal_Bool						m_bEnable;
93 	sal_Int16						m_nBorder;
94 	sal_Int32						m_nWidth;
95 // [properties]
96 
97 	inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> getORB() const { return m_xORB; }
98 	void registerProperties();
99 protected:
100 
101 	virtual ~OColumnControlModel();
102 	OColumnControlModel(const OColumnControlModel* _pSource
103 						,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
104 public:
105 	OColumnControlModel(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
106 
107 // UNO Anbindung
108 	DECLARE_XINTERFACE( )
109 
110 // ::com::sun::star::lang::XServiceInfo
111 	DECLARE_SERVICE_INFO_STATIC();
112 
113 // XTypeProvider
114 	DECLARE_TYPEPROVIDER( );
115 
116 // com::sun::star::uno::XAggregation
117 	virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
118 
119 //  ::com::sun::star::io::XPersistObject
120 	virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException);
121 	virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
122 	virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
123 
124 
125 // OPropertyArrayUsageHelper
126 	DECLARE_PROPERTYCONTAINER_DEFAULTS( );
127 
128 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone(  ) throw (::com::sun::star::uno::RuntimeException);
129 };
130 
131 //.........................................................................
132 }	// namespace dbaui
133 //.........................................................................
134 #endif // DBAUI_COLUMNMODEL_HXX
135