added a document header structure

Thu, 15 Mar 2018 11:31:39 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Thu, 15 Mar 2018 11:31:39 +0200
changeset 1286
2a0316eb374c
parent 1285
0d165d277562
child 1287
f1da43b7f5c6

added a document header structure

src/lddocument.h file | annotate | diff | comparison | revisions
--- a/src/lddocument.h	Thu Mar 15 10:46:46 2018 +0200
+++ b/src/lddocument.h	Thu Mar 15 11:31:39 2018 +0200
@@ -43,6 +43,49 @@
 	Q_OBJECT
 
 public:
+	struct Header
+	{
+		enum FileType
+		{
+			Part,
+			Subpart,
+			Shortcut,
+			Primitive,
+			Primitive_8,
+			Primitive_48,
+			Configuration,
+		} type;
+		enum Qualifier
+		{
+			Alias = 1 << 0,
+			Physical_Color = 1 << 1,
+			Flexible_Section = 1 << 2,
+		};
+		QFlags<Qualifier> qualfiers;
+		QString description;
+		QString filename;
+		struct
+		{
+			QString realName;
+			QString userName;
+		} author;
+		QString category;
+		QString cmdline;
+		QStringList help;
+		QStringList keywords;
+		enum
+		{
+			NoWinding,
+			CounterClockwise,
+			Clockwise,
+		} winding = NoWinding;
+		enum
+		{
+			CaLicense,
+			NonCaLicense
+		} license = CaLicense;
+	};
+
 	LDDocument (DocumentManager* parent);
 	~LDDocument();
 
@@ -112,5 +155,7 @@
 	void handleImminentObjectRemoval(const QModelIndex& index);
 };
 
+Q_DECLARE_OPERATORS_FOR_FLAGS(QFlags<LDDocument::Header::Qualifier>)
+
 // Parses a string line containing an LDraw object and returns the object parsed.
 LDObject* ParseLine (QString line);

mercurial