From 016003905ca0e8e459e3dc33e786beda8ec92f45 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Fri, 30 Jan 2015 17:00:07 -0500 Subject: Imported Upstream version 3.0.2 --- .../services/extralicensemanager.h | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h') 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& getLicenses() const; + QHash getLicensesContents() const; private: - QHash licenses; + bool addLicense(const QString& title, const QString& data, Type type); + QString readLicenseFile(const QString& path) const; + + QHash licenses; }; #endif // EXTRALISENCEMANAGER_H -- cgit v1.2.3