summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/CObject.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-10 20:33:53 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-10 20:33:53 +0200
commitb06d2c04dcce4cebac642b85da3ce0fcbff7aec7 (patch)
treef9e09c6de0bb70c14ab2dfcc564d7ae693503b3a /Libraries/LibCore/CObject.h
parentc33766f039c5935d33fe6897f215081a08727b5b (diff)
downloadserenity-b06d2c04dcce4cebac642b85da3ce0fcbff7aec7.zip
CObject: Add a "name" property.
This will be useful for things like the VisualBuilder code generator.
Diffstat (limited to 'Libraries/LibCore/CObject.h')
-rw-r--r--Libraries/LibCore/CObject.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibCore/CObject.h b/Libraries/LibCore/CObject.h
index 392a94e189..038dc93ca8 100644
--- a/Libraries/LibCore/CObject.h
+++ b/Libraries/LibCore/CObject.h
@@ -1,5 +1,6 @@
#pragma once
+#include <AK/AKString.h>
#include <AK/Function.h>
#include <AK/StdLibExtras.h>
#include <AK/Vector.h>
@@ -18,6 +19,9 @@ public:
virtual void event(CEvent&);
+ const String& name() const { return m_name; }
+ void set_name(const StringView& name) { m_name = name; }
+
Vector<CObject*>& children() { return m_children; }
const Vector<CObject*>& children() const { return m_children; }
@@ -58,6 +62,7 @@ protected:
private:
CObject* m_parent { nullptr };
+ String m_name;
int m_timer_id { 0 };
bool m_widget { false };
Vector<CObject*> m_children;