Loading...
Searching...
No Matches
iconLoader.h
Go to the documentation of this file.
#ifndef BALL_VIEW_KERNEL_ICONLOADER_H
#define BALL_VIEW_KERNEL_ICONLOADER_H
#include <list>
#include <boost/shared_ptr.hpp>
#include <BALL/DATATYPE/hashMap.h>
#include <QtCore/QMutex>
#include <QtCore/QReadWriteLock>
#include <QtCore/QStringList>
class QIcon;
namespace BALL
{
class String;
namespace VIEW
{
class BALL_VIEW_EXPORT IconLoader
{
public:
IconLoader();
explicit IconLoader(const QStringList& icon_dirs);
explicit IconLoader(const std::list<String>& icon_dirs);
~IconLoader();
static IconLoader& instance();
void appendIconPath(const String& path);
const QIcon& getIcon(const String& name);
private:
//Threads and singleton
static QMutex mutex_;
static boost::shared_ptr<IconLoader> loader_;
QReadWriteLock hash_map_lock_;
//Private members
const QIcon* const invalid_;
std::list<int> sizes_;
QStringList icon_dirs_;
HashMap<String, QIcon*> icon_map_;
//Private methods
void setup_();
QIcon* loadIcon_(const String& name);
};
}
}
#endif //BALL_VIEW_KERNEL_ICONLOADER_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
BALL::String
Definition string.h:57
BALL::VIEW::IconLoader::appendIconPath
void appendIconPath(const String &path)
BALL::VIEW::IconLoader::IconLoader
IconLoader(const QStringList &icon_dirs)
BALL::VIEW::IconLoader::IconLoader
IconLoader()
BALL::VIEW::IconLoader::instance
static IconLoader & instance()
BALL::VIEW::IconLoader::getIcon
const QIcon & getIcon(const String &name)
BALL::VIEW::IconLoader::IconLoader
IconLoader(const std::list< String > &icon_dirs)
BALL::VIEW::IconLoader::~IconLoader
~IconLoader()
hashMap.h
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13