File indexing completed on 2025-02-09 06:41:24

0001 /*
0002     SPDX-FileCopyrightText: 2023 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef DIALOGBACKGROUND_P_H
0008 #define DIALOGBACKGROUND_P_H
0009 
0010 #include "sharedqmlengine.h"
0011 #include <KSvg/FrameSvg>
0012 
0013 #include <QQuickItem>
0014 
0015 //
0016 //  W A R N I N G
0017 //  -------------
0018 //
0019 // This file is not part of the public Plasma API.  It exists purely as an
0020 // implementation detail.  This header file may change from version to
0021 // version without notice, or even be removed.
0022 //
0023 // We mean it.
0024 //
0025 
0026 namespace PlasmaQuick
0027 {
0028 class SharedQmlEngine;
0029 
0030 // This class wraps a FrameSvgITem created from QML, so is not necessary to statically link to it to be used in Dialog
0031 class DialogBackground : public QQuickItem
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036     DialogBackground(QQuickItem *parent = nullptr);
0037     ~DialogBackground() override;
0038 
0039     QString imagePath() const;
0040     void setImagePath(const QString &name);
0041 
0042     void setEnabledBorders(const KSvg::FrameSvg::EnabledBorders borders);
0043     KSvg::FrameSvg::EnabledBorders enabledBorders() const;
0044 
0045     QRegion mask() const;
0046 
0047     qreal leftMargin() const;
0048     qreal topMargin() const;
0049     qreal rightMargin() const;
0050     qreal bottomMargin() const;
0051 
0052     // Needed for the QML api of Dialog
0053     QObject *fixedMargins() const;
0054     QObject *inset() const;
0055 
0056 Q_SIGNALS:
0057     void fixedMarginsChanged();
0058     void maskChanged();
0059 
0060 private:
0061     QQuickItem *m_frameSvgItem;
0062     SharedQmlEngine *m_sharedEngine;
0063 };
0064 
0065 }
0066 
0067 #endif // multiple inclusion guard