diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-04-25 08:47:32 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-05-02 08:18:03 +0200 |
commit | 2da286b41edfced3c331f69445dcda6ce55b3c84 (patch) | |
tree | 7a301208ed0274ff4cbe05ff9b0d5ed6e15bd286 /sw/inc | |
parent | 4a0f65c338f32dffc9ecc47811aa199d13205a9e (diff) |
sw content controls, checkbox: add document model & UNO API
Add 4 new properties: if this is a checkbox, and is so:
- if it's checked
- unicode value for the checked state
- unicode value for the unchecked state
This should be enough for the UI to be able to update checkmark state on
click.
(cherry picked from commit cd2272874d1b1911dec6c6e7bf3d67861be4a015)
Change-Id: I723532fd2d3377cf09a1127c69c55f9539649088
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133641
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/formatcontentcontrol.hxx | 28 | ||||
-rw-r--r-- | sw/inc/unoprnms.hxx | 4 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx index d50c68945f39..54804612a2b5 100644 --- a/sw/inc/formatcontentcontrol.hxx +++ b/sw/inc/formatcontentcontrol.hxx @@ -79,6 +79,18 @@ class SwContentControl : public sw::BroadcastingModify /// Current content is placeholder text. bool m_bShowingPlaceHolder = false; + /// Display the content control as a checkbox. + bool m_bCheckbox = false; + + /// If m_bCheckbox is true, is the checkbox checked? + bool m_bChecked = false; + + /// If m_bCheckbox is true, the value of a checked checkbox. + OUString m_aCheckedState; + + /// If m_bCheckbox is true, the value of an unchecked checkbox. + OUString m_aUncheckedState; + public: SwTextContentControl* GetTextAttr() const; @@ -113,6 +125,22 @@ public: bool GetShowingPlaceHolder() const { return m_bShowingPlaceHolder; } + void SetCheckbox(bool bCheckbox) { m_bCheckbox = bCheckbox; } + + bool GetCheckbox() const { return m_bCheckbox; } + + void SetChecked(bool bChecked) { m_bChecked = bChecked; } + + bool GetChecked() const { return m_bChecked; } + + void SetCheckedState(const OUString& rCheckedState) { m_aCheckedState = rCheckedState; } + + OUString GetCheckedState() const { return m_aCheckedState; } + + void SetUncheckedState(const OUString& rUncheckedState) { m_aUncheckedState = rUncheckedState; } + + OUString GetUncheckedState() const { return m_aUncheckedState; } + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; }; diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 79a64e4109f5..239ab6a56a97 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -871,6 +871,10 @@ #define UNO_NAME_LINEBREAK "LineBreak" #define UNO_NAME_CONTENT_CONTROL "ContentControl" #define UNO_NAME_SHOWING_PLACE_HOLDER "ShowingPlaceHolder" +#define UNO_NAME_CHECKBOX "Checkbox" +#define UNO_NAME_CHECKED "Checked" +#define UNO_NAME_CHECKED_STATE "CheckedState" +#define UNO_NAME_UNCHECKED_STATE "UncheckedState" #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |