2
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 2 or (at your option)
7
* version 3 of the License.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
#include "AutoTypeTest.h"
20
bool AutoTypePlatformTest::isAvailable()
25
QString AutoTypePlatformTest::keyToString(Qt::Key key)
27
return QString("[Key0x%1]").arg(key, 0, 16);
30
QStringList AutoTypePlatformTest::windowTitles()
35
WId AutoTypePlatformTest::activeWindow()
40
QString AutoTypePlatformTest::activeWindowTitle()
42
return m_activeWindowTitle;
45
AutoTypeExecutor* AutoTypePlatformTest::createExecutor()
47
return new AutoTypeExecutorTest(this);
50
void AutoTypePlatformTest::setActiveWindowTitle(const QString& title)
52
m_activeWindowTitle = title;
55
QString AutoTypePlatformTest::actionChars()
60
int AutoTypePlatformTest::actionCount()
65
void AutoTypePlatformTest::clearActions()
67
m_actionChars.clear();
71
void AutoTypePlatformTest::addAction(const AutoTypeKey* action)
74
if (action->key != Qt::Key_unknown) {
75
m_actionChars += keyToString(action->key);
77
m_actionChars += action->character;
81
bool AutoTypePlatformTest::raiseWindow(WId window)
88
#if defined(Q_OS_MACOS)
89
bool AutoTypePlatformTest::hideOwnWindow()
94
bool AutoTypePlatformTest::raiseOwnWindow()
100
AutoTypeExecutorTest::AutoTypeExecutorTest(AutoTypePlatformTest* platform)
101
: m_platform(platform)
105
AutoTypeAction::Result AutoTypeExecutorTest::execBegin(const AutoTypeBegin* action)
108
return AutoTypeAction::Result::Ok();
111
AutoTypeAction::Result AutoTypeExecutorTest::execType(const AutoTypeKey* action)
113
m_platform->addAction(action);
114
return AutoTypeAction::Result::Ok();
117
AutoTypeAction::Result AutoTypeExecutorTest::execClearField(const AutoTypeClearField* action)
120
return AutoTypeAction::Result::Ok();