Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
IUpdater.h
1/*
2 * IUpdater.h
3 * This file is part of Open-Typer
4 *
5 * Copyright (C) 2023 - adazem009
6 *
7 * Open-Typer is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * Open-Typer is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Open-Typer. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef IUPDATER_H
22#define IUPDATER_H
23
24#include "global/modularity/ioc.h"
25#include "global/ISettings.h"
26
27class IUpdater : MODULE_EXPORT_INTERFACE
28{
29 public:
30 virtual ~IUpdater() { }
31
32 virtual bool updateAvailable() = 0;
33 virtual void installUpdate() = 0;
34
35 protected:
36 // Use this to check if updates are enabled
37 virtual bool updatesEnabled() final
38 {
39 return modularity::ioc()->resolve<ISettings>()->getValue("updater", "updateChecks").toBool();
40 }
41};
42
43#endif // IUPDATER_H
Definition ISettings.h:31
Definition IUpdater.h:28