From 00e5968bd28ab1df33b3a39dbac8cda99aa2a0d2 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Wed, 6 Apr 2016 23:09:30 +0200 Subject: NOISSUE Add a skeleton of the wonko system --- application/WonkoGui.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 application/WonkoGui.h (limited to 'application/WonkoGui.h') diff --git a/application/WonkoGui.h b/application/WonkoGui.h new file mode 100644 index 00000000..2b87b819 --- /dev/null +++ b/application/WonkoGui.h @@ -0,0 +1,28 @@ +#pragma once + +#include + +class QWidget; +class QString; + +using WonkoIndexPtr = std::shared_ptr; +using WonkoVersionListPtr = std::shared_ptr; +using WonkoVersionPtr = std::shared_ptr; + +namespace Wonko +{ +enum UpdateType +{ + AlwaysUpdate, + UpdateIfNeeded +}; + +/// Ensures that the index has been loaded, either from the local cache or remotely +WonkoIndexPtr ensureIndexLoaded(QWidget *parent); +/// Ensures that the given uid exists. Returns a nullptr if it doesn't. +WonkoVersionListPtr ensureVersionListExists(const QString &uid, QWidget *parent); +/// Ensures that the given uid exists and is loaded, either from the local cache or remotely. Returns nullptr if it doesn't exist or couldn't be loaded. +WonkoVersionListPtr ensureVersionListLoaded(const QString &uid, QWidget *parent); +WonkoVersionPtr ensureVersionExists(const QString &uid, const QString &version, QWidget *parent); +WonkoVersionPtr ensureVersionLoaded(const QString &uid, const QString &version, QWidget *parent, const UpdateType update = UpdateIfNeeded); +} -- cgit v1.2.3