1
/* ScummVM - Graphic Adventure Engine
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.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
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.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
#ifndef COMMON_TASKBAR_MANAGER_H
24
#define COMMON_TASKBAR_MANAGER_H
26
#include "common/scummsys.h"
27
#include "common/str.h"
29
#if defined(USE_TASKBAR)
34
* The TaskbarManager allows interaction with the ScummVM application icon:
35
* - in the taskbar on Windows 7 and later
36
* - in the launcher for Unity
37
* - in the dock on MacOSX
40
* This allows GUI code and engines to display a progress bar, an overlay icon and/or count
41
* associated with the ScummVM icon as well as add the started engine to the recent items
42
* list (so that the user can start the engine directly in one click).
45
* - Track search progress and found engines when running the Mass Add dialog
46
* - Add an entry to the recent items when starting an engine
47
* - Show the current running engine icon as an overlay
49
* @note functionality will vary between supported platforms (due to API limitations)
50
* and some of the methods will just be no-ops or approximate the functionality
53
class TaskbarManager {
56
* Values representing the taskbar progress state
58
enum TaskbarProgressState {
59
kTaskbarNoProgress = 0,
60
kTaskbarIndeterminate = 1,
67
virtual ~TaskbarManager() {}
70
* Sets an overlay icon on the taskbar icon
72
* When an empty name is given, no icon is shown
73
* and the current overlay icon (if any) is removed
75
* @param name Path to the icon
76
* @param description The description
78
* @note on Windows, the icon should be an ICO file
80
virtual void setOverlayIcon(const String &name, const String &description) {}
83
* Sets a progress value on the taskbar icon
85
* @param completed The current progress value.
86
* @param total The maximum progress value.
88
virtual void setProgressValue(int completed, int total) {}
91
* Sets the progress state on the taskbar icon
93
* State can be any of the following:
94
* - NoProgress: disable display of progress state
100
* @param state The progress state
102
virtual void setProgressState(TaskbarProgressState state) {}
105
* Sets the count number associated with the icon as an overlay
107
* @param count The count
109
* @note Setting a count of 0 will hide the count
111
virtual void setCount(int count) {}
114
* Adds an engine to the recent items list
116
* Path is automatically set to the current executable path,
117
* an icon name is generated (with fallback to default icon)
118
* and the command line is set to start the engine on click.
120
* @param name The target name.
121
* @param description The description.
123
virtual void addRecent(const String &name, const String &description) {}
126
* Notifies the user an error occured through the taskbar icon
128
* This will for example show the taskbar icon as red (using progress of 100% and an error state)
129
* on Windows, and set the launcher icon in the urgent state on Unity
131
virtual void notifyError() {}
134
* Clears the error notification
136
virtual void clearError() {}
139
} // End of namespace Common
143
#endif // COMMON_TASKBAR_MANAGER_H