ladybird/LibGUI/GToolBar.h
Andreas Kling 2cfcbdc735 AK: Add Retained<T>, like RetainPtr, but never null.
Also use some Clang attribute wizardry to get a warning for use-after-move.
2019-02-25 12:43:52 +01:00

26 lines
561 B
C++

#pragma once
#include <LibGUI/GWidget.h>
class GAction;
class GToolBar : public GWidget {
public:
explicit GToolBar(GWidget* parent);
virtual ~GToolBar() override;
void add_action(Retained<GAction>&&);
void add_separator();
private:
virtual const char* class_name() const override { return "GToolBar"; }
virtual void paint_event(GPaintEvent&) override;
struct Item {
enum Type { Invalid, Separator, Action };
Type type { Invalid };
RetainPtr<GAction> action;
};
Vector<OwnPtr<Item>> m_items;
};