1 /* 2 KWin - the KDE window manager 3 This file is part of the KDE project. 4 5 SPDX-FileCopyrightText: 2012 Martin Gräßlin <mgraesslin@kde.org> 6 7 SPDX-License-Identifier: GPL-2.0-or-later 8 */ 9 #ifndef KWIN_MOCK_TABBOX_HANDLER_H 10 #define KWIN_MOCK_TABBOX_HANDLER_H 11 12 #include "tabbox/tabboxhandler.h" 13 namespace KWin 14 { 15 class MockTabBoxHandler : public TabBox::TabBoxHandler 16 { 17 Q_OBJECT 18 public: 19 MockTabBoxHandler(QObject *parent = nullptr); 20 ~MockTabBoxHandler() override; activateAndClose()21 void activateAndClose() override { 22 } 23 QWeakPointer< TabBox::TabBoxClient > activeClient() const override; 24 void setActiveClient(const QWeakPointer<TabBox::TabBoxClient> &client); activeScreen()25 int activeScreen() const override { 26 return 0; 27 } 28 QWeakPointer< TabBox::TabBoxClient > clientToAddToList(TabBox::TabBoxClient *client, int desktop) const override; currentDesktop()29 int currentDesktop() const override { 30 return 1; 31 } desktopClient()32 QWeakPointer< TabBox::TabBoxClient > desktopClient() const override { 33 return QWeakPointer<TabBox::TabBoxClient>(); 34 } desktopName(int desktop)35 QString desktopName(int desktop) const override { 36 Q_UNUSED(desktop) 37 return "desktop 1"; 38 } desktopName(TabBox::TabBoxClient * client)39 QString desktopName(TabBox::TabBoxClient *client) const override { 40 Q_UNUSED(client) 41 return "desktop"; 42 } elevateClient(TabBox::TabBoxClient * c,QWindow * tabbox,bool elevate)43 void elevateClient(TabBox::TabBoxClient *c, QWindow *tabbox, bool elevate) const override { 44 Q_UNUSED(c) 45 Q_UNUSED(tabbox) 46 Q_UNUSED(elevate) 47 } shadeClient(TabBox::TabBoxClient * c,bool b)48 void shadeClient(TabBox::TabBoxClient *c, bool b) const override { 49 Q_UNUSED(c) 50 Q_UNUSED(b) 51 } hideOutline()52 virtual void hideOutline() { 53 } 54 QWeakPointer< TabBox::TabBoxClient > nextClientFocusChain(TabBox::TabBoxClient *client) const override; 55 QWeakPointer<TabBox::TabBoxClient> firstClientFocusChain() const override; 56 bool isInFocusChain (TabBox::TabBoxClient* client) const override; nextDesktopFocusChain(int desktop)57 int nextDesktopFocusChain(int desktop) const override { 58 Q_UNUSED(desktop) 59 return 1; 60 } numberOfDesktops()61 int numberOfDesktops() const override { 62 return 1; 63 } isKWinCompositing()64 bool isKWinCompositing() const override { 65 return false; 66 } raiseClient(TabBox::TabBoxClient * c)67 void raiseClient(TabBox::TabBoxClient *c) const override { 68 Q_UNUSED(c) 69 } restack(TabBox::TabBoxClient * c,TabBox::TabBoxClient * under)70 void restack(TabBox::TabBoxClient *c, TabBox::TabBoxClient *under) override { 71 Q_UNUSED(c) 72 Q_UNUSED(under) 73 } showOutline(const QRect & outline)74 virtual void showOutline(const QRect &outline) { 75 Q_UNUSED(outline) 76 } stackingOrder()77 TabBox::TabBoxClientList stackingOrder() const override { 78 return TabBox::TabBoxClientList(); 79 } 80 void grabbedKeyEvent(QKeyEvent *event) const override; 81 82 void highlightWindows(TabBox::TabBoxClient *window = nullptr, QWindow *controller = nullptr) override { 83 Q_UNUSED(window) 84 Q_UNUSED(controller) 85 } 86 noModifierGrab()87 bool noModifierGrab() const override { 88 return false; 89 } 90 91 // mock methods 92 QWeakPointer<TabBox::TabBoxClient> createMockWindow(const QString &caption); 93 void closeWindow(TabBox::TabBoxClient *client); 94 private: 95 QList< QSharedPointer<TabBox::TabBoxClient> > m_windows; 96 QWeakPointer<TabBox::TabBoxClient> m_activeClient; 97 }; 98 } // namespace KWin 99 #endif 100