ScummVM API documentation
updates.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program 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 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef COMMON_UPDATES_H
23#define COMMON_UPDATES_H
24
25#if defined(USE_UPDATES)
26
27namespace Common {
28
49class UpdateManager {
50public:
51 enum UpdateState {
52 kUpdateStateDisabled = 0,
53 kUpdateStateEnabled = 1,
54 kUpdateStateNotSupported = 2
55 };
56
57 enum UpdateInterval {
58 kUpdateIntervalNotSupported = 0,
59 kUpdateIntervalOneDay = 86400,
60 kUpdateIntervalOneWeek = 604800,
61 kUpdateIntervalOneMonth = 2628000 // average seconds per month (60*60*24*365)/12
62 };
63
64 UpdateManager() {}
65 virtual ~UpdateManager() {}
66
73 virtual void checkForUpdates() {}
74
80 virtual void setAutomaticallyChecksForUpdates(UpdateState state) {}
81
89 virtual UpdateState getAutomaticallyChecksForUpdates() { return kUpdateStateNotSupported; }
90
96 virtual void setUpdateCheckInterval(int interval) {}
97
103 virtual int getUpdateCheckInterval() { return kUpdateIntervalNotSupported; }
104
111 virtual bool getLastUpdateCheckTimeAndDate(TimeDate &t) { return false; }
112
119 static const int *getUpdateIntervals();
120
127 static Common::U32String updateIntervalToString(int interval);
128
135 static int normalizeInterval(int interval);
136};
137
140} // End of namespace Common
141
142#endif
143
144#endif // COMMON_UPDATES_H
Definition: ustr.h:57
Definition: algorithm.h:29
Definition: system.h:111