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 10cdf0e10cSrcweir * 11*24acc546SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 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. 19cdf0e10cSrcweir * 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 #include "GroupBox.hxx" 27cdf0e10cSrcweir #include "property.hxx" 28cdf0e10cSrcweir #ifndef _FRM_PROPERTY_HRC_ 29cdf0e10cSrcweir #include "property.hrc" 30cdf0e10cSrcweir #endif 31cdf0e10cSrcweir #include "services.hxx" 32cdf0e10cSrcweir #include <tools/debug.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir //......................................................................... 35cdf0e10cSrcweir namespace frm 36cdf0e10cSrcweir { 37cdf0e10cSrcweir using namespace ::com::sun::star::uno; 38cdf0e10cSrcweir using namespace ::com::sun::star::sdb; 39cdf0e10cSrcweir using namespace ::com::sun::star::sdbc; 40cdf0e10cSrcweir using namespace ::com::sun::star::sdbcx; 41cdf0e10cSrcweir using namespace ::com::sun::star::beans; 42cdf0e10cSrcweir using namespace ::com::sun::star::container; 43cdf0e10cSrcweir using namespace ::com::sun::star::form; 44cdf0e10cSrcweir using namespace ::com::sun::star::awt; 45cdf0e10cSrcweir using namespace ::com::sun::star::io; 46cdf0e10cSrcweir using namespace ::com::sun::star::lang; 47cdf0e10cSrcweir using namespace ::com::sun::star::util; 48cdf0e10cSrcweir 49cdf0e10cSrcweir //================================================================== 50cdf0e10cSrcweir // OGroupBoxModel 51cdf0e10cSrcweir //================================================================== 52cdf0e10cSrcweir 53cdf0e10cSrcweir //------------------------------------------------------------------ 54cdf0e10cSrcweir InterfaceRef SAL_CALL OGroupBoxModel_CreateInstance(const Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (RuntimeException) 55cdf0e10cSrcweir { 56cdf0e10cSrcweir return *(new OGroupBoxModel(_rxFactory)); 57cdf0e10cSrcweir } 58cdf0e10cSrcweir 59cdf0e10cSrcweir //------------------------------------------------------------------ 60cdf0e10cSrcweir DBG_NAME( OGroupBoxModel ) 61cdf0e10cSrcweir //------------------------------------------------------------------ 62cdf0e10cSrcweir OGroupBoxModel::OGroupBoxModel(const Reference<starlang::XMultiServiceFactory>& _rxFactory) 63cdf0e10cSrcweir :OControlModel(_rxFactory, VCL_CONTROLMODEL_GROUPBOX, VCL_CONTROL_GROUPBOX) 64cdf0e10cSrcweir { 65cdf0e10cSrcweir DBG_CTOR( OGroupBoxModel, NULL ); 66cdf0e10cSrcweir m_nClassId = FormComponentType::GROUPBOX; 67cdf0e10cSrcweir } 68cdf0e10cSrcweir 69cdf0e10cSrcweir //------------------------------------------------------------------ 70cdf0e10cSrcweir OGroupBoxModel::OGroupBoxModel( const OGroupBoxModel* _pOriginal, const Reference<starlang::XMultiServiceFactory>& _rxFactory ) 71cdf0e10cSrcweir :OControlModel( _pOriginal, _rxFactory ) 72cdf0e10cSrcweir { 73cdf0e10cSrcweir DBG_CTOR( OGroupBoxModel, NULL ); 74cdf0e10cSrcweir } 75cdf0e10cSrcweir 76cdf0e10cSrcweir // XServiceInfo 77cdf0e10cSrcweir //------------------------------------------------------------------------------ 78cdf0e10cSrcweir StringSequence SAL_CALL OGroupBoxModel::getSupportedServiceNames() throw(RuntimeException) 79cdf0e10cSrcweir { 80cdf0e10cSrcweir StringSequence aSupported = OControlModel::getSupportedServiceNames(); 81cdf0e10cSrcweir aSupported.realloc(aSupported.getLength() + 1); 82cdf0e10cSrcweir 83cdf0e10cSrcweir ::rtl::OUString* pArray = aSupported.getArray(); 84cdf0e10cSrcweir pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_GROUPBOX; 85cdf0e10cSrcweir return aSupported; 86cdf0e10cSrcweir } 87cdf0e10cSrcweir 88cdf0e10cSrcweir //------------------------------------------------------------------ 89cdf0e10cSrcweir OGroupBoxModel::~OGroupBoxModel() 90cdf0e10cSrcweir { 91cdf0e10cSrcweir DBG_DTOR( OGroupBoxModel, NULL ); 92cdf0e10cSrcweir } 93cdf0e10cSrcweir 94cdf0e10cSrcweir //------------------------------------------------------------------------------ 95cdf0e10cSrcweir IMPLEMENT_DEFAULT_CLONING( OGroupBoxModel ) 96cdf0e10cSrcweir 97cdf0e10cSrcweir //------------------------------------------------------------------------------ 98cdf0e10cSrcweir void OGroupBoxModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const 99cdf0e10cSrcweir { 100cdf0e10cSrcweir OControlModel::describeAggregateProperties( _rAggregateProps ); 101cdf0e10cSrcweir // don't want to have the TabStop property 102cdf0e10cSrcweir RemoveProperty(_rAggregateProps, PROPERTY_TABSTOP); 103cdf0e10cSrcweir } 104cdf0e10cSrcweir 105cdf0e10cSrcweir //------------------------------------------------------------------------------ 106cdf0e10cSrcweir ::rtl::OUString SAL_CALL OGroupBoxModel::getServiceName() throw(RuntimeException) 107cdf0e10cSrcweir { 108cdf0e10cSrcweir return FRM_COMPONENT_GROUPBOX; // old (non-sun) name for compatibility ! 109cdf0e10cSrcweir } 110cdf0e10cSrcweir 111cdf0e10cSrcweir //------------------------------------------------------------------------------ 112cdf0e10cSrcweir void SAL_CALL OGroupBoxModel::write(const Reference< XObjectOutputStream>& _rxOutStream) 113cdf0e10cSrcweir throw(IOException, RuntimeException) 114cdf0e10cSrcweir { 115cdf0e10cSrcweir OControlModel::write(_rxOutStream); 116cdf0e10cSrcweir 117cdf0e10cSrcweir // Version 118cdf0e10cSrcweir _rxOutStream->writeShort(0x0002); 119cdf0e10cSrcweir writeHelpTextCompatibly(_rxOutStream); 120cdf0e10cSrcweir } 121cdf0e10cSrcweir 122cdf0e10cSrcweir //------------------------------------------------------------------------------ 123cdf0e10cSrcweir void SAL_CALL OGroupBoxModel::read(const Reference< XObjectInputStream>& _rxInStream) throw(IOException, RuntimeException) 124cdf0e10cSrcweir { 125cdf0e10cSrcweir OControlModel::read( _rxInStream ); 126cdf0e10cSrcweir 127cdf0e10cSrcweir // Version 128cdf0e10cSrcweir sal_uInt16 nVersion = _rxInStream->readShort(); 129cdf0e10cSrcweir DBG_ASSERT(nVersion > 0, "OGroupBoxModel::read : version 0 ? this should never have been written !"); 130cdf0e10cSrcweir // ups, ist das Englisch richtig ? ;) 131cdf0e10cSrcweir 132cdf0e10cSrcweir if (nVersion == 2) 133cdf0e10cSrcweir readHelpTextCompatibly(_rxInStream); 134cdf0e10cSrcweir 135cdf0e10cSrcweir if (nVersion > 0x0002) 136cdf0e10cSrcweir { 137cdf0e10cSrcweir DBG_ERROR("OGroupBoxModel::read : unknown version !"); 138cdf0e10cSrcweir } 139cdf0e10cSrcweir }; 140cdf0e10cSrcweir 141cdf0e10cSrcweir //================================================================== 142cdf0e10cSrcweir // OGroupBoxControl 143cdf0e10cSrcweir //================================================================== 144cdf0e10cSrcweir 145cdf0e10cSrcweir //------------------------------------------------------------------ 146cdf0e10cSrcweir InterfaceRef SAL_CALL OGroupBoxControl_CreateInstance(const Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (RuntimeException) 147cdf0e10cSrcweir { 148cdf0e10cSrcweir return *(new OGroupBoxControl(_rxFactory)); 149cdf0e10cSrcweir } 150cdf0e10cSrcweir 151cdf0e10cSrcweir //------------------------------------------------------------------------------ 152cdf0e10cSrcweir OGroupBoxControl::OGroupBoxControl(const Reference<starlang::XMultiServiceFactory>& _rxFactory) 153cdf0e10cSrcweir :OControl(_rxFactory, VCL_CONTROL_GROUPBOX) 154cdf0e10cSrcweir { 155cdf0e10cSrcweir } 156cdf0e10cSrcweir 157cdf0e10cSrcweir //------------------------------------------------------------------------------ 158cdf0e10cSrcweir StringSequence SAL_CALL OGroupBoxControl::getSupportedServiceNames() throw(RuntimeException) 159cdf0e10cSrcweir { 160cdf0e10cSrcweir StringSequence aSupported = OControl::getSupportedServiceNames(); 161cdf0e10cSrcweir aSupported.realloc(aSupported.getLength() + 1); 162cdf0e10cSrcweir 163cdf0e10cSrcweir ::rtl::OUString* pArray = aSupported.getArray(); 164cdf0e10cSrcweir pArray[aSupported.getLength()-1] = FRM_SUN_CONTROL_GROUPBOX; 165cdf0e10cSrcweir return aSupported; 166cdf0e10cSrcweir } 167cdf0e10cSrcweir 168cdf0e10cSrcweir //......................................................................... 169cdf0e10cSrcweir } 170cdf0e10cSrcweir //......................................................................... 171cdf0e10cSrcweir 172