aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h28
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