CIconManager
#include "IconManager.h"
Description
Class to loading and manage icons.
Class is an singleton.
Private own types
Type |
Name |
Description |
typedef std::map< UnicodeString, int>::iterator |
Icons_it |
Type to iterate over map elements |
Private variables
Type |
Name |
Description |
std::map< UnicodeString, int> |
Icons |
Map of all loaded icons |
Private static variables
Type |
Name |
Description |
static CIconManager* |
Instance |
Object instance |
Private methods
Type |
Name |
Description |
|
CIconManager() |
Constructor |
Public methods
Type |
Name |
Description |
void |
LoadIcon(UnicodeString Name, UnicodeString Filename) |
Function loads icon from Filename. Name parameter is the name that will be used to get loaded icon |
void |
DestroyIcon(UnicodeString Name) |
Function unloads icon from AQQ |
void |
ReplaceIcon(UnicodeString Name, UnicodeString Filename) |
Function replaces the icon with the specified name by a new with the specified path |
int |
GetIconByName(UnicodeString Name) |
Function returns index of icon with the given name |
UnicodeString |
GetIconPathByName(UnicodeString Name) |
Function returns path of icon with the given name |
void |
DestroyAllIcons() |
Function unloads all icon from AQQ |
Public static methods
Type |
Name |
Description |
static CIconManager* |
instance() |
Function returns object instance |
Example
Loading an icon
UnicodeString Filename;
Filename = CPaths::instance()->PluginUserDir() + "\\MyPlugin\\icon.png";
CIconManager::instance()->LoadIcon("MY_ICON", Filename);
Get index of loaded icon
int IconIndex = 0;
IconIndex = CIconManager::instance()->GetIconByName("MY_ICON");