2015-12-09 08:04:30 +01:00
|
|
|
/* -*- 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/.
|
|
|
|
*/
|
|
|
|
|
2017-04-14 08:42:15 +10:00
|
|
|
#include <memory>
|
2016-01-07 01:28:44 +01:00
|
|
|
#include <vcl/uitest/uitest.hxx>
|
2016-01-09 02:02:25 +01:00
|
|
|
#include <vcl/uitest/uiobject.hxx>
|
|
|
|
|
|
|
|
#include <vcl/dialog.hxx>
|
|
|
|
|
2017-10-23 22:28:18 +02:00
|
|
|
#include <svdata.hxx>
|
2015-12-09 08:04:30 +01:00
|
|
|
|
2016-01-08 16:01:23 +01:00
|
|
|
#include <comphelper/dispatchcommand.hxx>
|
|
|
|
|
2017-06-20 09:45:36 +02:00
|
|
|
bool UITest::executeCommand(const OUString& rCommand)
|
2016-01-08 16:01:23 +01:00
|
|
|
{
|
2017-06-20 09:45:36 +02:00
|
|
|
return comphelper::dispatchCommand(
|
2016-09-05 15:42:29 +02:00
|
|
|
rCommand,
|
2017-02-27 04:10:03 +01:00
|
|
|
{{"SynchronMode", -1, css::uno::Any(true),
|
2016-09-05 15:42:29 +02:00
|
|
|
css::beans::PropertyState_DIRECT_VALUE}});
|
2016-01-08 16:01:23 +01:00
|
|
|
}
|
|
|
|
|
2017-06-20 09:45:36 +02:00
|
|
|
bool UITest::executeDialog(const OUString& rCommand)
|
2017-02-27 04:04:26 +01:00
|
|
|
{
|
2017-06-20 09:45:36 +02:00
|
|
|
return comphelper::dispatchCommand(
|
2017-02-27 04:04:26 +01:00
|
|
|
rCommand,
|
|
|
|
{{"SynchronMode", -1, css::uno::Any(false),
|
|
|
|
css::beans::PropertyState_DIRECT_VALUE}});
|
|
|
|
}
|
|
|
|
|
2016-01-09 02:02:25 +01:00
|
|
|
std::unique_ptr<UIObject> UITest::getFocusTopWindow()
|
|
|
|
{
|
|
|
|
ImplSVData* pSVData = ImplGetSVData();
|
|
|
|
ImplSVWinData& rWinData = pSVData->maWinData;
|
|
|
|
|
|
|
|
if (rWinData.mpLastExecuteDlg)
|
2016-03-30 05:14:50 +02:00
|
|
|
{
|
2016-03-31 06:10:26 +02:00
|
|
|
return rWinData.mpLastExecuteDlg->GetUITestFactory()(rWinData.mpLastExecuteDlg);
|
2016-03-30 05:14:50 +02:00
|
|
|
}
|
2016-01-09 02:02:25 +01:00
|
|
|
|
2016-03-30 05:14:50 +02:00
|
|
|
return rWinData.mpFirstFrame->GetUITestFactory()(rWinData.mpFirstFrame);
|
2016-01-09 02:02:25 +01:00
|
|
|
}
|
|
|
|
|
2017-03-26 00:24:10 +01:00
|
|
|
std::unique_ptr<UIObject> UITest::getFloatWindow()
|
|
|
|
{
|
|
|
|
ImplSVData* pSVData = ImplGetSVData();
|
|
|
|
ImplSVWinData& rWinData = pSVData->maWinData;
|
|
|
|
|
|
|
|
VclPtr<vcl::Window> pFloatWin = rWinData.mpFirstFloat;
|
|
|
|
if (pFloatWin)
|
|
|
|
return pFloatWin->GetUITestFactory()(pFloatWin);
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2015-12-09 08:04:30 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|