30 #include <com/sun/star/text/XText.hpp>
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/io/XPersistObject.hpp>
33 #include <com/sun/star/util/Duration.hpp>
34 #include <com/sun/star/form/FormComponentType.hpp>
35 #include <com/sun/star/form/FormSubmitEncoding.hpp>
36 #include <com/sun/star/form/FormSubmitMethod.hpp>
37 #include <com/sun/star/sdb/CommandType.hpp>
38 #include <com/sun/star/form/NavigationBarMode.hpp>
39 #include <com/sun/star/form/TabulatorCycle.hpp>
40 #include <com/sun/star/form/FormButtonType.hpp>
41 #include <com/sun/star/awt/ScrollBarOrientation.hpp>
42 #include <com/sun/star/awt/VisualEffect.hpp>
43 #include <com/sun/star/form/ListSourceType.hpp>
44 #include <com/sun/star/awt/ImagePosition.hpp>
49 #include <com/sun/star/form/binding/XBindableValue.hpp>
50 #include <com/sun/star/form/binding/XListEntrySink.hpp>
65 #include <string_view>
70 #if OSL_DEBUG_LEVEL > 0
71 #define RESET_BIT( bitfield, bit ) \
72 bitfield = bitfield & ~bit
74 #define RESET_BIT( bitfield, bit )
90 using namespace ::com::sun::star::form::binding;
94 const Sequence< ScriptEventDescriptor >& _rEvents)
155 Reference< XPersistObject > xPersistence(
m_xProps, UNO_QUERY);
156 if (!xPersistence.is())
158 OSL_FAIL(
"OElementExport::exportServiceNameAttribute: no XPersistObject!");
168 OUString sToWriteServiceName = sServiceName;
169 #define CHECK_N_TRANSLATE( name ) \
170 else if (sServiceName == SERVICE_PERSISTENT_COMPONENT_##name) \
171 sToWriteServiceName = SERVICE_##name
177 Reference< XServiceInfo > xSI(
m_xProps, UNO_QUERY);
200 #if OSL_DEBUG_LEVEL > 0
201 Reference< XServiceInfo > xSI(
m_xProps, UNO_QUERY);
202 OSL_ENSURE(xSI.is() && xSI->supportsService(sToWriteServiceName),
203 "OElementExport::exportServiceNameAttribute: wrong service name translation!");
206 sToWriteServiceName =
214 sToWriteServiceName);
229 const OUString& _rControlId,
const OUString& _rReferringControls,
230 const Sequence< ScriptEventDescriptor >& _rEvents)
232 ,m_sControlId(_rControlId)
233 ,m_sReferringControls(_rReferringControls)
234 ,m_nClassId(FormComponentType::
CONTROL)
242 OSL_ENSURE(
m_xProps.is(),
"OControlExport::OControlExport: invalid arguments!");
255 #if OSL_DEBUG_LEVEL > 0
257 m_nIncludeCommon = m_nIncludeCommon & ~
CCAFlags::Name;
265 #if OSL_DEBUG_LEVEL > 0
267 m_nIncludeCommon = m_nIncludeCommon & ~
CCAFlags::ServiceName;
277 OSL_ENSURE(!
m_sControlId.isEmpty(),
"OControlExport::exportInnerAttributes: have no control id for the control!");
280 #if OSL_DEBUG_LEVEL > 0
282 m_nIncludeCommon = m_nIncludeCommon & ~
CCAFlags::ControlId;
323 Reference< XText > xControlText(
m_xProps, UNO_QUERY );
324 if ( xControlText.is() )
327 while ( pCharAttributeProperties->
msApiName )
330 ++pCharAttributeProperties;
334 while ( pParaAttributeProperties->
msApiName )
337 ++pParaAttributeProperties;
384 Reference< XIndexAccess > xColumnContainer(
m_xProps, UNO_QUERY);
385 OSL_ENSURE(xColumnContainer.is(),
"OControlExport::exportSubTags: a grid control which is no IndexAccess?!!");
386 if (xColumnContainer.is())
403 for (
const auto& rListItem : std::as_const(aListItems))
419 if ( xControlText.is() )
421 bool bActingAsRichText =
false;
427 if ( bActingAsRichText )
441 for (
auto const & prop : aProperties )
448 if ( propDescription ==
nullptr )
456 SAL_WARN(
"xmloff.forms",
"OControlExport::exportGenericHandlerAttributes: invalid property handler provided by the factory!" );
469 const Any propValue =
m_xProps->getPropertyValue( prop.Name );
470 OUString attributeValue = handler->getAttributeValue( propValue );
502 static const CCAFlags nStringPropertyAttributeIds[] =
507 static const char * aStringPropertyNames[] =
513 "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (1)!");
521 OUString::createFromAscii(aStringPropertyNames[i])
523 #if OSL_DEBUG_LEVEL > 0
525 m_nIncludeCommon = m_nIncludeCommon & ~nStringPropertyAttributeIds[i];
532 static const CCAFlags nBooleanPropertyAttributeIds[] =
536 static const char * pBooleanPropertyNames[] =
547 #if OSL_DEBUG_LEVEL > 0
548 static const sal_Int32 nIdCount =
SAL_N_ELEMENTS(nBooleanPropertyAttributeIds);
549 static const sal_Int32 nNameCount =
SAL_N_ELEMENTS(pBooleanPropertyNames);
550 static const sal_Int32 nFlagsCount =
SAL_N_ELEMENTS(nBooleanPropertyAttrFlags);
551 OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
552 "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (2)!");
560 OUString::createFromAscii(pBooleanPropertyNames[i]),
561 nBooleanPropertyAttrFlags[i]);
562 #if OSL_DEBUG_LEVEL > 0
564 m_nIncludeCommon = m_nIncludeCommon & ~nBooleanPropertyAttributeIds[i];
572 static const CCAFlags nIntegerPropertyAttributeIds[] =
576 static const char * pIntegerPropertyNames[] =
580 static const sal_Int16 nIntegerPropertyAttrDefaults[] =
588 #if OSL_DEBUG_LEVEL > 0
589 static const sal_Int32 nIdCount =
SAL_N_ELEMENTS(nIntegerPropertyAttributeIds);
590 static const sal_Int32 nNameCount =
SAL_N_ELEMENTS(pIntegerPropertyNames);
591 static const sal_Int32 nDefaultCount =
SAL_N_ELEMENTS(nIntegerPropertyAttrDefaults);
592 OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount),
593 "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (3)!");
601 OUString::createFromAscii(pIntegerPropertyNames[i]),
602 nIntegerPropertyAttrDefaults[i]);
603 #if OSL_DEBUG_LEVEL > 0
605 m_nIncludeCommon = m_nIncludeCommon & ~nIntegerPropertyAttributeIds[i];
620 FormButtonType_PUSH);
621 #if OSL_DEBUG_LEVEL > 0
633 ScrollBarOrientation::HORIZONTAL
635 #if OSL_DEBUG_LEVEL > 0
650 #if OSL_DEBUG_LEVEL > 0
663 #if OSL_DEBUG_LEVEL > 0
684 sTextLenPropertyName,
692 #if OSL_DEBUG_LEVEL > 0
701 #if OSL_DEBUG_LEVEL > 0
711 #if OSL_DEBUG_LEVEL > 0
728 #if OSL_DEBUG_LEVEL > 0
736 const char* pCurrentValuePropertyName =
nullptr;
737 const char* pValuePropertyName =
nullptr;
754 nCurrentValueAttributeNamespaceKey,
755 pCurrentValueAttributeName,
756 pCurrentValuePropertyName
766 nValueAttributeNamespaceKey,
772 "OControlExport::exportCommonControlAttributes: no property found for the value attribute!");
774 "OControlExport::exportCommonControlAttributes: no property found for the current-value attribute!");
776 #if OSL_DEBUG_LEVEL > 0
783 "OControlExport::exportCommonControlAttributes: forgot some flags!");
790 #if OSL_DEBUG_LEVEL > 0
847 ListSourceType_VALUELIST
855 RESET_BIT( nIncludeDatabase, DAFlags::ListSource );
858 #if OSL_DEBUG_LEVEL > 0
860 "OControlExport::exportDatabaseAttributes: forgot some flags!");
868 #if OSL_DEBUG_LEVEL > 0
875 #if OSL_DEBUG_LEVEL > 0
877 nIncludeBinding = nIncludeBinding & ~
BAFlags( BAFlags::LinkedCell | BAFlags::ListLinkingType );
884 #if OSL_DEBUG_LEVEL > 0
886 nIncludeBinding = nIncludeBinding & ~
BAFlags::ListCellRange;
893 #if OSL_DEBUG_LEVEL > 0
895 nIncludeBinding = nIncludeBinding & ~
BAFlags::XFormsBind;
902 #if OSL_DEBUG_LEVEL > 0
904 nIncludeBinding = nIncludeBinding & ~
BAFlags::XFormsListBind;
911 #if OSL_DEBUG_LEVEL > 0
913 nIncludeBinding = nIncludeBinding & ~
BAFlags::XFormsSubmission;
917 #if OSL_DEBUG_LEVEL > 0
919 "OControlExport::exportBindingAttributes: forgot some flags!");
931 static const SCAFlags nBooleanPropertyAttributeIds[] =
936 static const char * pBooleanPropertyNames[] =
944 static const sal_Int32 nIdCount =
SAL_N_ELEMENTS(nBooleanPropertyAttributeIds);
945 #if OSL_DEBUG_LEVEL > 0
946 static const sal_Int32 nNameCount =
SAL_N_ELEMENTS(pBooleanPropertyNames);
947 OSL_ENSURE((nIdCount == nNameCount),
948 "OControlExport::exportSpecialAttributes: somebody tampered with the maps (1)!");
950 const SCAFlags* pAttributeId = nBooleanPropertyAttributeIds;
951 for ( i = 0; i < nIdCount; ++i, ++pAttributeId )
958 OUString::createFromAscii(pBooleanPropertyNames[i]),
961 #if OSL_DEBUG_LEVEL > 0
963 m_nIncludeSpecial = m_nIncludeSpecial & ~*pAttributeId;
971 static const SCAFlags nIntegerPropertyAttributeIds[] =
975 static const char * pIntegerPropertyNames[] =
979 static const sal_Int32 nIntegerPropertyAttrDefaults[] =
984 static const sal_Int32 nIdCount =
SAL_N_ELEMENTS( nIntegerPropertyAttributeIds );
985 #if OSL_DEBUG_LEVEL > 0
986 static const sal_Int32 nNameCount =
SAL_N_ELEMENTS( pIntegerPropertyNames );
987 OSL_ENSURE( ( nIdCount == nNameCount ),
988 "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
989 static const sal_Int32 nDefaultCount =
SAL_N_ELEMENTS( nIntegerPropertyAttrDefaults );
990 OSL_ENSURE( ( nIdCount == nDefaultCount ),
991 "OControlExport::exportSpecialAttributes: somebody tampered with the maps (3)!" );
993 for ( i = 0; i < nIdCount; ++i )
999 OUString::createFromAscii(pIntegerPropertyNames[i]),
1000 nIntegerPropertyAttrDefaults[i]
1002 #if OSL_DEBUG_LEVEL > 0
1004 m_nIncludeSpecial = m_nIncludeSpecial & ~nIntegerPropertyAttributeIds[i];
1010 OUString sPropertyName;
1016 OSL_FAIL(
"OControlExport::exportSpecialAttributes: not property which can be mapped to step-size attribute!" );
1018 if ( !sPropertyName.isEmpty() )
1026 #if OSL_DEBUG_LEVEL > 0
1028 m_nIncludeSpecial = m_nIncludeSpecial & ~
SCAFlags::StepSize;
1044 #if OSL_DEBUG_LEVEL > 0
1058 #if OSL_DEBUG_LEVEL > 0
1060 m_nIncludeSpecial = m_nIncludeSpecial & ~
SCAFlags::CurrentState;
1072 sal_Int32 nRepeatDelay = 0;
1076 util::Duration aDuration;
1077 aDuration.Hours = aTime.
GetHour();
1078 aDuration.Minutes = aTime.
GetMin();
1079 aDuration.Seconds = aTime.
GetSec();
1080 aDuration.NanoSeconds = (nRepeatDelay % 1000) * 1000000;
1086 ,buf.makeStringAndClear());
1090 #if OSL_DEBUG_LEVEL > 0
1106 OUString sCharacter(reinterpret_cast<const sal_Unicode*>(&nValue), 1);
1113 #if OSL_DEBUG_LEVEL > 0
1115 m_nIncludeSpecial = m_nIncludeSpecial & ~
SCAFlags::EchoChar;
1122 static const SCAFlags nStringPropertyAttributeIds[] =
1126 static const std::u16string_view pStringPropertyNames[] =
1131 static const sal_Int32 nIdCount =
SAL_N_ELEMENTS( nStringPropertyAttributeIds );
1132 #if OSL_DEBUG_LEVEL > 0
1133 static const sal_Int32 nNameCount =
SAL_N_ELEMENTS( pStringPropertyNames );
1134 OSL_ENSURE( ( nIdCount == nNameCount ),
1135 "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
1137 for ( i = 0; i < nIdCount; ++i )
1143 OUString(pStringPropertyNames[i])
1145 #if OSL_DEBUG_LEVEL > 0
1147 m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i];
1157 const char* pMinValuePropertyName =
nullptr;
1158 const char* pMaxValuePropertyName =
nullptr;
1162 "OControlExport::exportCommonControlAttributes: no property found for the min value attribute!");
1164 "OControlExport::exportCommonControlAttributes: no property found for the max value attribute!");
1174 nMinValueNamespaceKey,
1175 pMinValueAttributeName,
1176 pMinValuePropertyName);
1180 nMaxValueNamespaceKey,
1181 pMaxValueAttributeName,
1182 pMaxValuePropertyName);
1183 #if OSL_DEBUG_LEVEL > 0
1196 "OControlExport::exportSpecialAttributes: forgot some flags!");
1203 OUString sListSource;
1205 if ( !( aListSource >>= sListSource ) )
1208 aListSource >>= aListSourceSequence;
1209 if ( aListSourceSequence.hasElements() )
1210 sListSource = aListSourceSequence[ 0 ];
1221 if ( !sListSource.isEmpty() )
1234 Sequence< sal_Int16 > aValueSequence;
1236 m_xProps->getPropertyValue(_rPropertyName) >>= aValueSequence;
1238 for (
const auto& rValue : std::as_const(aValueSequence))
1255 Int16Set aSelection, aDefaultSelection;
1261 OUStringBuffer sBuffer;
1263 sTrue = sBuffer.makeStringAndClear();
1266 const OUString* pItems = aItems.getConstArray();
1267 const OUString*
pValues = aValues.getConstArray();
1269 sal_Int32 nItems = aItems.getLength();
1270 sal_Int32 nValues = aValues.getLength();
1272 sal_Int16 nMaxLen =
static_cast<sal_Int16
>(std::max(nItems, nValues));
1274 for (sal_Int16
i=0;
i<nMaxLen; ++
i )
1297 if (aSelection.
end() != aSelectedPos)
1304 aSelection.
erase(aSelectedPos);
1308 if (aDefaultSelection.
end() != aDefaultSelectedPos)
1315 aDefaultSelection.
erase(aDefaultSelectedPos);
1325 if (aSelection.
empty() && aDefaultSelection.
empty())
1328 sal_Int16 nLastSelected = -1;
1329 if ( !aSelection.
empty() )
1330 nLastSelected = *(--aSelection.
end());
1332 sal_Int16 nLastDefaultSelected = -1;
1333 if ( !aDefaultSelection.
empty() )
1334 nLastDefaultSelected = *(--aDefaultSelection.
end());
1337 sal_Int16 nLastReferredEntry = std::max(nLastSelected, nLastDefaultSelected);
1338 OSL_ENSURE(nLastReferredEntry >= nMaxLen,
"OControlExport::exportListSourceAsElements: inconsistence!");
1342 for (sal_Int16
i=nMaxLen;
i<=nLastReferredEntry; ++
i)
1344 if (aSelection.
end() != aSelection.
find(
i))
1353 if (aDefaultSelection.
end() != aDefaultSelection.
find(
i))
1369 if (pOuterElementName)
1373 pOuterElementName,
true,
1406 "OControlExport::examine: called me twice? Not initialized?" );
1412 bool knownType =
false;
1415 case FormComponentType::DATEFIELD:
1419 case FormComponentType::TIMEFIELD:
1427 case FormComponentType::NUMERICFIELD:
1428 case FormComponentType::CURRENCYFIELD:
1429 case FormComponentType::PATTERNFIELD:
1436 case FormComponentType::TEXTFIELD:
1452 sal_Int16 nEchoChar = 0;
1464 bool bMultiLine =
false;
1484 if ( (
m_nClassId != FormComponentType::DATEFIELD )
1485 && (
m_nClassId != FormComponentType::TIMEFIELD )
1497 if ( (
m_nClassId == FormComponentType::TEXTFIELD )
1498 || (
m_nClassId == FormComponentType::PATTERNFIELD )
1503 if (
m_nClassId != FormComponentType::FILECONTROL )
1507 if (
m_nClassId == FormComponentType::TEXTFIELD )
1513 if ( FormComponentType::PATTERNFIELD !=
m_nClassId )
1516 if (FormComponentType::TEXTFIELD !=
m_nClassId)
1532 case FormComponentType::FILECONTROL:
1541 case FormComponentType::FIXEDTEXT:
1550 case FormComponentType::COMBOBOX:
1561 case FormComponentType::LISTBOX:
1573 ListSourceType eListSourceType = ListSourceType_VALUELIST;
1576 OSL_ENSURE(bSuccess,
"OControlExport::examineControl: could not retrieve the ListSourceType!");
1577 if (ListSourceType_VALUELIST != eListSourceType)
1585 case FormComponentType::COMMANDBUTTON:
1590 case FormComponentType::IMAGEBUTTON:
1603 case FormComponentType::CHECKBOX:
1607 case FormComponentType::RADIOBUTTON:
1624 case FormComponentType::GROUPBOX:
1632 case FormComponentType::IMAGECONTROL:
1641 case FormComponentType::HIDDENCONTROL:
1647 case FormComponentType::GRIDCONTROL:
1655 case FormComponentType::SCROLLBAR:
1656 case FormComponentType::SPINBUTTON:
1663 if (
m_nClassId == FormComponentType::SCROLLBAR )
1670 OSL_FAIL(
"OControlExport::examineControl: unknown control type (class id)!");
1673 case FormComponentType::NAVIGATIONBAR:
1677 case FormComponentType::CONTROL:
1700 if (
m_nClassId == FormComponentType::LISTBOX )
1737 OSL_ENSURE( xBinding.is(),
"OControlExport::exportCellBindingAttributes: invalid bindable or invalid binding!" );
1738 if ( xBinding.is() )
1746 if ( _bIncludeListLinkageType )
1750 OUStringBuffer sBuffer;
1760 sBuffer.makeStringAndClear()
1792 Reference< XListEntrySource > xSource;
1794 xSource = xSink->getListEntrySource();
1795 OSL_ENSURE( xSource.is(),
"OControlExport::exportCellListSourceRange: list source or sink!" );
1817 sal_Int16 nImagePosition = ImagePosition::Centered;
1819 OSL_ENSURE( ( nImagePosition >= ImagePosition::LeftTop ) && ( nImagePosition <= ImagePosition::Centered ),
1820 "OControlExport::exportImagePositionAttributes: don't know this image position!" );
1822 if ( ( nImagePosition < ImagePosition::LeftTop ) || ( nImagePosition > ImagePosition::Centered ) )
1824 nImagePosition = ImagePosition::Centered;
1826 if ( nImagePosition == ImagePosition::Centered )
1841 XMLTokenEnum eXmlImagePosition = eXmlImagePositions[ nImagePosition / 3 ];
1842 XMLTokenEnum eXmlImageAlign = eXmlImageAligns [ nImagePosition % 3 ];
1865 OUString sBoundFieldPropertyName(
"BoundField" );
1869 m_xProps->getPropertyValue( sBoundFieldPropertyName ) >>= xBoundField;
1870 if ( xBoundField.is() )
1875 Reference< XBindableValue > xBindable(
m_xProps, UNO_QUERY );
1876 if ( xBindable.is() && xBindable->getValueBinding().is() )
1892 Reference< XListEntrySink > xEntrySink(
m_xProps, UNO_QUERY );
1893 if ( xEntrySink.is() && xEntrySink->getListEntrySource().is() )
1898 ListSourceType eListSourceType = ListSourceType_VALUELIST;
1900 if ( eListSourceType == ListSourceType_VALUELIST )
1914 OSL_FAIL(
"OControlExport::controlHasUserSuppliedListEntries: unreachable code!" );
1921 const Sequence< ScriptEventDescriptor >& _rEvents)
1922 :
OControlExport(_rContext, _rxControl, _rControlId, OUString(), _rEvents)
1934 OUString sColumnServiceName;
1939 sal_Int32 nLastSep = sColumnServiceName.lastIndexOf(
'.');
1940 OSL_ENSURE(-1 != nLastSep,
"OColumnExport::startExportElement: invalid service name!");
1941 sColumnServiceName = sColumnServiceName.copy(nLastSep + 1);
1942 sColumnServiceName =
1948 , sColumnServiceName);
1971 if ( !sStyleName.isEmpty() )
1989 if (FormComponentType::DATEFIELD !=
m_nClassId)
1996 const Sequence< ScriptEventDescriptor >& _rEvents)
1998 ,m_bCreateConnectionResourceElement(
false)
2000 OSL_ENSURE(
m_xProps.is(),
"OFormExport::OFormExport: invalid arguments!");
2013 OUString sPropValue;
2015 if ( sPropValue.isEmpty() )
2017 if ( !sPropValue.isEmpty() )
2031 Reference< XIndexAccess > xCollection(
m_xProps, UNO_QUERY);
2032 OSL_ENSURE(xCollection.is(),
"OFormLayerXMLExport::implExportForm: a form which is not an index access? Suspicious!");
2034 if (xCollection.is())
2048 static const char * aStringPropertyNames[] =
2052 static const sal_Int32 nIdCount =
SAL_N_ELEMENTS(eStringPropertyIds);
2053 #if OSL_DEBUG_LEVEL > 0
2054 static const sal_Int32 nNameCount =
SAL_N_ELEMENTS(aStringPropertyNames);
2055 OSL_ENSURE((nIdCount == nNameCount),
2056 "OFormExport::exportAttributes: somebody tampered with the maps (1)!");
2058 for (i=0; i<nIdCount; ++i)
2062 OUString::createFromAscii(aStringPropertyNames[i]));
2067 OUString sPropValue;
2092 static const char * pBooleanPropertyNames[] =
2105 static const sal_Int32 nIdCount =
SAL_N_ELEMENTS(eBooleanPropertyIds);
2106 #if OSL_DEBUG_LEVEL > 0
2107 static const sal_Int32 nNameCount =
SAL_N_ELEMENTS(pBooleanPropertyNames);
2108 static const sal_Int32 nFlagsCount =
SAL_N_ELEMENTS(nBooleanPropertyAttrFlags);
2109 OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
2110 "OFormExport::exportAttributes: somebody tampered with the maps (2)!");
2112 for (i=0; i<nIdCount; ++i)
2116 OUString::createFromAscii(pBooleanPropertyNames[i]),
2117 nBooleanPropertyAttrFlags[i]
2128 FormSubmitEncoding_URL,
2136 FormSubmitMethod_GET,
2144 CommandType::COMMAND,
2152 NavigationBarMode_CURRENT,
2160 TabulatorCycle_RECORDS,
const css::uno::Reference< css::beans::XPropertySetInfo > m_xPropertyInfo
tools::SvRef< SvBaseLink > xSink
#define PROPERTY_MASTERFIELDS
#define PROPERTY_LISTSOURCE
void exportedProperty(const OUString &_rPropertyName)
indicates that a property has been handled by a derived class, without using the helper methods of th...
#define PROPERTY_APPLYFILTER
void exportXFormsSubmissionAttributes()
exports the attribute(s) for an XForms submission
#define PROPERTY_CONTROLLABEL
OControlExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxControl, const OUString &_rControlId, const OUString &_rReferringControls, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rxEvents)
constructs an object capable of exporting controls
void AddAttribute(sal_uInt16 _nPrefix, const OUString &_rName, const OUString &_rValue)
virtual void implStartElement(const char *_pName)
start the XML element
const SvXMLEnumMapEntry< sal_Int32 > aCommandTypeMap[]
#define PROPERTY_DETAILFIELDS
void exportDatabaseAttributes()
adds database attributes to the XMLExport context given
constexpr sal_uInt16 XML_NAMESPACE_XFORMS
virtual void exportSubTags()
export any sub tags
void exportBindingAttributes()
adds the XML attributes which are related to binding controls to external values and/or list sources ...
virtual const char * getXMLElementName() const override
get the name of the XML element
#define PROPERTY_ALLOWINSERTS
OUString getScalarListSourceValue() const
retrieves the string specifying the ListSource of a list or combo box
void exportRemainingProperties()
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
#define PROPERTY_ENABLEVISIBLE
const SvXMLEnumMapEntry< sal_Int32 > aOrientationMap[]
void exportCommonControlAttributes()
adds common control attributes to the XMLExport context given
void exportBooleanPropertyAttribute(const sal_uInt16 _nNamespaceKey, const OUString &_pAttributeName, const OUString &_rPropertyName, const BoolAttrFlags _nBooleanAttributeFlags)
add an attribute which is represented by a boolean property to the export context ...
constexpr OUStringLiteral SERVICE_FORMATTEDFIELD
#define PROPERTY_DEFAULT_SELECT_SEQ
provides export related tools for attribute handling
#define PROPERTY_BOUNDCOLUMN
helper class wrapping different script event representations
const SvXMLEnumMapEntry< NavigationBarMode > aNavigationTypeMap[]
virtual void exportServiceNameAttribute()
add the service-name attribute to the export context
constexpr sal_uInt16 XML_NAMESPACE_OOO
const SvXMLEnumMapEntry< FormSubmitEncoding > aSubmitEncodingMap[]
const SvXMLEnumMapEntry< FormSubmitMethod > aSubmitMethodMap[]
const_iterator find(const Value &x) const
css::uno::Sequence< css::script::ScriptEventDescriptor > m_aEvents
#define PROPERTY_AUTOCOMPLETE
void exportGenericPropertyAttribute(const sal_uInt16 _nAttributeNamespaceKey, const OUString &_pAttributeName, const char *_pPropertyName)
add an arbitrary attribute extracted from an arbitrary property to the export context ...
FormAttributes
attributes in the xml tag representing a form
#define PROPERTY_MULTILINE
void exportListSourceAsAttribute()
exports the ListSource property of a control as attribute
#define PROPERTY_INPUT_REQUIRED
const sal_Int16 FORMATTEDFIELD
void exportOuterAttributes()
exports the attributes for the outer element
#define CHECK_N_TRANSLATE(name)
void exportSubTags() override
writes everything which needs to be represented as sub tag
#define PROPERTY_COMMAND_TYPE
#define PROPERTY_SPIN_INCREMENT
constexpr OUStringLiteral SERVICE_EDIT
const css::uno::Reference< css::beans::XPropertySet > m_xProps
void SAL_DLLPRIVATE AddAttributeIdLegacy(sal_uInt16 const nLegacyPrefix, OUString const &rValue)
add xml:id and legacy namespace id
#define PROPERTY_DEFAULT_STATE
#define PROPERTY_DATASOURCENAME
virtual void exportAttributes() override
export the attributes
virtual void exportAttributes()
export the attributes
void exportInt32PropertyAttribute(const sal_uInt16 _nNamespaceKey, const OUString &_pAttributeName, const OUString &_rPropertyName, const sal_Int32 _nDefault)
add an attribute which is represented by a sal_Int32 property to the export context ...
#define PROPERTY_FOCUS_ON_CLICK
virtual const char * getOuterXMLElementName() const override
get the name of the outer XML element
SvXMLAttributeList & GetAttrList()
std::unique_ptr< SvXMLElementExport > m_pXMLElement
#define PROPERTY_DATAFIELD
#define PROPERTY_PRINTABLE
const PropertyId propertyId
the unique ID of the property. The property meta data table must not contain two entries with the sam...
#define PROPERTY_RICH_TEXT
void exportEnumPropertyAttribute(const sal_uInt16 _nNamespaceKey, const OUString &_pAttributeName, const OUString &_rPropertyName, const SvXMLEnumMapEntry< EnumT > *_pValueMap, const EnumT _nDefault, const bool _bVoidDefault=false)
add an attribute which is represented by an enum property to the export context
PropertiesInfo aProperties
#define PROPERTY_IMAGE_POSITION
#define DBG_CHECK_PROPERTY(name, type)
const SvXMLEnumMapEntry< TriState > aCheckStateMap[]
#define SERVICE_PERSISTENT_COMPONENT_EDIT
const SvXMLEnumMapEntry< ListSourceType > aListSourceTypeMap[]
constexpr OUStringLiteral sServiceName
void exportInt16PropertyAttribute(const sal_uInt16 _nNamespaceKey, const OUString &_pAttributeName, const OUString &_rPropertyName, const sal_Int16 _nDefault, const bool force=false)
add an attribute which is represented by a sal_Int16 property to the export context ...
virtual void exportCollectionElements(const css::uno::Reference< css::container::XIndexAccess > &_rxCollection)=0
steps through a collection and exports all children of this collection
#define PROPERTY_LISTSOURCETYPE
void exportStringSequenceAttribute(const sal_uInt16 _nAttributeNamespaceKey, const OUString &_pAttributeName, const OUString &_rPropertyName)
exports a property value, which is a string sequence, as attribute
constexpr sal_uInt16 XML_NAMESPACE_FORM
#define PROPERTY_GROUP_NAME
IFormsExportContext & m_rContext
#define PROPERTY_SELECT_SEQ
OUString GetRelativeReference(const OUString &rValue)
#define PROPERTY_BUTTONTYPE
sal_uInt16 namespacePrefix
#define PROPERTY_SUBMIT_METHOD
bool shouldExportProperty(const OUString &i_propertyName) const
determines whether the given property is to be exported
static const char * getElementName(ElementType _eType)
retrieves the tag name to be used to describe a control of the given type
#define PROPERTY_IMAGE_ALIGN
#define SAL_N_ELEMENTS(arr)
#define PROPERTY_COLUMNSERVICENAME
::xmloff::token::XMLTokenEnum attributeToken
#define PROPERTY_IGNORERESULT
#define PROPERTY_LINE_INCREMENT
#define PROPERTY_TRISTATE
const SvXMLEnumMapEntry< FormButtonType > aFormButtonTypeMap[]
#define PROPERTY_TABINDEX
void exportImageDataAttribute()
add the form:image attribute to the export context.
#define DBG_UNHANDLED_EXCEPTION(...)
#define TOOLS_WARN_EXCEPTION(area, stream)
void exportXFormsBindAttributes()
exports the attribute(s) which bind this control to XForms
CCAFlags m_nIncludeCommon
void exportImagePositionAttributes()
exports the attribute(s) for the ImagePosition property
#define PROPERTY_READONLY
virtual void exportAttributes() override
export the attributes
#define PROPERTY_ECHO_CHAR
XMLEventExport & GetEventExport()
get Event export, with handlers for script types "None" and "StarBasic" already registered; other han...
bool controlHasUserSuppliedListEntries() const
determines whether the list entries (of a combo or list box) are supplied by the user ...
virtual SvXMLExport & getGlobalContext()=0
virtual void implEndElement() override
ends the XML element
#define RESET_BIT(bitfield, bit)
virtual sal_Int16 SAL_CALL getLength() override
const AttributeDescription attribute
SCAFlags m_nIncludeSpecial
#define PROPERTY_NAVIGATION
Represents a property with its API-name, its XML-name and the type of its value.
#define PROPERTY_VALUE_SEQ
void exportXFormsListAttributes()
exports the attribute(s) which bind the list of a list control to XForms
#define PROPERTY_REPEAT_DELAY
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
#define PROPERTY_ALLOWUPDATES
void exportGenericHandlerAttributes()
adds the attributes which are handled via generic IPropertyHandlers
const_iterator end() const
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
#define PROPERTY_ALLOWDELETES
virtual const char * getXMLElementName() const =0
get the name of the XML element
#define PROPERTY_ORIENTATION
#define PROPERTY_VISUAL_EFFECT
const SvXMLNamespaceMap & GetNamespaceMap() const
void exportCellBindingAttributes(bool _bIncludeListLinkageType)
exports the attribute which descrives a cell value binding of a control in a spreadsheet document ...
#define PROPERTY_PERSISTENCE_MAXTEXTLENGTH
static bool convertBool(bool &rBool, std::u16string_view rString)
virtual void implStartElement(const char *_pName) override
start the XML element
void exportCellListSourceRange()
exports the attribute which descrives a cell range which acts as list source for a list-like control ...
virtual void implEndElement()
ends the XML element
#define DBG_CHECK_PROPERTY_NO_TYPE(name)
const PropertyValue * pValues
void flagStyleProperties()
flag the style properties as 'already exported'
#define PROPERTY_ECHOCHAR
#define PROPERTY_MULTISELECTION
virtual ~OColumnExport() override
void exportStringPropertyAttribute(const sal_uInt16 _nNamespaceKey, const OUString &_pAttributeName, const OUString &_rPropertyName)
add an attribute which is represented by a string property to the export context
static const XMLPropertyMapEntry * getPropertyMapForType(TextPropMap _nType)
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
bool controlHasActiveDataBinding() const
determines whether the control we're exporting has an active data binding.
std::unique_ptr< SvXMLElementExport > m_pOuterElement
Handling of tokens in XML:
void exportTargetFrameAttribute()
add the hlink:target-frame attribute to the export context.
const SvXMLEnumMapEntry< sal_Int16 > aListLinkageMap[]
OElementExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxProps, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents)
INetProtocol GetProtocol() const
#define PROPERTY_STRICTFORMAT
virtual OUString getObjectStyleName(const css::uno::Reference< css::beans::XPropertySet > &_rxObject)=0
virtual void examine() override
examine the control.
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
#define PROPERTY_DROPDOWN
virtual ~OElementExport()
XMLTokenEnum
The enumeration of all XML tokens.
void exportInnerAttributes()
exports the attributes for the inner element
#define PROPERTY_DEFAULTBUTTON
Helper class for handling xml elements representing a form control.
#define PROPERTY_LINECOUNT
#define PROPERTY_BLOCK_INCREMENT
void getSequenceInt16PropertyAsSet(const OUString &_rPropertyName, Int16Set &_rOut)
gets a Sequence< sal_Int16 > property value as set of sal_Int16's
#define PROPERTY_MAXTEXTLENGTH
OUString m_sReferringControls
const SvXMLEnumMapEntry< sal_Int16 > aVisualEffectMap[]
#define SAL_WARN(area, stream)
#define PROPERTY_STRING_ITEM_LIST
virtual const char * getOuterXMLElementName() const
get the name of the outer XML element
virtual void exportServiceNameAttribute() override
add the service-name attribute to the export context
const EnumerationType m_eType
const SvXMLEnumMapEntry< TabulatorCycle > aTabulatorCycleMap[]
virtual void examine() override
examine the control.
void exportListSourceAsElements()
exports the ListSource property of a control as XML elements
void exportEvents()
exports the events (as script:events tag)
OColumnExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxControl, const OUString &_rControlId, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rxEvents)
ctor
std::pair< const_iterator, bool > insert(Value &&x)
#define PROPERTY_FORMATKEY
#define PROPERTY_EMPTY_IS_NULL
void exportSpecialAttributes()
adds attributes which are special to a control type to the export context's attribute list ...
DAFlags m_nIncludeDatabase
#define PROPERTY_SUBMIT_ENCODING
const PropertyHandlerFactory factory
denotes the attribute which represents the property.
#define PROPERTY_ESCAPEPROCESSING
std::vector< sal_Int16 >::const_iterator const_iterator
bool any2bool(const css::uno::Any &rAny)
void exportTargetLocationAttribute(bool _bAddType)
add the form:href attribute to the export context.
BAFlags m_nIncludeBindings
size_type erase(const Value &x)
virtual void examine()
examine the element we're exporting
bool m_bDetectedRangeSegmentation false
void Export(css::uno::Reference< css::document::XEventsSupplier > const &xAccess, bool bUseWhitespace=true)
export the events (calls EventExport::Export(Reference) )