1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_INC_TYPESERIALIZER_HXX
21 #define INCLUDED_VCL_INC_TYPESERIALIZER_HXX
23 #include <vcl/dllapi.h>
24 #include <tools/GenericTypeSerializer.hxx>
25 #include <vcl/gradient.hxx>
26 #include <vcl/gfxlink.hxx>
27 #include <vcl/graph.hxx>
29 constexpr sal_uInt32
createMagic(char char1
, char char2
, char char3
, char char4
)
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);
35 constexpr sal_uInt32 constSvgMagic
= createMagic('s', 'v', 'g', '0');
36 constexpr sal_uInt32 constWmfMagic
= createMagic('w', 'm', 'f', '0');
37 constexpr sal_uInt32 constEmfMagic
= createMagic('e', 'm', 'f', '0');
38 constexpr sal_uInt32 constPdfMagic
= createMagic('p', 'd', 'f', '0');
40 class VCL_DLLPUBLIC TypeSerializer
: public tools::GenericTypeSerializer
43 TypeSerializer(SvStream
& rStream
);
45 void readGradient(Gradient
& rGradient
);
46 void writeGradient(const Gradient
& rGradient
);
48 void readGfxLink(GfxLink
& rGfxLink
);
49 void writeGfxLink(const GfxLink
& rGfxLink
);
51 void readGraphic(Graphic
& rGraphic
);
52 void writeGraphic(const Graphic
& rGraphic
);
54 bool readMapMode(MapMode
& rMapMode
);
55 void writeMapMode(MapMode
const& rMapMode
);
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */