14#include <unordered_map>
16#include <com/sun/star/beans/PropertyValue.hpp>
17#include <com/sun/star/text/XTextRange.hpp>
18#include <com/sun/star/uno/Sequence.hxx>
19#include <com/sun/star/xml/dom/XDocument.hpp>
21#include <rtl/ustrbuf.hxx>
28class XComponentContext;
39class DomainMapper_Impl;
98 std::unordered_map<OUString, css::uno::Reference<css::xml::dom::XDocument>>
m_xPropertiesXMLs;
118 css::uno::Reference<css::awt::XControlModel>
const& xControlModel,
119 const css::uno::Sequence<css::beans::PropertyValue>& rGrabBag);
149 css::uno::Reference<css::uno::XComponentContext> xContext);
223 void SetColor(
const OUString& rColor);
229 void SetAlias(
const OUString& rAlias);
232 void SetTag(
const OUString& rTag);
233 const OUString&
GetTag()
const;
235 void SetId(sal_Int32 nId);
236 sal_Int32
GetId()
const;
241 void SetLock(
const OUString& rLock);
242 const OUString&
GetLock()
const;
Helper to create form controls from w:sdt tokens.
void SetAlias(const OUString &rAlias)
OUStringBuffer m_sDate
Date ISO string contained in the w:date element, used by the date control.
OUString m_sDataBindingPrefixMapping
<w:dataBinding w:prefixMappings="">
void SetSdtType(sal_uInt32 nSdtType)
const OUString & GetColor() const
void setDateFieldStartRange(const css::uno::Reference< css::text::XTextRange > &xStartRange)
sal_uInt32 GetSdtType() const
void setDataBindingPrefixMapping(const OUString &sValue)
void SetCheckedState(const OUString &rCheckedState)
const OUString & GetDataBindingXPath() const
OUStringBuffer & getDate()
std::optional< OUString > getValueFromDataBinding()
OUStringBuffer & getLocale()
void setOutsideAParagraph(bool bOutsideAParagraph)
void SetTabIndex(sal_uInt32 nTabIndex)
bool m_bShowingPlcHdr
Current contents are placeholder text.
const OUString & GetCheckedState() const
std::unordered_map< OUString, css::uno::Reference< css::xml::dom::XDocument > > m_xPropertiesXMLs
Storage for all properties documents as xml::dom::XDocument for later querying xpath for data.
sal_uInt32 m_nTabIndex
<w:sdtPr>'s <w:tabIndex w:val="...">.
void SetAppearance(const OUString &rAppearance)
void SetColor(const OUString &rColor)
std::vector< OUString > m_aDropDownDisplayTexts
Display texts of a drop-down control: <w:listItem w:displayText="...">.
const OUString & GetPlaceholderDocPart() const
OUString m_aPlaceholderDocPart
<w:placeholder>'s <w:docPart w:val="...">.
bool containedInInteropGrabBag(const OUString &rValueName)
OUString m_aAlias
<w:sdtPr>'s <w:alias w:val="...">.
std::vector< OUString > & getDropDownDisplayTexts()
std::vector< css::beans::PropertyValue > m_aGrabBag
Grab bag to store unsupported SDTs, aiming to save them back on export.
OUStringBuffer m_sDateFormat
Date format string as it comes from the ooxml document.
std::vector< OUString > m_aDropDownItems
Items of the drop-down control: <w:listItem w:value="...">.
const OUString & GetLock() const
OUString m_aColor
<w:sdtPr>'s <w15:color w:val="...">.
OUStringBuffer m_aSdtTexts
Pieces of the default text – currently used only by the dropdown control.
bool isOutsideAParagraph() const
void appendToInteropGrabBag(const css::beans::PropertyValue &rValue)
void setDataBindingStoreItemID(const OUString &sValue)
bool hasElements() const
If createControlShape() was ever called.
const OUString & GetUncheckedState() const
void createDateContentControl()
Create date control from w:sdt's w:date.
bool m_bChecked
If this is a checkbox, is the checkbox checked?
void createControlShape(css::awt::Size aSize, css::uno::Reference< css::awt::XControlModel > const &xControlModel, const css::uno::Sequence< css::beans::PropertyValue > &rGrabBag)
Create and append the drawing::XControlShape, containing the various models.
void createPlainTextControl()
void SetPlaceholderDocPart(const OUString &rPlaceholderDocPart)
bool m_bPropertiesXMLsLoaded
Check if m_xPropertiesXMLs is initialized and loaded (need extra flag to distinguish empty sequence f...
sal_Int32 getInteropGrabBagSize() const
css::uno::Sequence< css::beans::PropertyValue > getInteropGrabBagAndClear()
void SetTag(const OUString &rTag)
OUStringBuffer m_sLocale
Locale string as it comes from the ooxml document.
SdtHelper(DomainMapper_Impl &rDM_Impl, css::uno::Reference< css::uno::XComponentContext > xContext)
void setControlType(SdtControlType aType)
OUString m_sDataBindingStoreItemID
<w:dataBinding w:storeItemID="">
OUString m_aLock
<w:sdtPr>'s <w:lock w:val="...">.
OUStringBuffer & getSdtTexts()
OUString m_sDataBindingXPath
<w:dataBinding w:xpath="">
void setDataBindingXPath(const OUString &sValue)
void loadPropertiesXMLs()
OUStringBuffer & getDateFormat()
bool m_bOutsideAParagraph
The last stored SDT element is outside paragraphs.
bool GetShowingPlcHdr() const
void clear()
Clear all collected attributes for further reuse.
SdtControlType m_aControlType
Type of sdt control.
const OUString & GetAlias() const
void SetId(sal_Int32 nId)
DomainMapper_Impl & m_rDM_Impl
const OUString & GetTag() const
bool isInteropGrabBagEmpty() const
OUString m_aCheckedState
If this is a checkbox, the value of a checked checkbox.
css::uno::Reference< css::text::XTextRange > m_xDateFieldStartRange
Start range of the date field.
SdtControlType getControlType()
void SetUncheckedState(const OUString &rUncheckedState)
sal_Int32 m_nId
<w:sdtPr>'s <w:id w:val="...">.
OUString m_aTag
<w:sdtPr>'s <w:tag w:val="...">.
std::vector< OUString > & getDropDownItems()
const OUString & GetAppearance() const
OUString m_aUncheckedState
If this is a checkbox, the value of an unchecked checkbox.
const OUString & GetDataBindingStoreItemID() const
void SetLock(const OUString &rLock)
OUString m_aAppearance
<w:sdtPr>'s <w15:appearance w:val="...">.
sal_uInt32 GetTabIndex() const
void createDropDownControl()
Create drop-down control from w:sdt's w:dropDownList.
const OUString & GetDataBindingPrefixMapping() const
css::uno::Reference< css::uno::XComponentContext > m_xComponentContext