2
* Copyright (C) 2021 Team KeePassXC <team@keepassxc.org>
3
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 2 or (at your option)
8
* version 3 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#include "AutoTypeAction.h"
21
#include "core/Tools.h"
23
AutoTypeKey::AutoTypeKey(Qt::Key key, Qt::KeyboardModifiers modifiers)
25
, modifiers(modifiers)
29
AutoTypeKey::AutoTypeKey(const QChar& character, Qt::KeyboardModifiers modifiers)
30
: character(character)
31
, modifiers(modifiers)
35
AutoTypeAction::Result AutoTypeKey::exec(AutoTypeExecutor* executor) const
37
return executor->execType(this);
40
AutoTypeDelay::AutoTypeDelay(int delayMs, bool setExecDelay)
42
, setExecDelay(setExecDelay)
46
AutoTypeAction::Result AutoTypeDelay::exec(AutoTypeExecutor* executor) const
49
// Change the delay between actions
50
executor->execDelayMs = delayMs;
56
return AutoTypeAction::Result::Ok();
59
AutoTypeAction::Result AutoTypeClearField::exec(AutoTypeExecutor* executor) const
61
return executor->execClearField(this);
64
AutoTypeAction::Result AutoTypeBegin::exec(AutoTypeExecutor* executor) const
66
return executor->execBegin(this);
69
AutoTypeMode::AutoTypeMode(AutoTypeExecutor::Mode mode)
74
AutoTypeAction::Result AutoTypeMode::exec(AutoTypeExecutor* executor) const
76
executor->mode = mode;
77
return AutoTypeAction::Result::Ok();