DtkCore
DTK Core module
dexportedinterface.h
1
/*
2
* Copyright (C) 2017 ~ 2019 Deepin Technology Co., Ltd.
3
*
4
* Author: Chris Xiong <
[email protected]
>
5
*
6
* Maintainer: Chris Xiong <
[email protected]
>
7
*
8
* This program is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#ifndef DEXPORTEDINTERFACE_H
23
#define DEXPORTEDINTERFACE_H
24
25
#include <dtkcore_global.h>
26
#include <dobject.h>
27
28
#include <QObject>
29
30
#include <functional>
31
32
DCORE_BEGIN_NAMESPACE
33
34
namespace
DUtil {
35
class
DExportedInterfacePrivate;
36
class
LIBDTKCORESHARED_EXPORT
DExportedInterface
:
public
QObject,
public
DObject
37
{
38
Q_OBJECT
39
public
:
40
explicit
DExportedInterface
(QObject *parent =
nullptr
);
41
~DExportedInterface
();
42
43
void
registerAction(
const
QString &action,
const
QString &description,
const
std::function<QVariant(QString)> handler =
nullptr
);
44
virtual
QVariant invoke(
const
QString &action,
const
QString ¶meters)
const
;
45
private
:
46
D_DECLARE_PRIVATE(
DExportedInterface
)
47
};
48
}
49
50
DCORE_END_NAMESPACE
51
52
#endif
Dtk::Core::DObject
一些宏的定义.
Definition:
dobject.h:38
Dtk::Core::DUtil::DExportedInterface
Definition:
dexportedinterface.h:37
src
util
dexportedinterface.h
文档生成时间:2022-12-28-07:03 +00
Doxygen Version
1.9.4
制作者:deepin doc doc go SIG
文档使用CC-BY-4.0共享