DtkCore
DTK Core module
载入中...
搜索中...
未找到
dexportedinterface.h
1// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DEXPORTEDINTERFACE_H
6#define DEXPORTEDINTERFACE_H
7
8#include <dtkcore_global.h>
9#include <dobject.h>
10
11#include <QObject>
12
13#include <functional>
14
15DCORE_BEGIN_NAMESPACE
16
17namespace DUtil {
18class DExportedInterfacePrivate;
19class LIBDTKCORESHARED_EXPORT DExportedInterface : public QObject, public DObject
20{
21 Q_OBJECT
22public:
23 explicit DExportedInterface(QObject *parent = nullptr);
25
26 void registerAction(const QString &action, const QString &description, const std::function<QVariant(QString)> handler = nullptr);
27 virtual QVariant invoke(const QString &action, const QString &parameters) const;
28private:
29 D_DECLARE_PRIVATE(DExportedInterface)
30};
31}
32
33DCORE_END_NAMESPACE
34
35#endif
Definition dobject.h:25
Definition dexportedinterface.h:20