libyui-qt-pkg  2.45.27
YQIconPool.h
1 /**************************************************************************
2 Copyright (C) 2000 - 2010 Novell, Inc.
3 All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 
19 **************************************************************************/
20 
21 
22 
23 /*---------------------------------------------------------------------\
24 | |
25 | __ __ ____ _____ ____ |
26 | \ \ / /_ _/ ___|_ _|___ \ |
27 | \ V / _` \___ \ | | __) | |
28 | | | (_| |___) || | / __/ |
29 | |_|\__,_|____/ |_| |_____| |
30 | |
31 | core system |
32 | (C) SuSE GmbH |
33 \----------------------------------------------------------------------/
34 
35  File: YQIconPool.h
36 
37  Author: Stefan Hundhammer <sh@suse.de>
38 
39 /-*/
40 
41 
42 #ifndef YQIconPool_h
43 #define YQIconPool_h
44 
45 #include <qpixmap.h>
46 #include <QHash>
47 
49 {
50 public:
51 
52  static QPixmap pkgAutoDel();
53  static QPixmap pkgAutoInstall();
54  static QPixmap pkgAutoUpdate();
55  static QPixmap pkgDel();
56  static QPixmap pkgInstall();
57  static QPixmap pkgKeepInstalled();
58  static QPixmap pkgNoInst();
59  static QPixmap pkgProtected();
60  static QPixmap pkgTaboo();
61  static QPixmap pkgUpdate();
62 
63  static QPixmap disabledPkgAutoDel();
64  static QPixmap disabledPkgAutoInstall();
65  static QPixmap disabledPkgAutoUpdate();
66  static QPixmap disabledPkgDel();
67  static QPixmap disabledPkgInstall();
68  static QPixmap disabledPkgKeepInstalled();
69  static QPixmap disabledPkgNoInst();
70  static QPixmap disabledPkgProtected();
71  static QPixmap disabledPkgTaboo();
72  static QPixmap disabledPkgUpdate();
73 
74  static QPixmap normalPkgConflict();
75 
76  static QPixmap treePlus();
77  static QPixmap treeMinus();
78 
79  static QPixmap warningSign();
80  static QPixmap pkgSatisfied();
81 
82  static QPixmap tabRemove();
83  static QPixmap arrowLeft();
84  static QPixmap arrowRight();
85  static QPixmap arrowDown();
86 
87 protected:
88 
89  /**
90  * Return the global icon pool.
91  **/
92  static YQIconPool * iconPool();
93 
94  /**
95  * Return the cached icon for 'icon_name'. If the icon isn't in the cache
96  * yet, load it and store it in the cache.
97  *
98  * Return a red square as an error icon if there is no icon by that name.
99  **/
100  QPixmap cachedIcon(const QString icon_name, const bool enabled );
101 
102  /**
103  * Load the icon for 'icon_name' from the icon theme or, if that fails,
104  * from the compiled-in icons (using the Qt resource system). Return a null
105  * pixmap if there is no such icon.
106  **/
107  QPixmap loadIcon( const QString icon_name, const bool enabled );
108 
109 private:
110 
111  /**
112  * (Private!) Constructor
113  * Singleton object - use the static methods only!
114  **/
115  YQIconPool();
116 
117  /**
118  * Destructor
119  **/
120  virtual ~YQIconPool();
121 
122 
123  //
124  // Data members
125  //
126 
127  static YQIconPool * _iconPool;
128  QHash< const QString, QPixmap > _iconCache;
129 };
130 
131 
132 #endif // ifndef YQIconPool_h
static YQIconPool * iconPool()
Return the global icon pool.
Definition: YQIconPool.cc:90
QPixmap cachedIcon(const QString icon_name, const bool enabled)
Return the cached icon for &#39;icon_name&#39;.
Definition: YQIconPool.cc:112
QPixmap loadIcon(const QString icon_name, const bool enabled)
Load the icon for &#39;icon_name&#39; from the icon theme or, if that fails, from the compiled-in icons (usin...
Definition: YQIconPool.cc:137