uitest: add initial support for selecting chart elements

Change-Id: I3af11d44067618b5188f3dbf4abccc171dd98d0c
This commit is contained in:
Markus Mohrhard 2016-07-14 12:33:28 +02:00
parent 7b2966dbf2
commit b1e1b38349
5 changed files with 108 additions and 0 deletions

View file

@ -199,6 +199,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/sidebar/ChartSeriesPanel \
chart2/source/controller/sidebar/ChartSidebarModifyListener \
chart2/source/controller/sidebar/ChartSidebarSelectionListener \
chart2/source/controller/uitest/uiobject \
))
# Runtime dependency for unit-tests

View file

@ -65,6 +65,8 @@ public:
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
virtual FactoryFunction GetUITestFactory() const override;
private:
ChartController* m_pWindowController;
bool m_bInPaint;

View file

@ -0,0 +1,43 @@
/* -*- 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/.
*/
#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_INC_UIOBJECT_HXX
#define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_UIOBJECT_HXX
#include <vcl/uitest/uiobject.hxx>
#include "ChartWindow.hxx"
class ChartWindowUIObject : public WindowUIObject
{
VclPtr<chart::ChartWindow> mxChartWindow;
public:
ChartWindowUIObject(VclPtr<chart::ChartWindow> xChartWindow);
virtual StringMap get_state() override;
virtual void execute(const OUString& rAction,
const StringMap& rParameters) override;
virtual std::unique_ptr<UIObject> get_child(const OUString& rID) override;
virtual std::set<OUString> get_children() const override;
static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
protected:
virtual OUString get_name() const;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -20,6 +20,7 @@
#include "ChartWindow.hxx"
#include "ChartController.hxx"
#include "HelpIds.hrc"
#include "uiobject.hxx"
#include <vcl/help.hxx>
#include <vcl/openglwin.hxx>
@ -306,6 +307,11 @@ void ChartWindow::Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags
}
}
FactoryFunction ChartWindow::GetUITestFactory() const
{
return ChartWindowUIObject::create;
}
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -0,0 +1,56 @@
/* -*- 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 "uiobject.hxx"
ChartWindowUIObject::ChartWindowUIObject(VclPtr<chart::ChartWindow> xChartWindow):
WindowUIObject(xChartWindow),
mxChartWindow(xChartWindow)
{
}
StringMap ChartWindowUIObject::get_state()
{
StringMap aMap = WindowUIObject::get_state();
return aMap;
}
void ChartWindowUIObject::execute(const OUString& rAction,
const StringMap& rParameters)
{
WindowUIObject::execute(rAction, rParameters);
}
std::unique_ptr<UIObject> ChartWindowUIObject::get_child(const OUString& rID)
{
return nullptr;
}
std::set<OUString> ChartWindowUIObject::get_children() const
{
std::set<OUString> aChildren;
return aChildren;
}
std::unique_ptr<UIObject> ChartWindowUIObject::create(vcl::Window* pWindow)
{
chart::ChartWindow* pChartWindow = dynamic_cast<chart::ChartWindow*>(pWindow);
assert(pChartWindow);
return std::unique_ptr<UIObject>(new ChartWindowUIObject(pChartWindow));
}
OUString ChartWindowUIObject::get_name() const
{
return OUString("ChartWindowUIObject");
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */