summaryrefslogtreecommitdiff
path: root/svtools/source/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-09-29 17:08:48 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-09-29 17:26:49 +0200
commita801155464cf479b3fbf30f27e3f51030d69ba14 (patch)
treed4c7fe4f8627ef42cfda2266bb8cfe8a9c3e41a5 /svtools/source/uitest
parentd4e19a2394f58191b4d60f445988450142650679 (diff)
add introspection support for SvSimpleTable
This is the second part of the UI test tutorial. The tutorial shows how to add introspection support to a new vcl::Window based UI object. Change-Id: I2b3ed68d313749787869c7e85f2e27c9d01fff4a
Diffstat (limited to 'svtools/source/uitest')
-rw-r--r--svtools/source/uitest/uiobject.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/svtools/source/uitest/uiobject.cxx b/svtools/source/uitest/uiobject.cxx
index 6156f4451918..0a4550ff1813 100644
--- a/svtools/source/uitest/uiobject.cxx
+++ b/svtools/source/uitest/uiobject.cxx
@@ -10,6 +10,7 @@
#include "uitest/uiobject.hxx"
#include <svtools/treelistbox.hxx>
+#include <svtools/simptabl.hxx>
TreeListUIObject::TreeListUIObject(VclPtr<SvTreeListBox> xTreeList):
WindowUIObject(xTreeList),
@@ -140,4 +141,31 @@ OUString TreeListEntryUIObject::get_type() const
return OUString("TreeListEntry");
}
+SimpleTableUIObject::SimpleTableUIObject(VclPtr<SvSimpleTable> xTable):
+ TreeListUIObject(xTable),
+ mxTable(xTable)
+{
+}
+
+StringMap SimpleTableUIObject::get_state()
+{
+ StringMap aMap = TreeListUIObject::get_state();
+
+ aMap["ColumnCount"] = OUString::number(mxTable->TabCount());
+
+ return aMap;
+}
+
+OUString SimpleTableUIObject::UIObject::get_type() const
+{
+ return OUString("SimpleTable");
+}
+
+std::unique_ptr<UIObject> SimpleTableUIObject::createFromContainer(vcl::Window* pWindow)
+{
+ SvSimpleTableContainer* pTableContainer = dynamic_cast<SvSimpleTableContainer*>(pWindow);
+ assert(pTableContainer);
+ return std::unique_ptr<UIObject>(new SimpleTableUIObject(pTableContainer->GetTable()));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */