1// Copyright (C) 2021 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 QQUICKFOLDERBREADCRUMBBAR_P_H
5#define QQUICKFOLDERBREADCRUMBBAR_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 <QtQuickTemplates2/private/qquicktextfield_p.h>
21
22#include "qquickfiledialogimpl_p.h"
23
24QT_BEGIN_NAMESPACE
25
26class QQuickFolderBreadcrumbBarPrivate;
27
28class Q_QUICKDIALOGS2QUICKIMPL_PRIVATE_EXPORT QQuickFolderBreadcrumbBar : public QQuickContainer
29{
30 Q_OBJECT
31 Q_PROPERTY(QQuickDialog *dialog READ dialog WRITE setDialog NOTIFY dialogChanged)
32 Q_PROPERTY(QQmlComponent *buttonDelegate READ buttonDelegate WRITE setButtonDelegate NOTIFY buttonDelegateChanged)
33 Q_PROPERTY(QQmlComponent *separatorDelegate READ separatorDelegate WRITE setSeparatorDelegate NOTIFY separatorDelegateChanged)
34 Q_PROPERTY(QQuickAbstractButton *upButton READ upButton WRITE setUpButton NOTIFY upButtonChanged)
35 Q_PROPERTY(QQuickTextField *textField READ textField WRITE setTextField NOTIFY textFieldChanged)
36 Q_PROPERTY(int upButtonSpacing READ upButtonSpacing WRITE setUpButtonSpacing NOTIFY upButtonSpacingChanged)
37 QML_NAMED_ELEMENT(FolderBreadcrumbBar)
38 QML_ADDED_IN_VERSION(6, 2)
39
40public:
41 explicit QQuickFolderBreadcrumbBar(QQuickItem *parent = nullptr);
42
43 QQuickDialog *dialog() const;
44 void setDialog(QQuickDialog *dialog);
45
46 QQmlComponent *buttonDelegate();
47 void setButtonDelegate(QQmlComponent *delegate);
48
49 QQmlComponent *separatorDelegate();
50 void setSeparatorDelegate(QQmlComponent *delegate);
51
52 QQuickAbstractButton *upButton();
53 void setUpButton(QQuickAbstractButton *upButton);
54
55 int upButtonSpacing() const;
56 void setUpButtonSpacing(int upButtonSpacing);
57
58 QQuickTextField *textField();
59 void setTextField(QQuickTextField *textField);
60
61Q_SIGNALS:
62 void dialogChanged();
63 void buttonDelegateChanged();
64 void separatorDelegateChanged();
65 void upButtonChanged();
66 void upButtonSpacingChanged();
67 void textFieldChanged();
68
69protected:
70 bool event(QEvent *event) override;
71 void keyPressEvent(QKeyEvent *event) override;
72
73 void componentComplete() override;
74
75 void itemChange(ItemChange change, const ItemChangeData &data) override;
76
77 bool isContent(QQuickItem *item) const override;
78
79 QFont defaultFont() const override;
80
81#if QT_CONFIG(accessibility)
82 QAccessible::Role accessibleRole() const override;
83#endif
84
85private:
86 Q_DISABLE_COPY(QQuickFolderBreadcrumbBar)
87 Q_DECLARE_PRIVATE(QQuickFolderBreadcrumbBar)
88};
89
90QT_END_NAMESPACE
91
92QML_DECLARE_TYPE(QQuickFolderBreadcrumbBar)
93
94#endif // QQUICKFOLDERBREADCRUMBBAR_P_H
95

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