diff options
| author | 2015-01-30 17:00:07 -0500 | |
|---|---|---|
| committer | 2015-01-30 17:00:07 -0500 | |
| commit | 016003905ca0e8e459e3dc33e786beda8ec92f45 (patch) | |
| tree | 34aba2d2e0d66fbf2c3821ee8358f56e40c4c95e /SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h | |
| parent | 724c012ada23ef480c61fe99e3c9784b91aeb1ca (diff) | |
Imported Upstream version 3.0.2upstream/3.0.2
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h b/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h index fcf1203..c8da6f9 100644 --- a/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h +++ b/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h @@ -8,14 +8,38 @@ class API_EXPORT ExtraLicenseManager { public: + enum class Type + { + FILE, + CONTENTS + }; + + struct License + { + QString title; + QString data; + Type type; + QString violationMessage; + bool violated = false; + }; + ExtraLicenseManager(); + virtual ~ExtraLicenseManager(); bool addLicense(const QString& title, const QString& filePath); + bool addLicenseContents(const QString& title, const QString& contents); + void setViolatedLicense(const QString& title, const QString& violationMessage); + void unsetViolatedLicense(const QString& title); + bool isViolatedLicense(const QString& title); + QString getViolationMessage(const QString& title); bool removeLicense(const QString& title); - const QHash<QString,QString>& getLicenses() const; + QHash<QString,QString> getLicensesContents() const; private: - QHash<QString,QString> licenses; + bool addLicense(const QString& title, const QString& data, Type type); + QString readLicenseFile(const QString& path) const; + + QHash<QString,License*> licenses; }; #endif // EXTRALISENCEMANAGER_H |
