LibreOffice Module extensions (master) 1
xsdvalidationpropertyhandler.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 <sal/config.h>
21
23#include "formstrings.hxx"
24#include "formmetadata.hxx"
25#include "xsddatatypes.hxx"
26#include "modulepcr.hxx"
27#include <strings.hrc>
28#include <propctrlr.h>
29#include "newdatatype.hxx"
31#include "pcrcommon.hxx"
32#include "handlerhelper.hxx"
33
34#include <com/sun/star/beans/PropertyAttribute.hpp>
35#include <com/sun/star/lang/NullPointerException.hpp>
36#include <com/sun/star/xsd/WhiteSpaceTreatment.hpp>
37#include <com/sun/star/xsd/DataTypeClass.hpp>
38#include <com/sun/star/inspection/PropertyControlType.hpp>
39#include <com/sun/star/beans/Optional.hpp>
40#include <com/sun/star/inspection/XObjectInspectorUI.hpp>
41#include <com/sun/star/inspection/PropertyLineElement.hpp>
42#include <vcl/svapp.hxx>
43#include <vcl/weld.hxx>
44#include <tools/debug.hxx>
45#include <sal/macros.h>
46
47#include <algorithm>
48#include <limits>
49
50
51namespace pcr
52{
53
54
55 using namespace ::com::sun::star;
56 using namespace ::com::sun::star::uno;
57 using namespace ::com::sun::star::lang;
58 using namespace ::com::sun::star::beans;
59 using namespace ::com::sun::star::xforms;
60 using namespace ::com::sun::star::xsd;
61 using namespace ::com::sun::star::script;
62 using namespace ::com::sun::star::inspection;
63
64 using ::com::sun::star::beans::PropertyAttribute::MAYBEVOID;
65
66
67 //= XSDValidationPropertyHandler
68
69 XSDValidationPropertyHandler::XSDValidationPropertyHandler( const Reference< XComponentContext >& _rxContext )
70 :PropertyHandlerComponent( _rxContext )
71 {
72 }
73
74
76 {
77 }
78
79
81 {
82 return "com.sun.star.comp.extensions.XSDValidationPropertyHandler";
83 }
84
85
87 {
88 return{ "com.sun.star.form.inspection.XSDValidationPropertyHandler" };
89 }
90
91
92 Any SAL_CALL XSDValidationPropertyHandler::getPropertyValue( const OUString& _rPropertyName )
93 {
94 ::osl::MutexGuard aGuard( m_aMutex );
95 PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) );
96
97 OSL_ENSURE(m_pHelper, "XSDValidationPropertyHandler::getPropertyValue: inconsistency!");
98 // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties
99
100 Any aReturn;
101 ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType();
102 switch ( nPropId )
103 {
104 // common facets
105 case PROPERTY_ID_XSD_DATA_TYPE: aReturn = pType.is() ? pType->getFacet( PROPERTY_NAME ) : Any( OUString() ); break;
106 case PROPERTY_ID_XSD_WHITESPACES:aReturn = pType.is() ? pType->getFacet( PROPERTY_XSD_WHITESPACES ) : Any( WhiteSpaceTreatment::Preserve ); break;
107 case PROPERTY_ID_XSD_PATTERN: aReturn = pType.is() ? pType->getFacet( PROPERTY_XSD_PATTERN ) : Any( OUString() ); break;
108
109 // all other properties are simply forwarded, if they exist at the given type
110 default:
111 {
112 if ( pType.is() && pType->hasFacet( _rPropertyName ) )
113 aReturn = pType->getFacet( _rPropertyName );
114 }
115 break;
116 }
117
118 return aReturn;
119 }
120
121
122 void SAL_CALL XSDValidationPropertyHandler::setPropertyValue( const OUString& _rPropertyName, const Any& _rValue )
123 {
124 ::osl::MutexGuard aGuard( m_aMutex );
125 PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) );
126
127 OSL_ENSURE(m_pHelper, "XSDValidationPropertyHandler::getPropertyValue: inconsistency!");
128 // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties
129
130 if ( PROPERTY_ID_XSD_DATA_TYPE == nPropId )
131 {
132 OUString sTypeName;
133 OSL_VERIFY( _rValue >>= sTypeName );
134 m_pHelper->setValidatingDataTypeByName( sTypeName );
136 return;
137 }
138
139 ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType();
140 if ( !pType.is() )
141 {
142 OSL_FAIL( "XSDValidationPropertyHandler::setPropertyValue: you're trying to set a type facet, without a current type!" );
143 return;
144 }
145
146 pType->setFacet( _rPropertyName, _rValue );
148 }
149
150
152 {
154
155 Reference< frame::XModel > xDocument( impl_getContextDocument_nothrow() );
156 DBG_ASSERT( xDocument.is(), "XSDValidationPropertyHandler::onNewComponent: no document!" );
157 if ( EFormsHelper::isEForm( xDocument ) )
158 m_pHelper.reset( new XSDValidationHelper( m_aMutex, m_xComponent, xDocument ) );
159 else
160 m_pHelper.reset();
161 }
162
163
165 {
166 std::vector< Property > aProperties;
167
168 if (m_pHelper)
169 {
170 bool bAllowBinding = m_pHelper->canBindToAnyDataType();
171
172 if ( bAllowBinding )
173 {
174 aProperties.reserve( 28 );
175
179
180 // string facets
184
185 // decimal facets
188
189 // facets for different types
210 }
211 }
212
214 }
215
216
218 {
219 ::osl::MutexGuard aGuard( m_aMutex );
220
221 std::vector< OUString > aSuperfluous;
222 if (m_pHelper)
223 {
224 aSuperfluous.push_back( OUString(PROPERTY_CONTROLSOURCE) );
225 aSuperfluous.push_back( OUString(PROPERTY_EMPTY_IS_NULL) );
226 aSuperfluous.push_back( OUString(PROPERTY_FILTERPROPOSAL) );
227 aSuperfluous.push_back( OUString(PROPERTY_LISTSOURCETYPE) );
228 aSuperfluous.push_back( OUString(PROPERTY_LISTSOURCE) );
229 aSuperfluous.push_back( OUString(PROPERTY_BOUNDCOLUMN) );
230
231 bool bAllowBinding = m_pHelper->canBindToAnyDataType();
232
233 if ( bAllowBinding )
234 {
235 aSuperfluous.push_back( OUString(PROPERTY_MAXTEXTLEN) );
236 aSuperfluous.push_back( OUString(PROPERTY_VALUEMIN) );
237 aSuperfluous.push_back( OUString(PROPERTY_VALUEMAX) );
238 aSuperfluous.push_back( OUString(PROPERTY_DECIMAL_ACCURACY) );
239 aSuperfluous.push_back( OUString(PROPERTY_TIMEMIN) );
240 aSuperfluous.push_back( OUString(PROPERTY_TIMEMAX) );
241 aSuperfluous.push_back( OUString(PROPERTY_DATEMIN) );
242 aSuperfluous.push_back( OUString(PROPERTY_DATEMAX) );
243 aSuperfluous.push_back( OUString(PROPERTY_EFFECTIVE_MIN) );
244 aSuperfluous.push_back( OUString(PROPERTY_EFFECTIVE_MAX) );
245 }
246 }
247
248 return comphelper::containerToSequence( aSuperfluous );
249 }
250
251
253 {
254 ::osl::MutexGuard aGuard( m_aMutex );
255 std::vector< OUString > aInterestedInActuations;
256 if (m_pHelper)
257 {
258 aInterestedInActuations.push_back( OUString(PROPERTY_XSD_DATA_TYPE) );
259 aInterestedInActuations.push_back( OUString(PROPERTY_XML_DATA_MODEL) );
260 }
261 return comphelper::containerToSequence( aInterestedInActuations );
262 }
263
264
265 namespace
266 {
267 void showPropertyUI( const Reference< XObjectInspectorUI >& _rxInspectorUI, const OUString& _rPropertyName, bool _bShow )
268 {
269 if ( _bShow )
270 _rxInspectorUI->showPropertyUI( _rPropertyName );
271 else
272 _rxInspectorUI->hidePropertyUI( _rPropertyName );
273 }
274 }
275
276
277 LineDescriptor SAL_CALL XSDValidationPropertyHandler::describePropertyLine( const OUString& _rPropertyName,
278 const Reference< XPropertyControlFactory >& _rxControlFactory )
279 {
280 ::osl::MutexGuard aGuard( m_aMutex );
281 if ( !_rxControlFactory.is() )
282 throw NullPointerException();
283 if (!m_pHelper)
284 throw RuntimeException();
285
286 PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) );
287
288 LineDescriptor aDescriptor;
289 if ( nPropId != PROPERTY_ID_XSD_DATA_TYPE )
290 aDescriptor.IndentLevel = 1;
291
292 // collect some information about the to-be-created control
293 sal_Int16 nControlType = PropertyControlType::TextField;
294 std::vector< OUString > aListEntries;
295 Optional< double > aMinValue( false, 0 );
296 Optional< double > aMaxValue( false, 0 );
297
298 switch ( nPropId )
299 {
301 nControlType = PropertyControlType::ListBox;
302
303 implGetAvailableDataTypeNames( aListEntries );
304
305 aDescriptor.PrimaryButtonId = UID_PROP_ADD_DATA_TYPE;
306 aDescriptor.SecondaryButtonId = UID_PROP_REMOVE_DATA_TYPE;
307 aDescriptor.HasPrimaryButton = aDescriptor.HasSecondaryButton = true;
308 aDescriptor.PrimaryButtonImageURL = "private:graphicrepository/extensions/res/buttonplus.png";
309 aDescriptor.SecondaryButtonImageURL = "private:graphicrepository/extensions/res/buttonminus.png";
310 break;
311
313 {
314 nControlType = PropertyControlType::ListBox;
315 aListEntries = m_pInfoService->getPropertyEnumRepresentations( PROPERTY_ID_XSD_WHITESPACES );
316 }
317 break;
318
320 nControlType = PropertyControlType::TextField;
321 break;
322
326 nControlType = PropertyControlType::NumericField;
327 break;
328
331 nControlType = PropertyControlType::NumericField;
332 break;
333
338 {
339 nControlType = PropertyControlType::NumericField;
340
341 // handle limits for various 'INT' types according to
342 // their actual semantics (year, month, day)
343
344 ::rtl::Reference< XSDDataType > xDataType( m_pHelper->getValidatingDataType() );
345 sal_Int16 nTypeClass = xDataType.is() ? xDataType->classify() : DataTypeClass::STRING;
346
347 aMinValue.IsPresent = aMaxValue.IsPresent = true;
348 aMinValue.Value = DataTypeClass::gYear == nTypeClass ? 0 : 1;
349 aMaxValue.Value = std::numeric_limits< sal_Int32 >::max();
350 if ( DataTypeClass::gMonth == nTypeClass )
351 aMaxValue.Value = 12;
352 else if ( DataTypeClass::gDay == nTypeClass )
353 aMaxValue.Value = 31;
354 }
355 break;
356
361 nControlType = PropertyControlType::NumericField;
362 // TODO/eForms: do we have "auto-digits"?
363 break;
364
369 nControlType = PropertyControlType::DateField;
370 break;
371
376 nControlType = PropertyControlType::TimeField;
377 break;
378
383 nControlType = PropertyControlType::DateTimeField;
384 break;
385
386 default:
387 OSL_FAIL( "XSDValidationPropertyHandler::describePropertyLine: cannot handle this property!" );
388 break;
389 }
390
391 switch ( nControlType )
392 {
393 case PropertyControlType::ListBox:
394 aDescriptor.Control = PropertyHandlerHelper::createListBoxControl( _rxControlFactory, std::move(aListEntries), false, false );
395 break;
396 case PropertyControlType::NumericField:
397 aDescriptor.Control = PropertyHandlerHelper::createNumericControl( _rxControlFactory, 0, aMinValue, aMaxValue );
398 break;
399 default:
400 aDescriptor.Control = _rxControlFactory->createPropertyControl( nControlType, false );
401 break;
402 }
403
404 aDescriptor.Category = "Data";
405 aDescriptor.DisplayName = m_pInfoService->getPropertyTranslation( nPropId );
406 aDescriptor.HelpURL = HelpIdUrl::getHelpURL( m_pInfoService->getPropertyHelpId( nPropId ) );
407
408 return aDescriptor;
409 }
410
411
412 InteractiveSelectionResult SAL_CALL XSDValidationPropertyHandler::onInteractivePropertySelection( const OUString& _rPropertyName, sal_Bool _bPrimary, Any& /*_rData*/, const Reference< XObjectInspectorUI >& _rxInspectorUI )
413 {
414 if ( !_rxInspectorUI.is() )
415 throw NullPointerException();
416
417 ::osl::MutexGuard aGuard( m_aMutex );
418 OSL_ENSURE(m_pHelper, "XSDValidationPropertyHandler::onInteractivePropertySelection: we "
419 "don't have any SupportedProperties!");
420 if (!m_pHelper)
421 return InteractiveSelectionResult_Cancelled;
422
423 PropertyId nPropId( impl_getPropertyId_throwUnknownProperty( _rPropertyName ) );
424
425 switch ( nPropId )
426 {
428 {
429 if ( _bPrimary )
430 {
431 OUString sNewDataTypeName;
432 if ( implPrepareCloneDataCurrentType( sNewDataTypeName ) )
433 {
434 implDoCloneCurrentDataType( sNewDataTypeName );
435 return InteractiveSelectionResult_Success;
436 }
437 }
438 else
439 return implPrepareRemoveCurrentDataType() && implDoRemoveCurrentDataType() ? InteractiveSelectionResult_Success : InteractiveSelectionResult_Cancelled;
440 }
441 break;
442
443 default:
444 OSL_FAIL( "XSDValidationPropertyHandler::onInteractivePropertySelection: unexpected property to build a dedicated UI!" );
445 break;
446 }
447 return InteractiveSelectionResult_Cancelled;
448 }
449
450
451 void SAL_CALL XSDValidationPropertyHandler::addPropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener )
452 {
453 ::osl::MutexGuard aGuard( m_aMutex );
455 if (m_pHelper)
456 m_pHelper->registerBindingListener( _rxListener );
457 }
458
459
460 void SAL_CALL XSDValidationPropertyHandler::removePropertyChangeListener( const Reference< XPropertyChangeListener >& _rxListener )
461 {
462 ::osl::MutexGuard aGuard( m_aMutex );
463 if (m_pHelper)
464 m_pHelper->revokeBindingListener( _rxListener );
466 }
467
468
470 {
471 OSL_PRECOND(
472 m_pHelper,
473 "XSDValidationPropertyHandler::implPrepareCloneDataCurrentType: this will crash!");
474
475 ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType();
476 if ( !pType.is() )
477 {
478 OSL_FAIL( "XSDValidationPropertyHandler::implPrepareCloneDataCurrentType: invalid current data type!" );
479 return false;
480 }
481
482 std::vector< OUString > aExistentNames;
483 m_pHelper->getAvailableDataTypeNames( aExistentNames );
484
485 NewDataTypeDialog aDialog( nullptr, pType->getName(), aExistentNames ); // TODO/eForms: proper parent
486 if (aDialog.run() != RET_OK)
487 return false;
488
489 _rNewName = aDialog.GetName();
490 return true;
491 }
492
493
495 {
496 OSL_PRECOND(m_pHelper,
497 "XSDValidationPropertyHandler::implDoCloneCurrentDataType: this will crash!");
498
499 ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType();
500 if ( !pType.is() )
501 return;
502
503 if ( !m_pHelper->cloneDataType( pType, _rNewName ) )
504 return;
505
506 m_pHelper->setValidatingDataTypeByName( _rNewName );
507 }
508
510 {
511 OSL_PRECOND(
512 m_pHelper,
513 "XSDValidationPropertyHandler::implPrepareRemoveCurrentDataType: this will crash!");
514
515 ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType();
516 if ( !pType.is() )
517 {
518 OSL_FAIL( "XSDValidationPropertyHandler::implPrepareRemoveCurrentDataType: invalid current data type!" );
519 return false;
520 }
521
522 // confirmation message
523 OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ) );
524 sConfirmation = sConfirmation.replaceFirst( "#type#", pType->getName() );
525
526 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr, // TODO/eForms: proper parent
527 VclMessageType::Question, VclButtonsType::YesNo,
528 sConfirmation));
529 return xQueryBox->run() == RET_YES;
530 }
531
533 {
534 OSL_PRECOND(m_pHelper,
535 "XSDValidationPropertyHandler::implDoRemoveCurrentDataType: this will crash!");
536
537 ::rtl::Reference< XSDDataType > pType = m_pHelper->getValidatingDataType();
538 if ( !pType.is() )
539 return false;
540
541 // set a new data type at the binding, which is the "basic" type for the one
542 // we are going to delete
543 // (do this before the actual deletion, so the old type is still valid for property change
544 // notifications)
545 m_pHelper->setValidatingDataTypeByName( m_pHelper->getBasicTypeNameForClass( pType->classify() ) );
546 // now remove the type
547 m_pHelper->removeDataTypeFromRepository( pType->getName() );
548
549 return true;
550 }
551
552
553 void SAL_CALL XSDValidationPropertyHandler::actuatingPropertyChanged( const OUString& _rActuatingPropertyName, const Any& _rNewValue, const Any& _rOldValue, const Reference< XObjectInspectorUI >& _rxInspectorUI, sal_Bool _bFirstTimeInit )
554 {
555 if ( !_rxInspectorUI.is() )
556 throw NullPointerException();
557
558 ::osl::MutexGuard aGuard( m_aMutex );
559 PropertyId nActuatingPropId( impl_getPropertyId_throwRuntime( _rActuatingPropertyName ) );
560 if (!m_pHelper)
561 throw RuntimeException();
562 // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties
563
564 switch ( nActuatingPropId )
565 {
567 {
568 ::rtl::Reference< XSDDataType > xDataType( m_pHelper->getValidatingDataType() );
569
570 // is removal of this type possible?
571 bool bIsBasicType = xDataType.is() && xDataType->isBasicType();
572 _rxInspectorUI->enablePropertyUIElements( PROPERTY_XSD_DATA_TYPE, PropertyLineElement::PrimaryButton, xDataType.is() );
573 _rxInspectorUI->enablePropertyUIElements( PROPERTY_XSD_DATA_TYPE, PropertyLineElement::SecondaryButton, xDataType.is() && !bIsBasicType );
574
575
576 // show the facets which are available at the data type
577 OUString aFacets[] = {
601 };
602
603 size_t i=0;
604 const OUString* pLoop = nullptr;
605 for ( i = 0, pLoop = aFacets;
606 i < SAL_N_ELEMENTS( aFacets );
607 ++i, ++pLoop
608 )
609 {
610 showPropertyUI( _rxInspectorUI, *pLoop, xDataType.is() && xDataType->hasFacet( *pLoop ) );
611 _rxInspectorUI->enablePropertyUI( *pLoop, !bIsBasicType );
612 }
613 }
614 break;
615
617 {
618 // The data type which the current binding works with may not be present in the
619 // new model. Thus, transfer it.
620 OUString sOldModelName; _rOldValue >>= sOldModelName;
621 OUString sNewModelName; _rNewValue >>= sNewModelName;
622 OUString sDataType = m_pHelper->getValidatingDataTypeName();
623 m_pHelper->copyDataType( sOldModelName, sNewModelName, sDataType );
624
625 // the list of available data types depends on the chosen model, so update this
626 if ( !_bFirstTimeInit )
627 _rxInspectorUI->rebuildPropertyUI( PROPERTY_XSD_DATA_TYPE );
628 }
629 break;
630
631 default:
632 OSL_FAIL( "XSDValidationPropertyHandler::actuatingPropertyChanged: cannot handle this property!" );
633 return;
634 }
635
636 // in both cases, we need to care for the current value of the XSD_DATA_TYPE property,
637 // and update the FormatKey of the formatted field we're inspecting (if any)
638 if ( !_bFirstTimeInit && m_pHelper->isInspectingFormattedField() )
639 m_pHelper->findDefaultFormatForIntrospectee();
640 }
641
642
643 void XSDValidationPropertyHandler::implGetAvailableDataTypeNames( std::vector< OUString >& /* [out] */ _rNames ) const
644 {
645 OSL_PRECOND(
646 m_pHelper,
647 "XSDValidationPropertyHandler::implGetAvailableDataTypeNames: this will crash!");
648 // start with *all* types which are available at the model
649 std::vector< OUString > aAllTypes;
650 m_pHelper->getAvailableDataTypeNames( aAllTypes );
651 _rNames.clear();
652 _rNames.reserve( aAllTypes.size() );
653
654 // then allow only those which are "compatible" with our control
655 for (auto const& dataType : aAllTypes)
656 {
657 ::rtl::Reference< XSDDataType > pType = m_pHelper->getDataTypeByName(dataType);
658 if ( pType.is() && m_pHelper->canBindToDataType( pType->classify() ) )
659 _rNames.push_back(dataType);
660 }
661 }
662
663
664} // namespace pcr
665
666extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
668 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
669{
670 return cppu::acquire(new pcr::XSDValidationPropertyHandler(context));
671}
672
673/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
mutable::osl::Mutex m_aMutex
static bool isEForm(const css::uno::Reference< css::frame::XModel > &_rxContextDocument)
determines whether the given document is an eForm
static OUString getHelpURL(std::u16string_view)
Definition: pcrcommon.cxx:47
OUString GetName() const
Definition: newdatatype.hxx:43
PropertyHandler implementation which additionally supports XServiceInfo.
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...
static css::uno::Reference< css::inspection::XPropertyControl > createNumericControl(const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory, sal_Int16 _nDigits, const css::beans::Optional< double > &_rMinValue, const css::beans::Optional< double > &_rMaxValue)
creates an <member scope="css::inspection">PropertyControlType::NumericField</member>-type control an...
void addInt16PropertyDescription(std::vector< css::beans::Property > &_rProperties, const OUString &_rPropertyName, sal_Int16 _nAttribs=0) const
adds a description for the given int16 property to the given property vector
std::unique_ptr< OPropertyInfoService > m_pInfoService
access to property meta data
void addDoublePropertyDescription(std::vector< css::beans::Property > &_rProperties, const OUString &_rPropertyName, sal_Int16 _nAttribs) const
adds a description for the given double property to the given property vector
void addDatePropertyDescription(std::vector< css::beans::Property > &_rProperties, const OUString &_rPropertyName, sal_Int16 _nAttribs) const
adds a description for the given date property to the given property vector
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
void addTimePropertyDescription(std::vector< css::beans::Property > &_rProperties, const OUString &_rPropertyName, sal_Int16 _nAttribs) const
adds a description for the given time property to the given property vector
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...
PropertyId impl_getPropertyId_throwUnknownProperty(const OUString &_rPropertyName) const
retrieves the property id for a given property name
void addDateTimePropertyDescription(std::vector< css::beans::Property > &_rProperties, const OUString &_rPropertyName, sal_Int16 _nAttribs) const
adds a description for the given DateTime property to the given property vector
virtual void SAL_CALL removePropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
void addInt32PropertyDescription(std::vector< css::beans::Property > &_rProperties, const OUString &_rPropertyName, sal_Int16 _nAttribs=0) const
adds a description for the given int32 property to the given property vector
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...
virtual OUString SAL_CALL getImplementationName() override
virtual void onNewComponent() override
called when XPropertyHandler::inspect has been called, and we thus have a new component to inspect
void implGetAvailableDataTypeNames(std::vector< OUString > &_rNames) const
retrieves the names of the data types which our introspectee can be validated against
virtual css::uno::Sequence< OUString > SAL_CALL getSupersededProperties() override
XSDValidationPropertyHandler(const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
bool implPrepareCloneDataCurrentType(OUString &_rNewName)
virtual void SAL_CALL addPropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &_rPropertyName) override
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 removePropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
virtual css::uno::Sequence< css::beans::Property > doDescribeSupportedProperties() const override
virtual css::uno::Sequence< OUString > SAL_CALL getActuatingProperties() override
void implDoCloneCurrentDataType(const OUString &_rNewName)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::inspection::LineDescriptor SAL_CALL describePropertyLine(const OUString &_rPropertyName, const css::uno::Reference< css::inspection::XPropertyControlFactory > &_rxControlFactory) override
std::unique_ptr< XSDValidationHelper > m_pHelper
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 void SAL_CALL setPropertyValue(const OUString &_rPropertyName, const css::uno::Any &_rValue) override
virtual short run()
#define DBG_ASSERT(sCon, aError)
#define PROPERTY_ID_XSD_MAX_INCLUSIVE_INT
#define PROPERTY_ID_XSD_LENGTH
#define PROPERTY_ID_XSD_PATTERN
#define PROPERTY_ID_XSD_MIN_INCLUSIVE_DATE_TIME
#define PROPERTY_ID_XSD_DATA_TYPE
#define PROPERTY_ID_XSD_MAX_EXCLUSIVE_INT
#define PROPERTY_ID_XSD_MAX_EXCLUSIVE_DOUBLE
#define PROPERTY_ID_XSD_MAX_INCLUSIVE_TIME
#define PROPERTY_ID_XSD_MIN_EXCLUSIVE_DATE_TIME
#define PROPERTY_ID_XSD_MAX_EXCLUSIVE_DATE_TIME
#define PROPERTY_ID_XSD_MAX_INCLUSIVE_DATE
#define PROPERTY_ID_XSD_MIN_INCLUSIVE_DATE
#define PROPERTY_ID_XSD_MAX_EXCLUSIVE_TIME
#define PROPERTY_ID_XSD_TOTAL_DIGITS
#define PROPERTY_ID_XSD_MIN_INCLUSIVE_TIME
#define PROPERTY_ID_XSD_MIN_INCLUSIVE_DOUBLE
#define PROPERTY_ID_XSD_MIN_EXCLUSIVE_TIME
#define PROPERTY_ID_XSD_MAX_INCLUSIVE_DATE_TIME
#define PROPERTY_ID_XSD_WHITESPACES
#define PROPERTY_ID_XSD_MIN_EXCLUSIVE_DOUBLE
#define PROPERTY_ID_XSD_MAX_LENGTH
#define PROPERTY_ID_XSD_MIN_LENGTH
#define PROPERTY_ID_XSD_MIN_EXCLUSIVE_INT
#define PROPERTY_ID_XSD_MIN_EXCLUSIVE_DATE
#define PROPERTY_ID_XSD_MAX_EXCLUSIVE_DATE
#define PROPERTY_ID_XSD_MAX_INCLUSIVE_DOUBLE
#define PROPERTY_ID_XML_DATA_MODEL
#define PROPERTY_ID_XSD_FRACTION_DIGITS
#define PROPERTY_ID_XSD_MIN_INCLUSIVE_INT
constexpr OUStringLiteral PROPERTY_XSD_MIN_EXCLUSIVE_INT
constexpr OUStringLiteral PROPERTY_XSD_MAX_EXCLUSIVE_DATE_TIME
constexpr OUStringLiteral PROPERTY_XSD_MIN_EXCLUSIVE_DATE_TIME
constexpr OUStringLiteral PROPERTY_XSD_MIN_EXCLUSIVE_TIME
constexpr OUStringLiteral PROPERTY_XSD_MIN_EXCLUSIVE_DOUBLE
constexpr OUStringLiteral PROPERTY_NAME
Definition: formstrings.hxx:36
constexpr OUStringLiteral PROPERTY_FILTERPROPOSAL
constexpr OUStringLiteral PROPERTY_XSD_WHITESPACES
constexpr OUStringLiteral PROPERTY_TIMEMIN
constexpr OUStringLiteral PROPERTY_XSD_MAX_INCLUSIVE_DATE
constexpr OUStringLiteral PROPERTY_CONTROLSOURCE
Definition: formstrings.hxx:42
constexpr OUStringLiteral PROPERTY_EFFECTIVE_MAX
constexpr OUStringLiteral PROPERTY_XSD_MAX_EXCLUSIVE_TIME
constexpr OUStringLiteral PROPERTY_XSD_MIN_INCLUSIVE_DOUBLE
constexpr OUStringLiteral PROPERTY_XSD_MAX_INCLUSIVE_DATE_TIME
constexpr OUStringLiteral PROPERTY_VALUEMAX
Definition: formstrings.hxx:86
constexpr OUStringLiteral PROPERTY_XSD_MAX_EXCLUSIVE_DOUBLE
constexpr OUStringLiteral PROPERTY_XSD_MAX_EXCLUSIVE_INT
constexpr OUStringLiteral PROPERTY_EMPTY_IS_NULL
Definition: formstrings.hxx:72
constexpr OUStringLiteral PROPERTY_EFFECTIVE_MIN
constexpr OUStringLiteral PROPERTY_MAXTEXTLEN
Definition: formstrings.hxx:53
constexpr OUStringLiteral PROPERTY_DATEMAX
Definition: formstrings.hxx:98
constexpr OUStringLiteral PROPERTY_XSD_MIN_EXCLUSIVE_DATE
constexpr OUStringLiteral PROPERTY_XSD_MAX_LENGTH
constexpr OUStringLiteral PROPERTY_TIMEMAX
constexpr OUStringLiteral PROPERTY_LISTSOURCETYPE
Definition: formstrings.hxx:73
constexpr OUStringLiteral PROPERTY_XML_DATA_MODEL
constexpr OUStringLiteral PROPERTY_XSD_MIN_INCLUSIVE_DATE_TIME
constexpr OUStringLiteral PROPERTY_DECIMAL_ACCURACY
Definition: formstrings.hxx:82
constexpr OUStringLiteral PROPERTY_XSD_MAX_INCLUSIVE_DOUBLE
constexpr OUStringLiteral PROPERTY_XSD_MAX_EXCLUSIVE_DATE
constexpr OUStringLiteral PROPERTY_XSD_TOTAL_DIGITS
constexpr OUStringLiteral PROPERTY_XSD_DATA_TYPE
constexpr OUStringLiteral PROPERTY_BOUNDCOLUMN
constexpr OUStringLiteral PROPERTY_XSD_MAX_INCLUSIVE_TIME
constexpr OUStringLiteral PROPERTY_XSD_LENGTH
constexpr OUStringLiteral PROPERTY_DATEMIN
Definition: formstrings.hxx:97
constexpr OUStringLiteral PROPERTY_XSD_MIN_INCLUSIVE_INT
constexpr OUStringLiteral PROPERTY_XSD_FRACTION_DIGITS
constexpr OUStringLiteral PROPERTY_XSD_MAX_INCLUSIVE_INT
constexpr OUStringLiteral PROPERTY_VALUEMIN
Definition: formstrings.hxx:85
constexpr OUStringLiteral PROPERTY_LISTSOURCE
Definition: formstrings.hxx:74
constexpr OUStringLiteral PROPERTY_XSD_MIN_INCLUSIVE_TIME
constexpr OUStringLiteral PROPERTY_XSD_MIN_LENGTH
constexpr OUStringLiteral PROPERTY_XSD_PATTERN
constexpr OUStringLiteral PROPERTY_XSD_MIN_INCLUSIVE_DATE
#define SAL_N_ELEMENTS(arr)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
int i
a property handler for any virtual string properties
Definition: browserline.cxx:39
sal_Int32 PropertyId
OUString PcrRes(TranslateId aId)
Definition: modulepcr.cxx:26
constexpr OUStringLiteral UID_PROP_ADD_DATA_TYPE
Definition: propctrlr.h:46
constexpr OUStringLiteral UID_PROP_REMOVE_DATA_TYPE
Definition: propctrlr.h:47
unsigned char sal_Bool
RET_OK
RET_YES
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * extensions_propctrlr_XSDValidationPropertyHandler_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)