You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.3 KiB
61 lines
1.3 KiB
/* |
|
SPDX-FileCopyrightText: 2009 Chani Armitage <chani@kde.org> |
|
SPDX-FileCopyrightText: 2018 Eike Hein <hein@kde.org> |
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later |
|
*/ |
|
|
|
#pragma once |
|
|
|
#include "ui_config.h" |
|
#include <plasma/containmentactions.h> |
|
|
|
class QAction; |
|
|
|
namespace TaskManager |
|
{ |
|
class ActivityInfo; |
|
class TasksModel; |
|
class VirtualDesktopInfo; |
|
} |
|
|
|
class SwitchWindow : public Plasma::ContainmentActions |
|
{ |
|
Q_OBJECT |
|
public: |
|
SwitchWindow(QObject *parent, const QVariantList &args); |
|
~SwitchWindow() override; |
|
|
|
void restore(const KConfigGroup &config) override; |
|
QWidget *createConfigurationInterface(QWidget *parent) override; |
|
void configurationAccepted() override; |
|
void save(KConfigGroup &config) override; |
|
|
|
void performNextAction() override; |
|
void performPreviousAction() override; |
|
void doSwitch(bool up); |
|
QList<QAction *> contextualActions() override; |
|
|
|
private: |
|
void makeMenu(); |
|
|
|
private Q_SLOTS: |
|
void switchTo(QAction *action); |
|
|
|
private: |
|
enum MenuMode { |
|
AllFlat = 0, |
|
DesktopSubmenus, |
|
CurrentDesktop, |
|
}; |
|
|
|
QList<QAction *> m_actions; |
|
Ui::Config m_ui; |
|
MenuMode m_mode; |
|
|
|
TaskManager::VirtualDesktopInfo *m_virtualDesktopInfo; |
|
|
|
static TaskManager::ActivityInfo *s_activityInfo; |
|
static TaskManager::TasksModel *s_tasksModel; |
|
static int s_instanceCount; |
|
};
|
|
|