Loading...
Searching...
No Matches
LibraryInterface.hpp
1#pragma once
2#include <Library/ProcessEntry.hpp>
3
4#include <score/application/GUIApplicationContext.hpp>
5#include <score/document/DocumentContext.hpp>
6#include <score/plugins/Interface.hpp>
7#include <score/plugins/InterfaceList.hpp>
8#include <score/tools/std/StringHash.hpp>
9
10#include <score_plugin_library_export.h>
11
12#include <functional>
13class QAbstractItemModel;
14class QMimeData;
15class QDir;
16namespace Process
17{
18struct Preset;
19}
20
21namespace Library
22{
23class ProcessesItemModel;
24class FileSystemModel;
25class SCORE_PLUGIN_LIBRARY_EXPORT LibraryInterface : public score::InterfaceBase
26{
27 SCORE_INTERFACE(LibraryInterface, "9b94d974-9f2d-4986-a62b-b69e51a4d305")
28public:
29 ~LibraryInterface() override;
30
31 virtual QSet<QString> acceptedFiles() const noexcept;
32 virtual QSet<QString> acceptedMimeTypes() const noexcept;
33
34 virtual QWidget* previewWidget(const QString& path, QWidget* parent) const noexcept;
35 virtual QWidget*
36 previewWidget(const Process::Preset& preset, QWidget* parent) const noexcept;
37
38 virtual void setup(ProcessesItemModel& model, const score::GUIApplicationContext& ctx);
39 virtual void addPath(std::string_view);
40 virtual void removePath(std::string_view);
41
48 virtual std::optional<ProcessEntry> scanPath(std::string_view path);
49
57 virtual std::function<void()> asyncAddPath(std::string_view path);
58 virtual bool onDrop(const QMimeData& mime, int row, int column, const QDir& parent);
59
60 virtual bool onDoubleClick(const QString& path, const score::DocumentContext& ctx);
61};
62
63class SCORE_PLUGIN_LIBRARY_EXPORT LibraryInterfaceList final
64 : public score::InterfaceList<LibraryInterface>
65{
66public:
67 ~LibraryInterfaceList() override;
68};
69
71{
72 SCORE_CONCRETE("e4785238-af94-4fe9-9e5b-12b9555a2482")
73public:
74 ~LibraryDocumentLoader() override;
75
76 QSet<QString> acceptedFiles() const noexcept override;
77
78 bool onDoubleClick(const QString& path, const score::DocumentContext& ctx) override;
79};
80}
Definition LibraryInterface.hpp:71
Definition LibraryInterface.hpp:26
Definition LibraryInterface.hpp:65
Definition ProcessesItemModel.hpp:38
Base class for plug-in interfaces.
Definition Interface.hpp:52
InterfaceList Default implementation of InterfaceListBase.
Definition InterfaceList.hpp:97
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1115
Definition Preset.hpp:32
Definition DocumentContext.hpp:18
Specializes ApplicationContext with the QMainWindow.
Definition GUIApplicationContext.hpp:15