LibreOffice Module vcl (master) 1
TypeSerializer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_VCL_INC_TYPESERIALIZER_HXX
21#define INCLUDED_VCL_INC_TYPESERIALIZER_HXX
22
23#include <vcl/dllapi.h>
25#include <vcl/gradient.hxx>
26#include <vcl/gfxlink.hxx>
27#include <vcl/graph.hxx>
28
29constexpr sal_uInt32 createMagic(char char1, char char2, char char3, char char4)
30{
31 return (static_cast<sal_uInt32>(char1) << 24) | (static_cast<sal_uInt32>(char2) << 16)
32 | (static_cast<sal_uInt32>(char3) << 8) | (static_cast<sal_uInt32>(char4) << 0);
33}
34
35constexpr sal_uInt32 constSvgMagic = createMagic('s', 'v', 'g', '0');
36constexpr sal_uInt32 constWmfMagic = createMagic('w', 'm', 'f', '0');
37constexpr sal_uInt32 constEmfMagic = createMagic('e', 'm', 'f', '0');
38constexpr sal_uInt32 constPdfMagic = createMagic('p', 'd', 'f', '0');
39
41{
42public:
43 TypeSerializer(SvStream& rStream);
44
45 void readGradient(Gradient& rGradient);
46 void writeGradient(const Gradient& rGradient);
47
48 void readGfxLink(GfxLink& rGfxLink);
49 void writeGfxLink(const GfxLink& rGfxLink);
50
51 void readGraphic(Graphic& rGraphic);
52 void writeGraphic(const Graphic& rGraphic);
53
54 void readMapMode(MapMode& rMapMode);
55 void writeMapMode(MapMode const& rMapMode);
56};
57
58#endif
59
60/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr sal_uInt32 constPdfMagic
constexpr sal_uInt32 constSvgMagic
constexpr sal_uInt32 constEmfMagic
constexpr sal_uInt32 createMagic(char char1, char char2, char char3, char char4)
constexpr sal_uInt32 constWmfMagic
#define VCL_DLLPUBLIC
Definition: dllapi.h:29