2009-09-13 11:36:45 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
2013-03-12 12:17:53 +00:00
|
|
|
Copyright (C) 2009 Martin Gräßlin <mgraesslin@kde.org>
|
2009-09-13 11:36:45 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
#ifndef TABBOXCONFIG_H
|
|
|
|
#define TABBOXCONFIG_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @file
|
|
|
|
* This file defines the class TabBoxConfig.
|
|
|
|
*
|
|
|
|
* @author Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
* @since 4.4
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2009-09-13 11:36:45 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
namespace TabBox
|
|
|
|
{
|
|
|
|
class TabBoxConfigPrivate;
|
|
|
|
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* The TabBoxConfig class holds all configuration options for the TabBox.
|
|
|
|
* The TabBoxHandler contains a pointer to an object of this class and is
|
|
|
|
* used by all classes of TabBox. The config defines what kind of data the
|
|
|
|
* TabBox is displaying and how the layout looks like. There can be different
|
|
|
|
* Config sets and by setting a new config in the TabBoxHandler the behaviour
|
|
|
|
* of the TabBox is changed immediately.
|
|
|
|
*
|
|
|
|
* @author Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
* @since 4.4
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2009-09-13 11:36:45 +00:00
|
|
|
class TabBoxConfig
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* ClientDesktopMode defines whether windows from the current desktop or from all
|
|
|
|
* desktops are included in the TabBoxClient List in the TabBoxClientModel
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
enum ClientDesktopMode {
|
|
|
|
AllDesktopsClients, ///< TabBoxClients from all desktops are included.
|
|
|
|
OnlyCurrentDesktopClients, ///< Only TabBoxClients on current desktop are included
|
|
|
|
ExcludeCurrentDesktopClients ///< Exclude TabBoxClients on current desktop
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* ClientActivitiesMode defines whether windows from the current activity or from all
|
|
|
|
* activities are included in the TabBoxClient List in the TabBoxClientModel
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
enum ClientActivitiesMode {
|
|
|
|
AllActivitiesClients, ///< TabBoxClients from all Activities are included.
|
|
|
|
OnlyCurrentActivityClients, ///< Only TabBoxClients on current activity are included
|
|
|
|
ExcludeCurrentActivityClients ///< Exclude TabBoxClients on current activity
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* ClientApplicationsMode defines which windows from the current application or from all
|
|
|
|
* applications are included in the TabBoxClient List in the TabBoxClientModel
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
enum ClientApplicationsMode {
|
|
|
|
AllWindowsAllApplications, ///< TabBoxClients from all applications are included
|
|
|
|
OneWindowPerApplication, ///< Only one TabBoxClient for each application is included
|
|
|
|
AllWindowsCurrentApplication ///< Only TabBoxClients for the current application are included
|
|
|
|
};
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* ClientMinimizedMode defines which windows are included in the TabBoxClient List
|
|
|
|
* in the TabBoxClientModel based on whether they are minimized or not
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-01-26 23:25:32 +00:00
|
|
|
enum ClientMinimizedMode {
|
|
|
|
IgnoreMinimizedStatus, ///< TabBoxClients are included no matter they are minimized or not
|
|
|
|
ExcludeMinimizedClients, ///< Exclude minimized TabBoxClients
|
|
|
|
OnlyMinimizedClients ///< Only minimized TabBoxClients are included
|
|
|
|
};
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* ShowDesktopMode defines whether a TabBoxClient representing the desktop
|
|
|
|
* is included in the TabBoxClient List in the TabBoxClientModel
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
enum ShowDesktopMode {
|
|
|
|
DoNotShowDesktopClient, ///< A TabBoxClient representing the desktop is not included
|
|
|
|
ShowDesktopClient ///< A TabBoxClient representing the desktop is included
|
|
|
|
};
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* ClientActivitiesMode defines whether windows from the current activity or from all
|
|
|
|
* activities are included in the TabBoxClient List in the TabBoxClientModel
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
enum ClientMultiScreenMode {
|
|
|
|
IgnoreMultiScreen, ///< TabBoxClients are included independently of the screen they are on
|
|
|
|
OnlyCurrentScreenClients, ///< Only TabBoxClients on current screen are included
|
|
|
|
ExcludeCurrentScreenClients ///< Exclude TabBoxClients from the current screen
|
|
|
|
};
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* ClientSwitchingMode defines the sorting of the TabBoxClients in the
|
|
|
|
* TabBoxClientModel.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
enum ClientSwitchingMode {
|
|
|
|
FocusChainSwitching, ///< Sort by recently used. Most recently used TabBoxClient is the first
|
|
|
|
StackingOrderSwitching ///< Sort by current stacking order
|
|
|
|
};
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* DesktopSwitchingMode defines the sorting of the desktops in the
|
|
|
|
* TabBoxDesktopModel.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
enum DesktopSwitchingMode {
|
|
|
|
MostRecentlyUsedDesktopSwitching,///< Sort by recently used. Most recently used desktop is the first
|
|
|
|
StaticDesktopSwitching///< Static sorting in numerical ascending order
|
|
|
|
};
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* TabBoxMode defines what kind of items the TabBox is displaying and which
|
|
|
|
* Model is used
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
enum TabBoxMode {
|
|
|
|
ClientTabBox,///< TabBox uses TabBoxClientModel
|
|
|
|
DesktopTabBox///< TabBox uses TabBoxDesktopModel
|
|
|
|
};
|
|
|
|
TabBoxConfig();
|
|
|
|
~TabBoxConfig();
|
|
|
|
TabBoxConfig& operator=(const TabBoxConfig& object);
|
2009-09-13 11:36:45 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
// getters
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return If the TabBox should be shown or not
|
|
|
|
* This option does not apply for TabBoxMode DesktopTabBox.
|
|
|
|
* @see setShowTabBox
|
|
|
|
* @see defaultShowTabBox
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
bool isShowTabBox() const;
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return If Highlight Window effect should be used.
|
|
|
|
* This option does not apply for TabBoxMode DesktopTabBox.
|
|
|
|
* @see setHighlightWindows
|
|
|
|
* @see defaultHighlightWindows
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
bool isHighlightWindows() const;
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return The current TabBoxMode
|
|
|
|
* @see setTabBoxMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
TabBoxMode tabBoxMode() const;
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return The current ClientDesktopMode
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see setClientDesktopMode
|
|
|
|
* @see defaultDesktopMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
ClientDesktopMode clientDesktopMode() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return The current ClientActivitiesMode
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see setClientActivitiesMode
|
|
|
|
* @see defaultActivitiesMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
ClientActivitiesMode clientActivitiesMode() const;
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return The current ClientApplicationsMode
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see setClientApplicationsMode
|
|
|
|
* @see defaultApplicationsMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
ClientApplicationsMode clientApplicationsMode() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return The current ClientMinimizedMode
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see setClientMinimizedMode
|
|
|
|
* @see defaultMinimizedMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-01-26 23:25:32 +00:00
|
|
|
ClientMinimizedMode clientMinimizedMode() const;
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return The current ShowDesktopMode
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see setShowDesktopMode
|
|
|
|
* @see defaultShowDesktopMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
ShowDesktopMode showDesktopMode() const;
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return The current ClientMultiScreenMode
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see setClientMultiScreenMode
|
|
|
|
* @see defaultMultiScreenMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
ClientMultiScreenMode clientMultiScreenMode() const;
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return The current ClientSwitchingMode.
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see setClientSwitchingMode
|
|
|
|
* @see defaultSwitchingMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
ClientSwitchingMode clientSwitchingMode() const;
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return The current DesktopSwitchingMode
|
|
|
|
* This option only applies for TabBoxMode DesktopTabBox.
|
|
|
|
* @see setDesktopSwitchingMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
DesktopSwitchingMode desktopSwitchingMode() const;
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @return Then name of the current ItemLayout
|
|
|
|
* @see setlayoutName
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
QString& layoutName() const;
|
2009-09-13 11:36:45 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
// setters
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param show The tabbox should be shown or not.
|
|
|
|
* This option does not apply for TabBoxMode DesktopTabBox.
|
|
|
|
* @see isShowTabBox
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
void setShowTabBox(bool show);
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param highlight Highlight Windows effect should be used or not.
|
|
|
|
* This option does not apply for TabBoxMode DesktopTabBox.
|
|
|
|
* @see isHighlightWindows
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
void setHighlightWindows(bool highlight);
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param mode The new TabBoxMode to be used.
|
|
|
|
* @see tabBoxMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
void setTabBoxMode(TabBoxMode mode);
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param desktopMode The new ClientDesktopMode to be used.
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see clientDesktopMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
void setClientDesktopMode(ClientDesktopMode desktopMode);
|
2011-01-30 14:34:42 +00:00
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param activitiesMode The new ClientActivitiesMode to be used.
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see clientActivitiesMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
void setClientActivitiesMode(ClientActivitiesMode activitiesMode);
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param applicationsMode The new ClientApplicationsMode to be used.
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see clientApplicationsMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
void setClientApplicationsMode(ClientApplicationsMode applicationsMode);
|
2011-01-30 14:34:42 +00:00
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param minimizedMode The new ClientMinimizedMode to be used.
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see clientMinimizedMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-01-26 23:25:32 +00:00
|
|
|
void setClientMinimizedMode(ClientMinimizedMode minimizedMode);
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param showDesktopMode The new ShowDesktopMode to be used.
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see showDesktopMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
void setShowDesktopMode(ShowDesktopMode showDesktopMode);
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param multiScreenMode The new ClientMultiScreenMode to be used.
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see clientMultiScreenMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
void setClientMultiScreenMode(ClientMultiScreenMode multiScreenMode);
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param switchingMode The new ClientSwitchingMode to be used.
|
|
|
|
* This option only applies for TabBoxMode ClientTabBox.
|
|
|
|
* @see clientSwitchingMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2012-03-04 18:24:13 +00:00
|
|
|
void setClientSwitchingMode(ClientSwitchingMode switchingMode);
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param switchingMode The new DesktopSwitchingMode to be used.
|
|
|
|
* This option only applies for TabBoxMode DesktopTabBox.
|
|
|
|
* @see desktopSwitchingMode
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
void setDesktopSwitchingMode(DesktopSwitchingMode switchingMode);
|
|
|
|
/**
|
2019-02-02 18:17:44 +00:00
|
|
|
* @param name The new ItemLayout config name
|
|
|
|
* @see layoutName
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2011-01-30 14:34:42 +00:00
|
|
|
void setLayoutName(const QString& name);
|
2009-09-13 11:36:45 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
// some static methods to access default values
|
2012-03-04 18:24:13 +00:00
|
|
|
static ClientDesktopMode defaultDesktopMode() {
|
|
|
|
return OnlyCurrentDesktopClients;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2012-03-04 18:24:13 +00:00
|
|
|
static ClientActivitiesMode defaultActivitiesMode() {
|
|
|
|
return OnlyCurrentActivityClients;
|
|
|
|
}
|
|
|
|
static ClientApplicationsMode defaultApplicationsMode() {
|
|
|
|
return AllWindowsAllApplications;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2012-01-26 23:25:32 +00:00
|
|
|
static ClientMinimizedMode defaultMinimizedMode() {
|
|
|
|
return IgnoreMinimizedStatus;
|
|
|
|
}
|
2012-03-04 18:24:13 +00:00
|
|
|
static ShowDesktopMode defaultShowDesktopMode() {
|
|
|
|
return DoNotShowDesktopClient;
|
|
|
|
}
|
|
|
|
static ClientMultiScreenMode defaultMultiScreenMode() {
|
2012-03-30 20:16:24 +00:00
|
|
|
return IgnoreMultiScreen;
|
2012-03-04 18:24:13 +00:00
|
|
|
}
|
|
|
|
static ClientSwitchingMode defaultSwitchingMode() {
|
|
|
|
return FocusChainSwitching;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
static bool defaultShowTabBox() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
static bool defaultHighlightWindow() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
static QString defaultLayoutName() {
|
2014-10-28 15:45:30 +00:00
|
|
|
return QStringLiteral("org.kde.breeze.desktop");
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
TabBoxConfigPrivate* d;
|
|
|
|
};
|
2009-09-13 11:36:45 +00:00
|
|
|
|
|
|
|
} // namespace TabBox
|
|
|
|
} // namespace KWin
|
|
|
|
|
|
|
|
#endif // TABBOXCONFIG_H
|