summaryrefslogtreecommitdiff
path: root/vcl/source/uitest/uiobject.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2018-01-07 14:23:31 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2018-01-07 18:07:04 +0100
commite66a0d7095260c62b067541a0c47ce5c07074f18 (patch)
tree3580f6c4c309e322bbab9106979e4b63ecedf9ec /vcl/source/uitest/uiobject.cxx
parent8d52646747cc70a6c01174cb1a168ece4c95ac68 (diff)
uitest: add support for GtkTextView/VclMultiLineEdit
Change-Id: If1f22ee562b73a54042985254e0b9cd127025b55 Reviewed-on: https://gerrit.libreoffice.org/47529 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'vcl/source/uitest/uiobject.cxx')
-rw-r--r--vcl/source/uitest/uiobject.cxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 9fe9035e2e6a..56373981be74 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -18,6 +18,7 @@
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/edit.hxx>
+#include <vcl/vclmedit.hxx>
#include <comphelper/string.hxx>
@@ -670,6 +671,63 @@ std::unique_ptr<UIObject> EditUIObject::create(vcl::Window* pWindow)
return std::unique_ptr<UIObject>(new EditUIObject(pEdit));
}
+MultiLineEditUIObject::MultiLineEditUIObject(const VclPtr<VclMultiLineEdit>& xEdit):
+ WindowUIObject(xEdit),
+ mxEdit(xEdit)
+{
+}
+
+MultiLineEditUIObject::~MultiLineEditUIObject()
+{
+}
+
+void MultiLineEditUIObject::execute(const OUString& rAction,
+ const StringMap& rParameters)
+{
+ bool bHandled = true;
+ if (rAction == "TYPE")
+ {
+ WindowUIObject aChildObj(mxEdit->GetTextWindow());
+ aChildObj.execute(rAction, rParameters);
+ }
+ else if (rAction == "SELECT")
+ {
+ if (rParameters.find("FROM") != rParameters.end() &&
+ rParameters.find("TO") != rParameters.end())
+ {
+ long nMin = rParameters.find("FROM")->second.toInt32();
+ long nMax = rParameters.find("TO")->second.toInt32();
+ Selection aSelection(nMin, nMax);
+ mxEdit->SetSelection(aSelection);
+ }
+ }
+
+ if (!bHandled)
+ WindowUIObject::execute(rAction, rParameters);
+}
+
+StringMap MultiLineEditUIObject::get_state()
+{
+ StringMap aMap = WindowUIObject::get_state();
+ aMap["MaxTextLength"] = OUString::number(mxEdit->GetMaxTextLen());
+ aMap["SelectedText"] = mxEdit->GetSelected();
+ aMap["Text"] = mxEdit->GetText();
+
+ return aMap;
+}
+
+OUString MultiLineEditUIObject::get_name() const
+{
+ return OUString("MultiLineEditUIObject");
+}
+
+std::unique_ptr<UIObject> MultiLineEditUIObject::create(vcl::Window* pWindow)
+{
+ VclMultiLineEdit* pEdit = dynamic_cast<VclMultiLineEdit*>(pWindow);
+ assert(pEdit);
+ return std::unique_ptr<UIObject>(new MultiLineEditUIObject(pEdit));
+}
+
CheckBoxUIObject::CheckBoxUIObject(const VclPtr<CheckBox>& xCheckbox):
WindowUIObject(xCheckbox),
mxCheckBox(xCheckbox)