25#include <com/sun/star/container/XNameContainer.hpp>
26#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
54 &style.
_descr,
"FontDescriptor" );
65 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
82 Any aDecorationAny(
_xProps->getPropertyValue(
"Decoration" ) );
83 bool bDecoration =
true;
84 if ( (aDecorationAny >>= bDecoration) && !bDecoration )
88 uno::Reference< container::XNameContainer > xPagesContainer(
_xProps, uno::UNO_QUERY );
89 if ( xPagesContainer.is() && xPagesContainer->getElementNames().hasElements() )
92 pElem->readBullitinBoard( all_styles );
100 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
117 if (
readProp(
"Label" ) >>= aTitle)
123 uno::Reference< container::XNameContainer > xControlContainer(
_xProps, uno::UNO_QUERY );
124 if ( xControlContainer.is() && xControlContainer->getElementNames().hasElements() )
127 pElem->readBullitinBoard( all_styles );
136 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
153 uno::Reference< container::XNameContainer > xControlContainer(
_xProps, uno::UNO_QUERY );
154 if ( xControlContainer.is() && xControlContainer->getElementNames().hasElements() )
157 pElem->readBullitinBoard( all_styles );
166 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
192 if (extract_throw<bool>(
_xProps->getPropertyValue(
"Repeat" ) ))
195 if (extract_throw<bool>(
_xProps->getPropertyValue(
"Toggle" ) ))
214 OSL_FAIL(
"### unexpected radio state!" );
225 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
251 bool bTriState =
false;
252 if ((
readProp(
"TriState" ) >>= bTriState) && bTriState)
268 OSL_ENSURE( bTriState,
"### detected tristate value, but TriState is not set!" );
271 OSL_FAIL(
"### unexpected checkbox state!" );
281 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
313 Sequence< OUString > itemValues;
314 if ((
readProp(
"StringItemList" ) >>= itemValues) && itemValues.hasElements())
318 for (
const auto& rItemValue : std::as_const(itemValues) )
322 popup->addSubElement( item );
333 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
360 Sequence< OUString > itemValues;
361 if ((
readProp(
"StringItemList" ) >>= itemValues) && itemValues.hasElements())
365 for (
const auto& rItemValue : std::as_const(itemValues) )
369 popup->addSubElement( item );
372 Sequence< sal_Int16 > selected;
373 if (
readProp(
"SelectedItems" ) >>= selected)
375 sal_Int16
const * pSelected = selected.getConstArray();
376 for ( sal_Int32
nPos = selected.getLength();
nPos--; )
379 popup->getSubElement( pSelected[
nPos ] ).get() );
392 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
431 OSL_FAIL(
"### unexpected radio state!" );
442 Style aStyle( 0x2 | 0x8 | 0x20 );
471 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
501 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
532 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
563 if (
readProp(
"EchoChar" ) >>= nEcho)
575 Style aStyle( 0x1 | 0x4 );
597 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
625 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
652 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
684 if (extract_throw<bool>(
_xProps->getPropertyValue(
"Repeat" ) ))
694 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
724 if (extract_throw<bool>(
_xProps->getPropertyValue(
"Repeat" ) ))
735 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
766 if (extract_throw<bool>(
_xProps->getPropertyValue(
"Repeat" ) ))
775 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
802 if (extract_throw<bool>(
_xProps->getPropertyValue(
"Repeat" ) ))
812 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
844 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
870 if (extract_throw<bool>(
_xProps->getPropertyValue(
"Repeat" ) ))
874 switch (
a.getValueTypeClass())
876 case TypeClass_DOUBLE:
879 case TypeClass_STRING:
891 if (
readProp(
"FormatKey" ) >>= nKey)
893 Reference< util::XNumberFormatsSupplier > xSupplier;
894 if (
readProp(
"FormatsSupplier" ) >>= xSupplier)
897 xSupplier->getNumberFormats()->getByKey( nKey ) );
909 Style aStyle( 0x1 | 0x4 );
937 Style aStyle( 0x2 | 0x8 | 0x20 );
959 Style aStyle( 0x1 | 0x4 | 0x10 );
982 Style aStyle( 0x1 | 0x4 );
1012 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
1020 aStyle.
_set |= 0x20;
1052 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
1058 aStyle.
_set |= 0x20;
1074 Any aDecorationAny(
_xProps->getPropertyValue(
"Decoration" ) );
1075 bool bDecoration =
false;
1076 if ( (aDecorationAny >>= bDecoration) && !bDecoration )
1085 ::std::vector< rtl::Reference<ElementDescriptor> > all_elements;
1087 Reference< container::XNameContainer > xDialogModel(
_xProps, UNO_QUERY );
1088 if ( !xDialogModel.is() )
1090 const Sequence< OUString > aElements( xDialogModel->getElementNames() );
1094 for (
const auto& rElement : aElements )
1096 Any aControlModel( xDialogModel->getByName( rElement ) );
1097 Reference< beans::XPropertySet > xProps;
1098 OSL_VERIFY( aControlModel >>= xProps );
1101 Reference< beans::XPropertyState > xPropState( xProps, UNO_QUERY );
1102 OSL_ENSURE( xPropState.is(),
"no XPropertyState!" );
1103 if (! xPropState.is())
1105 Reference< lang::XServiceInfo > xServiceInfo( xProps, UNO_QUERY );
1106 OSL_ENSURE( xServiceInfo.is(),
"no XServiceInfo!" );
1107 if (! xServiceInfo.is())
1113 if ( xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlRadioButtonModel" ) )
1118 all_elements.push_back( pRadioGroup );
1122 pElem->readRadioButtonModel( all_styles );
1123 pRadioGroup->addSubElement( pElem );
1127 pRadioGroup =
nullptr;
1129 if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlButtonModel" ) )
1132 pElem->readButtonModel( all_styles );
1134 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlCheckBoxModel" ) )
1137 pElem->readCheckBoxModel( all_styles );
1139 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlComboBoxModel" ) )
1142 pElem->readComboBoxModel( all_styles );
1144 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlListBoxModel" ) )
1147 pElem->readListBoxModel( all_styles );
1149 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlGroupBoxModel" ) )
1152 pElem->readGroupBoxModel( all_styles );
1154 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoMultiPageModel" ) )
1157 pElem->readMultiPageModel( all_styles );
1159 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoFrameModel" ) )
1162 pElem->readFrameModel( all_styles );
1164 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoPageModel" ) )
1167 pElem->readPageModel( all_styles );
1169 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlFixedTextModel" ) )
1172 pElem->readFixedTextModel( all_styles );
1174 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlEditModel" ) )
1177 pElem->readEditModel( all_styles );
1180 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlFixedHyperlinkModel" ) )
1183 pElem->readFixedHyperLinkModel( all_styles );
1185 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlImageControlModel" ) )
1188 pElem->readImageControlModel( all_styles );
1190 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlFileControlModel" ) )
1193 pElem->readFileControlModel( all_styles );
1195 else if (xServiceInfo->supportsService(
"com.sun.star.awt.tree.TreeControlModel" ) )
1198 pElem->readTreeControlModel( all_styles );
1200 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlCurrencyFieldModel" ) )
1203 pElem->readCurrencyFieldModel( all_styles );
1205 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlDateFieldModel" ) )
1208 pElem->readDateFieldModel( all_styles );
1210 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlNumericFieldModel" ) )
1213 pElem->readNumericFieldModel( all_styles );
1215 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlTimeFieldModel" ) )
1218 pElem->readTimeFieldModel( all_styles );
1220 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlPatternFieldModel" ) )
1223 pElem->readPatternFieldModel( all_styles );
1225 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlFormattedFieldModel" ) )
1228 pElem->readFormattedFieldModel( all_styles );
1230 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlFixedLineModel" ) )
1233 pElem->readFixedLineModel( all_styles );
1235 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlScrollBarModel" ) )
1238 pElem->readScrollBarModel( all_styles );
1240 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlSpinButtonModel" ) )
1243 pElem->readSpinButtonModel( all_styles );
1245 else if (xServiceInfo->supportsService(
"com.sun.star.awt.UnoControlProgressBarModel" ) )
1248 pElem->readProgressBarModel( all_styles );
1250 else if (xServiceInfo->supportsService(
"com.sun.star.awt.grid.UnoControlGridModel" ) )
1253 pElem->readGridControlModel( all_styles );
1258 all_elements.push_back( pElem );
1262 OSL_FAIL(
"unknown control type!" );
void readBoolAttr(OUString const &rPropName, OUString const &rAttrName)
void readFrameModel(StyleBag *all_styles)
css::uno::Reference< css::beans::XPropertyState > _xPropState
void readTimeAttr(OUString const &rPropName, OUString const &rAttrName)
void readLongAttr(OUString const &rPropName, OUString const &rAttrName, bool forceAttribute=false)
void readBullitinBoard(StyleBag *all_styles)
void readImageControlModel(StyleBag *all_styles)
void readFixedHyperLinkModel(StyleBag *all_styles)
void readGridControlModel(StyleBag *all_styles)
void readDateAttr(OUString const &rPropName, OUString const &rAttrName)
void readImageOrGraphicAttr(OUString const &rAttrName)
void readDataAwareAttr(OUString const &rAttrName)
void readCheckBoxModel(StyleBag *all_styles)
void readDialogModel(StyleBag *all_styles)
void readDateFormatAttr(OUString const &rPropName, OUString const &rAttrName)
void readFileControlModel(StyleBag *all_styles)
void readListBoxModel(StyleBag *all_styles)
void readScrollBarModel(StyleBag *all_styles)
void readImageAlignAttr(OUString const &rPropName, OUString const &rAttrName)
void readAlignAttr(OUString const &rPropName, OUString const &rAttrName)
void readFormattedFieldModel(StyleBag *all_styles)
void readDateFieldModel(StyleBag *all_styles)
void readRadioButtonModel(StyleBag *all_styles)
void readDoubleAttr(OUString const &rPropName, OUString const &rAttrName)
void readShortAttr(OUString const &rPropName, OUString const &rAttrName)
void readMultiPageModel(StyleBag *all_styles)
void readPageModel(StyleBag *all_styles)
void readSpinButtonModel(StyleBag *all_styles)
css::uno::Reference< css::frame::XModel > _xDocument
void readCurrencyFieldModel(StyleBag *all_styles)
void readSelectionTypeAttr(OUString const &rPropName, OUString const &rAttrName)
void readStringAttr(OUString const &rPropName, OUString const &rAttrName)
void readLineEndFormatAttr(OUString const &rPropName, OUString const &rAttrName)
void readProgressBarModel(StyleBag *all_styles)
void readTimeFormatAttr(OUString const &rPropName, OUString const &rAttrName)
void readVerticalAlignAttr(OUString const &rPropName, OUString const &rAttrName)
void addNumberFormatAttr(css::uno::Reference< css::beans::XPropertySet > const &xFormatProperties)
void readButtonTypeAttr(OUString const &rPropName, OUString const &rAttrName)
void readEditModel(StyleBag *all_styles)
void readTreeControlModel(StyleBag *all_styles)
void readTimeFieldModel(StyleBag *all_styles)
void readDefaults(bool supportPrintable=true, bool supportVisible=true)
css::uno::Reference< css::beans::XPropertySet > _xProps
void readPatternFieldModel(StyleBag *all_styles)
void readFixedTextModel(StyleBag *all_styles)
void readNumericFieldModel(StyleBag *all_styles)
void readHexLongAttr(OUString const &rPropName, OUString const &rAttrName)
void readScrollableSettings()
void readButtonModel(StyleBag *all_styles)
ElementDescriptor(css::uno::Reference< css::beans::XPropertySet > xProps, css::uno::Reference< css::beans::XPropertyState > xPropState, OUString const &name, css::uno::Reference< css::frame::XModel > xDocument)
void readOrientationAttr(OUString const &rPropName, OUString const &rAttrName)
bool readProp(T *ret, OUString const &rPropName)
void readFixedLineModel(StyleBag *all_styles)
void readImagePositionAttr(OUString const &rPropName, OUString const &rAttrName)
void readComboBoxModel(StyleBag *all_styles)
void readGroupBoxModel(StyleBag *all_styles)
void readImageScaleModeAttr(OUString const &rPropName, OUString const &rAttrName)
OUString getStyleId(Style const &rStyle)
void addAttribute(OUString const &rAttrName, OUString const &rValue)
Adds an attribute to elements.
void addSubElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xElem)
Adds a sub element of element.
const sal_Int16 BORDER_SIMPLE
static bool readBorderProps(ElementDescriptor *element, Style &style)
const sal_Int16 BORDER_SIMPLE_COLOR
static bool readFontProps(ElementDescriptor *element, Style &style)
css::awt::FontDescriptor _descr
sal_uInt16 _fontEmphasisMark
sal_uInt32 _textLineColor
sal_uInt32 _backgroundColor
#define XMLNS_SCRIPT_PREFIX
#define XMLNS_DIALOGS_PREFIX
constexpr OUStringLiteral XMLNS_DIALOGS_URI
constexpr OUStringLiteral XMLNS_SCRIPT_URI