Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
SidebarRows.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include "phosphorcontrol_export.h"
7
8// Full definition, not a forward declaration: the QPointer<PageRegistry>
9// member and the QML-registered Q_PROPERTY over PageRegistry* both need the
10// complete type, not just a forward declaration.
11#include "PageRegistry.h"
12
13#include <QObject>
14#include <QPointer>
15#include <QString>
16#include <QVariantList>
17#include <QVariantMap>
18#include <QtQml/qqmlregistration.h>
19
20namespace PhosphorControl {
21
57class PHOSPHORCONTROL_EXPORT SidebarRows : public QObject
58{
59 Q_OBJECT
60 QML_NAMED_ELEMENT(SidebarRows)
62
63public:
64 explicit SidebarRows(QObject* parent = nullptr);
65 ~SidebarRows() override;
66
69
74 Q_INVOKABLE static QString dividerPrefix();
75
98 Q_INVOKABLE QVariantList build(bool flattenTree, const QString& searchText, const QString& currentParentId,
99 const QVariantMap& expandedCategories, const QVariantMap& flatTitleOverrides) const;
100
111 Q_INVOKABLE QVariantMap flatPageData(const QString& pageId, const QVariantMap& flatTitleOverrides) const;
112
133 Q_INVOKABLE QString resolveDrillScope(const QString& currentParentId) const;
134
135Q_SIGNALS:
137
138private:
145 QPointer<PageRegistry> m_registry;
151 QMetaObject::Connection m_registryDestroyed;
152};
153
154} // namespace PhosphorControl
Holds the catalogue of pages an application has registered.
Definition PageRegistry.h:46
QString resolveDrillScope(const QString &currentParentId) const
The drill scope the rail should actually be in, given currentParentId.
void setRegistry(PageRegistry *registry)
QVariantMap flatPageData(const QString &pageId, const QVariantMap &flatTitleOverrides) const
Registry page-data for pageId with its flat-mode title override applied, or an empty map for an unkno...
SidebarRows(QObject *parent=nullptr)
PageRegistry * registry() const
QVariantList build(bool flattenTree, const QString &searchText, const QString &currentParentId, const QVariantMap &expandedCategories, const QVariantMap &flatTitleOverrides) const
Build the visible row list.
static QString dividerPrefix()
The prefix stamped onto a synthetic divider row's pageId.
Definition ApplicationController.h:21