Loading...
Searching...
No Matches
ExplorerModelProvider.hpp
1#pragma once
2#include <Device/Widgets/DeviceModelProvider.hpp>
3
4#include <Explorer/DocumentPlugin/DeviceDocumentPlugin.hpp>
5
6#include <score/document/DocumentContext.hpp>
7
8namespace Explorer
9{
11{
12 SCORE_CONCRETE("a06e7c4e-a817-411c-8412-1d3f4ddce5e7")
13public:
14 ~ModelProvider() override = default;
15
17 getNodeModel(const score::DocumentContext& ctx) const noexcept override
18 {
19 auto plug = ctx.findPlugin<DeviceDocumentPlugin>();
20 if(plug)
21 {
22 return &plug->explorer();
23 }
24 return nullptr;
25 }
26
28 const QString& name, const score::DocumentContext& ctx) const noexcept override
29 {
30 if(auto plug = ctx.findPlugin<DeviceDocumentPlugin>())
31 return plug->list().findDevice(name);
32 return nullptr;
33 }
34
35 std::shared_ptr<void>
36 listenToAllAddresses(const score::DocumentContext& ctx) const noexcept override;
37};
38}
Definition DeviceInterface.hpp:107
Definition DeviceModelProvider.hpp:18
Definition NodeBasedItemModel.hpp:23
Definition ExplorerModelProvider.hpp:11
std::shared_ptr< void > listenToAllAddresses(const score::DocumentContext &ctx) const noexcept override
Listens to every address of every device of the document.
Definition ExplorerModelProvider.cpp:50
Device::DeviceInterface * findDevice(const QString &name, const score::DocumentContext &ctx) const noexcept override
Finds a device of the document by name, even if the explorer does not show it.
Definition ExplorerModelProvider.hpp:27
Definition DocumentContext.hpp:18