mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:47:35 +00:00
Move VisualBuilder into a new DevTools directory.
This commit is contained in:
parent
6b40b081b2
commit
3ae9fc5d88
18 changed files with 3 additions and 3 deletions
33
DevTools/VisualBuilder/VBProperty.h
Normal file
33
DevTools/VisualBuilder/VBProperty.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <LibGUI/GVariant.h>
|
||||
|
||||
class GWidget;
|
||||
class VBWidget;
|
||||
|
||||
class VBProperty {
|
||||
friend class VBWidget;
|
||||
public:
|
||||
VBProperty(VBWidget&, const String& name, const GVariant& value);
|
||||
VBProperty(VBWidget&, const String& name, Function<GVariant(const GWidget&)>&& getter, Function<void(GWidget&, const GVariant&)>&& setter);
|
||||
~VBProperty();
|
||||
|
||||
String name() const { return m_name; }
|
||||
const GVariant& value() const { return m_value; }
|
||||
void set_value(const GVariant&);
|
||||
|
||||
bool is_readonly() const { return m_readonly; }
|
||||
void set_readonly(bool b) { m_readonly = b; }
|
||||
|
||||
void sync();
|
||||
|
||||
private:
|
||||
VBWidget& m_widget;
|
||||
String m_name;
|
||||
GVariant m_value;
|
||||
Function<GVariant(const GWidget&)> m_getter;
|
||||
Function<void(GWidget&, const GVariant&)> m_setter;
|
||||
bool m_readonly { false };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue