summaryrefslogtreecommitdiff
path: root/vcl/source/uitest
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-04-01 11:57:31 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-04-01 14:12:05 +0200
commit1403a335b43089af7ed25fc67bd44df932dc9611 (patch)
tree2d7e7c3bb8fb081c2d7d86afa34d575c9ac2c855 /vcl/source/uitest
parent7c8e9db0e488606baa27a654769a3906f35cc8cd (diff)
uitest: add wrapper for VclExpander
Change-Id: I725c51fdddea9da9aa79d166d747261e80ca9376 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132416 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'vcl/source/uitest')
-rw-r--r--vcl/source/uitest/uiobject.cxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index da71b7d3e41d..d44134cb7996 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -894,6 +894,49 @@ std::unique_ptr<UIObject> MultiLineEditUIObject::create(vcl::Window* pWindow)
return std::unique_ptr<UIObject>(new MultiLineEditUIObject(pEdit));
}
+ExpanderUIObject::ExpanderUIObject(const VclPtr<VclExpander>& xExpander)
+ : WindowUIObject(xExpander)
+ , mxExpander(xExpander)
+{
+}
+
+ExpanderUIObject::~ExpanderUIObject()
+{
+}
+
+void ExpanderUIObject::execute(const OUString& rAction, const StringMap& rParameters)
+{
+ if (rAction == "EXPAND")
+ {
+ mxExpander->set_expanded(true);
+ }
+ else if (rAction == "COLLAPSE")
+ {
+ mxExpander->set_expanded(false);
+ }
+ else
+ WindowUIObject::execute(rAction, rParameters);
+}
+
+StringMap ExpanderUIObject::get_state()
+{
+ StringMap aMap = WindowUIObject::get_state();
+ aMap["Expanded"] = OUString::boolean(mxExpander->get_expanded());
+ return aMap;
+}
+
+OUString ExpanderUIObject::get_name() const
+{
+ return "ExpanderUIObject";
+}
+
+std::unique_ptr<UIObject> ExpanderUIObject::create(vcl::Window* pWindow)
+{
+ VclExpander* pVclExpander = dynamic_cast<VclExpander*>(pWindow);
+ assert(pVclExpander);
+ return std::unique_ptr<UIObject>(new ExpanderUIObject(pVclExpander));
+}
+
CheckBoxUIObject::CheckBoxUIObject(const VclPtr<CheckBox>& xCheckbox):
WindowUIObject(xCheckbox),
mxCheckBox(xCheckbox)