Loading...
Searching...
No Matches
LibraryInterface.hpp
1#pragma once
2#include <score/application/GUIApplicationContext.hpp>
3#include <score/document/DocumentContext.hpp>
4#include <score/plugins/Interface.hpp>
5#include <score/plugins/InterfaceList.hpp>
6#include <score/tools/std/StringHash.hpp>
7
8#include <score_plugin_library_export.h>
9
10#include <functional>
11class QAbstractItemModel;
12class QMimeData;
13class QDir;
14namespace Process
15{
16struct Preset;
17}
18
19namespace Library
20{
21class ProcessesItemModel;
22class FileSystemModel;
23class SCORE_PLUGIN_LIBRARY_EXPORT LibraryInterface : public score::InterfaceBase
24{
25 SCORE_INTERFACE(LibraryInterface, "9b94d974-9f2d-4986-a62b-b69e51a4d305")
26public:
27 ~LibraryInterface() override;
28
29 virtual QSet<QString> acceptedFiles() const noexcept;
30 virtual QSet<QString> acceptedMimeTypes() const noexcept;
31
32 virtual QWidget* previewWidget(const QString& path, QWidget* parent) const noexcept;
33 virtual QWidget*
34 previewWidget(const Process::Preset& preset, QWidget* parent) const noexcept;
35
36 virtual void setup(ProcessesItemModel& model, const score::GUIApplicationContext& ctx);
37 virtual void addPath(std::string_view);
38 virtual void removePath(std::string_view);
39
45 virtual std::function<void()> asyncAddPath(std::string_view path);
46 virtual bool onDrop(const QMimeData& mime, int row, int column, const QDir& parent);
47
48 virtual bool onDoubleClick(const QString& path, const score::DocumentContext& ctx);
49};
50
51class SCORE_PLUGIN_LIBRARY_EXPORT LibraryInterfaceList final
52 : public score::InterfaceList<LibraryInterface>
53{
54public:
55 ~LibraryInterfaceList() override;
56};
57
59{
60 SCORE_CONCRETE("e4785238-af94-4fe9-9e5b-12b9555a2482")
61public:
62 ~LibraryDocumentLoader() override;
63
64 QSet<QString> acceptedFiles() const noexcept override;
65
66 bool onDoubleClick(const QString& path, const score::DocumentContext& ctx) override;
67};
68}
Definition LibraryInterface.hpp:59
Definition LibraryInterface.hpp:24
Definition LibraryInterface.hpp:53
Definition ProcessesItemModel.hpp:44
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