LibreOffice Module forms (master) 1
Columns.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include "Columns.hxx"
21#include <property.hxx>
22#include <componenttools.hxx>
23#include "findpos.hxx"
24#include <com/sun/star/beans/PropertyAttribute.hpp>
25#include <com/sun/star/io/XPersistObject.hpp>
26#include <com/sun/star/io/XMarkableStream.hpp>
27#include <com/sun/star/form/XFormComponent.hpp>
28#include <com/sun/star/lang/XServiceInfo.hpp>
29#include <com/sun/star/form/binding/XBindableValue.hpp>
30#include <com/sun/star/beans/XPropertyContainer.hpp>
31#include <com/sun/star/text/XText.hpp>
35#include <comphelper/types.hxx>
36#include <services.hxx>
37#include <tools/debug.hxx>
39#include <utility>
40
41
42namespace frm
43{
44
45using namespace ::com::sun::star::uno;
46using namespace ::com::sun::star::beans;
47using namespace ::com::sun::star::container;
48using namespace ::com::sun::star::form;
49using namespace ::com::sun::star::awt;
50using namespace ::com::sun::star::io;
51using namespace ::com::sun::star::lang;
52using namespace ::com::sun::star::util;
53using namespace ::com::sun::star::text;
54using namespace ::com::sun::star::form::binding;
55
56const sal_uInt16 WIDTH = 0x0001;
57const sal_uInt16 ALIGN = 0x0002;
58const sal_uInt16 OLD_HIDDEN = 0x0004;
59const sal_uInt16 COMPATIBLE_HIDDEN = 0x0008;
60
61
62const css::uno::Sequence<OUString>& getColumnTypes()
63{
64 static css::uno::Sequence<OUString> aColumnTypes = []()
65 {
66 css::uno::Sequence<OUString> tmp(10);
67 OUString* pNames = tmp.getArray();
68 pNames[TYPE_CHECKBOX] = "CheckBox";
69 pNames[TYPE_COMBOBOX] = "ComboBox";
70 pNames[TYPE_CURRENCYFIELD] = "CurrencyField";
71 pNames[TYPE_DATEFIELD] = "DateField";
72 pNames[TYPE_FORMATTEDFIELD] = "FormattedField";
73 pNames[TYPE_LISTBOX] = "ListBox";
74 pNames[TYPE_NUMERICFIELD] = "NumericField";
75 pNames[TYPE_PATTERNFIELD] = "PatternField";
76 pNames[TYPE_TEXTFIELD] = "TextField";
77 pNames[TYPE_TIMEFIELD] = "TimeField";
78 return tmp;
79 }();
80 return aColumnTypes;
81}
82
83
84sal_Int32 getColumnTypeByModelName(const OUString& aModelName)
85{
86 static constexpr OUStringLiteral aModelPrefix (u"com.sun.star.form.component.");
87 static constexpr OUStringLiteral aCompatibleModelPrefix (u"stardiv.one.form.component.");
88
89 sal_Int32 nTypeId = -1;
90 if (aModelName == FRM_COMPONENT_EDIT)
91 nTypeId = TYPE_TEXTFIELD;
92 else
93 {
94 sal_Int32 nPrefixPos = aModelName.indexOf(aModelPrefix);
95#ifdef DBG_UTIL
96 sal_Int32 nCompatiblePrefixPos = aModelName.indexOf(aCompatibleModelPrefix);
97 DBG_ASSERT( (nPrefixPos != -1) || (nCompatiblePrefixPos != -1),
98 "::getColumnTypeByModelName() : wrong service!");
99#endif
100
101 OUString aColumnType = (nPrefixPos != -1)
102 ? aModelName.copy(aModelPrefix.getLength())
103 : aModelName.copy(aCompatibleModelPrefix.getLength());
104
105 const css::uno::Sequence<OUString>& rColumnTypes = getColumnTypes();
106 nTypeId = ::detail::findPos(aColumnType, rColumnTypes);
107 }
108 return nTypeId;
109}
110
111const Sequence<sal_Int8>& OGridColumn::getUnoTunnelId()
112{
113 static const comphelper::UnoIdInit theOGridColumnImplementationId;
114 return theOGridColumnImplementationId.getSeq();
115}
116
117
118sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence<sal_Int8>& _rIdentifier)
119{
120 sal_Int64 nReturn(0);
121
122 if ( comphelper::isUnoTunnelId<OGridColumn>(_rIdentifier) )
123 {
124 nReturn = comphelper::getSomething_cast(this);
125 }
126 else
127 {
128 Reference< XUnoTunnel > xAggTunnel;
129 if ( query_aggregation( m_xAggregate, xAggTunnel ) )
130 return xAggTunnel->getSomething( _rIdentifier );
131 }
132 return nReturn;
133}
134
135
136Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId()
137{
138 return css::uno::Sequence<sal_Int8>();
139}
140
141
142Sequence<Type> SAL_CALL OGridColumn::getTypes()
143{
145 // erase the types which we do not support
150
151 // but re-add their base class(es)
153
154 Reference< XTypeProvider > xProv;
155 if ( query_aggregation( m_xAggregate, xProv ))
156 aTypes.addTypes( xProv->getTypes() );
157
160 aTypes.removeType( cppu::UnoType<XText>::get() );
161
162 return aTypes.getTypes();
163}
164
165
166Any SAL_CALL OGridColumn::queryAggregation( const Type& _rType )
167{
168 Any aReturn;
169 // some functionality at our aggregate cannot be reasonably fulfilled here.
170 if ( _rType.equals(cppu::UnoType<XFormComponent>::get())
171 || _rType.equals(cppu::UnoType<XServiceInfo>::get())
172 || _rType.equals(cppu::UnoType<XBindableValue>::get())
175 )
176 return aReturn;
177
178 aReturn = OGridColumn_BASE::queryAggregation(_rType);
179 if (!aReturn.hasValue())
180 {
181 aReturn = OPropertySetAggregationHelper::queryInterface(_rType);
182 if (!aReturn.hasValue() && m_xAggregate.is())
183 aReturn = m_xAggregate->queryAggregation(_rType);
184 }
185
186 return aReturn;
187}
188
189
190OGridColumn::OGridColumn( const Reference<XComponentContext>& _rContext, OUString _sModelName )
192 ,OPropertySetAggregationHelper(OGridColumn_BASE::rBHelper)
193 ,m_aHidden( Any( false ) )
194 ,m_aModelName(std::move(_sModelName))
195{
196
197 // Create the UnoControlModel
198 if ( m_aModelName.isEmpty() ) // is there a to-be-aggregated model?
199 return;
200
201 osl_atomic_increment( &m_refCount );
202
203 {
204 m_xAggregate.set( _rContext->getServiceManager()->createInstanceWithContext( m_aModelName, _rContext ), UNO_QUERY );
205 setAggregation( m_xAggregate );
206 }
207
208 if ( m_xAggregate.is() )
209 { // don't omit those brackets - they ensure that the following temporary is properly deleted
210 m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) );
211 }
212
213 // Set refcount back to zero
214 osl_atomic_decrement( &m_refCount );
215}
216
217
220 ,OPropertySetAggregationHelper( OGridColumn_BASE::rBHelper )
221{
222
223 m_aWidth = _pOriginal->m_aWidth;
224 m_aAlign = _pOriginal->m_aAlign;
225 m_aHidden = _pOriginal->m_aHidden;
226 m_aModelName = _pOriginal->m_aModelName;
227 m_aLabel = _pOriginal->m_aLabel;
228
229 osl_atomic_increment( &m_refCount );
230 {
231 {
232 m_xAggregate = createAggregateClone( _pOriginal );
233 setAggregation( m_xAggregate );
234 }
235
236 if ( m_xAggregate.is() )
237 { // don't omit this brackets - they ensure that the following temporary is properly deleted
238 m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) );
239 }
240 }
241 osl_atomic_decrement( &m_refCount );
242}
243
244
246{
247 if (!OGridColumn_BASE::rBHelper.bDisposed)
248 {
249 acquire();
250 dispose();
251 }
252
253 // Free the aggregate
254 if (m_xAggregate.is())
255 {
256 css::uno::Reference<css::uno::XInterface> xIface;
257 m_xAggregate->setDelegator(xIface);
258 }
259
260}
261
262// XEventListener
263
264void SAL_CALL OGridColumn::disposing(const EventObject& _rSource)
265{
266 OPropertySetAggregationHelper::disposing(_rSource);
267
268 Reference<XEventListener> xEvtLstner;
269 if (query_aggregation(m_xAggregate, xEvtLstner))
270 xEvtLstner->disposing(_rSource);
271}
272
273// OGridColumn_BASE
274
276{
277 OGridColumn_BASE::disposing();
278 OPropertySetAggregationHelper::disposing();
279
280 Reference<XComponent> xComp;
282 xComp->dispose();
283}
284
285
286void OGridColumn::clearAggregateProperties( Sequence< Property >& _rProps, bool bAllowDropDown )
287{
288 // some properties are not to be exposed to the outer world
289 static const o3tl::sorted_vector< OUString > aForbiddenProperties {
327 };
328
329 Sequence< Property > aNewProps( _rProps.getLength() );
330 Property* pNewProps = aNewProps.getArray();
331
332 const Property* pProps = _rProps.getConstArray();
333 const Property* pPropsEnd = pProps + _rProps.getLength();
334 for ( ; pProps != pPropsEnd; ++pProps )
335 {
336 if ( aForbiddenProperties.find( pProps->Name ) == aForbiddenProperties.end()
337 && (bAllowDropDown || pProps->Name != PROPERTY_DROPDOWN))
338 *pNewProps++ = *pProps;
339 }
340
341 aNewProps.realloc( pNewProps - aNewProps.getArray() );
342 _rProps = aNewProps;
343}
344
345
346void OGridColumn::setOwnProperties(Sequence<Property>& aDescriptor)
347{
348 aDescriptor.realloc(5);
349 Property* pProperties = aDescriptor.getArray();
350 *pProperties++ = css::beans::Property(PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
351 *pProperties++ = css::beans::Property(PROPERTY_WIDTH, PROPERTY_ID_WIDTH, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEVOID | css::beans::PropertyAttribute::MAYBEDEFAULT);
352 *pProperties++ = css::beans::Property(PROPERTY_ALIGN, PROPERTY_ID_ALIGN, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEVOID | css::beans::PropertyAttribute::MAYBEDEFAULT);
353 *pProperties++ = css::beans::Property(PROPERTY_HIDDEN, PROPERTY_ID_HIDDEN, cppu::UnoType<bool>::get(),
354 css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
355 *pProperties++ = css::beans::Property(PROPERTY_COLUMNSERVICENAME, PROPERTY_ID_COLUMNSERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY);
356}
357
358// Reference<XPropertySet>
359
360void OGridColumn::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) const
361{
362 switch (nHandle)
363 {
365 rValue <<= m_aModelName;
366 break;
368 rValue <<= m_aLabel;
369 break;
371 rValue = m_aWidth;
372 break;
374 rValue = m_aAlign;
375 break;
377 rValue = m_aHidden;
378 break;
379 default:
380 OPropertySetAggregationHelper::getFastPropertyValue(rValue, nHandle);
381 }
382}
383
384
385sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue,
386 sal_Int32 nHandle, const Any& rValue )
387{
388 bool bModified(false);
389 switch (nHandle)
390 {
392 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aLabel);
393 break;
395 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, cppu::UnoType<sal_Int32>::get());
396 break;
398 bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_aAlign, cppu::UnoType<sal_Int32>::get());
399 // strange enough, css.awt.TextAlign is a 32-bit integer, while the Align property (both here for grid controls
400 // and for ordinary toolkit controls) is a 16-bit integer. So, allow for 32 bit, but normalize it to 16 bit
401 if ( bModified )
402 {
403 sal_Int32 nAlign( 0 );
404 if ( rConvertedValue >>= nAlign )
405 rConvertedValue <<= static_cast<sal_Int16>(nAlign);
406 }
407 break;
409 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, getBOOL(m_aHidden));
410 break;
411 }
412 return bModified;
413}
414
415
416void OGridColumn::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue )
417{
418 switch (nHandle)
419 {
421 DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "invalid type" );
422 rValue >>= m_aLabel;
423 break;
425 m_aWidth = rValue;
426 break;
428 m_aAlign = rValue;
429 break;
431 m_aHidden = rValue;
432 break;
433 }
434}
435
436
437// XPropertyState
438
440{
441 switch (nHandle)
442 {
445 return Any();
447 return Any(false);
448 default:
449 return OPropertySetAggregationHelper::getPropertyDefaultByHandle(nHandle);
450 }
451}
452
453// XCloneable
454
455Reference< XCloneable > SAL_CALL OGridColumn::createClone( )
456{
457 return createCloneColumn();
458}
459
460// XPersistObject
461
462void OGridColumn::write(const Reference<XObjectOutputStream>& _rxOutStream)
463{
464 // 1. Write the UnoControl
465 Reference<XMarkableStream> xMark(_rxOutStream, UNO_QUERY);
466 sal_Int32 nMark = xMark->createMark();
467
468 sal_Int32 nLen = 0;
469 _rxOutStream->writeLong(nLen);
470
471 Reference<XPersistObject> xPersist;
472 if (query_aggregation(m_xAggregate, xPersist))
473 xPersist->write(_rxOutStream);
474
475 // Calculate the length
476 nLen = xMark->offsetToMark(nMark) - 4;
477 xMark->jumpToMark(nMark);
478 _rxOutStream->writeLong(nLen);
479 xMark->jumpToFurthest();
480 xMark->deleteMark(nMark);
481
482 // 2. Write a version number
483 _rxOutStream->writeShort(0x0002);
484
485 sal_uInt16 nAnyMask = 0;
486 if (m_aWidth.getValueType().getTypeClass() == TypeClass_LONG)
487 nAnyMask |= WIDTH;
488
489 if (m_aAlign.getValueTypeClass() == TypeClass_SHORT)
490 nAnyMask |= ALIGN;
491
492 nAnyMask |= COMPATIBLE_HIDDEN;
493
494 _rxOutStream->writeShort(nAnyMask);
495
496 if (nAnyMask & WIDTH)
497 _rxOutStream->writeLong(getINT32(m_aWidth));
498 if (nAnyMask & ALIGN)
499 _rxOutStream->writeShort(getINT16(m_aAlign));
500
501 // Name
502 _rxOutStream << m_aLabel;
503
504 // the new place for the hidden flag : after m_aLabel, so older office version read the correct label, too
505 if (nAnyMask & COMPATIBLE_HIDDEN)
506 _rxOutStream->writeBoolean(getBOOL(m_aHidden));
507}
508
509
510void OGridColumn::read(const Reference<XObjectInputStream>& _rxInStream)
511{
512 // 1. Read the UnoControl
513 sal_Int32 nLen = _rxInStream->readLong();
514 if (nLen)
515 {
516 Reference<XMarkableStream> xMark(_rxInStream, UNO_QUERY);
517 sal_Int32 nMark = xMark->createMark();
518 Reference<XPersistObject> xPersist;
519 if (query_aggregation(m_xAggregate, xPersist))
520 xPersist->read(_rxInStream);
521
522 xMark->jumpToMark(nMark);
523 _rxInStream->skipBytes(nLen);
524 xMark->deleteMark(nMark);
525 }
526
527 // 2. Write a version number
528 _rxInStream->readShort(); // version;
529 sal_uInt16 nAnyMask = _rxInStream->readShort();
530
531 if (nAnyMask & WIDTH)
532 {
533 sal_Int32 nValue = _rxInStream->readLong();
534 m_aWidth <<= nValue;
535 }
536
537 if (nAnyMask & ALIGN)
538 {
539 sal_Int16 nValue = _rxInStream->readShort();
540 m_aAlign <<= nValue;
541 }
542 if (nAnyMask & OLD_HIDDEN)
543 {
544 bool bValue = _rxInStream->readBoolean();
545 m_aHidden <<= bValue;
546 }
547
548 // Name
549 _rxInStream >> m_aLabel;
550
551 if (nAnyMask & COMPATIBLE_HIDDEN)
552 {
553 bool bValue = _rxInStream->readBoolean();
554 m_aHidden <<= bValue;
555 }
556}
557
558TextFieldColumn::TextFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
560{
561}
563 :OGridColumn( _pCloneFrom )
564{
565}
566css::uno::Reference< css::beans::XPropertySetInfo> TextFieldColumn::getPropertySetInfo()
567{
568 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
569 return xInfo;
570}
572{
573 return *getArrayHelper();
574}
576 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
577 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
578 ) const
579{
580 if (m_xAggregateSet.is())
581 {
582 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
583 clearAggregateProperties(_rAggregateProps, false);
584 setOwnProperties(_rProps);
585 }
586}
588{
589 return new TextFieldColumn(this);
590}
591
592PatternFieldColumn::PatternFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
594{
595}
597 :OGridColumn( _pCloneFrom )
598{
599}
600css::uno::Reference< css::beans::XPropertySetInfo> PatternFieldColumn::getPropertySetInfo()
601{
602 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
603 return xInfo;
604}
606{
607 return *getArrayHelper();
608}
610 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
611 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
612 ) const
613{
614 if (m_xAggregateSet.is())
615 {
616 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
617 clearAggregateProperties(_rAggregateProps, false);
618 setOwnProperties(_rProps);
619 }
620}
622{
623 return new PatternFieldColumn(this);
624}
625
626DateFieldColumn::DateFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
628{
629}
631 :OGridColumn( _pCloneFrom )
632{
633}
634css::uno::Reference< css::beans::XPropertySetInfo> DateFieldColumn::getPropertySetInfo()
635{
636 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
637 return xInfo;
638}
640{
641 return *getArrayHelper();
642}
644 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
645 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
646 ) const
647{
648 if (m_xAggregateSet.is())
649 {
650 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
651 clearAggregateProperties(_rAggregateProps, true);
652 setOwnProperties(_rProps);
653 }
654}
656{
657 return new DateFieldColumn(this);
658}
659
660TimeFieldColumn::TimeFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
662{
663}
665 :OGridColumn( _pCloneFrom )
666{
667}
668css::uno::Reference< css::beans::XPropertySetInfo> TimeFieldColumn::getPropertySetInfo()
669{
670 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
671 return xInfo;
672}
674{
675 return *getArrayHelper();
676}
678 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
679 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
680 ) const
681{
682 if (m_xAggregateSet.is())
683 {
684 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
685 clearAggregateProperties(_rAggregateProps, false);
686 setOwnProperties(_rProps);
687 }
688}
690{
691 return new TimeFieldColumn(this);
692}
693
694NumericFieldColumn::NumericFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
696{
697}
699 :OGridColumn( _pCloneFrom )
700{
701}
702css::uno::Reference< css::beans::XPropertySetInfo> NumericFieldColumn::getPropertySetInfo()
703{
704 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
705 return xInfo;
706}
708{
709 return *getArrayHelper();
710}
712 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
713 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
714 ) const
715{
716 if (m_xAggregateSet.is())
717 {
718 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
719 clearAggregateProperties(_rAggregateProps, false);
720 setOwnProperties(_rProps);
721 }
722}
724{
725 return new NumericFieldColumn(this);
726}
727
728CurrencyFieldColumn::CurrencyFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
730{
731}
733 :OGridColumn( _pCloneFrom )
734{
735}
736css::uno::Reference< css::beans::XPropertySetInfo> CurrencyFieldColumn::getPropertySetInfo()
737{
738 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
739 return xInfo;
740}
742{
743 return *getArrayHelper();
744}
746 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
747 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
748 ) const
749{
750 if (m_xAggregateSet.is())
751 {
752 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
753 clearAggregateProperties(_rAggregateProps, false);
754 setOwnProperties(_rProps);
755 }
756}
758{
759 return new CurrencyFieldColumn(this);
760}
761
762CheckBoxColumn::CheckBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
764{
765}
767 :OGridColumn( _pCloneFrom )
768{
769}
770css::uno::Reference< css::beans::XPropertySetInfo> CheckBoxColumn::getPropertySetInfo()
771{
772 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
773 return xInfo;
774}
776{
777 return *getArrayHelper();
778}
780 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
781 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
782 ) const
783{
784 if (m_xAggregateSet.is())
785 {
786 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
787 clearAggregateProperties(_rAggregateProps, false);
788 setOwnProperties(_rProps);
789 }
790}
792{
793 return new CheckBoxColumn(this);
794}
795
796ComboBoxColumn::ComboBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
798{
799}
801 :OGridColumn( _pCloneFrom )
802{
803}
804css::uno::Reference< css::beans::XPropertySetInfo> ComboBoxColumn::getPropertySetInfo()
805{
806 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
807 return xInfo;
808}
810{
811 return *getArrayHelper();
812}
814 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
815 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
816 ) const
817{
818 if (m_xAggregateSet.is())
819 {
820 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
821 clearAggregateProperties(_rAggregateProps, false);
822 setOwnProperties(_rProps);
823 }
824}
826{
827 return new ComboBoxColumn(this);
828}
829
830ListBoxColumn::ListBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
832{
833}
835 :OGridColumn( _pCloneFrom )
836{
837}
838css::uno::Reference< css::beans::XPropertySetInfo> ListBoxColumn::getPropertySetInfo()
839{
840 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
841 return xInfo;
842}
844{
845 return *getArrayHelper();
846}
848 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
849 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
850 ) const
851{
852 if (m_xAggregateSet.is())
853 {
854 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
855 clearAggregateProperties(_rAggregateProps, false);
856 setOwnProperties(_rProps);
857 }
858}
860{
861 return new ListBoxColumn(this);
862}
863
864FormattedFieldColumn::FormattedFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
866{
867}
869 :OGridColumn( _pCloneFrom )
870{
871}
872css::uno::Reference< css::beans::XPropertySetInfo> FormattedFieldColumn::getPropertySetInfo()
873{
874 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
875 return xInfo;
876}
878{
879 return *getArrayHelper();
880}
882 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
883 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
884 ) const
885{
886 if (m_xAggregateSet.is())
887 {
888 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
889 clearAggregateProperties(_rAggregateProps, false);
890 setOwnProperties(_rProps);
891 }
892}
894{
895 return new FormattedFieldColumn(this);
896}
897
898} // namespace frm
899
900
901/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define TYPE_FORMATTEDFIELD
Definition: Columns.hxx:118
#define TYPE_TIMEFIELD
Definition: Columns.hxx:123
#define TYPE_COMBOBOX
Definition: Columns.hxx:115
#define TYPE_TEXTFIELD
Definition: Columns.hxx:122
#define TYPE_CHECKBOX
Definition: Columns.hxx:114
#define TYPE_DATEFIELD
Definition: Columns.hxx:117
#define TYPE_NUMERICFIELD
Definition: Columns.hxx:120
#define TYPE_PATTERNFIELD
Definition: Columns.hxx:121
#define TYPE_CURRENCYFIELD
Definition: Columns.hxx:116
#define TYPE_LISTBOX
Definition: Columns.hxx:119
::cppu::IPropertyArrayHelper * getArrayHelper()
const css::uno::Sequence< sal_Int8 > & getSeq() const
virtual css::uno::Any SAL_CALL queryAggregation(css::uno::Type const &rType) SAL_OVERRIDE
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:779
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:770
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:791
CheckBoxColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:762
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:775
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:809
ComboBoxColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:796
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:825
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:804
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:813
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:757
CurrencyFieldColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:728
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:741
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:736
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:745
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:643
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:639
DateFieldColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:626
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:634
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:655
FormattedFieldColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:864
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:872
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:881
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:893
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:877
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:847
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:838
ListBoxColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:830
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:843
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:859
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:723
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:711
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:702
NumericFieldColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:694
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:707
static css::uno::Reference< css::uno::XAggregation > createAggregateClone(const OCloneableAggregation *_pOriginal)
Definition: cloneable.cxx:38
css::uno::Reference< css::uno::XAggregation > m_xAggregate
Definition: cloneable.hxx:31
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: Columns.cxx:416
virtual rtl::Reference< OGridColumn > createCloneColumn() const =0
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: Columns.cxx:142
virtual css::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const override
Definition: Columns.cxx:439
virtual ~OGridColumn() override
Definition: Columns.cxx:245
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
Definition: Columns.cxx:455
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
Definition: Columns.cxx:360
static void clearAggregateProperties(css::uno::Sequence< css::beans::Property > &seqProps, bool bAllowDropDown)
Definition: Columns.cxx:286
OUString m_aModelName
Definition: Columns.hxx:56
css::uno::Any m_aHidden
Definition: Columns.hxx:53
css::uno::Any m_aWidth
Definition: Columns.hxx:51
void write(const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream)
Definition: Columns.cxx:462
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
Definition: Columns.cxx:166
OUString m_aLabel
Definition: Columns.hxx:59
virtual void SAL_CALL disposing() override
Definition: Columns.cxx:275
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &_rIdentifier) override
Definition: Columns.cxx:118
css::uno::Any m_aAlign
Definition: Columns.hxx:52
void read(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
Definition: Columns.cxx:510
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: Columns.cxx:136
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: Columns.cxx:385
OGridColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext, OUString _sModelName)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: Columns.cxx:111
static void setOwnProperties(css::uno::Sequence< css::beans::Property > &seqProps)
Definition: Columns.cxx:346
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:621
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:600
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:605
PatternFieldColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:592
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:609
TextFieldColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:558
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:571
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:566
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:587
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:575
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
Definition: Columns.cxx:677
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: Columns.cxx:668
virtual rtl::Reference< OGridColumn > createCloneColumn() const override
Definition: Columns.cxx:689
TimeFieldColumn(const css::uno::Reference< css::uno::XComponentContext > &_rContext)
Definition: Columns.cxx:660
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: Columns.cxx:673
a helper class which merges sequences of <type scope="css::uno">Type</type>s, so that the resulting s...
#define DBG_ASSERT(sCon, aError)
ULONG m_refCount
float u
sal_Int16 nValue
constexpr OUStringLiteral PROPERTY_TABINDEX
Definition: frm_strings.hxx:26
constexpr OUStringLiteral PROPERTY_COLUMNSERVICENAME
constexpr OUStringLiteral PROPERTY_FILLCOLOR
constexpr OUStringLiteral PROPERTY_LABEL
Definition: frm_strings.hxx:34
constexpr OUStringLiteral PROPERTY_AUTOCOMPLETE
constexpr OUStringLiteral PROPERTY_FONT_FAMILY
constexpr OUStringLiteral PROPERTY_BACKGROUNDCOLOR
constexpr OUStringLiteral PROPERTY_FONT_SLANT
constexpr OUStringLiteral PROPERTY_VERTICAL_ALIGN
Definition: frm_strings.hxx:85
constexpr OUStringLiteral PROPERTY_CONTROLLABEL
constexpr OUStringLiteral PROPERTY_ALIGN
Definition: frm_strings.hxx:84
constexpr OUStringLiteral PROPERTY_DROPDOWN
constexpr OUStringLiteral PROPERTY_FONT_WEIGHT
constexpr OUStringLiteral PROPERTY_FONT_HEIGHT
constexpr OUStringLiteral PROPERTY_FONTRELIEF
constexpr OUStringLiteral PROPERTY_FONT_UNDERLINE
constexpr OUStringLiteral PROPERTY_VSCROLL
constexpr OUStringLiteral PROPERTY_FONT_STRIKEOUT
constexpr OUStringLiteral PROPERTY_FONT_WORDLINEMODE
constexpr OUStringLiteral PROPERTY_IMAGE_URL
Definition: frm_strings.hxx:72
constexpr OUStringLiteral PROPERTY_FONTEMPHASISMARK
constexpr OUStringLiteral PROPERTY_IMAGE_POSITION
Definition: frm_strings.hxx:74
constexpr OUStringLiteral PROPERTY_PRINTABLE
constexpr OUStringLiteral PROPERTY_HSCROLL
constexpr OUStringLiteral PROPERTY_WIDTH
Definition: frm_strings.hxx:46
constexpr OUStringLiteral PROPERTY_HIDDEN
constexpr OUStringLiteral PROPERTY_TEXTCOLOR
constexpr OUStringLiteral PROPERTY_FONT_CHARSET
constexpr OUStringLiteral PROPERTY_FONT
constexpr OUStringLiteral PROPERTY_ECHO_CHAR
constexpr OUStringLiteral PROPERTY_HARDLINEBREAKS
constexpr OUStringLiteral PROPERTY_ENABLEVISIBLE
Definition: frm_strings.hxx:40
constexpr OUStringLiteral PROPERTY_LINECOLOR
constexpr OUStringLiteral PROPERTY_FONT_STYLENAME
constexpr OUStringLiteral PROPERTY_TEXTLINECOLOR
constexpr OUStringLiteral PROPERTY_MULTISELECTION
Definition: frm_strings.hxx:83
constexpr OUStringLiteral PROPERTY_BORDERCOLOR
constexpr OUStringLiteral PROPERTY_TABSTOP
constexpr OUStringLiteral PROPERTY_RICH_TEXT
constexpr OUStringLiteral PROPERTY_FONT_NAME
constexpr OUStringLiteral PROPERTY_BORDER
std::mutex m_aMutex
bool getBOOL(const Any &_rAny)
bool query_aggregation(const css::uno::Reference< css::uno::XAggregation > &_rxAggregate, css::uno::Reference< iface > &_rxOut)
sal_Int16 getINT16(const Any &_rAny)
sal_Int64 getSomething_cast(void *p)
bool tryPropertyValue(Any &_rConvertedValue, Any &_rOldValue, const Any &_rValueToSet, const Any &_rCurrentValue, const Type &_rExpectedType)
sal_Int32 getINT32(const Any &_rAny)
bool isAssignableFrom(const Type &_rAssignable, const Type &_rFrom)
Type
sal_Int32 findPos(const OUString &aStr, const css::uno::Sequence< OUString > &rList)
Definition: findpos.cxx:32
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
const sal_uInt16 OLD_HIDDEN
Definition: Columns.cxx:58
const sal_uInt16 COMPATIBLE_HIDDEN
Definition: Columns.cxx:59
const css::uno::Sequence< OUString > & getColumnTypes()
Definition: Columns.cxx:62
const sal_uInt16 WIDTH
Definition: Columns.cxx:56
sal_Int32 getColumnTypeByModelName(const OUString &aModelName)
Definition: Columns.cxx:84
const sal_uInt16 ALIGN
Definition: Columns.cxx:57
void dispose()
#define PROPERTY_ID_COLUMNSERVICENAME
Definition: property.hxx:240
#define PROPERTY_ID_LABEL
Definition: property.hxx:85
#define PROPERTY_ID_WIDTH
Definition: property.hxx:77
#define PROPERTY_ID_HIDDEN
Definition: property.hxx:196
#define PROPERTY_ID_ALIGN
Definition: property.hxx:98
sal_Int32 nHandle
constexpr OUStringLiteral FRM_SUN_COMPONENT_TIMEFIELD
Definition: services.hxx:124
constexpr OUStringLiteral FRM_SUN_COMPONENT_CURRENCYFIELD
Definition: services.hxx:127
constexpr OUStringLiteral FRM_SUN_COMPONENT_COMBOBOX
Definition: services.hxx:115
constexpr OUStringLiteral FRM_SUN_COMPONENT_FORMATTEDFIELD
Definition: services.hxx:130
constexpr OUStringLiteral FRM_SUN_COMPONENT_PATTERNFIELD
Definition: services.hxx:128
constexpr OUStringLiteral FRM_SUN_COMPONENT_CHECKBOX
Definition: services.hxx:120
constexpr OUStringLiteral FRM_SUN_COMPONENT_LISTBOX
Definition: services.hxx:114
constexpr OUStringLiteral FRM_SUN_COMPONENT_NUMERICFIELD
Definition: services.hxx:126
constexpr OUStringLiteral FRM_SUN_COMPONENT_TEXTFIELD
Definition: services.hxx:113
constexpr OUStringLiteral FRM_COMPONENT_EDIT
Definition: services.hxx:65
constexpr OUStringLiteral FRM_SUN_COMPONENT_DATEFIELD
Definition: services.hxx:125
unsigned char sal_Bool
const SvXMLTokenMapEntry aTypes[]