File indexing completed on 2024-05-05 09:51:13

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