1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxArtProvider class
4 // Author: Vaclav Slavik
8 // Copyright: (c) Vaclav Slavik
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_ARTPROV_H_
13 #define _WX_ARTPROV_H_
16 #pragma interface "artprov.h"
19 #include "wx/string.h"
20 #include "wx/bitmap.h"
23 class WXDLLEXPORT wxArtProvidersList
;
24 class WXDLLEXPORT wxArtProviderCache
;
26 // ----------------------------------------------------------------------------
28 // ----------------------------------------------------------------------------
30 typedef wxString wxArtDomain
;
31 typedef wxString wxArtID
;
33 // ----------------------------------------------------------------------------
34 // wxArtProvider class
35 // ----------------------------------------------------------------------------
37 class WXDLLEXPORT wxArtProvider
: public wxObject
40 // Add new provider to the top of providers stack.
41 static void PushProvider(wxArtProvider
*provider
);
43 // Remove latest added provider and delete it.
44 static bool PopProvider();
46 // Remove provider. The provider must have been added previously!
47 // The provider is _not_ deleted.
48 static bool RemoveProvider(wxArtProvider
*provider
);
50 // Query the providers for bitmap with given ID and return it. Return
51 // wxNullBitmap if no provider provides it.
52 static wxBitmap
GetBitmap(const wxArtDomain
& domain
, const wxArtID
& id
,
53 const wxSize
& size
= wxDefaultSize
);
55 // Query the providers for icon with given ID and return it. Return
56 // wxNullIcon if no provider provides it.
57 static wxIcon
GetIcon(const wxArtDomain
& domain
, const wxArtID
& id
,
58 const wxSize
& size
= wxDefaultSize
);
60 // Destroy caches & all providers
61 static void CleanUpProviders();
64 // Derived classes must override this method to create requested
65 // art resource. This method is called only once per instance's
66 // lifetime for each requested wxArtID.
67 virtual wxBitmap
CreateBitmap(const wxArtDomain
& WXUNUSED(domain
),
68 const wxArtID
& WXUNUSED(id
),
69 const wxSize
& WXUNUSED(size
))
71 wxFAIL_MSG(_T("pure virtual method wxArtProvider::CreateBitmap called!"));
77 static wxArtProvidersList
*sm_providers
;
78 // art resources cache (so that CreateXXX is not called that often):
79 static wxArtProviderCache
*sm_cache
;
81 DECLARE_ABSTRACT_CLASS(wxArtProvider
)
85 // ----------------------------------------------------------------------------
86 // Art pieces identifiers
87 // ----------------------------------------------------------------------------
89 // This is comprehensive list of art identifiers recognized by wxWindows. The
90 // identifiers follow two-levels scheme where a piece of art is described by
91 // its domain (file dialog, HTML help toolbar etc.) and resource identifier
94 #define wxART_WXHTML _T("wxhtml")
95 #define wxART_ADD_BOOKMARK _T("add_bookmark")
96 #define wxART_DEL_BOOKMARK _T("del_bookmark")
97 #define wxART_NAVIG_PANEL _T("navig_panel")
98 #define wxART_HELP_SETTINGS _T("help_settings")
99 #define wxART_HELP_BOOK _T("help_book")
100 #define wxART_HELP_FOLDER _T("help_folder")
101 #define wxART_HELP_PAGE _T("help_page")
103 #define wxART_BROWSER_TOOLBAR _T("browser_toolbar")
104 #define wxART_GO_BACK _T("go_back")
105 #define wxART_GO_FORWARD _T("go_forward")
106 #define wxART_GO_UP _T("go_up")
107 #define wxART_GO_DOWN _T("go_down")
108 #define wxART_GO_TO_PARENT _T("go_to_parent")
110 #define wxART_TOOLBAR _T("toolbar")
111 #define wxART_FILE_OPEN _T("file_open")
112 #define wxART_PRINT _T("print")
114 #define wxART_FRAME_ICON _T("frame_icon")
115 #define wxART_HELP _T("help")
119 #endif // _WX_ARTPROV_H_