LibreOffice Module extensions (master) 1
eformspropertyhandler.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
21#include "formstrings.hxx"
22#include "formmetadata.hxx"
23#include <propctrlr.h>
24#include "eformshelper.hxx"
25#include "handlerhelper.hxx"
26
27#include <com/sun/star/lang/NullPointerException.hpp>
28#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
29#include <com/sun/star/inspection/PropertyControlType.hpp>
30#include <com/sun/star/inspection/XObjectInspectorUI.hpp>
31#include <tools/debug.hxx>
33#include <sal/log.hxx>
34
35
36namespace pcr
37{
38
39
40 using namespace ::com::sun::star;
41 using namespace ::com::sun::star::uno;
42 using namespace ::com::sun::star::lang;
43 using namespace ::com::sun::star::beans;
44 using namespace ::com::sun::star::xforms;
45 using namespace ::com::sun::star::script;
46 using namespace ::com::sun::star::ui::dialogs;
47 using namespace ::com::sun::star::form::binding;
48 using namespace ::com::sun::star::inspection;
49
50
51 //= EFormsPropertyHandler
52
53
54 EFormsPropertyHandler::EFormsPropertyHandler( const Reference< XComponentContext >& _rxContext )
55 :PropertyHandlerComponent( _rxContext )
56 ,m_bSimulatingModelChange( false )
57 {
58 }
59
60
62 {
63 }
64
65
67 {
68 return "com.sun.star.comp.extensions.EFormsPropertyHandler";
69 }
70
71
73 {
74 return { "com.sun.star.form.inspection.XMLFormsPropertyHandler" };
75 }
76
77
79 {
80 OUString sModelName = m_pHelper->getCurrentFormModelName();
81 if ( sModelName.isEmpty() )
82 sModelName = m_sBindingLessModelName;
83 return sModelName;
84 }
85
86
87 Any SAL_CALL EFormsPropertyHandler::getPropertyValue( const OUString& _rPropertyName )
88 {
89 ::osl::MutexGuard aGuard( m_aMutex );
90 PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) );
91
92 OSL_ENSURE(
94 "EFormsPropertyHandler::getPropertyValue: we don't have any SupportedProperties!");
95 // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties
96
97 Any aReturn;
98 try
99 {
100 switch ( nPropId )
101 {
103 aReturn <<= m_pHelper->getCurrentListSourceBinding();
104 break;
105
107 aReturn <<= getModelNamePropertyValue();
108 break;
109
111 aReturn <<= m_pHelper->getCurrentBindingName();
112 break;
113
120 {
121 Reference< XPropertySet > xBindingProps( m_pHelper->getCurrentBinding() );
122 if ( xBindingProps.is() )
123 {
124 aReturn = xBindingProps->getPropertyValue( _rPropertyName );
125 DBG_ASSERT( aReturn.getValueType().equals( ::cppu::UnoType<OUString>::get() ),
126 "EFormsPropertyHandler::getPropertyValue: invalid BindingExpression value type!" );
127 }
128 else
129 aReturn <<= OUString();
130 }
131 break;
132
133 default:
134 OSL_FAIL( "EFormsPropertyHandler::getPropertyValue: cannot handle this property!" );
135 break;
136 }
137 }
138 catch( const Exception& )
139 {
140 TOOLS_WARN_EXCEPTION( "extensions.propctrlr", "EFormsPropertyHandler::getPropertyValue: caught exception!"
141 "(have been asked for the \"" <<_rPropertyName << "\" property.)");
142 }
143 return aReturn;
144 }
145
146
147 void SAL_CALL EFormsPropertyHandler::setPropertyValue( const OUString& _rPropertyName, const Any& _rValue )
148 {
149 ::osl::MutexGuard aGuard( m_aMutex );
150 PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) );
151
152 OSL_ENSURE(
153 m_pHelper,
154 "EFormsPropertyHandler::setPropertyValue: we don't have any SupportedProperties!");
155 // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties
156
157 try
158 {
159 Any aOldValue = getPropertyValue( _rPropertyName );
160
161 switch ( nPropId )
162 {
164 {
165 Reference< XListEntrySource > xSource;
166 OSL_VERIFY( _rValue >>= xSource );
167 m_pHelper->setListSourceBinding( xSource );
168 }
169 break;
170
172 {
173 OSL_VERIFY( _rValue >>= m_sBindingLessModelName );
174
175 // if the model changed, reset the binding to NULL
176 if ( m_pHelper->getCurrentFormModelName() != m_sBindingLessModelName )
177 {
178 OUString sOldBindingName = m_pHelper->getCurrentBindingName();
179 m_pHelper->setBinding( nullptr );
181 Any( sOldBindingName ), Any( OUString() ) );
182 }
183 }
184 break;
185
187 {
188 OUString sNewBindingName;
189 OSL_VERIFY( _rValue >>= sNewBindingName );
190
191 bool bPreviouslyEmptyModel = !m_pHelper->getCurrentFormModel().is();
192
193 Reference< XPropertySet > xNewBinding;
194 if ( !sNewBindingName.isEmpty() )
195 // obtain the binding with this name, for the current model
196 xNewBinding = m_pHelper->getOrCreateBindingForModel( getModelNamePropertyValue(), sNewBindingName );
197
198 m_pHelper->setBinding( xNewBinding );
199
200 if ( bPreviouslyEmptyModel )
201 { // simulate a property change for the model property
202 // This is because we "simulate" the Model property by remembering the
203 // value ourself. Other instances might, however, not know this value,
204 // but prefer to retrieve it somewhere else - e.g. from the EFormsHelper
205
206 // The really correct solution would be if *all* property handlers
207 // obtain a "current property value" for *all* properties from a central
208 // instance. Then, handler A could ask it for the value of property
209 // X, and this request would be re-routed to handler B, which ultimately
210 // knows the current value.
211 // However, there's no such mechanism in place currently.
214 Any( OUString() ), Any( getModelNamePropertyValue() ) );
216 }
217 }
218 break;
219
221 {
222 Reference< XPropertySet > xBinding( m_pHelper->getCurrentBinding() );
223 OSL_ENSURE( xBinding.is(), "You should not reach this without an active binding!" );
224 if ( xBinding.is() )
225 xBinding->setPropertyValue( PROPERTY_BIND_EXPRESSION, _rValue );
226 }
227 break;
228
234 {
235 Reference< XPropertySet > xBindingProps( m_pHelper->getCurrentBinding() );
236 DBG_ASSERT( xBindingProps.is(), "EFormsPropertyHandler::setPropertyValue: how can I set a property if there's no binding?" );
237 if ( xBindingProps.is() )
238 {
239 DBG_ASSERT( _rValue.getValueType().equals( ::cppu::UnoType<OUString>::get() ),
240 "EFormsPropertyHandler::setPropertyValue: invalid value type!" );
241 xBindingProps->setPropertyValue( _rPropertyName, _rValue );
242 }
243 }
244 break;
245
246 default:
247 OSL_FAIL( "EFormsPropertyHandler::setPropertyValue: cannot handle this property!" );
248 break;
249 }
250
252
253 Any aNewValue( getPropertyValue( _rPropertyName ) );
254 firePropertyChange( _rPropertyName, nPropId, aOldValue, aNewValue );
255 }
256 catch( const Exception& )
257 {
258 TOOLS_WARN_EXCEPTION( "extensions.propctrlr", "EFormsPropertyHandler::setPropertyValue" );
259 }
260 }
261
262
264 {
266
267 Reference< frame::XModel > xDocument( impl_getContextDocument_nothrow() );
268 DBG_ASSERT( xDocument.is(), "EFormsPropertyHandler::onNewComponent: no document!" );
269 if ( EFormsHelper::isEForm( xDocument ) )
270 m_pHelper.reset( new EFormsHelper( m_aMutex, m_xComponent, xDocument ) );
271 else
272 m_pHelper.reset();
273 }
274
275
277 {
278 std::vector< Property > aProperties;
279
280 if (m_pHelper)
281 {
282 if ( m_pHelper->canBindToAnyDataType() )
283 {
284 aProperties.reserve(9);
293 }
294 if ( m_pHelper->isListEntrySink() )
295 {
298 }
299 }
300
301 if ( aProperties.empty() )
302 return Sequence< Property >();
304 }
305
306
307 Any SAL_CALL EFormsPropertyHandler::convertToPropertyValue( const OUString& _rPropertyName, const Any& _rControlValue )
308 {
309 ::osl::MutexGuard aGuard( m_aMutex );
310 Any aReturn;
311
312 OSL_ENSURE(
313 m_pHelper,
314 "EFormsPropertyHandler::convertToPropertyValue: we have no SupportedProperties!");
315 if (!m_pHelper)
316 return aReturn;
317
318 PropertyId nPropId( m_pInfoService->getPropertyId( _rPropertyName ) );
319
320 OUString sControlValue;
321 switch ( nPropId )
322 {
324 {
325 OSL_VERIFY( _rControlValue >>= sControlValue );
326 Reference< XListEntrySource > xListSource( m_pHelper->getModelElementFromUIName( EFormsHelper::Binding, sControlValue ), UNO_QUERY );
327 OSL_ENSURE( xListSource.is() || !m_pHelper->getModelElementFromUIName( EFormsHelper::Binding, sControlValue ).is(),
328 "EFormsPropertyHandler::convertToPropertyValue: there's a binding which is no ListEntrySource!" );
329 aReturn <<= xListSource;
330 }
331 break;
332
333 default:
334 aReturn = PropertyHandlerComponent::convertToPropertyValue( _rPropertyName, _rControlValue );
335 break;
336 }
337
338 return aReturn;
339 }
340
341
342 Any SAL_CALL EFormsPropertyHandler::convertToControlValue( const OUString& _rPropertyName, const Any& _rPropertyValue, const Type& _rControlValueType )
343 {
344 ::osl::MutexGuard aGuard( m_aMutex );
345 Any aReturn;
346
347 OSL_ENSURE(m_pHelper,
348 "EFormsPropertyHandler::convertToControlValue: we have no SupportedProperties!");
349 if (!m_pHelper)
350 return aReturn;
351
352 PropertyId nPropId( m_pInfoService->getPropertyId( _rPropertyName ) );
353
354 OSL_ENSURE( _rControlValueType.getTypeClass() == TypeClass_STRING,
355 "EFormsPropertyHandler::convertToControlValue: all our controls should use strings for value exchange!" );
356
357 switch ( nPropId )
358 {
360 {
361 Reference< XPropertySet > xListSourceBinding( _rPropertyValue, UNO_QUERY );
362 if ( xListSourceBinding.is() )
363 aReturn <<= EFormsHelper::getModelElementUIName( EFormsHelper::Binding, xListSourceBinding );
364 }
365 break;
366
367 default:
368 aReturn = PropertyHandlerComponent::convertToControlValue( _rPropertyName, _rPropertyValue, _rControlValueType );
369 break;
370 }
371
372 return aReturn;
373 }
374
375
376 Sequence< OUString > SAL_CALL EFormsPropertyHandler::getActuatingProperties( )
377 {
378 ::osl::MutexGuard aGuard( m_aMutex );
379 if (!m_pHelper)
380 return Sequence< OUString >();
381
382 std::vector< OUString > aInterestedInActuations( 2 );
383 aInterestedInActuations[ 0 ] = PROPERTY_XML_DATA_MODEL;
384 aInterestedInActuations[ 1 ] = PROPERTY_BINDING_NAME;
385 return comphelper::containerToSequence(aInterestedInActuations);
386 }
387
388
389 Sequence< OUString > SAL_CALL EFormsPropertyHandler::getSupersededProperties( )
390 {
391 ::osl::MutexGuard aGuard( m_aMutex );
392 if (!m_pHelper)
393 return Sequence< OUString >();
394
395 Sequence<OUString> aReturn { PROPERTY_INPUT_REQUIRED };
396 return aReturn;
397 }
398
399 LineDescriptor SAL_CALL EFormsPropertyHandler::describePropertyLine( const OUString& _rPropertyName,
400 const Reference< XPropertyControlFactory >& _rxControlFactory )
401 {
402 ::osl::MutexGuard aGuard( m_aMutex );
403 if ( !_rxControlFactory.is() )
404 throw NullPointerException();
405 if (!m_pHelper)
406 throw RuntimeException();
407
408 LineDescriptor aDescriptor;
409 sal_Int16 nControlType = PropertyControlType::TextField;
410 std::vector< OUString > aListEntries;
411 PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) );
412 switch ( nPropId )
413 {
415 nControlType = PropertyControlType::ListBox;
416 m_pHelper->getAllElementUINames(EFormsHelper::Binding, aListEntries, true);
417 break;
418
420 nControlType = PropertyControlType::ListBox;
421 m_pHelper->getFormModelNames( aListEntries );
422 break;
423
425 {
426 nControlType = PropertyControlType::ComboBox;
427 OUString sCurrentModel( getModelNamePropertyValue() );
428 if ( !sCurrentModel.isEmpty() )
429 m_pHelper->getBindingNames( sCurrentModel, aListEntries );
430 }
431 break;
432
433 case PROPERTY_ID_BIND_EXPRESSION: aDescriptor.PrimaryButtonId = UID_PROP_DLG_BIND_EXPRESSION; break;
434 case PROPERTY_ID_XSD_REQUIRED: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_REQUIRED; break;
435 case PROPERTY_ID_XSD_RELEVANT: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_RELEVANT; break;
436 case PROPERTY_ID_XSD_READONLY: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_READONLY; break;
437 case PROPERTY_ID_XSD_CONSTRAINT: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_CONSTRAINT; break;
438 case PROPERTY_ID_XSD_CALCULATION: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_CALCULATION; break;
439
440 default:
441 OSL_FAIL( "EFormsPropertyHandler::describePropertyLine: cannot handle this property!" );
442 break;
443 }
444
445 switch ( nControlType )
446 {
447 case PropertyControlType::ListBox:
448 aDescriptor.Control = PropertyHandlerHelper::createListBoxControl( _rxControlFactory, std::move(aListEntries), false, true );
449 break;
450 case PropertyControlType::ComboBox:
451 aDescriptor.Control = PropertyHandlerHelper::createComboBoxControl( _rxControlFactory, std::move(aListEntries), true );
452 break;
453 default:
454 aDescriptor.Control = _rxControlFactory->createPropertyControl( nControlType, false );
455 break;
456 }
457
458 aDescriptor.DisplayName = m_pInfoService->getPropertyTranslation( nPropId );
459 aDescriptor.Category = "Data";
460 aDescriptor.HelpURL = HelpIdUrl::getHelpURL( m_pInfoService->getPropertyHelpId( nPropId ) );
461 return aDescriptor;
462 }
463
464 InteractiveSelectionResult SAL_CALL EFormsPropertyHandler::onInteractivePropertySelection( const OUString& _rPropertyName, sal_Bool /*_bPrimary*/, Any& _rData, const Reference< XObjectInspectorUI >& _rxInspectorUI )
465 {
466 if ( !_rxInspectorUI.is() )
467 throw NullPointerException();
468
469 ::osl::MutexGuard aGuard( m_aMutex );
470 OSL_ENSURE(m_pHelper, "EFormsPropertyHandler::onInteractivePropertySelection: we do not "
471 "have any SupportedProperties!");
472 if (!m_pHelper)
473 return InteractiveSelectionResult_Cancelled;
474
475 PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) );
476 OSL_ENSURE( ( PROPERTY_ID_BINDING_NAME == nPropId )
477 || ( PROPERTY_ID_BIND_EXPRESSION == nPropId )
478 || ( PROPERTY_ID_XSD_REQUIRED == nPropId )
479 || ( PROPERTY_ID_XSD_RELEVANT == nPropId )
480 || ( PROPERTY_ID_XSD_READONLY == nPropId )
481 || ( PROPERTY_ID_XSD_CONSTRAINT == nPropId )
482 || ( PROPERTY_ID_XSD_CALCULATION == nPropId ), "EFormsPropertyHandler::onInteractivePropertySelection: unexpected!" );
483
484 try
485 {
486 Reference< XExecutableDialog > xDialog;
487 xDialog.set( m_xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.xforms.ui.dialogs.AddCondition", m_xContext ), UNO_QUERY );
488 Reference< XPropertySet > xDialogProps( xDialog, UNO_QUERY_THROW );
489
490 // the model for the dialog to work with
491 Reference< xforms::XModel > xModel( m_pHelper->getCurrentFormModel() );
492 // the binding for the dialog to work with
493 Reference< XPropertySet > xBinding( m_pHelper->getCurrentBinding() );
494 // the aspect of the binding which the dialog should modify
495 const OUString& sFacetName( _rPropertyName );
496
497 OSL_ENSURE( xModel.is() && xBinding.is() && !sFacetName.isEmpty(),
498 "EFormsPropertyHandler::onInteractivePropertySelection: something is missing for the dialog initialization!" );
499 if ( !xModel.is() || !xBinding.is() || sFacetName.isEmpty() )
500 return InteractiveSelectionResult_Cancelled;
501
502 xDialogProps->setPropertyValue("FormModel", Any( xModel ) );
503 xDialogProps->setPropertyValue("Binding", Any( xBinding ) );
504 xDialogProps->setPropertyValue("FacetName", Any( sFacetName ) );
505
506 if ( !xDialog->execute() )
507 // cancelled
508 return InteractiveSelectionResult_Cancelled;
509
510 _rData = xDialogProps->getPropertyValue("ConditionValue");
511 return InteractiveSelectionResult_ObtainedValue;
512 }
513 catch( const Exception& )
514 {
515 TOOLS_WARN_EXCEPTION( "extensions.propctrlr", "EFormsPropertyHandler::onInteractivePropertySelection" );
516 }
517
518 // something went wrong here ...(but has been asserted already)
519 return InteractiveSelectionResult_Cancelled;
520 }
521
522
523 void SAL_CALL EFormsPropertyHandler::addPropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener )
524 {
525 ::osl::MutexGuard aGuard( m_aMutex );
527 if (m_pHelper)
528 m_pHelper->registerBindingListener( _rxListener );
529 }
530
531
532 void SAL_CALL EFormsPropertyHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener )
533 {
534 ::osl::MutexGuard aGuard( m_aMutex );
535 if (m_pHelper)
536 m_pHelper->revokeBindingListener( _rxListener );
538 }
539
540
541 void SAL_CALL EFormsPropertyHandler::actuatingPropertyChanged( const OUString& _rActuatingPropertyName, const Any& _rNewValue, const Any& /*_rOldValue*/, const Reference< XObjectInspectorUI >& _rxInspectorUI, sal_Bool )
542 {
543 if ( !_rxInspectorUI.is() )
544 throw NullPointerException();
545
546 ::osl::MutexGuard aGuard( m_aMutex );
547 PropertyId nActuatingPropId( impl_getPropertyId_throwRuntime( _rActuatingPropertyName ) );
548 OSL_PRECOND(m_pHelper, "EFormsPropertyHandler::actuatingPropertyChanged: inconsistency!");
549 // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties
550
551 DBG_ASSERT( _rxInspectorUI.is(), "EFormsPropertyHandler::actuatingPropertyChanged: invalid callback!" );
552 if ( !_rxInspectorUI.is() )
553 return;
554
555 switch ( nActuatingPropId )
556 {
558 {
560 break;
561 OUString sDataModelName;
562 OSL_VERIFY( _rNewValue >>= sDataModelName );
563 bool bBoundToSomeModel = !sDataModelName.isEmpty();
564 _rxInspectorUI->rebuildPropertyUI( PROPERTY_BINDING_NAME );
565 _rxInspectorUI->enablePropertyUI( PROPERTY_BINDING_NAME, bBoundToSomeModel );
566 [[fallthrough]];
567 }
568
570 {
571 bool bHaveABinding = !m_pHelper->getCurrentBindingName().isEmpty();
572 _rxInspectorUI->enablePropertyUI( PROPERTY_BIND_EXPRESSION, bHaveABinding );
573 _rxInspectorUI->enablePropertyUI( PROPERTY_XSD_REQUIRED, bHaveABinding );
574 _rxInspectorUI->enablePropertyUI( PROPERTY_XSD_RELEVANT, bHaveABinding );
575 _rxInspectorUI->enablePropertyUI( PROPERTY_XSD_READONLY, bHaveABinding );
576 _rxInspectorUI->enablePropertyUI( PROPERTY_XSD_CONSTRAINT, bHaveABinding );
577 _rxInspectorUI->enablePropertyUI( PROPERTY_XSD_CALCULATION, bHaveABinding );
578 _rxInspectorUI->enablePropertyUI( PROPERTY_XSD_DATA_TYPE, bHaveABinding );
579 }
580 break;
581
582 default:
583 OSL_FAIL( "EFormsPropertyHandler::actuatingPropertyChanged: cannot handle this property!" );
584 break;
585 }
586 }
587
588
589} // namespace pcr
590
591extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
593 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
594{
595 return cppu::acquire(new pcr::EFormsPropertyHandler(context));
596}
597
598/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
mutable::osl::Mutex m_aMutex
static OUString getModelElementUIName(const ModelElementType _eType, const css::uno::Reference< css::beans::XPropertySet > &_rxElement)
retrieves the name of a model's sub-element, as to be shown in the UI
static bool isEForm(const css::uno::Reference< css::frame::XModel > &_rxContextDocument)
determines whether the given document is an eForm
OUString m_sBindingLessModelName
current value of the Model property, if there is no binding, yet
std::unique_ptr< EFormsHelper > m_pHelper
virtual css::uno::Sequence< css::beans::Property > doDescribeSupportedProperties() const override
virtual void onNewComponent() override
called when XPropertyHandler::inspect has been called, and we thus have a new component to inspect
virtual css::inspection::LineDescriptor SAL_CALL describePropertyLine(const OUString &_rPropertyName, const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory) override
virtual css::uno::Sequence< OUString > SAL_CALL getActuatingProperties() override
virtual OUString SAL_CALL getImplementationName() override
bool m_bSimulatingModelChange
are we currently simulating a propertyChange event of the Model property?
virtual css::uno::Any SAL_CALL convertToPropertyValue(const OUString &_rPropertyName, const css::uno::Any &_rControlValue) override
virtual css::inspection::InteractiveSelectionResult SAL_CALL onInteractivePropertySelection(const OUString &_rPropertyName, sal_Bool _bPrimary, css::uno::Any &_rData, const css::uno::Reference< css::inspection::XObjectInspectorUI > &_rxInspectorUI) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &_rPropertyName) override
virtual ~EFormsPropertyHandler() override
EFormsPropertyHandler(const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Any SAL_CALL convertToControlValue(const OUString &_rPropertyName, const css::uno::Any &_rPropertyValue, const css::uno::Type &_rControlValueType) override
virtual void SAL_CALL removePropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
OUString getModelNamePropertyValue() const
returns the value of the PROPERTY_XML_DATA_MODEL property.
virtual void SAL_CALL actuatingPropertyChanged(const OUString &_rActuatingPropertyName, const css::uno::Any &_rNewValue, const css::uno::Any &_rOldValue, const css::uno::Reference< css::inspection::XObjectInspectorUI > &_rxInspectorUI, sal_Bool) override
virtual void SAL_CALL addPropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
virtual void SAL_CALL setPropertyValue(const OUString &_rPropertyName, const css::uno::Any &_rValue) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupersededProperties() override
static OUString getHelpURL(std::u16string_view)
Definition: pcrcommon.cxx:47
PropertyHandler implementation which additionally supports XServiceInfo.
static css::uno::Reference< css::inspection::XPropertyControl > createComboBoxControl(const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory, std::vector< OUString > &&_rInitialListEntries, bool _bSorted)
creates an <member scope="css::inspection">PropertyControlType::ComboBox</member>-type control and fi...
static css::uno::Reference< css::inspection::XPropertyControl > createListBoxControl(const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory, std::vector< OUString > &&_rInitialListEntries, bool _bReadOnlyControl, bool _bSorted)
creates an <member scope="css::inspection">PropertyControlType::ListBox</member>-type control and fil...
std::unique_ptr< OPropertyInfoService > m_pInfoService
access to property meta data
css::uno::Reference< css::uno::XComponentContext > m_xContext
the context in which the instance was created
virtual void onNewComponent()
called when XPropertyHandler::inspect has been called, and we thus have a new component to inspect
virtual void SAL_CALL addPropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
virtual css::uno::Any SAL_CALL convertToPropertyValue(const OUString &_rPropertyName, const css::uno::Any &_rControlValue) override
void addStringPropertyDescription(std::vector< css::beans::Property > &_rProperties, const OUString &_rPropertyName) const
adds a description for the given string property to the given property vector Most probably to be cal...
void firePropertyChange(const OUString &_rPropName, PropertyId _nPropId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
fires the change in a property value to our listener (if any)
virtual css::uno::Any SAL_CALL convertToControlValue(const OUString &_rPropertyName, const css::uno::Any &_rPropertyValue, const css::uno::Type &_rControlValueType) override
PropertyId impl_getPropertyId_throwUnknownProperty(const OUString &_rPropertyName) const
retrieves the property id for a given property name
virtual void SAL_CALL removePropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
css::uno::Reference< css::beans::XPropertySet > m_xComponent
the component we're inspecting
PropertyId impl_getPropertyId_throwRuntime(const OUString &_rPropertyName) const
retrieves the property id for a given property name
void impl_setContextDocumentModified_nothrow() const
marks the context document as modified
css::uno::Reference< css::frame::XModel > impl_getContextDocument_nothrow() const
returns the value of the ContextDocument property in the ComponentContext which was used to create th...
void implAddPropertyDescription(std::vector< css::beans::Property > &_rProperties, const OUString &_rPropertyName, const css::uno::Type &_rType, sal_Int16 _nAttribs=0) const
adds a Property, given by name only, to a given vector of Properties
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * extensions_propctrlr_EFormsPropertyHandler_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
#define PROPERTY_ID_BINDING_NAME
#define PROPERTY_ID_XSD_RELEVANT
#define PROPERTY_ID_XSD_CALCULATION
#define PROPERTY_ID_XSD_CONSTRAINT
#define PROPERTY_ID_LIST_BINDING
#define PROPERTY_ID_XSD_READONLY
#define PROPERTY_ID_BIND_EXPRESSION
#define PROPERTY_ID_XSD_REQUIRED
#define PROPERTY_ID_XML_DATA_MODEL
constexpr OUStringLiteral PROPERTY_XSD_CALCULATION
constexpr OUStringLiteral PROPERTY_BINDING_NAME
constexpr OUStringLiteral PROPERTY_XSD_CONSTRAINT
constexpr OUStringLiteral PROPERTY_XSD_READONLY
constexpr OUStringLiteral PROPERTY_XSD_RELEVANT
constexpr OUStringLiteral PROPERTY_XML_DATA_MODEL
constexpr OUStringLiteral PROPERTY_XSD_DATA_TYPE
constexpr OUStringLiteral PROPERTY_BIND_EXPRESSION
constexpr OUStringLiteral PROPERTY_INPUT_REQUIRED
Definition: formstrings.hxx:43
constexpr OUStringLiteral PROPERTY_XSD_REQUIRED
constexpr OUStringLiteral PROPERTY_LIST_BINDING
@ Exception
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Type
a property handler for any virtual string properties
Definition: browserline.cxx:39
sal_Int32 PropertyId
constexpr OUStringLiteral UID_PROP_DLG_XSD_RELEVANT
Definition: propctrlr.h:42
constexpr OUStringLiteral UID_PROP_DLG_XSD_READONLY
Definition: propctrlr.h:43
constexpr OUStringLiteral UID_PROP_DLG_XSD_CALCULATION
Definition: propctrlr.h:45
constexpr OUStringLiteral UID_PROP_DLG_BIND_EXPRESSION
Definition: propctrlr.h:40
constexpr OUStringLiteral UID_PROP_DLG_XSD_REQUIRED
Definition: propctrlr.h:41
constexpr OUStringLiteral UID_PROP_DLG_XSD_CONSTRAINT
Definition: propctrlr.h:44
Reference< XModel > xModel
unsigned char sal_Bool