summaryrefslogtreecommitdiffstats
path: root/starmath/source/eqnolefilehdr.hxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
commit940b4d1848e8c70ab7642901a68594e8016caffc (patch)
treeeb72f344ee6c3d9b80a7ecc079ea79e9fba8676d /starmath/source/eqnolefilehdr.hxx
parentInitial commit. (diff)
downloadlibreoffice-upstream.tar.xz
libreoffice-upstream.zip
Adding upstream version 1:7.0.4.upstream/1%7.0.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--starmath/source/eqnolefilehdr.hxx77
1 files changed, 77 insertions, 0 deletions
diff --git a/starmath/source/eqnolefilehdr.hxx b/starmath/source/eqnolefilehdr.hxx
new file mode 100644
index 000000000..29f93cd00
--- /dev/null
+++ b/starmath/source/eqnolefilehdr.hxx
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_STARMATH_SOURCE_EQNOLEFILEHDR_HXX
+#define INCLUDED_STARMATH_SOURCE_EQNOLEFILEHDR_HXX
+
+#include <sal/types.h>
+#include <tools/stream.hxx>
+
+class SotStorage;
+
+#define EQNOLEFILEHDR_SIZE 28
+
+class EQNOLEFILEHDR
+{
+public:
+ EQNOLEFILEHDR() : nCBHdr(0),nVersion(0),
+ nCf(0),nCBObject(0),nReserved1(0),nReserved2(0),
+ nReserved3(0), nReserved4(0) {}
+ explicit EQNOLEFILEHDR(sal_uInt32 nLenMTEF) : nCBHdr(0x1c),nVersion(0x20000),
+ nCf(0xc1c6),nCBObject(nLenMTEF),nReserved1(0),nReserved2(0x0014F690),
+ nReserved3(0x0014EBB4), nReserved4(0) {}
+
+ sal_uInt16 nCBHdr; // length of header, sizeof(EQNOLEFILEHDR) = 28
+ sal_uInt32 nVersion; // hiword = 2, loword = 0
+ sal_uInt16 nCf; // clipboard format ("MathType EF")
+ sal_uInt32 nCBObject; // length of MTEF data following this header
+ sal_uInt32 nReserved1; // not used
+ sal_uInt32 nReserved2; // not used
+ sal_uInt32 nReserved3; // not used
+ sal_uInt32 nReserved4; // not used
+
+ void Read(SvStream* pS)
+ {
+ pS->ReadUInt16( nCBHdr );
+ pS->ReadUInt32( nVersion );
+ pS->ReadUInt16( nCf );
+ pS->ReadUInt32( nCBObject );
+ pS->ReadUInt32( nReserved1 );
+ pS->ReadUInt32( nReserved2 );
+ pS->ReadUInt32( nReserved3 );
+ pS->ReadUInt32( nReserved4 );
+ }
+ void Write(SvStream* pS)
+ {
+ pS->WriteUInt16( nCBHdr );
+ pS->WriteUInt32( nVersion );
+ pS->WriteUInt16( nCf );
+ pS->WriteUInt32( nCBObject );
+ pS->WriteUInt32( nReserved1 );
+ pS->WriteUInt32( nReserved2 );
+ pS->WriteUInt32( nReserved3 );
+ pS->WriteUInt32( nReserved4 );
+ }
+};
+
+bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion );
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */