1*96de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*96de5490SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*96de5490SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*96de5490SAndrew Rist  * distributed with this work for additional information
6*96de5490SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*96de5490SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*96de5490SAndrew Rist  * "License"); you may not use this file except in compliance
9*96de5490SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*96de5490SAndrew Rist  *
11*96de5490SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*96de5490SAndrew Rist  *
13*96de5490SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*96de5490SAndrew Rist  * software distributed under the License is distributed on an
15*96de5490SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96de5490SAndrew Rist  * KIND, either express or implied.  See the License for the
17*96de5490SAndrew Rist  * specific language governing permissions and limitations
18*96de5490SAndrew Rist  * under the License.
19*96de5490SAndrew Rist  *
20*96de5490SAndrew Rist  *************************************************************/
21*96de5490SAndrew Rist 
22*96de5490SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef DBAUI_COLUMNMODEL_HXX
28cdf0e10cSrcweir #include "ColumnModel.hxx"
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _COM_SUN_STAR_AWT_FONTRELIEF_HPP_
31cdf0e10cSrcweir #include <com/sun/star/awt/FontRelief.hpp>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _COM_SUN_STAR_AWT_FONTEMPHASISMARK_HPP_
34cdf0e10cSrcweir #include <com/sun/star/awt/FontEmphasisMark.hpp>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
37cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #ifndef _CPPUHELPER_QUERYINTERFACE_HXX_
41cdf0e10cSrcweir #include <cppuhelper/queryinterface.hxx>
42cdf0e10cSrcweir #endif
43cdf0e10cSrcweir #ifndef _COMPHELPER_EXTRACT_HXX_
44cdf0e10cSrcweir #include <comphelper/extract.hxx>
45cdf0e10cSrcweir #endif
46cdf0e10cSrcweir #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
47cdf0e10cSrcweir #include "dbustrings.hrc"
48cdf0e10cSrcweir #endif
49cdf0e10cSrcweir #ifndef _DBU_REGHELPER_HXX_
50cdf0e10cSrcweir #include "dbu_reghelper.hxx"
51cdf0e10cSrcweir #endif
52cdf0e10cSrcweir #ifndef _TOOLKIT_UNOHLP_HXX
53cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx>
54cdf0e10cSrcweir #endif
55cdf0e10cSrcweir #ifndef _COMPHELPER_PROPERTY_HXX_
56cdf0e10cSrcweir #include <comphelper/property.hxx>
57cdf0e10cSrcweir #endif
58cdf0e10cSrcweir 
createRegistryInfo_OColumnControlModel()59cdf0e10cSrcweir extern "C" void SAL_CALL createRegistryInfo_OColumnControlModel()
60cdf0e10cSrcweir {
61cdf0e10cSrcweir 	static ::dbaui::OMultiInstanceAutoRegistration< ::dbaui::OColumnControlModel> aAutoRegistration;
62cdf0e10cSrcweir }
63cdf0e10cSrcweir 
64cdf0e10cSrcweir //.........................................................................
65cdf0e10cSrcweir namespace dbaui
66cdf0e10cSrcweir {
67cdf0e10cSrcweir //.........................................................................
68cdf0e10cSrcweir using namespace ::com::sun::star;
69cdf0e10cSrcweir using namespace ::com::sun::star::uno;
70cdf0e10cSrcweir using namespace ::com::sun::star::beans;
71cdf0e10cSrcweir using namespace ::com::sun::star::container;
72cdf0e10cSrcweir using namespace ::com::sun::star::awt;
73cdf0e10cSrcweir using namespace ::com::sun::star::io;
74cdf0e10cSrcweir using namespace ::com::sun::star::lang;
75cdf0e10cSrcweir using namespace ::com::sun::star::util;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 
DBG_NAME(OColumnControlModel)78cdf0e10cSrcweir DBG_NAME(OColumnControlModel)
79cdf0e10cSrcweir //------------------------------------------------------------------
80cdf0e10cSrcweir OColumnControlModel::OColumnControlModel(const Reference<XMultiServiceFactory>& _rxFactory)
81cdf0e10cSrcweir     :OPropertyContainer(m_aBHelper)
82cdf0e10cSrcweir     ,OColumnControlModel_BASE(m_aMutex)
83cdf0e10cSrcweir     ,m_xORB(_rxFactory)
84cdf0e10cSrcweir     ,m_sDefaultControl(SERVICE_CONTROLDEFAULT)
85cdf0e10cSrcweir     ,m_bEnable(sal_True)
86cdf0e10cSrcweir     ,m_nBorder(0)
87cdf0e10cSrcweir     ,m_nWidth(50)
88cdf0e10cSrcweir {
89cdf0e10cSrcweir 	DBG_CTOR(OColumnControlModel,NULL);
90cdf0e10cSrcweir 	registerProperties();
91cdf0e10cSrcweir }
92cdf0e10cSrcweir // -----------------------------------------------------------------------------
OColumnControlModel(const OColumnControlModel * _pSource,const Reference<XMultiServiceFactory> & _rxFactory)93cdf0e10cSrcweir OColumnControlModel::OColumnControlModel(const OColumnControlModel* _pSource,const Reference<XMultiServiceFactory>& _rxFactory)
94cdf0e10cSrcweir     :OPropertyContainer(m_aBHelper)
95cdf0e10cSrcweir     ,OColumnControlModel_BASE(m_aMutex)
96cdf0e10cSrcweir     ,m_xORB(_rxFactory)
97cdf0e10cSrcweir     ,m_sDefaultControl(_pSource->m_sDefaultControl)
98cdf0e10cSrcweir     ,m_aTabStop(_pSource->m_aTabStop)
99cdf0e10cSrcweir     ,m_bEnable(_pSource->m_bEnable)
100cdf0e10cSrcweir     ,m_nBorder(_pSource->m_nBorder)
101cdf0e10cSrcweir     ,m_nWidth(50)
102cdf0e10cSrcweir {
103cdf0e10cSrcweir 	DBG_CTOR(OColumnControlModel,NULL);
104cdf0e10cSrcweir 	registerProperties();
105cdf0e10cSrcweir }
106cdf0e10cSrcweir // -----------------------------------------------------------------------------
~OColumnControlModel()107cdf0e10cSrcweir OColumnControlModel::~OColumnControlModel()
108cdf0e10cSrcweir {
109cdf0e10cSrcweir 	DBG_DTOR(OColumnControlModel,NULL);
110cdf0e10cSrcweir 	if ( !OColumnControlModel_BASE::rBHelper.bDisposed && !OColumnControlModel_BASE::rBHelper.bInDispose )
111cdf0e10cSrcweir 	{
112cdf0e10cSrcweir 		acquire();
113cdf0e10cSrcweir 		dispose();
114cdf0e10cSrcweir 	}
115cdf0e10cSrcweir }
116cdf0e10cSrcweir // -----------------------------------------------------------------------------
registerProperties()117cdf0e10cSrcweir void OColumnControlModel::registerProperties()
118cdf0e10cSrcweir {
119cdf0e10cSrcweir 	registerProperty( PROPERTY_ACTIVE_CONNECTION, PROPERTY_ID_ACTIVE_CONNECTION, PropertyAttribute::TRANSIENT | PropertyAttribute::BOUND,
120cdf0e10cSrcweir 		&m_xConnection, ::getCppuType( &m_xConnection ) );
121cdf0e10cSrcweir 	Any a;
122cdf0e10cSrcweir 	a <<= m_xColumn;
123cdf0e10cSrcweir //	registerMayBeVoidProperty( PROPERTY_COLUMN, PROPERTY_ID_COLUMN, PropertyAttribute::TRANSIENT | PropertyAttribute::BOUND| PropertyAttribute::MAYBEVOID,
124cdf0e10cSrcweir //			&a, ::getCppuType( &m_xColumn ) );
125cdf0e10cSrcweir 	registerProperty( PROPERTY_COLUMN, PROPERTY_ID_COLUMN, PropertyAttribute::TRANSIENT | PropertyAttribute::BOUND,
126cdf0e10cSrcweir 			&m_xColumn, ::getCppuType( &m_xColumn ) );
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 	registerMayBeVoidProperty( PROPERTY_TABSTOP, PROPERTY_ID_TABSTOP, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID,
129cdf0e10cSrcweir 			&m_aTabStop, ::getCppuType( static_cast<sal_Int16*>(NULL) ) );
130cdf0e10cSrcweir 	registerProperty( PROPERTY_DEFAULTCONTROL, PROPERTY_ID_DEFAULTCONTROL, PropertyAttribute::BOUND,
131cdf0e10cSrcweir 			&m_sDefaultControl, ::getCppuType( &m_sDefaultControl ) );
132cdf0e10cSrcweir 	registerProperty( PROPERTY_ENABLED, PROPERTY_ID_ENABLED, PropertyAttribute::BOUND,
133cdf0e10cSrcweir 			&m_bEnable, ::getCppuType( &m_bEnable ) );
134cdf0e10cSrcweir 	registerProperty( PROPERTY_BORDER, PROPERTY_ID_BORDER, PropertyAttribute::BOUND,
135cdf0e10cSrcweir 		&m_nBorder, ::getCppuType( &m_nBorder ) );
136cdf0e10cSrcweir 	registerProperty( PROPERTY_EDIT_WIDTH, PROPERTY_ID_EDIT_WIDTH, PropertyAttribute::BOUND,
137cdf0e10cSrcweir 		&m_nWidth, ::getCppuType( &m_nWidth ) );
138cdf0e10cSrcweir }
139cdf0e10cSrcweir // XCloneable
140cdf0e10cSrcweir //------------------------------------------------------------------------------
createClone()141cdf0e10cSrcweir Reference< XCloneable > SAL_CALL OColumnControlModel::createClone( ) throw (RuntimeException)
142cdf0e10cSrcweir {
143cdf0e10cSrcweir     return new OColumnControlModel( this, getORB() );
144cdf0e10cSrcweir }
145cdf0e10cSrcweir //------------------------------------------------------------------------------
IMPLEMENT_TYPEPROVIDER2(OColumnControlModel,OColumnControlModel_BASE,comphelper::OPropertyContainer)146cdf0e10cSrcweir IMPLEMENT_TYPEPROVIDER2(OColumnControlModel,OColumnControlModel_BASE,comphelper::OPropertyContainer)
147cdf0e10cSrcweir IMPLEMENT_PROPERTYCONTAINER_DEFAULTS(OColumnControlModel)
148cdf0e10cSrcweir IMPLEMENT_SERVICE_INFO2_STATIC(OColumnControlModel,"com.sun.star.comp.dbu.OColumnControlModel","com.sun.star.awt.UnoControlModel","com.sun.star.sdb.ColumnDescriptorControlModel")
149cdf0e10cSrcweir IMPLEMENT_FORWARD_REFCOUNT( OColumnControlModel, OColumnControlModel_BASE )
150cdf0e10cSrcweir //------------------------------------------------------------------------------
151cdf0e10cSrcweir Any SAL_CALL OColumnControlModel::queryInterface( const Type& _rType ) throw (RuntimeException)
152cdf0e10cSrcweir {
153cdf0e10cSrcweir 	return OColumnControlModel_BASE::queryInterface( _rType );
154cdf0e10cSrcweir }
155cdf0e10cSrcweir // -----------------------------------------------------------------------------
156cdf0e10cSrcweir // com::sun::star::XAggregation
queryAggregation(const Type & rType)157cdf0e10cSrcweir Any SAL_CALL OColumnControlModel::queryAggregation( const Type& rType ) throw(RuntimeException)
158cdf0e10cSrcweir {
159cdf0e10cSrcweir 	Any aRet(OColumnControlModel_BASE::queryAggregation(rType));
160cdf0e10cSrcweir 	if (!aRet.hasValue())
161cdf0e10cSrcweir 		aRet = comphelper::OPropertyContainer::queryInterface(rType);
162cdf0e10cSrcweir 	return aRet;
163cdf0e10cSrcweir }
164cdf0e10cSrcweir //------------------------------------------------------------------------------
getServiceName()165cdf0e10cSrcweir ::rtl::OUString SAL_CALL OColumnControlModel::getServiceName() throw ( RuntimeException)
166cdf0e10cSrcweir {
167cdf0e10cSrcweir 	return ::rtl::OUString();
168cdf0e10cSrcweir }
169cdf0e10cSrcweir //------------------------------------------------------------------------------
write(const Reference<XObjectOutputStream> &)170cdf0e10cSrcweir void OColumnControlModel::write(const Reference<XObjectOutputStream>& /*_rxOutStream*/) throw ( ::com::sun::star::io::IOException, RuntimeException)
171cdf0e10cSrcweir {
172cdf0e10cSrcweir 	// TODO
173cdf0e10cSrcweir }
174cdf0e10cSrcweir 
175cdf0e10cSrcweir //------------------------------------------------------------------------------
read(const Reference<XObjectInputStream> &)176cdf0e10cSrcweir void OColumnControlModel::read(const Reference<XObjectInputStream>& /*_rxInStream*/) throw ( ::com::sun::star::io::IOException, RuntimeException)
177cdf0e10cSrcweir {
178cdf0e10cSrcweir 	// TODO
179cdf0e10cSrcweir }
180cdf0e10cSrcweir 
181cdf0e10cSrcweir //.........................................................................
182cdf0e10cSrcweir }	// namespace dbaui
183cdf0e10cSrcweir //.........................................................................
184cdf0e10cSrcweir 
185