nss: upgrade to release 3.73
[LibreOffice.git] / forms / source / component / GroupBox.cxx
blob25c353a0bceb27d542f8655e1a54977fab436f94
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "GroupBox.hxx"
21 #include <frm_strings.hxx>
22 #include <services.hxx>
23 #include <comphelper/property.hxx>
24 #include <tools/debug.hxx>
25 #include <com/sun/star/form/FormComponentType.hpp>
27 namespace frm
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star::sdb;
32 using namespace ::com::sun::star::sdbc;
33 using namespace ::com::sun::star::beans;
34 using namespace ::com::sun::star::container;
35 using namespace ::com::sun::star::form;
36 using namespace ::com::sun::star::awt;
37 using namespace ::com::sun::star::io;
38 using namespace ::com::sun::star::lang;
39 using namespace ::com::sun::star::util;
40 using namespace comphelper;
42 // OGroupBoxModel
45 OGroupBoxModel::OGroupBoxModel(const Reference<XComponentContext>& _rxFactory)
46 :OControlModel(_rxFactory, VCL_CONTROLMODEL_GROUPBOX, VCL_CONTROL_GROUPBOX)
48 m_nClassId = FormComponentType::GROUPBOX;
52 OGroupBoxModel::OGroupBoxModel( const OGroupBoxModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
53 :OControlModel( _pOriginal, _rxFactory )
57 // XServiceInfo
59 css::uno::Sequence<OUString> SAL_CALL OGroupBoxModel::getSupportedServiceNames()
61 css::uno::Sequence<OUString> aSupported = OControlModel::getSupportedServiceNames();
62 aSupported.realloc(aSupported.getLength() + 2);
64 OUString* pArray = aSupported.getArray();
65 pArray[aSupported.getLength()-2] = FRM_SUN_COMPONENT_GROUPBOX;
66 pArray[aSupported.getLength()-1] = FRM_COMPONENT_GROUPBOX;
67 return aSupported;
71 OGroupBoxModel::~OGroupBoxModel()
76 IMPLEMENT_DEFAULT_CLONING( OGroupBoxModel )
79 void OGroupBoxModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const
81 OControlModel::describeAggregateProperties( _rAggregateProps );
82 // don't want to have the TabStop property
83 RemoveProperty(_rAggregateProps, PROPERTY_TABSTOP);
87 OUString SAL_CALL OGroupBoxModel::getServiceName()
89 return FRM_COMPONENT_GROUPBOX; // old (non-sun) name for compatibility !
93 void SAL_CALL OGroupBoxModel::write(const Reference< XObjectOutputStream>& _rxOutStream)
95 OControlModel::write(_rxOutStream);
97 // Version
98 _rxOutStream->writeShort(0x0002);
99 writeHelpTextCompatibly(_rxOutStream);
103 void SAL_CALL OGroupBoxModel::read(const Reference< XObjectInputStream>& _rxInStream)
105 OControlModel::read( _rxInStream );
107 // Version
108 sal_uInt16 nVersion = _rxInStream->readShort();
109 DBG_ASSERT(nVersion > 0, "OGroupBoxModel::read : version 0 ? this should never have been written !");
111 if (nVersion == 2)
112 readHelpTextCompatibly(_rxInStream);
114 if (nVersion > 0x0002)
116 OSL_FAIL("OGroupBoxModel::read : unknown version !");
121 // OGroupBoxControl
123 OGroupBoxControl::OGroupBoxControl(const Reference<XComponentContext>& _rxFactory)
124 :OControl(_rxFactory, VCL_CONTROL_GROUPBOX)
129 css::uno::Sequence<OUString> SAL_CALL OGroupBoxControl::getSupportedServiceNames()
131 css::uno::Sequence<OUString> aSupported = OControl::getSupportedServiceNames();
132 aSupported.realloc(aSupported.getLength() + 2);
134 OUString* pArray = aSupported.getArray();
135 pArray[aSupported.getLength()-2] = FRM_SUN_CONTROL_GROUPBOX;
136 pArray[aSupported.getLength()-1] = STARDIV_ONE_FORM_CONTROL_GROUPBOX;
137 return aSupported;
142 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
143 com_sun_star_form_OGroupBoxModel_get_implementation(css::uno::XComponentContext* component,
144 css::uno::Sequence<css::uno::Any> const &)
146 return cppu::acquire(new frm::OGroupBoxModel(component));
150 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
151 com_sun_star_form_OGroupBoxControl_get_implementation(css::uno::XComponentContext* component,
152 css::uno::Sequence<css::uno::Any> const &)
154 return cppu::acquire(new frm::OGroupBoxControl(component));
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */