summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-04-03 02:38:11 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-18 17:01:55 +0200
commitae9dc22955e5b83cb2671c21d9bfea7dd3b389b5 (patch)
treeafa82d18e406419fad94677a93ac9ae0cd150177 /svtools
parent65ce002f4ff1559d836c1af2749963031fdc4efe (diff)
uitest: add initial version of wrapper for tree list box
The tree list will also be the first case where we need non-vcl::Window based children. We should create one child for each entry to make it possible to interact with them correctly. Change-Id: I49e1ddf7b271946fd595ebfe2f4f2d0c8a535fdc
Diffstat (limited to 'svtools')
-rw-r--r--svtools/Library_svt.mk1
-rw-r--r--svtools/inc/uitest/uiobject.hxx30
-rw-r--r--svtools/source/contnr/treelistbox.cxx6
-rw-r--r--svtools/source/uitest/uiobject.cxx41
4 files changed, 78 insertions, 0 deletions
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 5ace8cadde2a..fccfae51d4fa 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -212,6 +212,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/table/mousefunction \
svtools/source/table/cellvalueconversion \
svtools/source/table/tablegeometry \
+ svtools/source/uitest/uiobject \
svtools/source/uno/addrtempuno \
svtools/source/uno/fpicker \
svtools/source/uno/framestatuslistener \
diff --git a/svtools/inc/uitest/uiobject.hxx b/svtools/inc/uitest/uiobject.hxx
new file mode 100644
index 000000000000..8e7cbcecb1c8
--- /dev/null
+++ b/svtools/inc/uitest/uiobject.hxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <vcl/uitest/uiobject.hxx>
+
+class SvTreeListBox;
+
+class TreeListUIObject : public WindowUIObject
+{
+public:
+ TreeListUIObject(VclPtr<SvTreeListBox> xTreeList);
+
+ virtual UIObjectType get_type() const override;
+
+ virtual StringMap get_state() override;
+
+ static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
+
+protected:
+
+ virtual OUString get_name() const override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 6021d6b1ea3e..b0e1333d000a 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -40,6 +40,7 @@
#include <svtools/treelistentry.hxx>
#include <svtools/viewdataentry.hxx>
#include "svimpbox.hxx"
+#include "uitest/uiobject.hxx"
#include <set>
#include <string.h>
@@ -3828,4 +3829,9 @@ bool SvTreeListBox::set_property(const OString &rKey, const OString &rValue)
return true;
}
+FactoryFunction SvTreeListBox::GetUITestFactory() const
+{
+ return TreeListUIObject::create;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uitest/uiobject.cxx b/svtools/source/uitest/uiobject.cxx
new file mode 100644
index 000000000000..db345487909c
--- /dev/null
+++ b/svtools/source/uitest/uiobject.cxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "uitest/uiobject.hxx"
+
+#include <svtools/treelistbox.hxx>
+
+TreeListUIObject::TreeListUIObject(VclPtr<SvTreeListBox> xTreeList):
+ WindowUIObject(xTreeList)
+{
+}
+
+StringMap TreeListUIObject::get_state()
+{
+ return WindowUIObject::get_state();
+}
+
+UIObjectType TreeListUIObject::get_type() const
+{
+ return UIObjectType::WINDOW;
+}
+
+OUString TreeListUIObject::get_name() const
+{
+ return OUString("TreeListUIObject");
+}
+
+std::unique_ptr<UIObject> TreeListUIObject::create(vcl::Window* pWindow)
+{
+ SvTreeListBox* pTreeList = dynamic_cast<SvTreeListBox*>(pWindow);
+ assert(pTreeList);
+ return std::unique_ptr<UIObject>(new TreeListUIObject(pTreeList));
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */