BALL 1.5.0
Loading...
Searching...
No Matches
iconLoader.h
Go to the documentation of this file.
1#ifndef BALL_VIEW_KERNEL_ICONLOADER_H
2#define BALL_VIEW_KERNEL_ICONLOADER_H
3
4#include <list>
5#include <boost/shared_ptr.hpp>
7
8#include <QtCore/QMutex>
9#include <QtCore/QReadWriteLock>
10#include <QtCore/QStringList>
11
12class QIcon;
13
14namespace BALL
15{
16 class String;
17
18 namespace VIEW
19 {
29 {
30 public:
36
42 explicit IconLoader(const QStringList& icon_dirs);
43
49 explicit IconLoader(const std::list<String>& icon_dirs);
50
56
61
70 void appendIconPath(const String& path);
71
77 const QIcon& getIcon(const String& name);
78
79 private:
80 //Threads and singleton
81 static QMutex mutex_;
82 static boost::shared_ptr<IconLoader> loader_;
83 QReadWriteLock hash_map_lock_;
84
85 //Private members
86 const QIcon* const invalid_;
87 std::list<int> sizes_;
88 QStringList icon_dirs_;
90
91 //Private methods
92 void setup_();
93 QIcon* loadIcon_(const String& name);
94 };
95 }
96}
97
98#endif //BALL_VIEW_KERNEL_ICONLOADER_H
99
HashMap class based on the STL map (containing serveral convenience functions)
Definition hashMap.h:74
void appendIconPath(const String &path)
IconLoader(const QStringList &icon_dirs)
static IconLoader & instance()
const QIcon & getIcon(const String &name)
IconLoader(const std::list< String > &icon_dirs)
#define BALL_VIEW_EXPORT