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_OOX_OLE_AXFONTDATA_HXX
21 #define INCLUDED_OOX_OLE_AXFONTDATA_HXX
23 #include <oox/dllapi.h>
24 #include <rtl/ustring.hxx>
25 #include <sal/types.h>
26 #include <o3tl/typed_flags_set.hxx>
29 class BinaryInputStream
;
30 class BinaryOutputStream
;
33 enum class AxFontFlags
{
37 Underline
= 0x00000004,
38 Strikeout
= 0x00000008,
39 Disabled
= 0x00002000,
40 AutoColor
= 0x40000000,
43 template<> struct typed_flags
<AxFontFlags
> : is_typed_flags
<AxFontFlags
, 0x4000200f> {};
49 enum class AxHorizontalAlign
{
50 Left
= 1, Right
= 2, Center
= 3
53 /** All entries of a font property. */
54 struct OOX_DLLPUBLIC AxFontData
56 OUString maFontName
; ///< Name of the used font.
57 AxFontFlags mnFontEffects
; ///< Font effect flags.
58 sal_Int32 mnFontHeight
; ///< Height of the font (not really twips, see code).
59 sal_Int32 mnFontCharSet
; ///< Windows character set of the font.
60 AxHorizontalAlign mnHorAlign
; ///< Horizontal text alignment.
61 bool mbDblUnderline
; ///< True = double underline style (legacy VML drawing controls only).
63 explicit AxFontData();
65 /** Converts the internal representation of the font height to points. */
66 sal_Int16
getHeightPoints() const;
67 /** Converts the passed font height from points to the internal representation. */
68 void setHeightPoints( sal_Int16 nPoints
);
70 /** Reads the font data settings from the passed input stream. */
71 bool importBinaryModel( BinaryInputStream
& rInStrm
);
73 void exportBinaryModel( BinaryOutputStream
& rOutStrm
);
74 /** Reads the font data settings from the passed input stream that contains
75 an OLE StdFont structure. */
76 bool importStdFont( BinaryInputStream
& rInStrm
);
77 /** Reads the font data settings from the passed input stream depending on
78 the GUID preceding the actual font data. */
79 bool importGuidAndFont( BinaryInputStream
& rInStrm
);
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */