File indexing completed on 2024-05-12 05:32:13

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2009 Martin Gräßlin <mgraesslin@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include <QString>
0013 
0014 /**
0015  * @file
0016  * This file defines the class TabBoxConfig.
0017  *
0018  * @author Martin Gräßlin <mgraesslin@kde.org>
0019  * @since 4.4
0020  */
0021 
0022 namespace KWin
0023 {
0024 namespace TabBox
0025 {
0026 class TabBoxConfigPrivate;
0027 
0028 /**
0029  * The TabBoxConfig class holds all configuration options for the TabBox.
0030  * The TabBoxHandler contains a pointer to an object of this class and is
0031  * used by all classes of TabBox. The config defines what kind of data the
0032  * TabBox is displaying and how the layout looks like. There can be different
0033  * Config sets and by setting a new config in the TabBoxHandler the behaviour
0034  * of the TabBox is changed immediately.
0035  *
0036  * @author Martin Gräßlin <mgraesslin@kde.org>
0037  * @since 4.4
0038  */
0039 class TabBoxConfig
0040 {
0041 public:
0042     /**
0043      * ClientDesktopMode defines whether windows from the current desktop or from all
0044      * desktops are included in the Window List in the ClientModel
0045      */
0046     enum ClientDesktopMode {
0047         AllDesktopsClients, ///< Windows from all desktops are included.
0048         OnlyCurrentDesktopClients, ///< Only Windows on current desktop are included
0049         ExcludeCurrentDesktopClients ///< Exclude Windows on current desktop
0050     };
0051     /**
0052      * ClientActivitiesMode defines whether windows from the current activity or from all
0053      * activities are included in the Window List in the ClientModel
0054      */
0055     enum ClientActivitiesMode {
0056         AllActivitiesClients, ///< Windows from all Activities are included.
0057         OnlyCurrentActivityClients, ///< Only Windows on current activity are included
0058         ExcludeCurrentActivityClients ///< Exclude Windows on current activity
0059     };
0060     /**
0061      * ClientApplicationsMode defines which windows from the current application or from all
0062      * applications are included in the Window List in the ClientModel
0063      */
0064     enum ClientApplicationsMode {
0065         AllWindowsAllApplications, ///< Windows from all applications are included
0066         OneWindowPerApplication, ///< Only one Window for each application is included
0067         AllWindowsCurrentApplication ///< Only Windows for the current application are included
0068     };
0069     /**
0070      * ClientMinimizedMode defines which windows are included in the Window List
0071      * in the ClientModel based on whether they are minimized or not
0072      */
0073     enum ClientMinimizedMode {
0074         IgnoreMinimizedStatus, ///< Windows are included no matter they are minimized or not
0075         ExcludeMinimizedClients, ///< Exclude minimized Windows
0076         OnlyMinimizedClients ///< Only minimized Windows are included
0077     };
0078     /**
0079      * ShowDesktopMode defines whether a Window representing the desktop
0080      * is included in the Window List in the ClientModel
0081      */
0082     enum ShowDesktopMode {
0083         DoNotShowDesktopClient, ///< A Window representing the desktop is not included
0084         ShowDesktopClient ///< A Window representing the desktop is included
0085     };
0086     /**
0087      * OrderMinimizedMode defines whether the Windows considered part of the
0088      * Window List should be grouped by the minimisation status
0089      */
0090     enum OrderMinimizedMode {
0091         NoGroupByMinimized, ///< Windows are not grouped by whether they are minimized
0092         GroupByMinimized ///< Windows are grouped by whether they are minimized or not
0093     };
0094     /**
0095      * ClientActivitiesMode defines whether windows from the current activity or from all
0096      * activities are included in the Window List in the ClientModel
0097      */
0098     enum ClientMultiScreenMode {
0099         IgnoreMultiScreen, ///< Windows are included independently of the screen they are on
0100         OnlyCurrentScreenClients, ///< Only Windows on current screen are included
0101         ExcludeCurrentScreenClients ///< Exclude Windows from the current screen
0102     };
0103     /**
0104      * ClientSwitchingMode defines the sorting of the Windows in the
0105      * ClientModel.
0106      */
0107     enum ClientSwitchingMode {
0108         FocusChainSwitching, ///< Sort by recently used. Most recently used Window is the first
0109         StackingOrderSwitching ///< Sort by current stacking order
0110     };
0111     TabBoxConfig();
0112     ~TabBoxConfig();
0113     TabBoxConfig &operator=(const TabBoxConfig &object);
0114 
0115     // getters
0116     /**
0117      * @return If the TabBox should be shown or not
0118      * @see setShowTabBox
0119      * @see defaultShowTabBox
0120      */
0121     bool isShowTabBox() const;
0122     /**
0123      * @return If Highlight Window effect should be used.
0124      * @see setHighlightWindows
0125      * @see defaultHighlightWindows
0126      */
0127     bool isHighlightWindows() const;
0128     /**
0129      * @return The current ClientDesktopMode
0130      * @see setClientDesktopMode
0131      * @see defaultDesktopMode
0132      */
0133     ClientDesktopMode clientDesktopMode() const;
0134     /**
0135      * @return The current ClientActivitiesMode
0136      * @see setClientActivitiesMode
0137      * @see defaultActivitiesMode
0138      */
0139     ClientActivitiesMode clientActivitiesMode() const;
0140     /**
0141      * @return The current ClientApplicationsMode
0142      * @see setClientApplicationsMode
0143      * @see defaultApplicationsMode
0144      */
0145     ClientApplicationsMode clientApplicationsMode() const;
0146     /**
0147      * @return The current OrderMinimizedMode
0148      * @see setOrderMinimizedMode
0149      * @see defaultOrderMinimizedMode
0150      */
0151     OrderMinimizedMode orderMinimizedMode() const;
0152     /**
0153      * @return The current ClientMinimizedMode
0154      * @see setClientMinimizedMode
0155      * @see defaultMinimizedMode
0156      */
0157     ClientMinimizedMode clientMinimizedMode() const;
0158     /**
0159      * @return The current ShowDesktopMode
0160      * @see setShowDesktopMode
0161      * @see defaultShowDesktopMode
0162      */
0163     ShowDesktopMode showDesktopMode() const;
0164     /**
0165      * @return The current ClientMultiScreenMode
0166      * @see setClientMultiScreenMode
0167      * @see defaultMultiScreenMode
0168      */
0169     ClientMultiScreenMode clientMultiScreenMode() const;
0170     /**
0171      * @return The current ClientSwitchingMode.
0172      * @see setClientSwitchingMode
0173      * @see defaultSwitchingMode
0174      */
0175     ClientSwitchingMode clientSwitchingMode() const;
0176     /**
0177      * @return Then name of the current ItemLayout
0178      * @see setlayoutName
0179      */
0180     QString &layoutName() const;
0181 
0182     // setters
0183     /**
0184      * @param show The tabbox should be shown or not.
0185      * @see isShowTabBox
0186      */
0187     void setShowTabBox(bool show);
0188     /**
0189      * @param highlight Highlight Windows effect should be used or not.
0190      * @see isHighlightWindows
0191      */
0192     void setHighlightWindows(bool highlight);
0193     /**
0194      * @param desktopMode The new ClientDesktopMode to be used.
0195      * @see clientDesktopMode
0196      */
0197     void setClientDesktopMode(ClientDesktopMode desktopMode);
0198     /**
0199      * @param activitiesMode The new ClientActivitiesMode to be used.
0200      * @see clientActivitiesMode
0201      */
0202     void setClientActivitiesMode(ClientActivitiesMode activitiesMode);
0203     /**
0204      * @param applicationsMode The new ClientApplicationsMode to be used.
0205      * @see clientApplicationsMode
0206      */
0207     void setClientApplicationsMode(ClientApplicationsMode applicationsMode);
0208     /**
0209      * @param orderMinimizedMode The new OrderMinimizedMode to be used.
0210      * @see orderMinimizedMode
0211      */
0212     void setOrderMinimizedMode(OrderMinimizedMode orderMinimizedMode);
0213     /**
0214      * @param minimizedMode The new ClientMinimizedMode to be used.
0215      * @see clientMinimizedMode
0216      */
0217     void setClientMinimizedMode(ClientMinimizedMode minimizedMode);
0218     /**
0219      * @param showDesktopMode The new ShowDesktopMode to be used.
0220      * @see showDesktopMode
0221      */
0222     void setShowDesktopMode(ShowDesktopMode showDesktopMode);
0223     /**
0224      * @param multiScreenMode The new ClientMultiScreenMode to be used.
0225      * @see clientMultiScreenMode
0226      */
0227     void setClientMultiScreenMode(ClientMultiScreenMode multiScreenMode);
0228     /**
0229      * @param switchingMode The new ClientSwitchingMode to be used.
0230      * @see clientSwitchingMode
0231      */
0232     void setClientSwitchingMode(ClientSwitchingMode switchingMode);
0233     /**
0234      * @param name The new ItemLayout config name
0235      * @see layoutName
0236      */
0237     void setLayoutName(const QString &name);
0238 
0239     // some static methods to access default values
0240     static ClientDesktopMode defaultDesktopMode()
0241     {
0242         return OnlyCurrentDesktopClients;
0243     }
0244     static ClientActivitiesMode defaultActivitiesMode()
0245     {
0246         return OnlyCurrentActivityClients;
0247     }
0248     static ClientApplicationsMode defaultApplicationsMode()
0249     {
0250         return AllWindowsAllApplications;
0251     }
0252     static OrderMinimizedMode defaultOrderMinimizedMode()
0253     {
0254         return NoGroupByMinimized;
0255     }
0256     static ClientMinimizedMode defaultMinimizedMode()
0257     {
0258         return IgnoreMinimizedStatus;
0259     }
0260     static ShowDesktopMode defaultShowDesktopMode()
0261     {
0262         return DoNotShowDesktopClient;
0263     }
0264     static ClientMultiScreenMode defaultMultiScreenMode()
0265     {
0266         return IgnoreMultiScreen;
0267     }
0268     static ClientSwitchingMode defaultSwitchingMode()
0269     {
0270         return FocusChainSwitching;
0271     }
0272     static bool defaultShowTabBox()
0273     {
0274         return true;
0275     }
0276     static bool defaultHighlightWindow()
0277     {
0278         return true;
0279     }
0280     static QString defaultLayoutName()
0281     {
0282         return QStringLiteral("thumbnail_grid");
0283     }
0284 
0285 private:
0286     TabBoxConfigPrivate *d;
0287 };
0288 
0289 } // namespace TabBox
0290 } // namespace KWin