ScummVM
Common::TaskbarManager Class Reference

The TaskbarManager allows interaction with the ScummVM application icon: More...

#include <taskbar.h>

Public Types

enum  TaskbarProgressState {
  kTaskbarNoProgress = 0, kTaskbarIndeterminate = 1, kTaskbarNormal = 2, kTaskbarError = 4,
  kTaskbarPaused = 8
}
 Values representing the taskbar progress state. More...
 

Public Member Functions

 TaskbarManager ()
 
virtual ~TaskbarManager ()
 
virtual void setOverlayIcon (const String &name, const String &description)
 Sets an overlay icon on the taskbar icon. More...
 
virtual void setProgressValue (int completed, int total)
 Sets a progress value on the taskbar icon. More...
 
virtual void setProgressState (TaskbarProgressState state)
 Sets the progress state on the taskbar icon. More...
 
virtual void setCount (int count)
 Sets the count number associated with the icon as an overlay. More...
 
virtual void addRecent (const String &name, const String &description)
 Adds an engine to the recent items list. More...
 
virtual void notifyError ()
 Notifies the user an error occurred through the taskbar icon. More...
 
virtual void clearError ()
 Clears the error notification. More...
 

Detailed Description

The TaskbarManager allows interaction with the ScummVM application icon:

  • in the taskbar on Windows 7 and later
  • in the launcher for Unity
  • in the dock on Mac OS X
  • ...

This allows GUI code and engines to display a progress bar, an overlay icon and/or count associated with the ScummVM icon as well as add the started engine to the recent items list (so that the user can start the engine directly in one click).

Examples of use:

  • Track search progress and found engines when running the Mass Add dialog
  • Add an entry to the recent items when starting an engine
  • Show the current running engine icon as an overlay
Note
functionality will vary between supported platforms (due to API limitations) and some of the methods will just be no-ops or approximate the functionality as best as possible

Definition at line 53 of file taskbar.h.

Member Enumeration Documentation

◆ TaskbarProgressState

Values representing the taskbar progress state.

Enumerator
kTaskbarNoProgress 
kTaskbarIndeterminate 
kTaskbarNormal 
kTaskbarError 
kTaskbarPaused 

Definition at line 58 of file taskbar.h.

Constructor & Destructor Documentation

◆ TaskbarManager()

Common::TaskbarManager::TaskbarManager ( )
inline

Definition at line 66 of file taskbar.h.

◆ ~TaskbarManager()

virtual Common::TaskbarManager::~TaskbarManager ( )
inlinevirtual

Definition at line 67 of file taskbar.h.

Member Function Documentation

◆ addRecent()

virtual void Common::TaskbarManager::addRecent ( const String name,
const String description 
)
inlinevirtual

Adds an engine to the recent items list.

Path is automatically set to the current executable path, an icon name is generated (with fallback to default icon) and the command line is set to start the engine on click.

Parameters
nameThe target name.
descriptionThe description.

Definition at line 123 of file taskbar.h.

◆ clearError()

virtual void Common::TaskbarManager::clearError ( )
inlinevirtual

Clears the error notification.

Definition at line 136 of file taskbar.h.

◆ notifyError()

virtual void Common::TaskbarManager::notifyError ( )
inlinevirtual

Notifies the user an error occurred through the taskbar icon.

This will for example show the taskbar icon as red (using progress of 100% and an error state) on Windows, and set the launcher icon in the urgent state on Unity

Definition at line 131 of file taskbar.h.

◆ setCount()

virtual void Common::TaskbarManager::setCount ( int  count)
inlinevirtual

Sets the count number associated with the icon as an overlay.

Parameters
countThe count
Note
Setting a count of 0 will hide the count

Definition at line 111 of file taskbar.h.

◆ setOverlayIcon()

virtual void Common::TaskbarManager::setOverlayIcon ( const String name,
const String description 
)
inlinevirtual

Sets an overlay icon on the taskbar icon.

When an empty name is given, no icon is shown and the current overlay icon (if any) is removed

Parameters
namePath to the icon
descriptionThe description
Note
on Windows, the icon should be an ICO file

Definition at line 80 of file taskbar.h.

◆ setProgressState()

virtual void Common::TaskbarManager::setProgressState ( TaskbarProgressState  state)
inlinevirtual

Sets the progress state on the taskbar icon.

State can be any of the following:

  • NoProgress: disable display of progress state
  • Indeterminate
  • Normal
  • Error
  • Paused
Parameters
stateThe progress state

Definition at line 102 of file taskbar.h.

◆ setProgressValue()

virtual void Common::TaskbarManager::setProgressValue ( int  completed,
int  total 
)
inlinevirtual

Sets a progress value on the taskbar icon.

Parameters
completedThe current progress value.
totalThe maximum progress value.

Definition at line 88 of file taskbar.h.


The documentation for this class was generated from the following file: