1*24acc546SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*24acc546SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*24acc546SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*24acc546SAndrew Rist  * distributed with this work for additional information
6*24acc546SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*24acc546SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*24acc546SAndrew Rist  * "License"); you may not use this file except in compliance
9*24acc546SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*24acc546SAndrew Rist  *
11*24acc546SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*24acc546SAndrew Rist  *
13*24acc546SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*24acc546SAndrew Rist  * software distributed under the License is distributed on an
15*24acc546SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*24acc546SAndrew Rist  * KIND, either express or implied.  See the License for the
17*24acc546SAndrew Rist  * specific language governing permissions and limitations
18*24acc546SAndrew Rist  * under the License.
19*24acc546SAndrew Rist  *
20*24acc546SAndrew Rist  *************************************************************/
21*24acc546SAndrew Rist 
22*24acc546SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_forms.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "FixedText.hxx"
29cdf0e10cSrcweir #include "services.hxx"
30cdf0e10cSrcweir #ifndef _FRM_PROPERTY_HRC_
31cdf0e10cSrcweir #include "property.hrc"
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include "property.hxx"
34cdf0e10cSrcweir #include <tools/debug.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //.........................................................................
37cdf0e10cSrcweir namespace frm
38cdf0e10cSrcweir {
39cdf0e10cSrcweir using namespace ::com::sun::star::uno;
40cdf0e10cSrcweir using namespace ::com::sun::star::sdb;
41cdf0e10cSrcweir using namespace ::com::sun::star::sdbc;
42cdf0e10cSrcweir using namespace ::com::sun::star::sdbcx;
43cdf0e10cSrcweir using namespace ::com::sun::star::beans;
44cdf0e10cSrcweir using namespace ::com::sun::star::container;
45cdf0e10cSrcweir using namespace ::com::sun::star::form;
46cdf0e10cSrcweir using namespace ::com::sun::star::awt;
47cdf0e10cSrcweir using namespace ::com::sun::star::io;
48cdf0e10cSrcweir using namespace ::com::sun::star::lang;
49cdf0e10cSrcweir using namespace ::com::sun::star::util;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //------------------------------------------------------------------------------
OFixedTextModel_CreateInstance(const Reference<XMultiServiceFactory> & _rxFactory)52cdf0e10cSrcweir InterfaceRef SAL_CALL OFixedTextModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
53cdf0e10cSrcweir {
54cdf0e10cSrcweir 	return *(new OFixedTextModel(_rxFactory));
55cdf0e10cSrcweir }
56cdf0e10cSrcweir 
57cdf0e10cSrcweir //------------------------------------------------------------------
DBG_NAME(OFixedTextModel)58cdf0e10cSrcweir DBG_NAME( OFixedTextModel )
59cdf0e10cSrcweir //------------------------------------------------------------------
60cdf0e10cSrcweir OFixedTextModel::OFixedTextModel( const Reference<XMultiServiceFactory>& _rxFactory )
61cdf0e10cSrcweir 		:OControlModel(_rxFactory, VCL_CONTROLMODEL_FIXEDTEXT)
62cdf0e10cSrcweir 
63cdf0e10cSrcweir {
64cdf0e10cSrcweir 	DBG_CTOR( OFixedTextModel, NULL );
65cdf0e10cSrcweir 	m_nClassId = FormComponentType::FIXEDTEXT;
66cdf0e10cSrcweir }
67cdf0e10cSrcweir 
68cdf0e10cSrcweir //------------------------------------------------------------------
OFixedTextModel(const OFixedTextModel * _pOriginal,const Reference<XMultiServiceFactory> & _rxFactory)69cdf0e10cSrcweir OFixedTextModel::OFixedTextModel( const OFixedTextModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
70cdf0e10cSrcweir 	:OControlModel( _pOriginal, _rxFactory )
71cdf0e10cSrcweir 
72cdf0e10cSrcweir {
73cdf0e10cSrcweir 	DBG_CTOR( OFixedTextModel, NULL );
74cdf0e10cSrcweir }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir //------------------------------------------------------------------
~OFixedTextModel()77cdf0e10cSrcweir OFixedTextModel::~OFixedTextModel( )
78cdf0e10cSrcweir {
79cdf0e10cSrcweir 	DBG_DTOR( OFixedTextModel, NULL );
80cdf0e10cSrcweir }
81cdf0e10cSrcweir 
82cdf0e10cSrcweir //------------------------------------------------------------------------------
IMPLEMENT_DEFAULT_CLONING(OFixedTextModel)83cdf0e10cSrcweir IMPLEMENT_DEFAULT_CLONING( OFixedTextModel )
84cdf0e10cSrcweir 
85cdf0e10cSrcweir //------------------------------------------------------------------------------
86cdf0e10cSrcweir StringSequence SAL_CALL OFixedTextModel::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)
87cdf0e10cSrcweir {
88cdf0e10cSrcweir 	StringSequence aSupported = OControlModel::getSupportedServiceNames();
89cdf0e10cSrcweir 	aSupported.realloc(aSupported.getLength() + 1);
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	::rtl::OUString* pArray = aSupported.getArray();
92cdf0e10cSrcweir 	pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_FIXEDTEXT;
93cdf0e10cSrcweir 	return aSupported;
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir //------------------------------------------------------------------------------
describeAggregateProperties(Sequence<Property> & _rAggregateProps) const97cdf0e10cSrcweir void OFixedTextModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const
98cdf0e10cSrcweir {
99cdf0e10cSrcweir     OControlModel::describeAggregateProperties( _rAggregateProps );
100cdf0e10cSrcweir 	RemoveProperty( _rAggregateProps, PROPERTY_TABSTOP );
101cdf0e10cSrcweir }
102cdf0e10cSrcweir 
103cdf0e10cSrcweir //------------------------------------------------------------------------------
getServiceName()104cdf0e10cSrcweir ::rtl::OUString SAL_CALL OFixedTextModel::getServiceName() throw(RuntimeException)
105cdf0e10cSrcweir {
106cdf0e10cSrcweir 	return FRM_COMPONENT_FIXEDTEXT;	// old (non-sun) name for compatibility !
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
109cdf0e10cSrcweir //------------------------------------------------------------------------------
write(const Reference<XObjectOutputStream> & _rxOutStream)110cdf0e10cSrcweir void SAL_CALL OFixedTextModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
111cdf0e10cSrcweir 	throw(IOException, RuntimeException)
112cdf0e10cSrcweir {
113cdf0e10cSrcweir 	OControlModel::write(_rxOutStream);
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	// Version
116cdf0e10cSrcweir 	_rxOutStream->writeShort(0x0002);
117cdf0e10cSrcweir 	writeHelpTextCompatibly(_rxOutStream);
118cdf0e10cSrcweir }
119cdf0e10cSrcweir 
120cdf0e10cSrcweir //------------------------------------------------------------------------------
read(const Reference<XObjectInputStream> & _rxInStream)121cdf0e10cSrcweir void SAL_CALL OFixedTextModel::read(const Reference<XObjectInputStream>& _rxInStream) throw(IOException, RuntimeException)
122cdf0e10cSrcweir {
123cdf0e10cSrcweir 	OControlModel::read(_rxInStream);
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 	// Version
126cdf0e10cSrcweir 	sal_Int16 nVersion = _rxInStream->readShort();
127cdf0e10cSrcweir 	if (nVersion > 1)
128cdf0e10cSrcweir 		readHelpTextCompatibly(_rxInStream);
129cdf0e10cSrcweir }
130cdf0e10cSrcweir 
131cdf0e10cSrcweir //.........................................................................
132cdf0e10cSrcweir }
133cdf0e10cSrcweir //.........................................................................
134cdf0e10cSrcweir 
135