1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKSIDEBAR_P_H
5#define QQUICKSIDEBAR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQml/qqmlcomponent.h>
19#include <QtQuickTemplates2/private/qquickcontainer_p.h>
20#include <QtCore/qstandardpaths.h>
21
22#include "qquickfiledialogimpl_p.h"
23
24QT_BEGIN_NAMESPACE
25
26class QQuickSideBarPrivate;
27
28class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickSideBar : public QQuickContainer
29{
30 Q_OBJECT
31 Q_PROPERTY(QQuickDialog *dialog READ dialog WRITE setDialog NOTIFY dialogChanged FINAL)
32 Q_PROPERTY(QList<QStandardPaths::StandardLocation> folderPaths READ folderPaths WRITE setFolderPaths NOTIFY folderPathsChanged FINAL)
33 Q_PROPERTY(QList<QStandardPaths::StandardLocation> effectiveFolderPaths READ effectiveFolderPaths NOTIFY effectiveFolderPathsChanged FINAL)
34 Q_PROPERTY(QList<QUrl> favoritePaths READ favoritePaths NOTIFY favoritePathsChanged FINAL)
35 Q_PROPERTY(QQmlComponent *buttonDelegate READ buttonDelegate WRITE setButtonDelegate NOTIFY buttonDelegateChanged FINAL)
36 Q_PROPERTY(QQmlComponent *separatorDelegate READ separatorDelegate WRITE setSeparatorDelegate NOTIFY separatorDelegateChanged FINAL)
37 Q_PROPERTY(QQmlComponent *addFavoriteDelegate READ addFavoriteDelegate WRITE setAddFavoriteDelegate NOTIFY addFavoriteDelegateChanged FINAL)
38 QML_NAMED_ELEMENT(SideBar)
39 QML_ADDED_IN_VERSION(6, 9)
40
41public:
42 explicit QQuickSideBar(QQuickItem *parent = nullptr);
43 ~QQuickSideBar();
44
45 QQuickDialog *dialog() const;
46 void setDialog(QQuickDialog *dialog);
47
48 QList<QStandardPaths::StandardLocation> folderPaths() const;
49 void setFolderPaths(const QList<QStandardPaths::StandardLocation>& folderPaths);
50
51 QList<QStandardPaths::StandardLocation> effectiveFolderPaths() const;
52
53 QList<QUrl> favoritePaths() const;
54
55 QQmlComponent *buttonDelegate() const;
56 void setButtonDelegate(QQmlComponent *delegate);
57
58 QQmlComponent *separatorDelegate() const;
59 void setSeparatorDelegate(QQmlComponent *delegate);
60
61 QQmlComponent *addFavoriteDelegate() const;
62 void setAddFavoriteDelegate(QQmlComponent *delegate);
63
64
65Q_SIGNALS:
66 void dialogChanged();
67 void folderPathsChanged();
68 void effectiveFolderPathsChanged();
69 void favoritePathsChanged();
70 void buttonDelegateChanged();
71 void separatorDelegateChanged();
72 void addFavoriteDelegateChanged();
73
74protected:
75 void componentComplete() override;
76
77private:
78 void setFavoritePaths(const QList<QUrl>& favoritePaths);
79
80 Q_DISABLE_COPY(QQuickSideBar)
81 Q_DECLARE_PRIVATE(QQuickSideBar)
82};
83
84QT_END_NAMESPACE
85
86#endif // QQUICKSIDEBAR_P_H
87

source code of qtdeclarative/src/quickdialogs/quickdialogsquickimpl/qquicksidebar_p.h