1 #ifndef FILEZILLA_INTERFACE_TOOLBAR_HEADER
2 #define FILEZILLA_INTERFACE_TOOLBAR_HEADER
3 
4 #include "state.h"
5 
6 #include "option_change_event_handler.h"
7 
8 #include <wx/toolbar.h>
9 
10 class CMainFrame;
11 
12 class CToolBar final : public wxToolBar, public CGlobalStateEventHandler, public COptionChangeEventHandler
13 {
14 public:
15 	CToolBar();
16 	virtual ~CToolBar();
17 
18 	void UpdateToolbarState();
19 
20 	static CToolBar* Load(CMainFrame* pMainFrame);
21 
22 	bool ShowTool(int id);
23 	bool HideTool(int id);
24 
25 #ifdef __WXMSW__
26 	virtual bool Realize();
27 #endif
28 
29 protected:
30 	void MakeTool(char const* id, std::wstring const& art, wxString const& tooltip, wxString const& help = wxString(), wxItemKind type = wxITEM_NORMAL);
31 	void MakeTools();
32 
33 	virtual void OnStateChange(CState* pState, t_statechange_notifications notification, std::wstring const& data, const void* data2) override;
34 	virtual void OnOptionsChanged(watched_options const& options);
35 
36 	CMainFrame* m_pMainFrame{};
37 
38 	std::map<int, wxToolBarToolBase*> m_hidden_tools;
39 
40 #ifdef __WXMSW__
41 	std::unique_ptr<wxImageList> toolImages_;
42 	std::unique_ptr<wxImageList> disabledToolImages_;
43 #endif
44 
45 	wxSize iconSize_;
46 };
47 
48 #endif
49