SPDX-FileCopyrightText: 2010 Andriy Rysin <rysin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QMap>
#include <QString>
#include <QWidgetList>
#include "keyboard_config.h"
#include "x11_helper.h"
class LayoutMemoryPersister;
class LayoutMemory : public QObject
{
Q_OBJECT
QString previousLayoutMapKey;
QList<LayoutUnit> prevLayoutList;
const KeyboardConfig &keyboardConfig;
void registerListeners();
void unregisterListeners();
QString getCurrentMapKey();
void setCurrentLayoutFromMap();
public Q_SLOTS:
void layoutMapChanged();
void layoutChanged();
void windowChanged(WId wId);
void desktopChanged(int desktop);
public:
LayoutMemory(const KeyboardConfig &keyboardConfig);
~LayoutMemory() override;
void configChanged();
protected:
QMap<QString, LayoutSet> layoutMap;
friend class LayoutMemoryPersister;
};