Loading...
Searching...
No Matches
BALL::VIEW::IconLoader Class Reference

`#include <BALL/VIEW/KERNEL/iconLoader.h>`

## Public Member Functions

| IconLoader ()
| IconLoader (const QStringList &icon_dirs)
| IconLoader (const std::list< String > &icon_dirs)
| ~IconLoader ()
void | appendIconPath (const String &path)
const QIcon & | getIcon (const String &name)

## Static Public Member Functions

static IconLoader & | instance ()

## Detailed Description

This class is an icon loader for the VIEW classes. It handles icon themes as defined in the freedesktop.org standard. It automatically detects all present resolutions of an icon and loads them. Furthermore it features an icon cache in order to minimize disk access. There are essentially two ways to use this class: Use it in a singleton wise fashion or create an specialized instance.

Definition at line 28 of file iconLoader.h.

## Constructor & Destructor Documentation

## IconLoader() [1/3]

BALL::VIEW::IconLoader::IconLoader | ( |  | ) |

Creates an IconLoader instance using BALL_DATA_PATH/graphics/icons as icon path.

## IconLoader() [2/3]

BALL::VIEW::IconLoader::IconLoader | ( | const QStringList & | icon_dirs | ) |

explicit

Creates an IconLoader using the directories in icon_dirs as icon paths.

Parameters

  icon_dirs | A list of paths to icon directories.

## IconLoader() [3/3]

BALL::VIEW::IconLoader::IconLoader | ( | const std::list< String > & | icon_dirs | ) |

explicit

Creates an IconLoader using the directories in icon_dirs as icon paths.

Parameters

  icon_dirs | A list of paths to icon directories.

## ~IconLoader()

BALL::VIEW::IconLoader::~IconLoader | ( |  | ) |

Destructor. It deletes all cached icons and thus invalidates all external pointers to these icons.

## Member Function Documentation

## appendIconPath()

void BALL::VIEW::IconLoader::appendIconPath | ( | const String & | path | ) |

Add another icon directory. The directory must be organised in a freedesktop.org compliant fashion. Essentially this means its layout has to look like this: path/nxn/context/icon.png

Parameters

  path | The path to an icon directory.

## getIcon()

const QIcon & BALL::VIEW::IconLoader::getIcon | ( | const String & | name | ) |

Retrieve the icon identified by name from the directory.

Parameters

  The | icons name. A usual example looks like: "actions/document-save"

## instance()

IconLoader & BALL::VIEW::IconLoader::instance | ( |  | ) |

static

Return the global instance of the icon loader.