Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
IDesktopWidgetFactory.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3#pragma once
4
6#include <PhosphorRegistry/phosphorregistry_export.h>
7
8#include <QtCore/qtclasshelpermacros.h>
9
10QT_BEGIN_NAMESPACE
11class QObject;
12class QQmlEngine;
13class QQuickItem;
14QT_END_NAMESPACE
15
16namespace PhosphorRegistry {
17
18// Factory for one desktop card / widget (calendar, weather, system
19// monitor, media, shortcuts) — the kinds of things that sit on the
20// dashboard or as standalone desktop tiles.
21//
22// Phase 1.3 ships this as a documented header; the consuming
23// Dashboard / desktop-widget surface lands in Phase 4.4 (cards
24// reused inside Control Center) and Phase 5 (standalone dashboard).
25class PHOSPHORREGISTRY_EXPORT IDesktopWidgetFactory : public IFactoryBase
26{
27public:
29 ~IDesktopWidgetFactory() override = default;
30 Q_DISABLE_COPY_MOVE(IDesktopWidgetFactory)
31
32 // Construct a widget QQuickItem rooted at parent. engine MUST
33 // NOT be null. Same lifetime contract as
34 // IBarWidgetFactory::createWidget. Returning nullptr means the
35 // widget is unavailable in the current environment.
36 [[nodiscard]] virtual QQuickItem* createWidget(QQmlEngine* engine, QObject* parent) = 0;
37};
38
39} // namespace PhosphorRegistry
virtual QQuickItem * createWidget(QQmlEngine *engine, QObject *parent)=0
Definition IBarWidgetFactory.h:16