Branch data Line data Source code
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 : : #ifndef _RTF_HXX
20 : : #define _RTF_HXX
21 : :
22 : : #include <tools/solar.h>
23 : :
24 : : // Umsetzung einiger FlyFrame-Attribute
25 : : class RTFVertOrient
26 : : {
27 : : union {
28 : : struct {
29 : : sal_uInt16 nOrient : 4;
30 : : sal_uInt16 nRelOrient : 1;
31 : : } Flags;
32 : : sal_uInt16 nVal;
33 : : } Value;
34 : :
35 : : public:
36 : 0 : RTFVertOrient( sal_uInt16 nValue ) { Value.nVal = nValue; }
37 : :
38 : 0 : RTFVertOrient( sal_uInt16 nOrient, sal_uInt16 nRelOrient ) {
39 : 0 : Value.Flags.nOrient = nOrient;
40 : 0 : Value.Flags.nRelOrient = nRelOrient;
41 : 0 : }
42 : :
43 : 0 : sal_uInt16 GetOrient() const { return Value.Flags.nOrient; }
44 : 0 : sal_uInt16 GetRelation() const { return Value.Flags.nRelOrient; }
45 : 0 : sal_uInt16 GetValue() const { return Value.nVal; }
46 : : };
47 : :
48 : :
49 : : class RTFHoriOrient
50 : : {
51 : : union {
52 : : struct {
53 : : sal_uInt16 nOrient : 4;
54 : : sal_uInt16 nRelAnchor : 4;
55 : : sal_uInt16 nRelOrient : 1;
56 : : } Flags;
57 : : sal_uInt16 nVal;
58 : : } Value;
59 : :
60 : : public:
61 : 0 : RTFHoriOrient( sal_uInt16 nValue ) { Value.nVal = nValue; }
62 : :
63 : 0 : RTFHoriOrient( sal_uInt16 nOrient, sal_uInt16 nRelOrient ) {
64 : 0 : Value.Flags.nOrient = nOrient;
65 : 0 : Value.Flags.nRelOrient = nRelOrient;
66 : 0 : Value.Flags.nRelAnchor = 0;
67 : 0 : }
68 : :
69 : 0 : sal_uInt16 GetOrient() const { return Value.Flags.nOrient; }
70 : 0 : sal_uInt16 GetRelation() const { return Value.Flags.nRelOrient; }
71 : 0 : sal_uInt16 GetValue() const { return Value.nVal; }
72 : : };
73 : :
74 : : class RTFProtect
75 : : {
76 : : union {
77 : : struct {
78 : : sal_Bool bCntnt : 1;
79 : : sal_Bool bSize : 1;
80 : : sal_Bool bPos : 1;
81 : : } Flags;
82 : : sal_uInt8 nVal;
83 : : } Value;
84 : : public:
85 : 0 : RTFProtect( sal_uInt8 nValue ) { Value.nVal = nValue; }
86 : :
87 : : RTFProtect( sal_Bool bCntnt, sal_Bool bSize, sal_Bool bPos ) {
88 : : Value.Flags.bCntnt = bCntnt;
89 : : Value.Flags.bSize = bSize;
90 : : Value.Flags.bPos = bPos;
91 : : }
92 : :
93 : 0 : sal_Bool GetCntnt() const { return Value.Flags.bCntnt; }
94 : 0 : sal_Bool GetSize() const { return Value.Flags.bSize; }
95 : 0 : sal_Bool GetPos() const { return Value.Flags.bPos; }
96 : : sal_uInt16 GetValue() const { return Value.nVal; }
97 : : };
98 : :
99 : :
100 : : class RTFSurround
101 : : {
102 : : union {
103 : : struct {
104 : : sal_uInt16 nGoldCut : 1;
105 : : sal_uInt16 nOrder : 4;
106 : : } Flags;
107 : : sal_uInt8 nVal;
108 : : } Value;
109 : : public:
110 : 0 : RTFSurround( sal_uInt8 nValue ) { Value.nVal = nValue; }
111 : :
112 : 0 : RTFSurround( sal_Bool bGoldCut, sal_uInt8 nOrder ) {
113 : 0 : Value.Flags.nOrder = nOrder;
114 : 0 : Value.Flags.nGoldCut = bGoldCut;
115 : 0 : }
116 : :
117 : 0 : sal_uInt8 GetOrder() const { return (sal_uInt8)Value.Flags.nOrder; }
118 : 0 : sal_Bool GetGoldCut() const { return (sal_Bool)Value.Flags.nGoldCut; }
119 : 0 : sal_uInt16 GetValue() const { return Value.nVal; }
120 : : };
121 : :
122 : : #endif // _RTF_HXX
123 : :
124 : :
125 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|