1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:08:12 +00:00
serenity/Applications/VisualBuilder/VBWidgetRegistry.h
Andreas Kling f52e66ceda VisualBuilder: Add a widget registry and a property class.
I need somewhere to centralize the knowledge about the different widget
types available. And VBProperty represents a property key/value of arbitrary
type (it uses a GVariant for the value.)
2019-04-11 16:13:19 +02:00

20 lines
494 B
C++

#pragma once
#include "VBWidgetType.h"
#include <AK/HashMap.h>
#include <AK/OwnPtr.h>
#include <AK/AKString.h>
class GWidget;
class VBProperty;
class VBWidgetRegistry {
public:
template<typename Callback> static void for_each_widget_type(Callback callback)
{
for (unsigned i = 1; i < (unsigned)VBWidgetType::__Count; ++i)
callback((VBWidgetType)i);
}
static GWidget* build_gwidget(VBWidgetType, GWidget* parent, HashMap<String, OwnPtr<VBProperty>>&);
};