File indexing completed on 2024-04-28 05:50:52

0001 /*
0002     SPDX-FileCopyrightText: 2008 Robert Knight <robertknight@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef PARTMANUALTEST_H
0008 #define PARTMANUALTEST_H
0009 
0010 #include <QEventLoop>
0011 
0012 #include <KParts/Part>
0013 #include <kde_terminal_interface.h>
0014 
0015 class QKeyEvent;
0016 
0017 namespace Konsole
0018 {
0019 class PartManualTest : public QObject
0020 {
0021     Q_OBJECT
0022 
0023 private Q_SLOTS:
0024     void testShortcutOverride();
0025 
0026     // marked as protected so they are not treated as test cases
0027 protected Q_SLOTS:
0028     void overrideShortcut(QKeyEvent *event, bool &override);
0029     void shortcutTriggered();
0030 
0031 private:
0032     KParts::Part *createPart();
0033 
0034     // variables for testShortcutOverride()
0035     bool _shortcutTriggered = false;
0036     bool _overrideCalled = false;
0037     bool _override = false;
0038     QEventLoop *_shortcutEventLoop = nullptr;
0039 };
0040 
0041 }
0042 
0043 #endif // PARTMANUALTEST_H