/src/libreoffice/drawinglayer/source/tools/emfpstringformat.hxx
Line | Count | Source |
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 | | #pragma once |
21 | | |
22 | | #include "emfphelperdata.hxx" |
23 | | |
24 | | namespace emfplushelper |
25 | | { |
26 | | const sal_uInt32 StringFormatDirectionRightToLeft = 0x00000001; |
27 | | const sal_uInt32 StringFormatDirectionVertical = 0x00000002; |
28 | | const sal_uInt32 StringFormatNoFitBlackBox = 0x00000004; |
29 | | const sal_uInt32 StringFormatDisplayFormatControl = 0x00000020; |
30 | | const sal_uInt32 StringFormatNoFontFallback = 0x00000400; |
31 | | const sal_uInt32 StringFormatMeasureTrailingSpaces = 0x00000800; |
32 | | const sal_uInt32 StringFormatNoWrap = 0x00001000; |
33 | | const sal_uInt32 StringFormatLineLimit = 0x00002000; |
34 | | const sal_uInt32 StringFormatNoClip = 0x00004000; |
35 | | const sal_uInt32 StringFormatBypassGDI = 0x80000000; |
36 | | |
37 | | enum StringAlignment |
38 | | { |
39 | | StringAlignmentNear = 0x00000000, |
40 | | StringAlignmentCenter = 0x00000001, |
41 | | StringAlignmentFar = 0x00000002 |
42 | | }; |
43 | | |
44 | | enum StringDigitSubstitution |
45 | | { |
46 | | StringDigitSubstitutionUser = 0x00000000, |
47 | | StringDigitSubstitutionNone = 0x00000001, |
48 | | StringDigitSubstitutionNational = 0x00000002, |
49 | | StringDigitSubstitutionTraditional = 0x00000003 |
50 | | }; |
51 | | |
52 | | enum HotkeyPrefix |
53 | | { |
54 | | HotkeyPrefixNone = 0x00000000, |
55 | | HotkeyPrefixShow = 0x00000001, |
56 | | HotkeyPrefixHide = 0x00000002 |
57 | | }; |
58 | | |
59 | | enum StringTrimming |
60 | | { |
61 | | StringTrimmingNone = 0x00000000, |
62 | | StringTrimmingCharacter = 0x00000001, |
63 | | StringTrimmingWord = 0x00000002, |
64 | | StringTrimmingEllipsisCharacter = 0x00000003, |
65 | | StringTrimmingEllipsisWord = 0x00000004, |
66 | | StringTrimmingEllipsisPath = 0x00000005 |
67 | | }; |
68 | | |
69 | | struct EMFPStringFormat : public EMFPObject |
70 | | { |
71 | | sal_uInt32 header; |
72 | | sal_uInt32 stringFormatFlags; |
73 | | sal_uInt32 language; |
74 | | sal_uInt32 stringAlignment; // Horizontal alignment |
75 | | sal_uInt32 lineAlign; // Vertical alignment |
76 | | sal_uInt32 digitSubstitution; |
77 | | sal_uInt32 digitLanguage; |
78 | | float firstTabOffset; |
79 | | sal_Int32 hotkeyPrefix; |
80 | | float leadingMargin; // Length of the space to add to the starting position of a string. |
81 | | float trailingMargin; // Length of the space to leave following a string. |
82 | | float tracking; |
83 | | sal_Int32 trimming; |
84 | | sal_Int32 tabStopCount; |
85 | | sal_Int32 rangeCount; |
86 | | |
87 | | EMFPStringFormat(); |
88 | | void Read(SvMemoryStream &s); |
89 | | |
90 | | // flags table from MS-EMFPLUS doc |
91 | 0 | bool DirectionRightToLeft() const { return stringFormatFlags & 0x00000001;} |
92 | 0 | bool DirectionVertical() const { return stringFormatFlags & 0x00000002;} |
93 | 0 | bool NoFitBlackBox() const { return stringFormatFlags & 0x00000004;} |
94 | 0 | bool DisplayFormatControl() const { return stringFormatFlags & 0x00000020;} |
95 | 0 | bool NoFontFallback() const { return stringFormatFlags & 0x00000400;} |
96 | 0 | bool MeasureTrailingSpaces() const { return stringFormatFlags & 0x00000800;} |
97 | 0 | bool NoWrap() const { return stringFormatFlags & 0x00001000;} |
98 | 0 | bool LineLimit() const { return stringFormatFlags & 0x00002000;} |
99 | 0 | bool NoClip() const { return stringFormatFlags & 0x00004000;} |
100 | 0 | bool BypassGDI() const { return stringFormatFlags & 0x80000000;} |
101 | | }; |
102 | | } |
103 | | |
104 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |