src/lddocument.h

changeset 1288
d1e45f90654b
parent 1287
f1da43b7f5c6
child 1291
9c570a30c98a
--- a/src/lddocument.h	Thu Mar 15 18:51:58 2018 +0200
+++ b/src/lddocument.h	Fri Mar 16 11:50:35 2018 +0200
@@ -30,6 +30,13 @@
 
 struct LDHeader
 {
+	struct HistoryEntry
+	{
+		QDate date;
+		QString author;
+		QString description;
+		enum { UserName, RealName } authorType = UserName;
+	};
 	enum FileType
 	{
 		Part,
@@ -48,7 +55,7 @@
 	};
 	QFlags<Qualifier> qualfiers;
 	QString description;
-	QString filename;
+	QString name;
 	struct
 	{
 		QString realName;
@@ -58,6 +65,7 @@
 	QString cmdline;
 	QStringList help;
 	QStringList keywords;
+	QVector<HistoryEntry> history;
 	enum
 	{
 		NoWinding,
@@ -71,6 +79,13 @@
 	} license = CaLicense;
 };
 
+Q_DECLARE_OPERATORS_FOR_FLAGS(QFlags<LDHeader::Qualifier>)
+
+decltype(LDHeader::winding) operator^(
+	decltype(LDHeader::winding) one,
+	decltype(LDHeader::winding) other
+);
+
 //
 // This class stores a document either as a editable file for the user or for
 // subfile caching.
@@ -114,6 +129,7 @@
 	void setDefaultName (QString value);
 	void setFrozen(bool value);
 	void setFullPath (QString value);
+	void setHeader(LDHeader&& header);
 	void setName (QString value);
 	void setSavePosition (long value);
 	void setTabIndex (int value);
@@ -156,7 +172,5 @@
 	void handleImminentObjectRemoval(const QModelIndex& index);
 };
 
-Q_DECLARE_OPERATORS_FOR_FLAGS(QFlags<LDHeader::Qualifier>)
-
 // Parses a string line containing an LDraw object and returns the object parsed.
 LDObject* ParseLine (QString line);

mercurial