31#include <com/sun/star/text/XText.hpp>
32#include <com/sun/star/lang/XServiceInfo.hpp>
33#include <com/sun/star/io/XPersistObject.hpp>
34#include <com/sun/star/util/Duration.hpp>
35#include <com/sun/star/form/FormComponentType.hpp>
36#include <com/sun/star/form/FormSubmitEncoding.hpp>
37#include <com/sun/star/form/FormSubmitMethod.hpp>
38#include <com/sun/star/sdb/CommandType.hpp>
39#include <com/sun/star/form/NavigationBarMode.hpp>
40#include <com/sun/star/form/TabulatorCycle.hpp>
41#include <com/sun/star/form/FormButtonType.hpp>
42#include <com/sun/star/awt/ScrollBarOrientation.hpp>
43#include <com/sun/star/awt/VisualEffect.hpp>
44#include <com/sun/star/form/ListSourceType.hpp>
45#include <com/sun/star/awt/ImagePosition.hpp>
50#include <com/sun/star/form/binding/XBindableValue.hpp>
51#include <com/sun/star/form/binding/XListEntrySink.hpp>
71 #if OSL_DEBUG_LEVEL > 0
72 #define RESET_BIT( bitfield, bit ) \
73 bitfield = bitfield & ~bit
75 #define RESET_BIT( bitfield, bit )
91 using namespace ::com::sun::star::form::binding;
95 const Sequence< ScriptEventDescriptor >& _rEvents)
156 Reference< XPersistObject > xPersistence(
m_xProps, UNO_QUERY);
157 if (!xPersistence.is())
159 OSL_FAIL(
"OElementExport::exportServiceNameAttribute: no XPersistObject!");
170#define CHECK_N_TRANSLATE( persistentComponent, serviceName ) \
171 else if (sServiceName == persistentComponent) \
172 sToWriteServiceName = serviceName
178 Reference< XServiceInfo > xSI(
m_xProps, UNO_QUERY);
201#if OSL_DEBUG_LEVEL > 0
202 Reference< XServiceInfo > xSI(
m_xProps, UNO_QUERY);
203 OSL_ENSURE(xSI.is() && xSI->supportsService(sToWriteServiceName),
204 "OElementExport::exportServiceNameAttribute: wrong service name translation!");
207 sToWriteServiceName =
215 sToWriteServiceName);
230 OUString _sControlId, OUString _sReferringControls,
231 const Sequence< ScriptEventDescriptor >& _rEvents)
233 ,m_sControlId(
std::move(_sControlId))
234 ,m_sReferringControls(
std::move(_sReferringControls))
235 ,m_nClassId(FormComponentType::
CONTROL)
243 OSL_ENSURE(
m_xProps.is(),
"OControlExport::OControlExport: invalid arguments!");
256 #if OSL_DEBUG_LEVEL > 0
266 #if OSL_DEBUG_LEVEL > 0
278 OSL_ENSURE(!
m_sControlId.isEmpty(),
"OControlExport::exportInnerAttributes: have no control id for the control!");
281 #if OSL_DEBUG_LEVEL > 0
324 Reference< XText > xControlText(
m_xProps, UNO_QUERY );
325 if ( xControlText.is() )
328 while ( !pCharAttributeProperties->
IsEnd() )
331 ++pCharAttributeProperties;
335 while ( !pParaAttributeProperties->
IsEnd() )
338 ++pParaAttributeProperties;
385 Reference< XIndexAccess > xColumnContainer(
m_xProps, UNO_QUERY);
386 OSL_ENSURE(xColumnContainer.is(),
"OControlExport::exportSubTags: a grid control which is no IndexAccess?!!");
387 if (xColumnContainer.is())
401 Sequence< OUString > aListItems;
404 for (
const auto& rListItem : std::as_const(aListItems))
420 if ( xControlText.is() )
422 bool bActingAsRichText =
false;
428 if ( bActingAsRichText )
449 if ( propDescription ==
nullptr )
457 SAL_WARN(
"xmloff.forms",
"OControlExport::exportGenericHandlerAttributes: invalid property handler provided by the factory!" );
470 const Any propValue =
m_xProps->getPropertyValue( prop.Name );
471 OUString attributeValue = handler->getAttributeValue( propValue );
503 static const CCAFlags nStringPropertyAttributeIds[] =
508 static const rtl::OUStringConstExpr aStringPropertyNames[] =
512 OSL_ENSURE( std::size(aStringPropertyNames) ==
513 std::size(nStringPropertyAttributeIds),
514 "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (1)!");
516 for (
i=0;
i<std::size(nStringPropertyAttributeIds); ++
i)
522 aStringPropertyNames[
i]
524 #if OSL_DEBUG_LEVEL > 0
533 static const CCAFlags nBooleanPropertyAttributeIds[] =
537 static const rtl::OUStringConstExpr pBooleanPropertyNames[] =
548 #if OSL_DEBUG_LEVEL > 0
549 static const sal_Int32 nIdCount = std::size(nBooleanPropertyAttributeIds);
550 static const sal_Int32 nNameCount = std::size(pBooleanPropertyNames);
551 static const sal_Int32 nFlagsCount = std::size(nBooleanPropertyAttrFlags);
552 OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
553 "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (2)!");
555 for (
i=0;
i<std::size(nBooleanPropertyAttributeIds); ++
i)
561 pBooleanPropertyNames[
i],
562 nBooleanPropertyAttrFlags[
i]);
563 #if OSL_DEBUG_LEVEL > 0
573 static const CCAFlags nIntegerPropertyAttributeIds[] =
577 static const rtl::OUStringConstExpr pIntegerPropertyNames[] =
581 static const sal_Int16 nIntegerPropertyAttrDefaults[] =
589 #if OSL_DEBUG_LEVEL > 0
590 static const sal_Int32 nIdCount = std::size(nIntegerPropertyAttributeIds);
591 static const sal_Int32 nNameCount = std::size(pIntegerPropertyNames);
592 static const sal_Int32 nDefaultCount = std::size(nIntegerPropertyAttrDefaults);
593 OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount),
594 "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (3)!");
596 for (
i=0;
i<std::size(nIntegerPropertyAttributeIds); ++
i)
602 pIntegerPropertyNames[
i],
603 nIntegerPropertyAttrDefaults[
i]);
604 #if OSL_DEBUG_LEVEL > 0
621 FormButtonType_PUSH);
622 #if OSL_DEBUG_LEVEL > 0
634 ScrollBarOrientation::HORIZONTAL
636 #if OSL_DEBUG_LEVEL > 0
651 #if OSL_DEBUG_LEVEL > 0
664 #if OSL_DEBUG_LEVEL > 0
685 sTextLenPropertyName,
693 #if OSL_DEBUG_LEVEL > 0
702 #if OSL_DEBUG_LEVEL > 0
712 #if OSL_DEBUG_LEVEL > 0
729 #if OSL_DEBUG_LEVEL > 0
737 OUString pCurrentValuePropertyName;
738 OUString pValuePropertyName;
755 nCurrentValueAttributeNamespaceKey,
756 pCurrentValueAttributeName,
757 pCurrentValuePropertyName
767 nValueAttributeNamespaceKey,
773 "OControlExport::exportCommonControlAttributes: no property found for the value attribute!");
775 "OControlExport::exportCommonControlAttributes: no property found for the current-value attribute!");
777 #if OSL_DEBUG_LEVEL > 0
784 "OControlExport::exportCommonControlAttributes: forgot some flags!");
791#if OSL_DEBUG_LEVEL > 0
848 ListSourceType_VALUELIST
859#if OSL_DEBUG_LEVEL > 0
861 "OControlExport::exportDatabaseAttributes: forgot some flags!");
869#if OSL_DEBUG_LEVEL > 0
876 #if OSL_DEBUG_LEVEL > 0
885 #if OSL_DEBUG_LEVEL > 0
887 nIncludeBinding = nIncludeBinding &
~BAFlags::ListCellRange;
894 #if OSL_DEBUG_LEVEL > 0
896 nIncludeBinding = nIncludeBinding &
~BAFlags::XFormsBind;
903 #if OSL_DEBUG_LEVEL > 0
905 nIncludeBinding = nIncludeBinding &
~BAFlags::XFormsListBind;
912 #if OSL_DEBUG_LEVEL > 0
914 nIncludeBinding = nIncludeBinding &
~BAFlags::XFormsSubmission;
918 #if OSL_DEBUG_LEVEL > 0
920 "OControlExport::exportBindingAttributes: forgot some flags!");
932 static const SCAFlags nBooleanPropertyAttributeIds[] =
937 static const rtl::OUStringConstExpr pBooleanPropertyNames[] =
945 static const sal_Int32 nIdCount = std::size(nBooleanPropertyAttributeIds);
946 #if OSL_DEBUG_LEVEL > 0
947 static const sal_Int32 nNameCount = std::size(pBooleanPropertyNames);
948 OSL_ENSURE((nIdCount == nNameCount),
949 "OControlExport::exportSpecialAttributes: somebody tampered with the maps (1)!");
951 const SCAFlags* pAttributeId = nBooleanPropertyAttributeIds;
952 for (
i = 0;
i < nIdCount; ++
i, ++pAttributeId )
959 pBooleanPropertyNames[
i],
962 #if OSL_DEBUG_LEVEL > 0
972 static const SCAFlags nIntegerPropertyAttributeIds[] =
976 static const rtl::OUStringConstExpr pIntegerPropertyNames[] =
980 static const sal_Int32 nIntegerPropertyAttrDefaults[] =
985 static const sal_Int32 nIdCount = std::size( nIntegerPropertyAttributeIds );
986 #if OSL_DEBUG_LEVEL > 0
987 static const sal_Int32 nNameCount = std::size( pIntegerPropertyNames );
988 OSL_ENSURE( ( nIdCount == nNameCount ),
989 "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
990 static const sal_Int32 nDefaultCount = std::size( nIntegerPropertyAttrDefaults );
991 OSL_ENSURE( ( nIdCount == nDefaultCount ),
992 "OControlExport::exportSpecialAttributes: somebody tampered with the maps (3)!" );
994 for (
i = 0;
i < nIdCount; ++
i )
1000 pIntegerPropertyNames[
i],
1001 nIntegerPropertyAttrDefaults[
i]
1003 #if OSL_DEBUG_LEVEL > 0
1011 OUString sPropertyName;
1017 OSL_FAIL(
"OControlExport::exportSpecialAttributes: not property which can be mapped to step-size attribute!" );
1019 if ( !sPropertyName.isEmpty() )
1027 #if OSL_DEBUG_LEVEL > 0
1045 #if OSL_DEBUG_LEVEL > 0
1059 #if OSL_DEBUG_LEVEL > 0
1073 sal_Int32 nRepeatDelay = 0;
1077 util::Duration aDuration;
1078 aDuration.Hours = aTime.
GetHour();
1079 aDuration.Minutes = aTime.
GetMin();
1080 aDuration.Seconds = aTime.
GetSec();
1081 aDuration.NanoSeconds = (nRepeatDelay % 1000) * 1000000;
1087 ,buf.makeStringAndClear());
1091 #if OSL_DEBUG_LEVEL > 0
1114 #if OSL_DEBUG_LEVEL > 0
1123 static const SCAFlags nStringPropertyAttributeIds[] =
1127 static const rtl::OUStringConstExpr pStringPropertyNames[] =
1132 static const sal_Int32 nIdCount = std::size( nStringPropertyAttributeIds );
1133 #if OSL_DEBUG_LEVEL > 0
1134 static const sal_Int32 nNameCount = std::size( pStringPropertyNames );
1135 OSL_ENSURE( ( nIdCount == nNameCount ),
1136 "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
1138 for (
i = 0;
i < nIdCount; ++
i )
1144 OUString(pStringPropertyNames[
i])
1146 #if OSL_DEBUG_LEVEL > 0
1158 OUString pMinValuePropertyName;
1159 OUString pMaxValuePropertyName;
1163 "OControlExport::exportCommonControlAttributes: no property found for the min value attribute!");
1165 "OControlExport::exportCommonControlAttributes: no property found for the max value attribute!");
1175 nMinValueNamespaceKey,
1176 pMinValueAttributeName,
1177 pMinValuePropertyName);
1181 nMaxValueNamespaceKey,
1182 pMaxValueAttributeName,
1183 pMaxValuePropertyName);
1184 #if OSL_DEBUG_LEVEL > 0
1197 "OControlExport::exportSpecialAttributes: forgot some flags!");
1204 OUString sListSource;
1206 if ( !( aListSource >>= sListSource ) )
1208 Sequence< OUString > aListSourceSequence;
1209 aListSource >>= aListSourceSequence;
1210 if ( aListSourceSequence.hasElements() )
1211 sListSource = aListSourceSequence[ 0 ];
1222 if ( !sListSource.isEmpty() )
1235 Sequence< sal_Int16 > aValueSequence;
1237 m_xProps->getPropertyValue(_rPropertyName) >>= aValueSequence;
1239 for (
const auto& rValue : std::as_const(aValueSequence))
1246 Sequence< OUString > aItems, aValues;
1256 Int16Set aSelection, aDefaultSelection;
1262 OUStringBuffer sBuffer;
1264 sTrue = sBuffer.makeStringAndClear();
1267 const OUString* pItems = aItems.getConstArray();
1268 const OUString*
pValues = aValues.getConstArray();
1270 sal_Int32 nItems = aItems.getLength();
1271 sal_Int32 nValues = aValues.getLength();
1273 sal_Int16 nMaxLen =
static_cast<sal_Int16
>(std::max(nItems, nValues));
1275 for (sal_Int16
i=0;
i<nMaxLen; ++
i )
1298 if (aSelection.
end() != aSelectedPos)
1305 aSelection.
erase(aSelectedPos);
1309 if (aDefaultSelection.
end() != aDefaultSelectedPos)
1316 aDefaultSelection.
erase(aDefaultSelectedPos);
1326 if (aSelection.
empty() && aDefaultSelection.
empty())
1329 sal_Int16 nLastSelected = -1;
1330 if ( !aSelection.
empty() )
1331 nLastSelected = *(--aSelection.
end());
1333 sal_Int16 nLastDefaultSelected = -1;
1334 if ( !aDefaultSelection.
empty() )
1335 nLastDefaultSelected = *(--aDefaultSelection.
end());
1338 sal_Int16 nLastReferredEntry = std::max(nLastSelected, nLastDefaultSelected);
1339 OSL_ENSURE(nLastReferredEntry >= nMaxLen,
"OControlExport::exportListSourceAsElements: inconsistence!");
1343 for (sal_Int16
i=nMaxLen;
i<=nLastReferredEntry; ++
i)
1345 if (aSelection.
end() != aSelection.
find(
i))
1354 if (aDefaultSelection.
end() != aDefaultSelection.
find(
i))
1370 if (pOuterElementName)
1374 pOuterElementName,
true,
1407 "OControlExport::examine: called me twice? Not initialized?" );
1413 bool knownType =
false;
1416 case FormComponentType::DATEFIELD:
1420 case FormComponentType::TIMEFIELD:
1428 case FormComponentType::NUMERICFIELD:
1429 case FormComponentType::CURRENCYFIELD:
1430 case FormComponentType::PATTERNFIELD:
1437 case FormComponentType::TEXTFIELD:
1453 sal_Int16 nEchoChar = 0;
1465 bool bMultiLine =
false;
1485 if ( (
m_nClassId != FormComponentType::DATEFIELD )
1486 && (
m_nClassId != FormComponentType::TIMEFIELD )
1498 if ( (
m_nClassId == FormComponentType::TEXTFIELD )
1499 || (
m_nClassId == FormComponentType::PATTERNFIELD )
1504 if (
m_nClassId != FormComponentType::FILECONTROL )
1508 if (
m_nClassId == FormComponentType::TEXTFIELD )
1514 if ( FormComponentType::PATTERNFIELD !=
m_nClassId )
1517 if (FormComponentType::TEXTFIELD !=
m_nClassId)
1533 case FormComponentType::FILECONTROL:
1542 case FormComponentType::FIXEDTEXT:
1551 case FormComponentType::COMBOBOX:
1562 case FormComponentType::LISTBOX:
1574 ListSourceType eListSourceType = ListSourceType_VALUELIST;
1577 OSL_ENSURE(bSuccess,
"OControlExport::examineControl: could not retrieve the ListSourceType!");
1578 if (ListSourceType_VALUELIST != eListSourceType)
1586 case FormComponentType::COMMANDBUTTON:
1591 case FormComponentType::IMAGEBUTTON:
1604 case FormComponentType::CHECKBOX:
1608 case FormComponentType::RADIOBUTTON:
1625 case FormComponentType::GROUPBOX:
1633 case FormComponentType::IMAGECONTROL:
1642 case FormComponentType::HIDDENCONTROL:
1648 case FormComponentType::GRIDCONTROL:
1656 case FormComponentType::SCROLLBAR:
1657 case FormComponentType::SPINBUTTON:
1664 if (
m_nClassId == FormComponentType::SCROLLBAR )
1671 OSL_FAIL(
"OControlExport::examineControl: unknown control type (class id)!");
1674 case FormComponentType::NAVIGATIONBAR:
1678 case FormComponentType::CONTROL:
1701 if (
m_nClassId == FormComponentType::LISTBOX )
1737 Reference< XValueBinding > xBinding(
aHelper.getCurrentBinding() );
1738 OSL_ENSURE( xBinding.is(),
"OControlExport::exportCellBindingAttributes: invalid bindable or invalid binding!" );
1739 if ( xBinding.is() )
1744 aHelper.getStringAddressFromCellBinding( xBinding )
1747 if ( _bIncludeListLinkageType )
1751 OUStringBuffer sBuffer;
1761 sBuffer.makeStringAndClear()
1793 Reference< XListEntrySource > xSource;
1795 xSource =
xSink->getListEntrySource();
1796 OSL_ENSURE( xSource.is(),
"OControlExport::exportCellListSourceRange: list source or sink!" );
1804 aHelper.getStringAddressFromCellListSource( xSource )
1818 sal_Int16 nImagePosition = ImagePosition::Centered;
1820 OSL_ENSURE( ( nImagePosition >= ImagePosition::LeftTop ) && ( nImagePosition <= ImagePosition::Centered ),
1821 "OControlExport::exportImagePositionAttributes: don't know this image position!" );
1823 if ( ( nImagePosition < ImagePosition::LeftTop ) || ( nImagePosition > ImagePosition::Centered ) )
1825 nImagePosition = ImagePosition::Centered;
1827 if ( nImagePosition == ImagePosition::Centered )
1842 XMLTokenEnum eXmlImagePosition = eXmlImagePositions[ nImagePosition / 3 ];
1843 XMLTokenEnum eXmlImageAlign = eXmlImageAligns [ nImagePosition % 3 ];
1866 OUString sBoundFieldPropertyName(
"BoundField" );
1869 Reference< XPropertySet > xBoundField;
1870 m_xProps->getPropertyValue( sBoundFieldPropertyName ) >>= xBoundField;
1871 if ( xBoundField.is() )
1876 Reference< XBindableValue > xBindable(
m_xProps, UNO_QUERY );
1877 if ( xBindable.is() && xBindable->getValueBinding().is() )
1893 Reference< XListEntrySink > xEntrySink(
m_xProps, UNO_QUERY );
1894 if ( xEntrySink.is() && xEntrySink->getListEntrySource().is() )
1899 ListSourceType eListSourceType = ListSourceType_VALUELIST;
1901 if ( eListSourceType == ListSourceType_VALUELIST )
1915 OSL_FAIL(
"OControlExport::controlHasUserSuppliedListEntries: unreachable code!" );
1922 const Sequence< ScriptEventDescriptor >& _rEvents)
1923 :
OControlExport(_rContext, _rxControl, _rControlId, OUString(), _rEvents)
1935 OUString sColumnServiceName;
1940 sal_Int32 nLastSep = sColumnServiceName.lastIndexOf(
'.');
1941 OSL_ENSURE(-1 != nLastSep,
"OColumnExport::startExportElement: invalid service name!");
1942 sColumnServiceName = sColumnServiceName.copy(nLastSep + 1);
1943 sColumnServiceName =
1949 , sColumnServiceName);
1972 if ( !sStyleName.isEmpty() )
1990 if (FormComponentType::DATEFIELD !=
m_nClassId)
1997 const Sequence< ScriptEventDescriptor >& _rEvents)
1999 ,m_bCreateConnectionResourceElement(false)
2001 OSL_ENSURE(
m_xProps.is(),
"OFormExport::OFormExport: invalid arguments!");
2014 OUString sPropValue;
2016 if ( sPropValue.isEmpty() )
2018 if ( !sPropValue.isEmpty() )
2032 Reference< XIndexAccess > xCollection(
m_xProps, UNO_QUERY);
2033 OSL_ENSURE(xCollection.is(),
"OFormLayerXMLExport::implExportForm: a form which is not an index access? Suspicious!");
2035 if (xCollection.is())
2049 static const rtl::OUStringConstExpr aStringPropertyNames[] =
2053 static const sal_Int32 nIdCount = std::size(eStringPropertyIds);
2054 #if OSL_DEBUG_LEVEL > 0
2055 static const sal_Int32 nNameCount = std::size(aStringPropertyNames);
2056 OSL_ENSURE((nIdCount == nNameCount),
2057 "OFormExport::exportAttributes: somebody tampered with the maps (1)!");
2059 for (
i=0;
i<nIdCount; ++
i)
2063 aStringPropertyNames[
i]);
2068 OUString sPropValue;
2093 static const rtl::OUStringConstExpr pBooleanPropertyNames[] =
2106 static const sal_Int32 nIdCount = std::size(eBooleanPropertyIds);
2107 #if OSL_DEBUG_LEVEL > 0
2108 static const sal_Int32 nNameCount = std::size(pBooleanPropertyNames);
2109 static const sal_Int32 nFlagsCount = std::size(nBooleanPropertyAttrFlags);
2110 OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
2111 "OFormExport::exportAttributes: somebody tampered with the maps (2)!");
2113 for (
i=0;
i<nIdCount; ++
i)
2117 pBooleanPropertyNames[
i],
2118 nBooleanPropertyAttrFlags[
i]
2129 FormSubmitEncoding_URL,
2137 FormSubmitMethod_GET,
2145 CommandType::COMMAND,
2153 NavigationBarMode_CURRENT,
2161 TabulatorCycle_RECORDS,
const PropertyValue * pValues
PropertiesInfo aProperties
constexpr OUStringLiteral sServiceName
const SvXMLNamespaceMap & GetNamespaceMap() const
OUString GetRelativeReference(const OUString &rValue)
XMLEventExport & GetEventExport()
get Event export, with handlers for script types "None" and "StarBasic" already registered; other han...
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
void SAL_DLLPRIVATE AddAttributeIdLegacy(sal_uInt16 const nLegacyPrefix, OUString const &rValue)
add xml:id and legacy namespace id
comphelper::AttributeList & GetAttrList()
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
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...
void Export(css::uno::Reference< css::document::XEventsSupplier > const &xAccess, bool bUseWhitespace=true)
export the events (calls EventExport::Export(Reference<XNameAccess>) )
static const XMLPropertyMapEntry * getPropertyMapForType(TextPropMap _nType)
virtual sal_Int16 SAL_CALL getLength() override
std::vector< Value >::const_iterator const_iterator
const_iterator find(const Value &x) const
size_type erase(const Value &x)
const_iterator end() const
std::pair< const_iterator, bool > insert(Value &&x)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
static bool convertBool(bool &rBool, std::u16string_view rString)
virtual SvXMLExport & getGlobalContext()=0
virtual OUString getObjectStyleName(const css::uno::Reference< css::beans::XPropertySet > &_rxObject)=0
virtual void exportCollectionElements(const css::uno::Reference< css::container::XIndexAccess > &_rxCollection)=0
steps through a collection and exports all children of this collection
virtual void examine() override
examine the control.
OColumnExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxControl, const OUString &_rControlId, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rxEvents)
ctor
virtual void exportServiceNameAttribute() override
add the service-name attribute to the export context
virtual ~OColumnExport() override
virtual const char * getOuterXMLElementName() const override
get the name of the outer XML element
virtual void exportAttributes() override
export the attributes
static const char * getElementName(ElementType _eType)
retrieves the tag name to be used to describe a control of the given type
Helper class for handling xml elements representing a form control.
DAFlags m_nIncludeDatabase
void exportCellBindingAttributes(bool _bIncludeListLinkageType)
exports the attribute which descrives a cell value binding of a control in a spreadsheet document
bool controlHasActiveDataBinding() const
determines whether the control we're exporting has an active data binding.
OUString m_sReferringControls
virtual void implEndElement() override
ends the XML element
void exportOuterAttributes()
exports the attributes for the outer element
std::unique_ptr< SvXMLElementExport > m_pOuterElement
void exportXFormsBindAttributes()
exports the attribute(s) which bind this control to XForms
virtual void implStartElement(const char *_pName) override
start the XML element
BAFlags m_nIncludeBindings
SCAFlags m_nIncludeSpecial
void exportXFormsListAttributes()
exports the attribute(s) which bind the list of a list control to XForms
void exportXFormsSubmissionAttributes()
exports the attribute(s) for an XForms submission
CCAFlags m_nIncludeCommon
void getSequenceInt16PropertyAsSet(const OUString &_rPropertyName, Int16Set &_rOut)
gets a Sequence< sal_Int16 > property value as set of sal_Int16's
virtual void exportAttributes() override
export the attributes
void exportListSourceAsAttribute()
exports the ListSource property of a control as attribute
virtual const char * getXMLElementName() const override
get the name of the XML element
void exportSubTags() override
writes everything which needs to be represented as sub tag
void exportDatabaseAttributes()
adds database attributes to the XMLExport context given
void exportCommonControlAttributes()
adds common control attributes to the XMLExport context given
OControlExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxControl, OUString _sControlId, OUString _sReferringControls, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rxEvents)
constructs an object capable of exporting controls
bool controlHasUserSuppliedListEntries() const
determines whether the list entries (of a combo or list box) are supplied by the user
void exportBindingAttributes()
adds the XML attributes which are related to binding controls to external values and/or list sources
void exportListSourceAsElements()
exports the ListSource property of a control as XML elements
virtual void examine() override
examine the control.
void exportCellListSourceRange()
exports the attribute which descrives a cell range which acts as list source for a list-like control
void exportInnerAttributes()
exports the attributes for the inner element
virtual const char * getOuterXMLElementName() const
get the name of the outer XML element
void exportImagePositionAttributes()
exports the attribute(s) for the ImagePosition property
void exportGenericHandlerAttributes()
adds the attributes which are handled via generic IPropertyHandlers
void exportSpecialAttributes()
adds attributes which are special to a control type to the export context's attribute list
OUString getScalarListSourceValue() const
retrieves the string specifying the ListSource of a list or combo box
virtual ~OElementExport()
virtual void implEndElement()
ends the XML element
virtual void exportSubTags()
export any sub tags
void exportEvents()
exports the events (as script:events tag)
OElementExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxProps, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents)
virtual void implStartElement(const char *_pName)
start the XML element
virtual void exportAttributes()
export the attributes
virtual const char * getXMLElementName() const =0
get the name of the XML element
std::unique_ptr< SvXMLElementExport > m_pXMLElement
virtual void examine()
examine the element we're exporting
css::uno::Sequence< css::script::ScriptEventDescriptor > m_aEvents
virtual void exportServiceNameAttribute()
add the service-name attribute to the export context
helper class wrapping different script event representations
provides export related tools for attribute handling
void exportStringSequenceAttribute(const sal_uInt16 _nAttributeNamespaceKey, const OUString &_pAttributeName, const OUString &_rPropertyName)
exports a property value, which is a string sequence, as attribute
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
IFormsExportContext & m_rContext
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
void exportedProperty(const OUString &_rPropertyName)
indicates that a property has been handled by a derived class, without using the helper methods of th...
bool shouldExportProperty(const OUString &i_propertyName) const
determines whether the given property is to be exported
void flagStyleProperties()
flag the style properties as 'already exported'
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
void exportImageDataAttribute()
add the form:image attribute to the export context.
const css::uno::Reference< css::beans::XPropertySet > m_xProps
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
void exportGenericPropertyAttribute(const sal_uInt16 _nAttributeNamespaceKey, const OUString &_pAttributeName, const OUString &_pPropertyName)
add an arbitrary attribute extracted from an arbitrary property to the export context
void exportRemainingProperties()
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
const css::uno::Reference< css::beans::XPropertySetInfo > m_xPropertyInfo
void AddAttribute(sal_uInt16 _nPrefix, const OUString &_rName, const OUString &_rValue)
void exportTargetLocationAttribute(bool _bAddType)
add the form:href attribute to the export context.
void exportTargetFrameAttribute()
add the hlink:target-frame attribute to the export context.
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
#define RESET_BIT(bitfield, bit)
#define CHECK_N_TRANSLATE(persistentComponent, serviceName)
const EnumerationType m_eType
tools::SvRef< SvBaseLink > xSink
#define SAL_WARN(area, stream)
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
@ XML_CONNECTION_RESOURCE
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
constexpr OUStringLiteral PROPERTY_SPIN_INCREMENT
constexpr OUStringLiteral SERVICE_GRID
constexpr OUStringLiteral PROPERTY_INPUT_REQUIRED
constexpr OUStringLiteral PROPERTY_COLUMNSERVICENAME
constexpr OUStringLiteral PROPERTY_CYCLE
constexpr OUStringLiteral PROPERTY_BUTTONTYPE
constexpr OUStringLiteral PROPERTY_BLOCK_INCREMENT
const SvXMLEnumMapEntry< TriState > aCheckStateMap[]
constexpr OUStringLiteral PROPERTY_DEFAULT_STATE
constexpr OUStringLiteral PROPERTY_ALLOWUPDATES
constexpr OUStringLiteral SERVICE_IMAGEBUTTON
constexpr OUStringLiteral SERVICE_EDIT
constexpr OUStringLiteral PROPERTY_ECHOCHAR
constexpr OUStringLiteral SERVICE_FORM
constexpr OUStringLiteral PROPERTY_ECHO_CHAR
const SvXMLEnumMapEntry< NavigationBarMode > aNavigationTypeMap[]
constexpr OUStringLiteral PROPERTY_SELECT_SEQ
constexpr OUStringLiteral PROPERTY_LINECOUNT
constexpr OUStringLiteral SERVICE_NUMERICFIELD
constexpr OUStringLiteral PROPERTY_STRICTFORMAT
constexpr OUStringLiteral PROPERTY_ALLOWDELETES
constexpr OUStringLiteral PROPERTY_DETAILFIELDS
constexpr OUStringLiteral PROPERTY_ENABLED
constexpr OUStringLiteral SERVICE_RADIOBUTTON
const SvXMLEnumMapEntry< sal_Int16 > aVisualEffectMap[]
constexpr OUStringLiteral PROPERTY_ENABLEVISIBLE
constexpr OUStringLiteral SERVICE_TIMEFIELD
const SvXMLEnumMapEntry< sal_Int32 > aOrientationMap[]
constexpr OUStringLiteral PROPERTY_ESCAPEPROCESSING
constexpr OUStringLiteral PROPERTY_CLASSID
const SvXMLEnumMapEntry< FormSubmitMethod > aSubmitMethodMap[]
constexpr OUStringLiteral SERVICE_COMMANDBUTTON
constexpr OUStringLiteral PROPERTY_COMMAND_TYPE
FormAttributes
attributes in the xml tag representing a form
constexpr OUStringLiteral PROPERTY_VALUE_SEQ
constexpr OUStringLiteral PROPERTY_TRISTATE
constexpr OUStringLiteral PROPERTY_TITLE
constexpr OUStringLiteral PROPERTY_DEFAULTBUTTON
constexpr OUStringLiteral PROPERTY_ALLOWINSERTS
constexpr OUStringLiteral PROPERTY_LINE_INCREMENT
constexpr OUStringLiteral PROPERTY_COMMAND
constexpr OUStringLiteral PROPERTY_URL
constexpr OUStringLiteral PROPERTY_DATAFIELD
constexpr OUStringLiteral PROPERTY_STATE
const SvXMLEnumMapEntry< ListSourceType > aListSourceTypeMap[]
constexpr OUStringLiteral SERVICE_FILECONTROL
constexpr OUStringLiteral PROPERTY_MULTISELECTION
const SvXMLEnumMapEntry< FormButtonType > aFormButtonTypeMap[]
constexpr OUStringLiteral SERVICE_HIDDENCONTROL
constexpr OUStringLiteral PROPERTY_DEFAULT_SELECT_SEQ
constexpr OUStringLiteral SERVICE_PATTERNFIELD
constexpr OUStringLiteral PROPERTY_NAME
constexpr OUStringLiteral PROPERTY_LABEL
constexpr OUStringLiteral PROPERTY_PRINTABLE
constexpr OUStringLiteral PROPERTY_REPEAT_DELAY
constexpr OUStringLiteral PROPERTY_IGNORERESULT
constexpr OUStringLiteral PROPERTY_CONTROLLABEL
constexpr OUStringLiteral PROPERTY_READONLY
constexpr OUStringLiteral SERVICE_IMAGECONTROL
const SvXMLEnumMapEntry< FormSubmitEncoding > aSubmitEncodingMap[]
constexpr OUStringLiteral PROPERTY_ORIENTATION
constexpr OUStringLiteral PROPERTY_MAXTEXTLENGTH
constexpr OUStringLiteral PROPERTY_RICH_TEXT
constexpr OUStringLiteral SERVICE_FORMATTEDFIELD
constexpr OUStringLiteral SERVICE_COMBOBOX
const SvXMLEnumMapEntry< sal_Int32 > aCommandTypeMap[]
constexpr OUStringLiteral PROPERTY_LISTSOURCE
constexpr OUStringLiteral PROPERTY_TABSTOP
constexpr OUStringLiteral SERVICE_FIXEDTEXT
constexpr OUStringLiteral PROPERTY_SUBMIT_ENCODING
constexpr OUStringLiteral PROPERTY_VISUAL_EFFECT
constexpr OUStringLiteral PROPERTY_IMAGE_ALIGN
constexpr OUStringLiteral SERVICE_LISTBOX
constexpr OUStringLiteral PROPERTY_DROPDOWN
const SvXMLEnumMapEntry< sal_Int16 > aListLinkageMap[]
constexpr OUStringLiteral SERVICE_DATEFIELD
constexpr OUStringLiteral PROPERTY_ORDER
constexpr OUStringLiteral PROPERTY_SUBMIT_METHOD
constexpr OUStringLiteral PROPERTY_EMPTY_IS_NULL
constexpr OUStringLiteral PROPERTY_FOCUS_ON_CLICK
constexpr OUStringLiteral PROPERTY_STRING_ITEM_LIST
constexpr OUStringLiteral PROPERTY_APPLYFILTER
constexpr OUStringLiteral PROPERTY_MASTERFIELDS
constexpr OUStringLiteral PROPERTY_TOGGLE
const SvXMLEnumMapEntry< TabulatorCycle > aTabulatorCycleMap[]
constexpr OUStringLiteral PROPERTY_MULTILINE
constexpr OUStringLiteral PROPERTY_TABINDEX
constexpr OUStringLiteral PROPERTY_NAVIGATION
constexpr OUStringLiteral PROPERTY_FILTER
constexpr OUStringLiteral PROPERTY_BOUNDCOLUMN
constexpr OUStringLiteral PROPERTY_DATASOURCENAME
constexpr OUStringLiteral PROPERTY_PERSISTENCE_MAXTEXTLENGTH
constexpr OUStringLiteral SERVICE_CHECKBOX
constexpr OUStringLiteral PROPERTY_AUTOCOMPLETE
constexpr OUStringLiteral SERVICE_GROUPBOX
constexpr OUStringLiteral PROPERTY_LISTSOURCETYPE
constexpr OUStringLiteral PROPERTY_IMAGE_POSITION
constexpr OUStringLiteral PROPERTY_FORMATKEY
constexpr OUStringLiteral SERVICE_CURRENCYFIELD
constexpr OUStringLiteral PROPERTY_GROUP_NAME
#define DBG_CHECK_PROPERTY_NO_TYPE(name)
#define DBG_CHECK_PROPERTY(name, type)
#define SERVICE_PERSISTENT_COMPONENT_GROUPBOX
#define SERVICE_PERSISTENT_COMPONENT_COMBOBOX
#define SERVICE_PERSISTENT_COMPONENT_CURRENCYFIELD
#define SERVICE_PERSISTENT_COMPONENT_FILECONTROL
#define SERVICE_PERSISTENT_COMPONENT_GRID
#define SERVICE_PERSISTENT_COMPONENT_LISTBOX
#define SERVICE_PERSISTENT_COMPONENT_FORM
#define SERVICE_PERSISTENT_COMPONENT_FORMATTEDFIELD
#define SERVICE_PERSISTENT_COMPONENT_TIMEFIELD
#define SERVICE_PERSISTENT_COMPONENT_DATEFIELD
#define SERVICE_PERSISTENT_COMPONENT_HIDDENCONTROL
#define SERVICE_PERSISTENT_COMPONENT_EDIT
#define SERVICE_PERSISTENT_COMPONENT_FIXEDTEXT
#define SERVICE_PERSISTENT_COMPONENT_IMAGEBUTTON
#define SERVICE_PERSISTENT_COMPONENT_CHECKBOX
#define SERVICE_PERSISTENT_COMPONENT_RADIOBUTTON
#define SERVICE_PERSISTENT_COMPONENT_NUMERICFIELD
#define SERVICE_PERSISTENT_COMPONENT_IMAGECONTROL
#define SERVICE_PERSISTENT_COMPONENT_COMMANDBUTTON
#define SERVICE_PERSISTENT_COMPONENT_PATTERNFIELD
Represents a property with its API-name, its XML-name and the type of its value.
const OUString & getApiName() const
::xmloff::token::XMLTokenEnum attributeToken
sal_uInt16 namespacePrefix
const PropertyId propertyId
the unique ID of the property. The property meta data table must not contain two entries with the sam...
const AttributeDescription attribute
const PropertyHandlerFactory factory
denotes the attribute which represents the property.
constexpr sal_uInt16 XML_NAMESPACE_FORM
constexpr sal_uInt16 XML_NAMESPACE_XFORMS
constexpr sal_uInt16 XML_NAMESPACE_OOO