diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-03 02:38:11 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-18 17:01:55 +0200 |
commit | ae9dc22955e5b83cb2671c21d9bfea7dd3b389b5 (patch) | |
tree | afa82d18e406419fad94677a93ac9ae0cd150177 | |
parent | 65ce002f4ff1559d836c1af2749963031fdc4efe (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
-rw-r--r-- | include/svtools/treelistbox.hxx | 2 | ||||
-rw-r--r-- | svtools/Library_svt.mk | 1 | ||||
-rw-r--r-- | svtools/inc/uitest/uiobject.hxx | 30 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 6 | ||||
-rw-r--r-- | svtools/source/uitest/uiobject.cxx | 41 |
5 files changed, 80 insertions, 0 deletions
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx index aaeb1f65bbd4..9a6a2ed219c5 100644 --- a/include/svtools/treelistbox.hxx +++ b/include/svtools/treelistbox.hxx @@ -796,6 +796,8 @@ public: virtual Size GetOptimalSize() const override; void SetAlternatingRowColors( const bool bEnable ); + + virtual FactoryFunction GetUITestFactory() const override; }; #define SV_LBOX_DD_FORMAT "SV_LBOX_DD_FORMAT" 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: */ |