summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/CObject.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-18 20:36:37 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-19 16:34:53 +0200
commitc2213449c04792a496510b75268305720e692e89 (patch)
tree7c7cdfec93ad5ba8cd5308ea804dbaf9728755a2 /Libraries/LibCore/CObject.h
parenta32123f221fb54ca4f5461fd6e8fd7d01760f325 (diff)
downloadserenity-c2213449c04792a496510b75268305720e692e89.zip
LibCore: Move CObject serialization into CObject::save_to(JsonObject&)
The idea is for subclasses to override this and add whatever properties are relevant for them, then call up to their base class, etc.
Diffstat (limited to 'Libraries/LibCore/CObject.h')
-rw-r--r--Libraries/LibCore/CObject.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibCore/CObject.h b/Libraries/LibCore/CObject.h
index c8c6f743c9..f35403d1ef 100644
--- a/Libraries/LibCore/CObject.h
+++ b/Libraries/LibCore/CObject.h
@@ -7,6 +7,10 @@
#include <AK/Vector.h>
#include <AK/Weakable.h>
+namespace AK {
+class JsonObject;
+}
+
class CEvent;
class CChildEvent;
class CCustomEvent;
@@ -63,6 +67,8 @@ public:
bool is_widget() const { return m_widget; }
virtual bool is_window() const { return false; }
+ virtual void save_to(AK::JsonObject&);
+
static IntrusiveList<CObject, &CObject::m_all_objects_list_node>& all_objects();
protected: