Skip to content
Phosphor
/
API Reference
Search
PlasmaZones
Libraries
Guides
Brand
Palette
About
GitHub
Discord
Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
LayoutSourceBundle.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 <phosphorlayoutapi_export.h>
7
8
#include <
PhosphorLayoutApi/CompositeLayoutSource.h
>
9
#include <
PhosphorLayoutApi/ILayoutSource.h
>
10
#include <
PhosphorLayoutApi/ILayoutSourceFactory.h
>
11
#include <
PhosphorLayoutApi/LayoutSourceProviderRegistry.h
>
12
13
#include <PhosphorRegistry/Registry.h>
14
15
#include <QHash>
16
17
#include <memory>
18
#include <vector>
19
20
namespace
PhosphorLayout
{
21
47
class
PHOSPHORLAYOUTAPI_EXPORT
LayoutSourceBundle
48
{
49
public
:
50
LayoutSourceBundle
();
51
~LayoutSourceBundle
();
52
53
LayoutSourceBundle
(
const
LayoutSourceBundle
&) =
delete
;
54
LayoutSourceBundle
&
operator=
(
const
LayoutSourceBundle
&) =
delete
;
55
LayoutSourceBundle
(
LayoutSourceBundle
&&) noexcept;
56
LayoutSourceBundle
& operator=(
LayoutSourceBundle
&&) noexcept;
57
68
void
addFactory(std::unique_ptr<
ILayoutSourceFactory
> factory);
69
81
void
build();
82
121
void
buildFromRegistered(const
FactoryContext
& ctx);
122
125
CompositeLayoutSource
* composite()
const
126
{
127
return
m_composite.get();
128
}
129
148
ILayoutSource
*
source
(
const
QString& name)
const
;
149
150
private
:
159
std::unique_ptr<PhosphorRegistry::Registry<ILayoutSourceFactory>> m_factoryRegistry;
160
std::vector<std::unique_ptr<ILayoutSource>> m_sources;
166
QHash<QString, std::size_t> m_sourceIndex;
172
std::unique_ptr<CompositeLayoutSource> m_composite;
173
};
174
175
}
// namespace PhosphorLayout
CompositeLayoutSource.h
ILayoutSourceFactory.h
ILayoutSource.h
LayoutSourceProviderRegistry.h
PhosphorLayout::CompositeLayoutSource
Aggregates multiple ILayoutSource implementations behind one ILayoutSource interface.
Definition
CompositeLayoutSource.h:39
PhosphorLayout::FactoryContext
Service registry passed to a layout-source-provider builder so it can pull whatever registries / depe...
Definition
LayoutSourceProviderRegistry.h:66
PhosphorLayout::ILayoutSourceFactory
Abstract factory for an ILayoutSource implementation.
Definition
ILayoutSourceFactory.h:46
PhosphorLayout::ILayoutSource
Abstract producer of LayoutPreview values.
Definition
ILayoutSource.h:48
PhosphorLayout::LayoutSourceBundle
Owning bundle that assembles a list of ILayoutSourceFactory instances into a single CompositeLayoutSo...
Definition
LayoutSourceBundle.h:48
PhosphorLayout::LayoutSourceBundle::LayoutSourceBundle
LayoutSourceBundle(LayoutSourceBundle &&) noexcept
PhosphorLayout::LayoutSourceBundle::LayoutSourceBundle
LayoutSourceBundle(const LayoutSourceBundle &)=delete
PhosphorLayout::LayoutSourceBundle::~LayoutSourceBundle
~LayoutSourceBundle()
PhosphorLayout::LayoutSourceBundle::operator=
LayoutSourceBundle & operator=(const LayoutSourceBundle &)=delete
PhosphorLayout::LayoutSourceBundle::LayoutSourceBundle
LayoutSourceBundle()
PhosphorLayout::LayoutSourceBundle::source
ILayoutSource * source(const QString &name) const
Borrowed access to the source produced by the factory whose name() matches name.
PhosphorLayout
Definition
AlgorithmMetadata.h:10
phosphor-layout-api
include
PhosphorLayoutApi
LayoutSourceBundle.h
Generated by
1.9.8