]> git.saurik.com Git - wxWidgets.git/blob - include/wx/artprov.h
compatibility constructors for wxMenuItem() taking bool instead of wxItemKind
[wxWidgets.git] / include / wx / artprov.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: artprov.h
3 // Purpose: wxArtProvider class
4 // Author: Vaclav Slavik
5 // Modified by:
6 // Created: 18/03/2002
7 // RCS-ID: $Id$
8 // Copyright: (c) Vaclav Slavik
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_ARTPROV_H_
13 #define _WX_ARTPROV_H_
14
15 #ifdef __GNUG__
16 #pragma interface "artprov.h"
17 #endif
18
19 #include "wx/string.h"
20 #include "wx/bitmap.h"
21 #include "wx/icon.h"
22
23 class WXDLLEXPORT wxArtProvidersList;
24 class WXDLLEXPORT wxArtProviderCache;
25
26 // ----------------------------------------------------------------------------
27 // Types
28 // ----------------------------------------------------------------------------
29
30 typedef wxString wxArtClient;
31 typedef wxString wxArtID;
32
33 // ----------------------------------------------------------------------------
34 // Art clients
35 // ----------------------------------------------------------------------------
36
37 #define wxART_TOOLBAR _T("toolbar_C")
38 #define wxART_MENU _T("menu_C")
39 #define wxART_FRAME_ICON _T("frame_icon_C")
40
41 #define wxART_CMN_DIALOG _T("cmn_dialog_C")
42 #define wxART_HELP_BROWSER _T("help_browser_C")
43
44 #define wxART_OTHER _T("other_C")
45
46 // ----------------------------------------------------------------------------
47 // Art IDs
48 // ----------------------------------------------------------------------------
49
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")
74 #define wxART_TICK_MARK _T("tick")
75 #define wxART_CROSS_MARK _T("cross")
76
77 // ----------------------------------------------------------------------------
78 // wxArtProvider class
79 // ----------------------------------------------------------------------------
80
81 class WXDLLEXPORT wxArtProvider : public wxObject
82 {
83 public:
84 // Add new provider to the top of providers stack.
85 static void PushProvider(wxArtProvider *provider);
86
87 // Remove latest added provider and delete it.
88 static bool PopProvider();
89
90 // Remove provider. The provider must have been added previously!
91 // The provider is _not_ deleted.
92 static bool RemoveProvider(wxArtProvider *provider);
93
94 // Query the providers for bitmap with given ID and return it. Return
95 // wxNullBitmap if no provider provides it.
96 static wxBitmap GetBitmap(const wxArtID& id,
97 const wxArtClient& client = wxART_OTHER,
98 const wxSize& size = wxDefaultSize);
99
100 // Query the providers for icon with given ID and return it. Return
101 // wxNullIcon if no provider provides it.
102 static wxIcon GetIcon(const wxArtID& id,
103 const wxArtClient& client = wxART_OTHER,
104 const wxSize& size = wxDefaultSize);
105
106 // Destroy caches & all providers
107 static void CleanUpProviders();
108
109 protected:
110 // Derived classes must override this method to create requested
111 // art resource. This method is called only once per instance's
112 // lifetime for each requested wxArtID.
113 virtual wxBitmap CreateBitmap(const wxArtID& WXUNUSED(id),
114 const wxArtClient& WXUNUSED(client),
115 const wxSize& WXUNUSED(size))
116 {
117 wxFAIL_MSG(_T("pure virtual method wxArtProvider::CreateBitmap called!"));
118 return wxNullBitmap;
119 }
120
121 private:
122 // list of providers:
123 static wxArtProvidersList *sm_providers;
124 // art resources cache (so that CreateXXX is not called that often):
125 static wxArtProviderCache *sm_cache;
126
127 DECLARE_ABSTRACT_CLASS(wxArtProvider)
128 };
129
130
131 #endif // _WX_ARTPROV_H_