]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/iconbndl.h
Removing more CodeWarrior project files.
[wxWidgets.git] / interface / wx / iconbndl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: iconbndl.h
3 // Purpose: interface of wxIconBundle
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxIconBundle
11
12 This class contains multiple copies of an icon in different sizes.
13 It is typically used in wxDialog::SetIcons and wxTopLevelWindow::SetIcons.
14
15 @library{wxcore}
16 @category{gdi}
17
18 @stdobjects
19 ::wxNullIconBundle
20 */
21 class wxIconBundle : public wxGDIObject
22 {
23 public:
24 /**
25 Default ctor.
26 */
27 wxIconBundle();
28
29 /**
30 Initializes the bundle with the icon(s) found in the file.
31 */
32 wxIconBundle(const wxString& file, wxBitmapType type);
33
34 /**
35 Initializes the bundle with a single icon.
36 */
37 wxIconBundle(const wxIcon& icon);
38
39 /**
40 Copy constructor.
41 */
42 wxIconBundle(const wxIconBundle& ic);
43
44 /**
45 Destructor.
46 */
47 virtual ~wxIconBundle();
48
49 /**
50 Adds all the icons contained in the file to the bundle; if the collection
51 already contains icons with the same width and height, they are replaced
52 by the new ones.
53 */
54 void AddIcon(const wxString& file, wxBitmapType type);
55
56 /**
57 Adds the icon to the collection; if the collection already
58 contains an icon with the same width and height, it is
59 replaced by the new one.
60 */
61 void AddIcon(const wxIcon& icon);
62
63 /**
64 Returns the icon with the given size; if no such icon exists, returns
65 the icon with size @c wxSYS_ICON_X and @c wxSYS_ICON_Y; if no such icon
66 exists, returns the first icon in the bundle.
67
68 If size = wxDefaultSize, returns the icon with size @c wxSYS_ICON_X and
69 @c wxSYS_ICON_Y.
70 */
71 wxIcon GetIcon(const wxSize& size) const;
72
73 /**
74 Same as @code GetIcon( wxSize( size, size ) ) @endcode.
75 */
76 wxIcon GetIcon(wxCoord size = wxDefaultCoord) const;
77
78 /**
79 Returns the icon with exactly the given size or ::wxNullIcon if this
80 size is not available.
81 */
82 wxIcon GetIconOfExactSize(const wxSize& size) const;
83
84 /**
85 Returns @true if the bundle doesn't contain any icons, @false otherwise
86 (in which case a call to GetIcon() with default parameter should return
87 a valid icon).
88 */
89 bool IsEmpty() const;
90
91 /**
92 Assignment operator, using @ref overview_refcount "reference counting".
93 */
94 wxIconBundle& operator=(const wxIconBundle& ic);
95
96 /**
97 Equality operator. This returns @true if two icon bundles are equal.
98 */
99 bool operator ==(const wxIconBundle& ic);
100
101 /**
102 Inequality operator. This returns true if two icon bundles are not equal.
103 */
104 bool operator !=(const wxIconBundle& ic);
105 };
106
107
108 /**
109 An empty wxIconBundle.
110 */
111 wxIconBundle wxNullIconBundle;
112
113