File indexing completed on 2024-04-21 16:17:35

0001 /*
0002  *  SPDX-FileCopyrightText: 2012 Alejandro Fiestas Olivares <afiestas@kde.org>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.1-or-later
0005  */
0006 
0007 #ifndef SCREEN_CONFIG_H
0008 #define SCREEN_CONFIG_H
0009 
0010 #include "kscreen_export.h"
0011 #include "types.h"
0012 
0013 #include <QObject>
0014 #include <QSize>
0015 
0016 namespace KScreen
0017 {
0018 class KSCREEN_EXPORT Screen : public QObject
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     Q_PROPERTY(int id READ id CONSTANT)
0024     Q_PROPERTY(QSize currentSize READ currentSize WRITE setCurrentSize NOTIFY currentSizeChanged)
0025     Q_PROPERTY(QSize minSize READ minSize CONSTANT)
0026     Q_PROPERTY(QSize maxSize READ maxSize CONSTANT)
0027     Q_PROPERTY(int maxActiveOutputsCount READ maxActiveOutputsCount CONSTANT)
0028 
0029     explicit Screen();
0030     ~Screen() override;
0031 
0032     ScreenPtr clone() const;
0033 
0034     /**
0035      * The id of this screen.
0036      * @return id of this screen
0037      */
0038     int id() const;
0039     /**
0040      * The identifier of this screen.
0041      * @param id id of the screen
0042      */
0043     void setId(int id);
0044 
0045     /**
0046      * The current screen size in pixels.
0047      * @return Screen size in pixels
0048      */
0049     QSize currentSize() const;
0050     /**
0051      * Set the current screen size in pixels.
0052      * @param currentSize Screen size in pixels
0053      */
0054     void setCurrentSize(const QSize &currentSize);
0055 
0056     /**
0057      * The minimum screen size in pixels.
0058      * @return Minimum screen size in pixels
0059      */
0060     QSize minSize() const;
0061     /**
0062      * Set the minimum screen size in pixels.
0063      * @param minSize Minimum screen size in pixels
0064      */
0065     void setMinSize(const QSize &minSize);
0066 
0067     /**
0068      * The maximum screen size in pixels.
0069      * @return Maximum screen size in pixels
0070      */
0071     QSize maxSize() const;
0072     /**
0073      * Set the maximum screen size in pixels.
0074      * @param maxSize Maximum screen size in pixels
0075      */
0076     void setMaxSize(const QSize &maxSize);
0077 
0078     int maxActiveOutputsCount() const;
0079     void setMaxActiveOutputsCount(int maxActiveOutputsCount);
0080 
0081     void apply(const ScreenPtr &other);
0082 
0083 Q_SIGNALS:
0084     void currentSizeChanged();
0085 
0086 private:
0087     Q_DISABLE_COPY(Screen)
0088 
0089     class Private;
0090     Private *const d;
0091 
0092     Screen(Private *dd);
0093 };
0094 
0095 } // KScreen namespace
0096 #endif // SCREEN_H