| 1 |
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#ifndef DLICENSEINFO_H |
| 6 |
#define DLICENSEINFO_H |
| 7 |
|
| 8 |
#include <QVector> |
| 9 |
|
| 10 |
#include <dtkcore_global.h> |
| 11 |
#include <dobject.h> |
| 12 |
|
| 13 |
DCORE_BEGIN_NAMESPACE |
| 14 |
|
| 15 |
class DLicenseInfoPrivate; |
| 16 |
class LIBDTKCORESHARED_EXPORT DLicenseInfo : public DObject |
| 17 |
{ |
| 18 |
public: |
| 19 |
explicit DLicenseInfo(DObject *parent = nullptr); |
| 20 |
|
| 21 |
bool loadContent(const QByteArray &content); |
| 22 |
bool loadFile(const QString &file); |
| 23 |
void setLicenseSearchPath(const QString &path); |
| 24 |
QByteArray licenseContent(const QString &licenseName); |
| 25 |
|
| 26 |
class DComponentInfoPrivate; |
| 27 |
class LIBDTKCORESHARED_EXPORT DComponentInfo : public DObject |
| 28 |
{ |
| 29 |
public: |
| 30 |
explicit DComponentInfo(DObject *parent = nullptr); |
| 31 |
~DComponentInfo() override; |
| 32 |
|
| 33 |
QString name() const; |
| 34 |
QString version() const; |
| 35 |
QString copyRight() const; |
| 36 |
QString licenseName() const; |
| 37 |
|
| 38 |
private: |
| 39 |
D_DECLARE_PRIVATE(DComponentInfo) |
| 40 |
friend class DLicenseInfoPrivate; |
| 41 |
}; |
| 42 |
using DComponentInfos = QVector<DComponentInfo*>; |
| 43 |
DComponentInfos componentInfos() const; |
| 44 |
|
| 45 |
private: |
| 46 |
D_DECLARE_PRIVATE(DLicenseInfo) |
| 47 |
}; |
| 48 |
|
| 49 |
DCORE_END_NAMESPACE |
| 50 |
|
| 51 |
#endif // DLICENSEINFO_H |