summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibPDF/Forward.h
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2021-04-30 18:23:17 -0700
committerAndreas Kling <kling@serenityos.org>2021-05-10 10:32:39 +0200
commita8f5b6aaa3405e4b4eda49888ee9da8572d5473d (patch)
treee5c95bb185071cda2f81d5802cd67b366533eb2f /Userland/Libraries/LibPDF/Forward.h
parentaf9a7b13748cc4ccffe6f257c520b2a3b040102b (diff)
downloadserenity-a8f5b6aaa3405e4b4eda49888ee9da8572d5473d.zip
LibPDF: Create basic object structure
This commit is the start of LibPDF, and introduces some basic structure objects. This emulates LibJS's Value structure, where Value is a simple class that can contain a pointer to a more complex Object class with more data. All of the basic PDF objects have a representation.
Diffstat (limited to 'Userland/Libraries/LibPDF/Forward.h')
-rw-r--r--Userland/Libraries/LibPDF/Forward.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/Userland/Libraries/LibPDF/Forward.h b/Userland/Libraries/LibPDF/Forward.h
new file mode 100644
index 0000000000..dd9825cff8
--- /dev/null
+++ b/Userland/Libraries/LibPDF/Forward.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+namespace PDF {
+
+class Document;
+class Object;
+
+#define ENUMERATE_DIRECT_OBJECT_TYPES(V) \
+ V(StringObject, string) \
+ V(NameObject, name) \
+ V(ArrayObject, array) \
+ V(DictObject, dict) \
+ V(StreamObject, stream) \
+ V(IndirectValue, indirect_value)
+
+#define ENUMERATE_OBJECT_TYPES(V) \
+ ENUMERATE_DIRECT_OBJECT_TYPES(V) \
+ V(IndirectValueRef, indirect_value_ref)
+
+#define FORWARD_DECL(class_name, _) class class_name;
+ENUMERATE_OBJECT_TYPES(FORWARD_DECL)
+#undef FORWARD_DECL
+
+template<typename T>
+concept IsObject = IsBaseOf<Object, T>;
+
+}