22#include <com/sun/star/text/XTextContent.hpp>
23#include <com/sun/star/beans/PropertyValue.hpp>
80 void NotifyChangeTextNode(
SwTextNode* pTextNode);
83 const std::shared_ptr<SwContentControl>&
GetContentControl()
const {
return m_pContentControl; }
99 const OUString& ToString()
const;
103 static void ItemsToAny(
const std::vector<SwContentControlListItem>& rItems,
104 css::uno::Any& rVal);
106 static std::vector<SwContentControlListItem> ItemsFromAny(
const css::uno::Any& rVal);
120 bool m_bShowingPlaceHolder =
false;
123 bool m_bCheckbox =
false;
126 bool m_bChecked =
false;
136 bool m_bPicture =
false;
138 bool m_bDate =
false;
150 bool m_bPlainText =
false;
153 bool m_bComboBox =
false;
156 bool m_bDropDown =
false;
186 sal_uInt32 m_nTabIndex = 0;
203 bool m_bReadWrite =
false;
214 void NotifyChangeTextNode(
SwTextNode* pTextNode);
218 return m_wXContentControl;
231 m_bShowingPlaceHolder = bShowingPlaceHolder;
244 void SetCheckedState(
const OUString& rCheckedState) { m_aCheckedState = rCheckedState; }
248 void SetUncheckedState(
const OUString& rUncheckedState) { m_aUncheckedState = rUncheckedState; }
252 const std::vector<SwContentControlListItem>&
GetListItems()
const {
return m_aListItems; }
254 void SetListItems(
const std::vector<SwContentControlListItem>& rListItems)
256 m_aListItems = rListItems;
259 bool AddListItem(
size_t nZIndex,
const OUString& rDisplayText,
const OUString& rValue);
260 void DeleteListItem(
size_t nZIndex);
261 void ClearListItems();
271 void SetDateFormat(
const OUString& rDateFormat) { m_aDateFormat = rDateFormat; }
275 void SetDateLanguage(
const OUString& rDateLanguage) { m_aDateLanguage = rDateLanguage; }
279 void SetCurrentDate(
const OUString& rCurrentDate) { m_aCurrentDate = rCurrentDate; }
284 void SetCurrentDateValue(
double fCurrentDate);
287 double GetCurrentDateValue()
const;
306 m_aPlaceholderDocPart = rPlaceholderDocPart;
313 m_oSelectedListItem = oSelectedListItem;
320 std::optional<size_t> GetSelectedListItem(
bool bCheckDocModel)
const;
322 void SetSelectedDate(std::optional<double> oSelectedDate) { m_oSelectedDate = oSelectedDate; }
336 m_aDataBindingPrefixMappings = rDataBindingPrefixMappings;
343 m_aDataBindingXpath = rDataBindingXpath;
350 m_aDataBindingStoreItemID = rDataBindingStoreItemID;
359 void SetAppearance(
const OUString& rAppearance) { m_aAppearance = rAppearance; }
363 void SetAlias(
const OUString& rAlias) { m_aAlias = rAlias; }
365 const OUString&
GetAlias()
const {
return m_aAlias; }
367 void SetTag(
const OUString& rTag) { m_aTag = rTag; }
369 const OUString&
GetTag()
const {
return m_aTag; }
373 sal_Int32
GetId()
const {
return m_nId; }
375 void SetTabIndex(sal_uInt32 nTabIndex) { m_nTabIndex = nTabIndex; }
380 void SetLock(
bool bLockContent,
bool bLockControl);
381 void SetLock(
const OUString& rLock) { m_aLock = rLock; }
384 std::optional<bool> GetLock(
bool bControl)
const;
385 const OUString&
GetLock()
const {
return m_aLock; }
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
Represents one list item in a content control dropdown list.
OUString m_aValue
This must not be empty.
OUString m_aDisplayText
This may be empty, ToString() falls back to m_aValue.
Stores the properties of a content control.
void SetSelectedDate(std::optional< double > oSelectedDate)
OUString m_aCheckedState
If m_bCheckbox is true, the value of a checked checkbox.
void SetShowingPlaceHolder(bool bShowingPlaceHolder)
OUString m_aDataBindingXpath
The data bindings's XPath: just remembered.
const OUString & GetCurrentDate() const
void SetPicture(bool bPicture)
void SetPlaceholderDocPart(const OUString &rPlaceholderDocPart)
void SetDataBindingXpath(const OUString &rDataBindingXpath)
const OUString & GetDateFormat() const
const OUString & GetDateLanguage() const
bool GetReadWrite() const
const OUString & GetLock() const
SwFormatContentControl * m_pFormat
SwFormatContentControl * GetFormatContentControl() const
OUString m_aAppearance
The appearance: just remembered.
unotools::WeakReference< SwXContentControl > m_wXContentControl
OUString m_aDateLanguage
If m_bDate is true, the date's BCP 47 language tag.
void SetCurrentDate(const OUString &rCurrentDate)
const OUString & GetAppearance() const
void SetReadWrite(bool bReadWrite)
void SetDateFormat(const OUString &rDateFormat)
const OUString & GetDataBindingStoreItemID() const
void SetDataBindingPrefixMappings(const OUString &rDataBindingPrefixMappings)
void SetAlias(const OUString &rAlias)
const OUString & GetDataBindingXpath() const
sal_uInt32 GetTabIndex() const
void SetCheckedState(const OUString &rCheckedState)
void SetListItems(const std::vector< SwContentControlListItem > &rListItems)
const OUString & GetCheckedState() const
std::optional< size_t > m_oSelectedListItem
Stores a list item index, in case the doc model is not yet updated.
void SetPlainText(bool bPlainText)
void SetFormatContentControl(SwFormatContentControl *pFormat)
OUString m_aDataBindingPrefixMappings
The data bindings's prefix mappings: just remembered.
const std::vector< SwContentControlListItem > & GetListItems() const
void SetTag(const OUString &rTag)
void SetAppearance(const OUString &rAppearance)
const std::optional< size_t > & GetSelectedListItem() const
void SetDateLanguage(const OUString &rDateLanguage)
OUString m_aLock
The control and content locks: mostly just remembered.
const std::optional< double > & GetSelectedDate() const
void SetComboBox(bool bComboBox)
void SetChecked(bool bChecked)
void SetColor(const OUString &rColor)
OUString m_aDateFormat
If m_bDate is true, the date format in a syntax accepted by SvNumberFormatter::PutEntry().
OUString m_aTag
The tag: just remembered.
std::optional< double > m_oSelectedDate
Stores a date timestamp, in case the doc model is not yet updated.
void SetUncheckedState(const OUString &rUncheckedState)
void SetDataBindingStoreItemID(const OUString &rDataBindingStoreItemID)
void SetDropDown(bool bDropDown)
bool GetPlainText() const
OUString m_aAlias
The alias: just remembered.
SwTextNode * m_pTextNode
Can be nullptr if not in a document for undo purposes.
const unotools::WeakReference< SwXContentControl > & GetXContentControl() const
const OUString & GetDataBindingPrefixMappings() const
std::vector< SwContentControlListItem > m_aListItems
OUString m_aUncheckedState
If m_bCheckbox is true, the value of an unchecked checkbox.
OUString m_aCurrentDate
Date in YYYY-MM-DDT00:00:00Z format.
const OUString & GetAlias() const
const OUString & GetUncheckedState() const
void SetId(sal_Int32 nId)
void SetCheckbox(bool bCheckbox)
OUString m_aPlaceholderDocPart
The placeholder's doc part: just remembered.
OUString m_aColor
The color: just remembered.
void SetSelectedListItem(std::optional< size_t > oSelectedListItem)
OUString m_aDataBindingStoreItemID
The data bindings's store item ID: just remembered.
const OUString & GetPlaceholderDocPart() const
const OUString & GetColor() const
bool GetShowingPlaceHolder() const
const OUString & GetTag() const
void SetLock(const OUString &rLock)
SwTextNode * GetTextNode() const
void SetTabIndex(sal_uInt32 nTabIndex)
SfxPoolItem subclass that wraps an SwContentControl.
std::shared_ptr< SwContentControl > m_pContentControl
const std::shared_ptr< SwContentControl > & GetContentControl() const
SwTextContentControl * m_pTextAttr
SwTextContentControl * GetTextAttr()
SwTextAttr subclass that tracks the location of the wrapped SwFormatContentControl.
SwTextNode is a paragraph in the document model.
UNO API wrapper around an SwContentControl, exposed as the com.sun.star.text.ContentControl service.
struct _xmlTextWriter * xmlTextWriterPtr
OUString GetDateString(const css::util::DateTime &_rDT)