Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kcontrol / kxkb / layoutmap.h
blobab336c81114ec61df7d22b7eaffd9825755bbda9
1 /*
2 * Copyright (C) 2006 Andriy Rysin (rysin@kde.org)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __LAYOUTMAP_H
21 #define __LAYOUTMAP_H
23 #include <assert.h>
25 #include <QQueue>
26 #include <QMap>
27 #include <QtGui/QWidget>
29 #include <kdebug.h>
31 #include "kxkbconfig.h"
34 // LayoutMap is used for per-window or per-application switching policy
35 class LayoutMap {
36 typedef QQueue<int> LayoutQueue;
37 typedef QMap<WId, LayoutQueue> WinLayoutMap;
38 typedef QMap<QString, LayoutQueue> WinClassLayoutMap;
40 public:
41 LayoutMap(const KxkbConfig& kxkbConfig);
42 // void setConfig(const KxkbConfig& kxkbConfig);
44 void setCurrentLayout(int layout);
45 int getNextLayout();
46 int getCurrentLayout();
48 void ownerChanged();
49 void reset();
51 private:
52 // pseudo-union
53 LayoutQueue m_globalLayouts;
54 WinLayoutMap m_winLayouts;
55 WinClassLayoutMap m_appLayouts;
57 const KxkbConfig& m_kxkbConfig;
58 WId m_currentWinId;
59 int m_currentDesktop;
60 QString m_currentWinClass; // only for SWITCH_POLICY_WIN_CLASS
62 void initLayoutQueue(LayoutQueue& layoutQueue);
63 LayoutQueue& getCurrentLayoutQueue();
64 LayoutQueue& getCurrentLayoutQueueInternal();
65 void clearMaps();
66 QString getOwner();
69 #endif