File indexing completed on 2024-05-19 11:48:25

0001 /*
0002     SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>
0003     SPDX-FileCopyrightText: 2017 David Edmundson <davidedmundson@kde.org>
0004     SPDX-FileCopyrightText: 2016 The Qt Company Ltd. <https://www.qt.io/licensing/>
0005 
0006     This file is part of the Qt Quick Controls module of the Qt Toolkit.
0007 
0008     SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KFQF-Accepted-GPL OR LicenseRef-Qt-Commercial
0009 */
0010 
0011 #ifndef KQUICKPADDING_H
0012 #define KQUICKPADDING_H
0013 
0014 #include <QObject>
0015 
0016 class KQuickPadding : public QObject
0017 {
0018     Q_OBJECT
0019 
0020     Q_PROPERTY(int left READ left WRITE setLeft NOTIFY leftChanged)
0021     Q_PROPERTY(int top READ top WRITE setTop NOTIFY topChanged)
0022     Q_PROPERTY(int right READ right WRITE setRight NOTIFY rightChanged)
0023     Q_PROPERTY(int bottom READ bottom WRITE setBottom NOTIFY bottomChanged)
0024 
0025     int m_left;
0026     int m_top;
0027     int m_right;
0028     int m_bottom;
0029 
0030 public:
0031     KQuickPadding(QObject *parent = nullptr)
0032         : QObject(parent)
0033         , m_left(0)
0034         , m_top(0)
0035         , m_right(0)
0036         , m_bottom(0)
0037     {
0038     }
0039 
0040     int left() const
0041     {
0042         return m_left;
0043     }
0044     int top() const
0045     {
0046         return m_top;
0047     }
0048     int right() const
0049     {
0050         return m_right;
0051     }
0052     int bottom() const
0053     {
0054         return m_bottom;
0055     }
0056 
0057 public Q_SLOTS:
0058     void setLeft(int arg)
0059     {
0060         if (m_left != arg) {
0061             m_left = arg;
0062             Q_EMIT leftChanged();
0063         }
0064     }
0065     void setTop(int arg)
0066     {
0067         if (m_top != arg) {
0068             m_top = arg;
0069             Q_EMIT topChanged();
0070         }
0071     }
0072     void setRight(int arg)
0073     {
0074         if (m_right != arg) {
0075             m_right = arg;
0076             Q_EMIT rightChanged();
0077         }
0078     }
0079     void setBottom(int arg)
0080     {
0081         if (m_bottom != arg) {
0082             m_bottom = arg;
0083             Q_EMIT bottomChanged();
0084         }
0085     }
0086 
0087 Q_SIGNALS:
0088     void leftChanged();
0089     void topChanged();
0090     void rightChanged();
0091     void bottomChanged();
0092 };
0093 
0094 #endif // QQUICKPADDING_H