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>
9class QAbstractItemModel;
10class QMimeData;
11class QDir;
12namespace Process
13{
14struct Preset;
15}
16
17namespace Library
18{
19class ProcessesItemModel;
20class FileSystemModel;
21class SCORE_PLUGIN_LIBRARY_EXPORT LibraryInterface : public score::InterfaceBase
22{
23 SCORE_INTERFACE(LibraryInterface, "9b94d974-9f2d-4986-a62b-b69e51a4d305")
24public:
25 ~LibraryInterface() override;
26
27 virtual QSet<QString> acceptedFiles() const noexcept;
28 virtual QSet<QString> acceptedMimeTypes() const noexcept;
29
30 virtual QWidget* previewWidget(const QString& path, QWidget* parent) const noexcept;
31 virtual QWidget*
32 previewWidget(const Process::Preset& preset, QWidget* parent) const noexcept;
33
34 virtual void setup(ProcessesItemModel& model, const score::GUIApplicationContext& ctx);
35 virtual void addPath(std::string_view);
36 virtual void removePath(std::string_view);
37 virtual bool onDrop(const QMimeData& mime, int row, int column, const QDir& parent);
38
39 virtual bool onDoubleClick(const QString& path, const score::DocumentContext& ctx);
40};
41
42class SCORE_PLUGIN_LIBRARY_EXPORT LibraryInterfaceList final
43 : public score::InterfaceList<LibraryInterface>
44{
45public:
46 ~LibraryInterfaceList() override;
47};
48
50{
51 SCORE_CONCRETE("e4785238-af94-4fe9-9e5b-12b9555a2482")
52public:
53 ~LibraryDocumentLoader() override;
54
55 QSet<QString> acceptedFiles() const noexcept override;
56
57 bool onDoubleClick(const QString& path, const score::DocumentContext& ctx) override;
58};
59}
Definition LibraryInterface.hpp:50
Definition LibraryInterface.hpp:22
Definition LibraryInterface.hpp:44
Definition ProcessesItemModel.hpp:45
Base class for plug-in interfaces.
Definition Interface.hpp:52
InterfaceList Default implementation of InterfaceListBase.
Definition InterfaceList.hpp:80
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1324
Definition Preset.hpp:32
Definition DocumentContext.hpp:18
Specializes ApplicationContext with the QMainWindow.
Definition GUIApplicationContext.hpp:15