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 wxArtClient
;
31 typedef wxString wxArtID
;
33 // ----------------------------------------------------------------------------
35 // ----------------------------------------------------------------------------
37 #define wxART_TOOLBAR _T("toolbar_C")
38 #define wxART_MENU _T("menu_C")
39 #define wxART_FRAME_ICON _T("frame_icon_C")
41 #define wxART_CMN_DIALOG _T("cmn_dialog_C")
42 #define wxART_HELP_BROWSER _T("help_browser_C")
44 #define wxART_OTHER _T("other_C")
46 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
50 #define wxART_ADD_BOOKMARK _T("add_bookmark")
51 #define wxART_DEL_BOOKMARK _T("del_bookmark")
52 #define wxART_HELP_SIDE_PANEL _T("help_side_panel")
53 #define wxART_HELP_SETTINGS _T("help_settings")
54 #define wxART_HELP_BOOK _T("help_book")
55 #define wxART_HELP_FOLDER _T("help_folder")
56 #define wxART_HELP_PAGE _T("help_page")
57 #define wxART_GO_BACK _T("go_back")
58 #define wxART_GO_FORWARD _T("go_forward")
59 #define wxART_GO_UP _T("go_up")
60 #define wxART_GO_DOWN _T("go_down")
61 #define wxART_GO_TO_PARENT _T("go_to_parent")
62 #define wxART_GO_HOME _T("go_home")
63 #define wxART_FILE_OPEN _T("file_open")
64 #define wxART_PRINT _T("print")
65 #define wxART_HELP _T("help")
66 #define wxART_TIP _T("tip")
67 #define wxART_REPORT_VIEW _T("report_view")
68 #define wxART_LIST_VIEW _T("list_view")
69 #define wxART_NEW_DIR _T("new_dir")
70 #define wxART_FOLDER _T("folder")
71 #define wxART_GO_DIR_UP _T("go_dir_up")
72 #define wxART_EXECUTABLE_FILE _T("executable_file")
73 #define wxART_NORMAL_FILE _T("normal_file")
75 // ----------------------------------------------------------------------------
76 // wxArtProvider class
77 // ----------------------------------------------------------------------------
79 class WXDLLEXPORT wxArtProvider
: public wxObject
82 // Add new provider to the top of providers stack.
83 static void PushProvider(wxArtProvider
*provider
);
85 // Remove latest added provider and delete it.
86 static bool PopProvider();
88 // Remove provider. The provider must have been added previously!
89 // The provider is _not_ deleted.
90 static bool RemoveProvider(wxArtProvider
*provider
);
92 // Query the providers for bitmap with given ID and return it. Return
93 // wxNullBitmap if no provider provides it.
94 static wxBitmap
GetBitmap(const wxArtID
& id
,
95 const wxArtClient
& client
= wxART_OTHER
,
96 const wxSize
& size
= wxDefaultSize
);
98 // Query the providers for icon with given ID and return it. Return
99 // wxNullIcon if no provider provides it.
100 static wxIcon
GetIcon(const wxArtID
& id
,
101 const wxArtClient
& client
= wxART_OTHER
,
102 const wxSize
& size
= wxDefaultSize
);
104 // Destroy caches & all providers
105 static void CleanUpProviders();
108 // Derived classes must override this method to create requested
109 // art resource. This method is called only once per instance's
110 // lifetime for each requested wxArtID.
111 virtual wxBitmap
CreateBitmap(const wxArtID
& WXUNUSED(id
),
112 const wxArtClient
& WXUNUSED(client
),
113 const wxSize
& WXUNUSED(size
))
115 wxFAIL_MSG(_T("pure virtual method wxArtProvider::CreateBitmap called!"));
120 // list of providers:
121 static wxArtProvidersList
*sm_providers
;
122 // art resources cache (so that CreateXXX is not called that often):
123 static wxArtProviderCache
*sm_cache
;
125 DECLARE_ABSTRACT_CLASS(wxArtProvider
)
129 #endif // _WX_ARTPROV_H_