File: IconProvider.h

package info (click to toggle)
qt-advanced-docking-system 4.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,492 kB
  • sloc: cpp: 16,302; python: 1,392; makefile: 12
file content (61 lines) | stat: -rw-r--r-- 1,497 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef IconProviderH
#define IconProviderH
//============================================================================
/// \file   IconProvider.h
/// \author Uwe Kindler
/// \date   18.10.2019
/// \brief  Declaration of CIconProvider
//============================================================================

//============================================================================
//                                   INCLUDES
//============================================================================
#include <QIcon>

#include "ads_globals.h"

namespace ads
{

struct IconProviderPrivate;

/**
 * This object provides all icons that are required by the advanced docking
 * system.
 * The IconProvider enables the user to register custom icons in case using
 * stylesheets is not an option.
 */
class ADS_EXPORT CIconProvider
{
private:
	IconProviderPrivate* d; ///< private data (pimpl)
	friend struct IconProviderPrivate;

public:
	/**
	 * Default Constructor
	 */
	CIconProvider();

	/**
	 * Virtual Destructor
	 */
	virtual ~CIconProvider();

	/**
	 * The function returns a custom icon if one is registered and a null Icon
	 * if no custom icon is registered
	 */
	QIcon customIcon(eIcon IconId) const;

	/**
	 * Registers a custom icon for the given IconId
	 */
	void registerCustomIcon(eIcon IconId, const QIcon &icon);
}; // class IconProvider

} // namespace ads


//---------------------------------------------------------------------------
#endif // IconProviderH