LibreOffice Module forms (master) 1
Grid.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 "findpos.hxx"
22#include "Grid.hxx"
23#include <property.hxx>
24#include <services.hxx>
25#include <com/sun/star/beans/PropertyAttribute.hpp>
26#include <com/sun/star/form/FormComponentType.hpp>
27#include <com/sun/star/io/XMarkableStream.hpp>
28#include <com/sun/star/text/WritingMode2.hpp>
32#include <comphelper/types.hxx>
33#include <vcl/unohelp.hxx>
34#include <vcl/svapp.hxx>
35#include <tools/debug.hxx>
37
38using namespace ::com::sun::star::uno;
39
40namespace frm
41{
42using namespace ::com::sun::star;
43using namespace ::com::sun::star::sdb;
44using namespace ::com::sun::star::sdbc;
45using namespace ::com::sun::star::beans;
46using namespace ::com::sun::star::container;
47using namespace ::com::sun::star::form;
48using namespace ::com::sun::star::awt;
49using namespace ::com::sun::star::io;
50using namespace ::com::sun::star::lang;
51using namespace ::com::sun::star::util;
52using namespace ::com::sun::star::view;
53namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
54const sal_uInt16 ROWHEIGHT = 0x0001;
55const sal_uInt16 FONTTYPE = 0x0002;
56const sal_uInt16 FONTSIZE = 0x0004;
57const sal_uInt16 FONTATTRIBS = 0x0008;
58const sal_uInt16 TABSTOP = 0x0010;
59const sal_uInt16 TEXTCOLOR = 0x0020;
60const sal_uInt16 FONTDESCRIPTOR = 0x0040;
61const sal_uInt16 RECORDMARKER = 0x0080;
62const sal_uInt16 BACKGROUNDCOLOR = 0x0100;
63
64OGridControlModel::OGridControlModel(const Reference<XComponentContext>& _rxFactory)
65 :OControlModel(_rxFactory, OUString())
66 ,OInterfaceContainer(_rxFactory, m_aMutex, cppu::UnoType<XPropertySet>::get())
67 ,OErrorBroadcaster( OComponentHelper::rBHelper )
68 ,FontControlModel( false )
69 ,m_aSelectListeners(m_aMutex)
70 ,m_aResetListeners(m_aMutex)
71 ,m_aRowSetChangeListeners(m_aMutex)
72 ,m_aDefaultControl( FRM_SUN_CONTROL_GRIDCONTROL )
73 ,m_nBorder(1)
74 ,m_nWritingMode( WritingMode2::CONTEXT )
75 ,m_nContextWritingMode( WritingMode2::CONTEXT )
76 ,m_bEnableVisible(true)
77 ,m_bEnable(true)
78 ,m_bNavigation(true)
79 ,m_bRecordMarker(true)
80 ,m_bPrintable(true)
81 ,m_bAlwaysShowCursor(false)
82 ,m_bDisplaySynchron(true)
83{
84 m_nClassId = FormComponentType::GRIDCONTROL;
85}
86
87OGridControlModel::OGridControlModel( const OGridControlModel* _pOriginal, const Reference< XComponentContext >& _rxFactory )
88 :OControlModel( _pOriginal, _rxFactory )
89 ,OInterfaceContainer( _rxFactory, m_aMutex, cppu::UnoType<XPropertySet>::get() )
90 ,OErrorBroadcaster( OComponentHelper::rBHelper )
91 ,FontControlModel( _pOriginal )
92 ,m_aSelectListeners( m_aMutex )
93 ,m_aResetListeners( m_aMutex )
94 ,m_aRowSetChangeListeners( m_aMutex )
95{
96 m_aDefaultControl = _pOriginal->m_aDefaultControl;
97 m_bEnable = _pOriginal->m_bEnable;
98 m_bEnableVisible = _pOriginal->m_bEnableVisible;
99 m_bNavigation = _pOriginal->m_bNavigation;
100 m_nBorder = _pOriginal->m_nBorder;
101 m_nWritingMode = _pOriginal->m_nWritingMode;
102 m_nContextWritingMode = _pOriginal->m_nContextWritingMode;
103 m_bRecordMarker = _pOriginal->m_bRecordMarker;
104 m_bPrintable = _pOriginal->m_bPrintable;
105 m_bAlwaysShowCursor = _pOriginal->m_bAlwaysShowCursor;
106 m_bDisplaySynchron = _pOriginal->m_bDisplaySynchron;
107 // clone the columns
108 cloneColumns( _pOriginal );
109 // TODO: clone the events?
110}
111
112OGridControlModel::~OGridControlModel()
113{
114 if (!OComponentHelper::rBHelper.bDisposed)
115 {
116 acquire();
117 dispose();
118 }
119}
120
121// XCloneable
122Reference< XCloneable > SAL_CALL OGridControlModel::createClone( )
123{
124 rtl::Reference<OGridControlModel> pClone = new OGridControlModel( this, getContext() );
125 pClone->OControlModel::clonedFrom( this );
126 // do not call OInterfaceContainer::clonedFrom, it would clone the elements aka columns, which is
127 // already done in the ctor
128 //pClone->OInterfaceContainer::clonedFrom( *this );
129 return static_cast< XCloneable* >( static_cast< OControlModel* >( pClone.get() ) );
130}
131
132void OGridControlModel::cloneColumns( const OGridControlModel* _pOriginalContainer )
133{
134 try
135 {
136 Reference< XCloneable > xColCloneable;
137 sal_Int32 nIndex = 0;
138 for (auto const& column : _pOriginalContainer->m_aItems)
139 {
140 // ask the col for a factory for the clone
141 xColCloneable.set(column, css::uno::UNO_QUERY);
142 DBG_ASSERT( xColCloneable.is(), "OGridControlModel::cloneColumns: column is not cloneable!" );
143 if ( xColCloneable.is() )
144 {
145 // create a clone of the column
146 Reference< XCloneable > xColClone( xColCloneable->createClone() );
147 DBG_ASSERT( xColClone.is(), "OGridControlModel::cloneColumns: invalid column clone!" );
148 if ( xColClone.is() )
149 {
150 // insert this clone into our own container
151 insertByIndex( nIndex, xColClone->queryInterface( m_aElementType ) );
152 }
153 }
154 ++nIndex;
155 }
156 }
157 catch( const Exception& )
158 {
159 TOOLS_WARN_EXCEPTION( "forms.component", "OGridControlModel::cloneColumns: caught an exception while cloning the columns!" );
160 }
161}
162
163// XServiceInfo
164css::uno::Sequence<OUString> OGridControlModel::getSupportedServiceNames()
165{
166 css::uno::Sequence<OUString> aSupported = OControlModel::getSupportedServiceNames();
167 aSupported.realloc(aSupported.getLength() + 4);
168 auto pSupported = aSupported.getArray();
169 pSupported[aSupported.getLength()-4] = "com.sun.star.awt.UnoControlModel";
170 pSupported[aSupported.getLength()-3] = FRM_SUN_COMPONENT_GRIDCONTROL;
171 pSupported[aSupported.getLength()-2] = FRM_COMPONENT_GRID;
172 pSupported[aSupported.getLength()-1] = FRM_COMPONENT_GRIDCONTROL;
173 return aSupported;
174}
175Any SAL_CALL OGridControlModel::queryAggregation( const Type& _rType )
176{
177 Any aReturn = OGridControlModel_BASE::queryInterface(_rType);
178 if ( !aReturn.hasValue() )
179 {
180 aReturn = OControlModel::queryAggregation( _rType );
181 if ( !aReturn.hasValue() )
182 {
183 aReturn = OInterfaceContainer::queryInterface( _rType );
184 if ( !aReturn.hasValue() )
185 aReturn = OErrorBroadcaster::queryInterface( _rType );
186 }
187 }
188 return aReturn;
189}
190
191// XSQLErrorListener
192void SAL_CALL OGridControlModel::errorOccured( const SQLErrorEvent& _rEvent )
193{
194 // forward the errors which happened to my columns to my own listeners
195 onError( _rEvent );
196}
197
198// XRowSetSupplier
199Reference< XRowSet > SAL_CALL OGridControlModel::getRowSet( )
200{
201 return Reference< XRowSet >( getParent(), UNO_QUERY );
202}
203
204void SAL_CALL OGridControlModel::setRowSet( const Reference< XRowSet >& /*_rxDataSource*/ )
205{
206 OSL_FAIL( "OGridControlModel::setRowSet: not supported!" );
207}
208
209void SAL_CALL OGridControlModel::addRowSetChangeListener( const Reference< XRowSetChangeListener >& i_Listener )
210{
211 if ( i_Listener.is() )
212 m_aRowSetChangeListeners.addInterface( i_Listener );
213}
214
215void SAL_CALL OGridControlModel::removeRowSetChangeListener( const Reference< XRowSetChangeListener >& i_Listener )
216{
217 m_aRowSetChangeListeners.removeInterface( i_Listener );
218}
219
220// XChild
221void SAL_CALL OGridControlModel::setParent( const css::uno::Reference<css::uno::XInterface>& i_Parent )
222{
223 ::osl::ClearableMutexGuard aGuard( m_aMutex );
224 if ( i_Parent == getParent() )
225 return;
226 OControlModel::setParent( i_Parent );
227 EventObject aEvent( *this );
228 aGuard.clear();
229 m_aRowSetChangeListeners.notifyEach( &XRowSetChangeListener::onRowSetChanged, aEvent );
230}
231Sequence< Type > SAL_CALL OGridControlModel::getTypes( )
232{
233 return concatSequences(
235 OControlModel::getTypes(),
236 OInterfaceContainer::getTypes(),
237 OErrorBroadcaster::getTypes()
238 ),
239 OGridControlModel_BASE::getTypes()
240 );
241}
242
243// OComponentHelper
244void OGridControlModel::disposing()
245{
246 OControlModel::disposing();
247 OErrorBroadcaster::disposing();
248 OInterfaceContainer::disposing();
249 setParent(nullptr);
250 EventObject aEvt(static_cast<XWeak*>(this));
251 m_aSelectListeners.disposeAndClear(aEvt);
252 m_aResetListeners.disposeAndClear(aEvt);
253 m_aRowSetChangeListeners.disposeAndClear(aEvt);
254}
255
256// XEventListener
257void OGridControlModel::disposing(const EventObject& _rEvent)
258{
259 OControlModel::disposing( _rEvent );
260 OInterfaceContainer::disposing( _rEvent );
261}
262
263// XSelectionSupplier
264sal_Bool SAL_CALL OGridControlModel::select(const Any& rElement)
265{
266 ::osl::ClearableMutexGuard aGuard( m_aMutex );
267 Reference<XPropertySet> xSel;
268 if (rElement.hasValue())
269 {
270 xSel.set(rElement, css::uno::UNO_QUERY);
271 if (!xSel.is())
272 {
273 throw IllegalArgumentException();
274 }
275 }
276 css::uno::Reference<css::uno::XInterface> xMe = static_cast<XWeak*>(this);
277 if (xSel.is())
278 {
279 Reference<XChild> xAsChild(xSel, UNO_QUERY);
280 if (!xAsChild.is() || (xAsChild->getParent() != xMe))
281 {
282 throw IllegalArgumentException();
283 }
284 }
285 if ( xSel != m_xSelection )
286 {
287 m_xSelection = xSel;
288 aGuard.clear();
289 m_aSelectListeners.notifyEach( &XSelectionChangeListener::selectionChanged, EventObject( *this ) );
290 return true;
291 }
292 return false;
293}
294Any SAL_CALL OGridControlModel::getSelection()
295{
296 return Any(m_xSelection);
297}
298
299void OGridControlModel::addSelectionChangeListener(const Reference< XSelectionChangeListener >& _rxListener)
300{
301 m_aSelectListeners.addInterface(_rxListener);
302}
303
304void OGridControlModel::removeSelectionChangeListener(const Reference< XSelectionChangeListener >& _rxListener)
305{
306 m_aSelectListeners.removeInterface(_rxListener);
307}
308
309// XGridColumnFactory
310Reference<XPropertySet> SAL_CALL OGridControlModel::createColumn(const OUString& ColumnType)
311{
313 const Sequence< OUString >& rColumnTypes = frm::getColumnTypes();
314 return createColumnById( ::detail::findPos( ColumnType, rColumnTypes ) );
315}
316Reference<XPropertySet> OGridControlModel::createColumnById(sal_Int32 nTypeId) const
317{
318 Reference<XPropertySet> xReturn;
319 switch (nTypeId)
320 {
321 case TYPE_CHECKBOX: xReturn = new CheckBoxColumn( getContext() ); break;
322 case TYPE_COMBOBOX: xReturn = new ComboBoxColumn( getContext() ); break;
323 case TYPE_CURRENCYFIELD: xReturn = new CurrencyFieldColumn( getContext() ); break;
324 case TYPE_DATEFIELD: xReturn = new DateFieldColumn( getContext() ); break;
325 case TYPE_LISTBOX: xReturn = new ListBoxColumn( getContext() ); break;
326 case TYPE_NUMERICFIELD: xReturn = new NumericFieldColumn( getContext() ); break;
327 case TYPE_PATTERNFIELD: xReturn = new PatternFieldColumn( getContext() ); break;
328 case TYPE_TEXTFIELD: xReturn = new TextFieldColumn( getContext() ); break;
329 case TYPE_TIMEFIELD: xReturn = new TimeFieldColumn( getContext() ); break;
330 case TYPE_FORMATTEDFIELD: xReturn = new FormattedFieldColumn( getContext() ); break;
331 default:
332 OSL_FAIL("OGridControlModel::createColumn: Unknown Column");
333 break;
334 }
335 return xReturn;
336}
337css::uno::Sequence<OUString> SAL_CALL OGridControlModel::getColumnTypes()
338{
339 return frm::getColumnTypes();
340}
341
342// XReset
343void SAL_CALL OGridControlModel::reset()
344{
345 ::comphelper::OInterfaceIteratorHelper3 aIter(m_aResetListeners);
346 EventObject aEvt(static_cast<XWeak*>(this));
347 bool bContinue = true;
348 while (aIter.hasMoreElements() && bContinue)
349 bContinue = aIter.next()->approveReset(aEvt);
350 if (bContinue)
351 {
352 _reset();
353 m_aResetListeners.notifyEach( &XResetListener::resetted, aEvt );
354 }
355}
356void SAL_CALL OGridControlModel::addResetListener(const Reference<XResetListener>& _rxListener)
357{
358 m_aResetListeners.addInterface(_rxListener);
359}
360void SAL_CALL OGridControlModel::removeResetListener(const Reference<XResetListener>& _rxListener)
361{
362 m_aResetListeners.removeInterface(_rxListener);
363}
364void OGridControlModel::_reset()
365{
366 Reference<XReset> xReset;
367 sal_Int32 nCount = getCount();
368 for (sal_Int32 nIndex=0; nIndex < nCount; nIndex++)
369 {
370 getByIndex( nIndex ) >>= xReset;
371 if (xReset.is())
372 xReset->reset();
373 }
374}
375
376// XPropertySet
377void OGridControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const
378{
379 _rProps.realloc(37);
380 css::beans::Property* pProperties = _rProps.getArray();
381 *pProperties++ = css::beans::Property(PROPERTY_NAME, PROPERTY_ID_NAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
382 *pProperties++ = css::beans::Property(PROPERTY_CLASSID, PROPERTY_ID_CLASSID, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::TRANSIENT);
383 *pProperties++ = css::beans::Property(PROPERTY_TAG, PROPERTY_ID_TAG, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
384 *pProperties++ = css::beans::Property(PROPERTY_TABINDEX, PROPERTY_ID_TABINDEX, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND);
385 *pProperties++ = css::beans::Property(PROPERTY_TABSTOP, PROPERTY_ID_TABSTOP, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | css::beans::PropertyAttribute::MAYBEVOID);
386 *pProperties++ = css::beans::Property(PROPERTY_HASNAVIGATION, PROPERTY_ID_HASNAVIGATION, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
387 *pProperties++ = css::beans::Property(PROPERTY_ENABLED, PROPERTY_ID_ENABLED, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND);
388 *pProperties++ = css::beans::Property(PROPERTY_ENABLEVISIBLE, PROPERTY_ID_ENABLEVISIBLE, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
389 *pProperties++ = css::beans::Property(PROPERTY_BORDER, PROPERTY_ID_BORDER, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND);
390 *pProperties++ = css::beans::Property(PROPERTY_BORDERCOLOR, PROPERTY_ID_BORDERCOLOR, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEVOID);
391 *pProperties++ = css::beans::Property(PROPERTY_DEFAULTCONTROL, PROPERTY_ID_DEFAULTCONTROL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
392 *pProperties++ = css::beans::Property(PROPERTY_TEXTCOLOR, PROPERTY_ID_TEXTCOLOR, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | css::beans::PropertyAttribute::MAYBEVOID);
393 *pProperties++ = css::beans::Property(PROPERTY_BACKGROUNDCOLOR, PROPERTY_ID_BACKGROUNDCOLOR, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | css::beans::PropertyAttribute::MAYBEVOID);
394 *pProperties++ = css::beans::Property(PROPERTY_FONT, PROPERTY_ID_FONT, cppu::UnoType<FontDescriptor>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
395 *pProperties++ = css::beans::Property(PROPERTY_ROWHEIGHT, PROPERTY_ID_ROWHEIGHT, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | css::beans::PropertyAttribute::MAYBEVOID);
396 *pProperties++ = css::beans::Property(PROPERTY_HELPTEXT, PROPERTY_ID_HELPTEXT, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
397 *pProperties++ = css::beans::Property(PROPERTY_FONT_NAME, PROPERTY_ID_FONT_NAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEDEFAULT);
398 *pProperties++ = css::beans::Property(PROPERTY_FONT_STYLENAME, PROPERTY_ID_FONT_STYLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEDEFAULT);
399 *pProperties++ = css::beans::Property(PROPERTY_FONT_FAMILY, PROPERTY_ID_FONT_FAMILY, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::MAYBEDEFAULT);
400 *pProperties++ = css::beans::Property(PROPERTY_FONT_CHARSET, PROPERTY_ID_FONT_CHARSET, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::MAYBEDEFAULT);
401 *pProperties++ = css::beans::Property(PROPERTY_FONT_HEIGHT, PROPERTY_ID_FONT_HEIGHT, cppu::UnoType<float>::get(), css::beans::PropertyAttribute::MAYBEDEFAULT);
402 *pProperties++ = css::beans::Property(PROPERTY_FONT_WEIGHT, PROPERTY_ID_FONT_WEIGHT, cppu::UnoType<float>::get(), css::beans::PropertyAttribute::MAYBEDEFAULT);
403 *pProperties++ = css::beans::Property(PROPERTY_FONT_SLANT, PROPERTY_ID_FONT_SLANT, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::MAYBEDEFAULT);
404 *pProperties++ = css::beans::Property(PROPERTY_FONT_UNDERLINE, PROPERTY_ID_FONT_UNDERLINE, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::MAYBEDEFAULT);
406 css::beans::PropertyAttribute::MAYBEDEFAULT);
407 *pProperties++ = css::beans::Property(PROPERTY_TEXTLINECOLOR, PROPERTY_ID_TEXTLINECOLOR, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | css::beans::PropertyAttribute::MAYBEVOID);
408 *pProperties++ = css::beans::Property(PROPERTY_FONTEMPHASISMARK, PROPERTY_ID_FONTEMPHASISMARK, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
409 *pProperties++ = css::beans::Property(PROPERTY_FONTRELIEF, PROPERTY_ID_FONTRELIEF, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
410 *pProperties++ = css::beans::Property(PROPERTY_FONT_STRIKEOUT, PROPERTY_ID_FONT_STRIKEOUT, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::MAYBEDEFAULT);
411 *pProperties++ = css::beans::Property(PROPERTY_RECORDMARKER, PROPERTY_ID_RECORDMARKER, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
412 *pProperties++ = css::beans::Property(PROPERTY_PRINTABLE, PROPERTY_ID_PRINTABLE, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
413 *pProperties++ = css::beans::Property(PROPERTY_CURSORCOLOR, PROPERTY_ID_CURSORCOLOR, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT |
414 css::beans::PropertyAttribute::MAYBEVOID | css::beans::PropertyAttribute::TRANSIENT);
415 *pProperties++ = css::beans::Property(PROPERTY_ALWAYSSHOWCURSOR, PROPERTY_ID_ALWAYSSHOWCURSOR, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | css::beans::PropertyAttribute::TRANSIENT);
416 *pProperties++ = css::beans::Property(PROPERTY_DISPLAYSYNCHRON, PROPERTY_ID_DISPLAYSYNCHRON, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | css::beans::PropertyAttribute::TRANSIENT);
417 *pProperties++ = css::beans::Property(PROPERTY_HELPURL, PROPERTY_ID_HELPURL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
418 *pProperties++ = css::beans::Property(PROPERTY_WRITING_MODE, PROPERTY_ID_WRITING_MODE, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
419 *pProperties++ = css::beans::Property(PROPERTY_CONTEXT_WRITING_MODE, PROPERTY_ID_CONTEXT_WRITING_MODE, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | css::beans::PropertyAttribute::TRANSIENT);
420 DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(), "<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
421}
422void OGridControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) const
423{
424 switch (nHandle)
425 {
427 rValue <<= m_nContextWritingMode;
428 break;
430 rValue <<= m_nWritingMode;
431 break;
433 rValue <<= m_sHelpText;
434 break;
436 rValue <<= m_sHelpURL;
437 break;
439 rValue <<= m_bDisplaySynchron;
440 break;
442 rValue <<= m_bAlwaysShowCursor;
443 break;
445 rValue = m_aCursorColor;
446 break;
448 rValue <<= m_bPrintable;
449 break;
451 rValue = m_aTabStop;
452 break;
454 rValue <<= m_bNavigation;
455 break;
457 rValue <<= m_bRecordMarker;
458 break;
460 rValue <<= m_bEnable;
461 break;
463 rValue <<= m_bEnableVisible;
464 break;
466 rValue <<= m_nBorder;
467 break;
469 rValue = m_aBorderColor;
470 break;
472 rValue <<= m_aDefaultControl;
473 break;
475 rValue = m_aBackgroundColor;
476 break;
478 rValue = m_aRowHeight;
479 break;
480 default:
481 if ( isFontRelatedProperty( nHandle ) )
482 FontControlModel::getFastPropertyValue( rValue, nHandle );
483 else
484 OControlModel::getFastPropertyValue( rValue, nHandle );
485 }
486}
487
488sal_Bool OGridControlModel::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue,
489 sal_Int32 nHandle, const Any& rValue )
490{
491 bool bModified(false);
492 switch (nHandle)
493 {
495 bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_nContextWritingMode );
496 break;
498 bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_nWritingMode );
499 break;
501 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_sHelpText);
502 break;
504 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_sHelpURL);
505 break;
507 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bDisplaySynchron);
508 break;
510 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bAlwaysShowCursor);
511 break;
513 if (!rValue.hasValue() || !m_aCursorColor.hasValue())
514 {
515 if (rValue.hasValue() && (TypeClass_LONG != rValue.getValueType().getTypeClass()))
516 {
517 throw IllegalArgumentException();
518 }
519 rOldValue = m_aCursorColor;
520 rConvertedValue = rValue;
521 bModified = rOldValue != rConvertedValue;
522 }
523 else
524 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, getINT32(m_aCursorColor));
525 break;
527 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bPrintable);
528 break;
530 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aTabStop, cppu::UnoType<bool>::get());
531 break;
533 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bNavigation);
534 break;
536 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bRecordMarker);
537 break;
539 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bEnable);
540 break;
542 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bEnableVisible);
543 break;
545 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_nBorder);
546 break;
548 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aBorderColor, cppu::UnoType<sal_Int32>::get());
549 break;
551 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aDefaultControl);
552 break;
554 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aBackgroundColor, cppu::UnoType<sal_Int32>::get());
555 break;
557 {
558 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aRowHeight, cppu::UnoType<sal_Int32>::get());
559 sal_Int32 nNewVal( 0 );
560 if ( ( rConvertedValue >>= nNewVal ) && ( nNewVal <= 0 ) )
561 {
562 rConvertedValue.clear();
563 bModified = m_aRowHeight.hasValue();
564 }
565 }
566 break;
567 default:
568 if ( isFontRelatedProperty( nHandle ) )
569 bModified = FontControlModel::convertFastPropertyValue( rConvertedValue, rOldValue, nHandle, rValue );
570 else
571 bModified = OControlModel::convertFastPropertyValue( rConvertedValue, rOldValue, nHandle, rValue);
572 }
573 return bModified;
574}
575void OGridControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue )
576{
577 switch (nHandle)
578 {
580 rValue >>= m_nContextWritingMode;
581 break;
583 rValue >>= m_nWritingMode;
584 break;
586 rValue >>= m_sHelpText;
587 break;
589 rValue >>= m_sHelpURL;
590 break;
592 m_bDisplaySynchron = getBOOL(rValue);
593 break;
595 m_bAlwaysShowCursor = getBOOL(rValue);
596 break;
598 m_aCursorColor = rValue;
599 break;
601 m_bPrintable = getBOOL(rValue);
602 break;
604 m_aTabStop = rValue;
605 break;
607 m_bNavigation = getBOOL(rValue);
608 break;
610 m_bEnable = getBOOL(rValue);
611 break;
613 m_bEnableVisible = getBOOL(rValue);
614 break;
616 m_bRecordMarker = getBOOL(rValue);
617 break;
619 rValue >>= m_nBorder;
620 break;
622 m_aBorderColor = rValue;
623 break;
625 rValue >>= m_aDefaultControl;
626 break;
628 m_aBackgroundColor = rValue;
629 break;
631 m_aRowHeight = rValue;
632 break;
633 default:
634 if ( isFontRelatedProperty( nHandle ) )
635 {
636 FontControlModel::setFastPropertyValue_NoBroadcast_impl(
637 *this, &OGridControlModel::setDependentFastPropertyValue,
638 nHandle, rValue);
639 }
640 else
641 OControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue );
642 }
643}
644
645//XPropertyState
646Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const
647{
648 Any aReturn;
649 switch (nHandle)
650 {
653 aReturn <<= WritingMode2::CONTEXT;
654 break;
656 aReturn <<= OUString( STARDIV_ONE_FORM_CONTROL_GRID );
657 break;
664 aReturn <<= true;
665 break;
667 aReturn <<= false;
668 break;
671 aReturn <<= OUString();
672 break;
674 aReturn <<= sal_Int16(1);
675 break;
681 // void
682 break;
683 default:
684 if ( isFontRelatedProperty( nHandle ) )
685 aReturn = FontControlModel::getPropertyDefaultByHandle( nHandle );
686 else
687 aReturn = OControlModel::getPropertyDefaultByHandle(nHandle);
688 }
689 return aReturn;
690}
691
692void OGridControlModel::gotColumn( const Reference< XInterface >& _rxColumn )
693{
694 Reference< XSQLErrorBroadcaster > xBroadcaster( _rxColumn, UNO_QUERY );
695 if ( xBroadcaster.is() )
696 xBroadcaster->addSQLErrorListener( this );
697}
698
699void OGridControlModel::lostColumn(const Reference< XInterface >& _rxColumn)
700{
701 if ( m_xSelection == _rxColumn )
702 { // the currently selected element was replaced
703 m_xSelection.clear();
704 EventObject aEvt( static_cast< XWeak* >( this ) );
705 m_aSelectListeners.notifyEach( &XSelectionChangeListener::selectionChanged, aEvt );
706 }
707 Reference< XSQLErrorBroadcaster > xBroadcaster( _rxColumn, UNO_QUERY );
708 if ( xBroadcaster.is() )
709 xBroadcaster->removeSQLErrorListener( this );
710}
711
712void OGridControlModel::implRemoved(const css::uno::Reference<css::uno::XInterface>& _rxObject)
713{
714 OInterfaceContainer::implRemoved(_rxObject);
715 lostColumn(_rxObject);
716}
717
718void OGridControlModel::implInserted( const ElementDescription* _pElement )
719{
720 OInterfaceContainer::implInserted( _pElement );
721 gotColumn( _pElement->xInterface );
722}
723
724void OGridControlModel::impl_replacedElement( const ContainerEvent& _rEvent, ::osl::ClearableMutexGuard& _rInstanceLock )
725{
726 Reference< XInterface > xOldColumn( _rEvent.ReplacedElement, UNO_QUERY );
727 Reference< XInterface > xNewColumn( _rEvent.Element, UNO_QUERY );
728 bool bNewSelection = ( xOldColumn == m_xSelection );
729 lostColumn( xOldColumn );
730 gotColumn( xNewColumn );
731 if ( bNewSelection )
732 m_xSelection.set( xNewColumn, UNO_QUERY );
733 OInterfaceContainer::impl_replacedElement( _rEvent, _rInstanceLock );
734 // < SYNCHRONIZED
735 if ( bNewSelection )
736 {
737 m_aSelectListeners.notifyEach( &XSelectionChangeListener::selectionChanged, EventObject( *this ) );
738 }
739}
740
741ElementDescription* OGridControlModel::createElementMetaData( )
742{
743 return new ElementDescription;
744}
745
746void OGridControlModel::approveNewElement( const Reference< XPropertySet >& _rxObject, ElementDescription* _pElement )
747{
748 OGridColumn* pCol = comphelper::getFromUnoTunnel<OGridColumn>( _rxObject );
749 if ( !pCol )
750 throw IllegalArgumentException();
751 OInterfaceContainer::approveNewElement( _rxObject, _pElement );
752}
753
754// XPersistObject
755OUString SAL_CALL OGridControlModel::getServiceName()
756{
757 return FRM_COMPONENT_GRID; // old (non-sun) name for compatibility!
758}
759
760void OGridControlModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
761{
762 OControlModel::write(_rxOutStream);
763 Reference<XMarkableStream> xMark(_rxOutStream, UNO_QUERY);
764 // 1. Version
765 _rxOutStream->writeShort(0x0008);
766 // 2. Columns
767 sal_Int32 nLen = getCount();
768 _rxOutStream->writeLong(nLen);
769 for (sal_Int32 i = 0; i < nLen; i++)
770 {
771 // first the service name for the underlying model
772 OGridColumn* pCol = comphelper::getFromUnoTunnel<OGridColumn>(m_aItems[i]);
773 DBG_ASSERT(pCol != nullptr, "OGridControlModel::write : such items should never reach it into my container !");
774 _rxOutStream << pCol->getModelName();
775 // then the object itself
776 sal_Int32 nMark = xMark->createMark();
777 sal_Int32 nObjLen = 0;
778 _rxOutStream->writeLong(nObjLen);
779 // writing the column
780 pCol->write(_rxOutStream);
781 // determining the length
782 nObjLen = xMark->offsetToMark(nMark) - 4;
783 xMark->jumpToMark(nMark);
784 _rxOutStream->writeLong(nObjLen);
785 xMark->jumpToFurthest();
786 xMark->deleteMark(nMark);
787 }
788 // 3. Events
789 writeEvents(_rxOutStream);
790 // 4. Attributes
791 // Masking for all 'any' types
792 sal_uInt16 nAnyMask = 0;
793 if (m_aRowHeight.getValueType().getTypeClass() == TypeClass_LONG)
794 nAnyMask |= ROWHEIGHT;
795 if ( getFont() != getDefaultFont() )
797 if (m_aTabStop.getValueType().getTypeClass() == TypeClass_BOOLEAN)
798 nAnyMask |= TABSTOP;
799 if ( hasTextColor() )
800 nAnyMask |= TEXTCOLOR;
801 if (m_aBackgroundColor.getValueType().getTypeClass() == TypeClass_LONG)
802 nAnyMask |= BACKGROUNDCOLOR;
803 if (!m_bRecordMarker)
804 nAnyMask |= RECORDMARKER;
805 _rxOutStream->writeShort(nAnyMask);
806 if (nAnyMask & ROWHEIGHT)
807 _rxOutStream->writeLong(getINT32(m_aRowHeight));
808 // old structures
809 const FontDescriptor& aFont = getFont();
810 if ( nAnyMask & FONTDESCRIPTOR )
811 {
812 // Attrib
813 _rxOutStream->writeShort( sal::static_int_cast< sal_Int16 >( vcl::unohelper::ConvertFontWeight( aFont.Weight ) ) );
814 _rxOutStream->writeShort( sal::static_int_cast< sal_Int16 >( aFont.Slant ) );
815 _rxOutStream->writeShort( aFont.Underline );
816 _rxOutStream->writeShort( aFont.Strikeout );
817 _rxOutStream->writeShort( sal_Int16(aFont.Orientation * 10) );
818 _rxOutStream->writeBoolean( aFont.Kerning );
819 _rxOutStream->writeBoolean( aFont.WordLineMode );
820 // Size
821 _rxOutStream->writeLong( aFont.Width );
822 _rxOutStream->writeLong( aFont.Height );
823 _rxOutStream->writeShort( sal::static_int_cast< sal_Int16 >( vcl::unohelper::ConvertFontWidth( aFont.CharacterWidth ) ) );
824 // Type
825 _rxOutStream->writeUTF( aFont.Name );
826 _rxOutStream->writeUTF( aFont.StyleName );
827 _rxOutStream->writeShort( aFont.Family );
828 _rxOutStream->writeShort( aFont.CharSet );
829 _rxOutStream->writeShort( aFont.Pitch );
830 }
831 _rxOutStream << m_aDefaultControl;
832 _rxOutStream->writeShort(m_nBorder);
833 _rxOutStream->writeBoolean(m_bEnable);
834 if (nAnyMask & TABSTOP)
835 _rxOutStream->writeBoolean(getBOOL(m_aTabStop));
836 _rxOutStream->writeBoolean(m_bNavigation);
837 if (nAnyMask & TEXTCOLOR)
838 _rxOutStream->writeLong( sal_Int32(getTextColor()) );
839 // new since version 6
840 _rxOutStream << m_sHelpText;
841 if (nAnyMask & FONTDESCRIPTOR)
842 _rxOutStream << getFont();
843 if (nAnyMask & RECORDMARKER)
844 _rxOutStream->writeBoolean(m_bRecordMarker);
845 // new since version 7
846 _rxOutStream->writeBoolean(m_bPrintable);
847 // new since version 8
848 if (nAnyMask & BACKGROUNDCOLOR)
849 _rxOutStream->writeLong(getINT32(m_aBackgroundColor));
850}
851
852void OGridControlModel::read(const Reference<XObjectInputStream>& _rxInStream)
853{
855 OControlModel::read(_rxInStream);
856 Reference<XMarkableStream> xMark(_rxInStream, UNO_QUERY);
857 // 1. version
858 sal_Int16 nVersion = _rxInStream->readShort();
859 // 2. reading the columns
860 sal_Int32 nLen = _rxInStream->readLong();
861 if (nLen)
862 {
863 for (sal_Int32 i = 0; i < nLen; i++)
864 {
865 // reading the model names
866 OUString sModelName;
867 _rxInStream >> sModelName;
868 Reference<XPropertySet> xCol(createColumnById(getColumnTypeByModelName(sModelName)));
869 DBG_ASSERT(xCol.is(), "OGridControlModel::read : unknown column type !");
870 sal_Int32 nObjLen = _rxInStream->readLong();
871 if (nObjLen)
872 {
873 sal_Int32 nMark = xMark->createMark();
874 if (xCol.is())
875 {
876 OGridColumn* pCol = comphelper::getFromUnoTunnel<OGridColumn>(xCol);
877 pCol->read(_rxInStream);
878 }
879 xMark->jumpToMark(nMark);
880 _rxInStream->skipBytes(nObjLen);
881 xMark->deleteMark(nMark);
882 }
883 if ( xCol.is() )
884 implInsert( i, xCol, false, nullptr, false );
885 }
886 }
887 // In the base implementation events are only read, elements in the container exist
888 // but since before TF_ONE for the GridControl events were always written, so they
889 // need to be read, too
890 sal_Int32 nObjLen = _rxInStream->readLong();
891 if (nObjLen)
892 {
893 sal_Int32 nMark = xMark->createMark();
894 Reference<XPersistObject> xObj(m_xEventAttacher, UNO_QUERY);
895 if (xObj.is())
896 xObj->read(_rxInStream);
897 xMark->jumpToMark(nMark);
898 _rxInStream->skipBytes(nObjLen);
899 xMark->deleteMark(nMark);
900 }
901 // reading the attachment
902 for (sal_Int32 i = 0; i < nLen; i++)
903 {
904 css::uno::Reference<css::uno::XInterface> xIfc(m_aItems[i], UNO_QUERY);
905 Reference<XPropertySet> xSet(xIfc, UNO_QUERY);
906 Any aHelper;
907 aHelper <<= xSet;
908 m_xEventAttacher->attach( i, xIfc, aHelper );
909 }
910 // 4. reading the attributes
911 if (nVersion == 1)
912 return;
913 // Masking for any
914 sal_uInt16 nAnyMask = _rxInStream->readShort();
915 if (nAnyMask & ROWHEIGHT)
916 {
917 sal_Int32 nValue = _rxInStream->readLong();
918 m_aRowHeight <<= nValue;
919 }
920 FontDescriptor aFont( getFont() );
921 if ( nAnyMask & FONTATTRIBS )
922 {
923 aFont.Weight = static_cast<float>(vcl::unohelper::ConvertFontWeight( _rxInStream->readShort() ));
924 aFont.Slant = static_cast<FontSlant>(_rxInStream->readShort());
925 aFont.Underline = _rxInStream->readShort();
926 aFont.Strikeout = _rxInStream->readShort();
927 aFont.Orientation = static_cast<float>(_rxInStream->readShort()) / 10;
928 aFont.Kerning = _rxInStream->readBoolean() != 0;
929 aFont.WordLineMode = _rxInStream->readBoolean() != 0;
930 }
931 if ( nAnyMask & FONTSIZE )
932 {
933 aFont.Width = static_cast<sal_Int16>(_rxInStream->readLong());
934 aFont.Height = static_cast<sal_Int16>(_rxInStream->readLong());
935 aFont.CharacterWidth = static_cast<float>(vcl::unohelper::ConvertFontWidth( _rxInStream->readShort() ));
936 }
937 if ( nAnyMask & FONTTYPE )
938 {
939 aFont.Name = _rxInStream->readUTF();
940 aFont.StyleName = _rxInStream->readUTF();
941 aFont.Family = _rxInStream->readShort();
942 aFont.CharSet = _rxInStream->readShort();
943 aFont.Pitch = _rxInStream->readShort();
944 }
945 if ( nAnyMask & ( FONTATTRIBS | FONTSIZE | FONTTYPE ) )
946 setFont( aFont );
947 // Name
948 _rxInStream >> m_aDefaultControl;
949 m_nBorder = _rxInStream->readShort();
950 m_bEnable = _rxInStream->readBoolean();
951 if (nAnyMask & TABSTOP)
952 {
953 m_aTabStop <<= (_rxInStream->readBoolean() != 0);
954 }
955 if (nVersion > 3)
956 m_bNavigation = _rxInStream->readBoolean();
957 if (nAnyMask & TEXTCOLOR)
958 {
959 sal_Int32 nValue = _rxInStream->readLong();
960 setTextColor( ::Color(ColorTransparency, nValue) );
961 }
962 // new since version 6
963 if (nVersion > 5)
964 _rxInStream >> m_sHelpText;
965 if (nAnyMask & FONTDESCRIPTOR)
966 {
967 FontDescriptor aUNOFont;
968 _rxInStream >> aUNOFont;
969 setFont( aFont );
970 }
971 if (nAnyMask & RECORDMARKER)
972 m_bRecordMarker = _rxInStream->readBoolean();
973 // new since version 7
974 if (nVersion > 6)
975 m_bPrintable = _rxInStream->readBoolean();
976 if (nAnyMask & BACKGROUNDCOLOR)
977 {
978 sal_Int32 nValue = _rxInStream->readLong();
979 m_aBackgroundColor <<= nValue;
980 }
981}
982
983}
984
985extern "C" SAL_DLLPUBLIC_EXPORT XInterface*
987 Sequence<Any> const &)
988{
989 return cppu::acquire(new frm::OGridControlModel(component));
990}
991
992/* 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
SAL_DLLPUBLIC_EXPORT XInterface * com_sun_star_form_OGridControlModel_get_implementation(XComponentContext *component, Sequence< Any > const &)
Definition: Grid.cxx:986
AnyEventRef aEvent
css::uno::Reference< ListenerT > const & next()
void write(const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream)
Definition: Columns.cxx:462
const OUString & getModelName() const
Definition: Columns.hxx:104
void read(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
Definition: Columns.cxx:510
OGridControlModel(const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
ColorTransparency
int nCount
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
Any aHelper
sal_Int16 nVersion
sal_Int16 nValue
constexpr OUStringLiteral PROPERTY_TABINDEX
Definition: frm_strings.hxx:26
constexpr OUStringLiteral PROPERTY_DEFAULTCONTROL
Definition: frm_strings.hxx:51
constexpr OUStringLiteral PROPERTY_NAME
Definition: frm_strings.hxx:28
constexpr OUStringLiteral PROPERTY_FONT_FAMILY
constexpr OUStringLiteral PROPERTY_BACKGROUNDCOLOR
constexpr OUStringLiteral PROPERTY_FONT_SLANT
constexpr OUStringLiteral PROPERTY_DISPLAYSYNCHRON
constexpr OUStringLiteral PROPERTY_HASNAVIGATION
Definition: frm_strings.hxx:36
constexpr OUStringLiteral PROPERTY_CURSORCOLOR
constexpr OUStringLiteral PROPERTY_HELPURL
constexpr OUStringLiteral PROPERTY_FONT_WEIGHT
constexpr OUStringLiteral PROPERTY_FONT_HEIGHT
constexpr OUStringLiteral PROPERTY_FONTRELIEF
constexpr OUStringLiteral PROPERTY_FONT_UNDERLINE
constexpr OUStringLiteral PROPERTY_FONT_STRIKEOUT
constexpr OUStringLiteral PROPERTY_FONT_WORDLINEMODE
constexpr OUStringLiteral PROPERTY_HELPTEXT
constexpr OUStringLiteral PROPERTY_CLASSID
Definition: frm_strings.hxx:30
constexpr OUStringLiteral PROPERTY_FONTEMPHASISMARK
constexpr OUStringLiteral PROPERTY_PRINTABLE
constexpr OUStringLiteral PROPERTY_TAG
Definition: frm_strings.hxx:27
constexpr OUStringLiteral PROPERTY_TEXTCOLOR
constexpr OUStringLiteral PROPERTY_FONT_CHARSET
constexpr OUStringLiteral PROPERTY_RECORDMARKER
constexpr OUStringLiteral PROPERTY_FONT
constexpr OUStringLiteral PROPERTY_ALWAYSSHOWCURSOR
constexpr OUStringLiteral PROPERTY_ENABLEVISIBLE
Definition: frm_strings.hxx:40
constexpr OUStringLiteral PROPERTY_WRITING_MODE
constexpr OUStringLiteral PROPERTY_FONT_STYLENAME
constexpr OUStringLiteral PROPERTY_TEXTLINECOLOR
constexpr OUStringLiteral PROPERTY_ROWHEIGHT
constexpr OUStringLiteral PROPERTY_BORDERCOLOR
constexpr OUStringLiteral PROPERTY_TABSTOP
constexpr OUStringLiteral PROPERTY_FONT_NAME
constexpr OUStringLiteral PROPERTY_BORDER
constexpr OUStringLiteral PROPERTY_ENABLED
Definition: frm_strings.hxx:39
constexpr OUStringLiteral PROPERTY_CONTEXT_WRITING_MODE
std::mutex m_aMutex
sal_Int32 nIndex
@ Exception
class SAL_NO_VTABLE XPropertySet
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
bool getBOOL(const Any &_rAny)
FontDescriptor getDefaultFont()
bool tryPropertyValue(Any &_rConvertedValue, Any &_rOldValue, const Any &_rValueToSet, const Any &_rCurrentValue, const Type &_rExpectedType)
sal_Int32 getINT32(const Any &_rAny)
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 BACKGROUNDCOLOR
Definition: Grid.cxx:62
const sal_uInt16 TEXTCOLOR
Definition: Grid.cxx:59
const sal_uInt16 FONTATTRIBS
Definition: Grid.cxx:57
const sal_uInt16 RECORDMARKER
Definition: Grid.cxx:61
const sal_uInt16 ROWHEIGHT
Definition: Grid.cxx:54
const sal_uInt16 TABSTOP
Definition: Grid.cxx:58
const css::uno::Sequence< OUString > & getColumnTypes()
Definition: Columns.cxx:62
sal_Int32 getColumnTypeByModelName(const OUString &aModelName)
Definition: Columns.cxx:84
const sal_uInt16 FONTTYPE
Definition: Grid.cxx:55
const sal_uInt16 FONTSIZE
Definition: Grid.cxx:56
const sal_uInt16 FONTDESCRIPTOR
Definition: Grid.cxx:60
int i
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
void dispose()
VCL_DLLPUBLIC float ConvertFontWidth(FontWidth eWidth)
VCL_DLLPUBLIC float ConvertFontWeight(FontWeight eWeight)
#define PROPERTY_ID_FONT_UNDERLINE
Definition: property.hxx:184
#define PROPERTY_ID_FONT_SLANT
Definition: property.hxx:183
#define PROPERTY_ID_NAME
Definition: property.hxx:40
#define PROPERTY_ID_HASNAVIGATION
Definition: property.hxx:90
#define PROPERTY_ID_FONTEMPHASISMARK
Definition: property.hxx:245
#define PROPERTY_ID_FONT_HEIGHT
Definition: property.hxx:181
#define PROPERTY_ID_FONTRELIEF
Definition: property.hxx:246
#define PROPERTY_ID_PRINTABLE
Definition: property.hxx:152
#define PROPERTY_ID_WRITING_MODE
Definition: property.hxx:55
#define PROPERTY_ID_FONT_WEIGHT
Definition: property.hxx:182
#define PROPERTY_ID_ENABLEVISIBLE
Definition: property.hxx:200
#define PROPERTY_ID_BACKGROUNDCOLOR
Definition: property.hxx:93
#define PROPERTY_ID_ALWAYSSHOWCURSOR
Definition: property.hxx:209
#define PROPERTY_ID_FONT_NAME
Definition: property.hxx:177
#define PROPERTY_ID_ENABLED
Definition: property.hxx:144
#define PROPERTY_ID_FONT_STRIKEOUT
Definition: property.hxx:185
#define PROPERTY_ID_FONT_WORDLINEMODE
Definition: property.hxx:243
#define PROPERTY_ID_TAG
Definition: property.hxx:155
#define PROPERTY_ID_HELPTEXT
Definition: property.hxx:176
#define PROPERTY_ID_CURSORCOLOR
Definition: property.hxx:208
#define PROPERTY_ID_BORDERCOLOR
Definition: property.hxx:91
#define PROPERTY_ID_FONT_CHARSET
Definition: property.hxx:180
#define PROPERTY_ID_CLASSID
Definition: property.hxx:45
#define PROPERTY_ID_TABSTOP
Definition: property.hxx:103
#define PROPERTY_ID_TEXTLINECOLOR
Definition: property.hxx:244
#define PROPERTY_ID_TEXTCOLOR
Definition: property.hxx:95
#define PROPERTY_ID_ROWHEIGHT
Definition: property.hxx:92
#define PROPERTY_ID_DEFAULTCONTROL
Definition: property.hxx:78
#define PROPERTY_ID_FONT
Definition: property.hxx:89
#define PROPERTY_ID_CONTEXT_WRITING_MODE
Definition: property.hxx:56
#define PROPERTY_ID_RECORDMARKER
Definition: property.hxx:188
#define PROPERTY_ID_FONT_FAMILY
Definition: property.hxx:179
#define PROPERTY_ID_HELPURL
Definition: property.hxx:187
#define PROPERTY_ID_FONT_STYLENAME
Definition: property.hxx:178
#define PROPERTY_ID_TABINDEX
Definition: property.hxx:41
#define PROPERTY_ID_BORDER
Definition: property.hxx:97
#define PROPERTY_ID_DISPLAYSYNCHRON
Definition: property.hxx:210
sal_Int32 nHandle
constexpr OUStringLiteral FRM_SUN_CONTROL_GRIDCONTROL
Definition: services.hxx:157
constexpr OUStringLiteral FRM_SUN_COMPONENT_GRIDCONTROL
Definition: services.hxx:121
constexpr OUStringLiteral FRM_COMPONENT_GRIDCONTROL
Definition: services.hxx:75
constexpr OUStringLiteral FRM_COMPONENT_GRID
Definition: services.hxx:74
constexpr OUStringLiteral STARDIV_ONE_FORM_CONTROL_GRID
Definition: services.hxx:97
css::uno::Reference< css::uno::XInterface > xInterface
unsigned char sal_Bool