score
Home
Classes
Namespaces
Files
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
8
namespace
Explorer
9
{
10
class
ModelProvider
final :
public
Device::DeviceModelProvider
11
{
12
SCORE_CONCRETE(
"a06e7c4e-a817-411c-8412-1d3f4ddce5e7"
)
13
public
:
14
~
ModelProvider
()
override
=
default
;
15
16
Device::NodeBasedItemModel
*
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
};
27
}
Device::DeviceModelProvider
Definition:
DeviceModelProvider.hpp:15
Device::NodeBasedItemModel
Definition:
NodeBasedItemModel.hpp:18
Explorer::ModelProvider
Definition:
ExplorerModelProvider.hpp:11
score::DocumentContext
Definition:
DocumentContext.hpp:18