merge the formfield patch from ooo-build
[ooovba.git] / sw / source / filter / inc / rtf.hxx
blob989466aae18a3afb75880b8abfbc01fd2b87e506
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rtf.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _RTF_HXX
31 #define _RTF_HXX
33 #include <tools/solar.h>
35 // Umsetzung einiger FlyFrame-Attribute
36 class RTFVertOrient
38 union {
39 struct {
40 USHORT nOrient : 4;
41 USHORT nRelOrient : 1;
42 } Flags;
43 USHORT nVal;
44 } Value;
46 public:
47 RTFVertOrient( USHORT nValue ) { Value.nVal = nValue; }
49 RTFVertOrient( USHORT nOrient, USHORT nRelOrient ) {
50 Value.Flags.nOrient = nOrient;
51 Value.Flags.nRelOrient = nRelOrient;
54 USHORT GetOrient() const { return Value.Flags.nOrient; }
55 USHORT GetRelation() const { return Value.Flags.nRelOrient; }
56 USHORT GetValue() const { return Value.nVal; }
60 class RTFHoriOrient
62 union {
63 struct {
64 USHORT nOrient : 4;
65 USHORT nRelAnchor : 4;
66 USHORT nRelOrient : 1;
67 } Flags;
68 USHORT nVal;
69 } Value;
71 public:
72 RTFHoriOrient( USHORT nValue ) { Value.nVal = nValue; }
74 RTFHoriOrient( USHORT nOrient, USHORT nRelOrient ) {
75 Value.Flags.nOrient = nOrient;
76 Value.Flags.nRelOrient = nRelOrient;
77 Value.Flags.nRelAnchor = 0;
80 USHORT GetOrient() const { return Value.Flags.nOrient; }
81 USHORT GetRelation() const { return Value.Flags.nRelOrient; }
82 USHORT GetValue() const { return Value.nVal; }
85 class RTFProtect
87 union {
88 struct {
89 BOOL bCntnt : 1;
90 BOOL bSize : 1;
91 BOOL bPos : 1;
92 } Flags;
93 BYTE nVal;
94 } Value;
95 public:
96 RTFProtect( BYTE nValue ) { Value.nVal = nValue; }
98 RTFProtect( BOOL bCntnt, BOOL bSize, BOOL bPos ) {
99 Value.Flags.bCntnt = bCntnt;
100 Value.Flags.bSize = bSize;
101 Value.Flags.bPos = bPos;
104 BOOL GetCntnt() const { return Value.Flags.bCntnt; }
105 BOOL GetSize() const { return Value.Flags.bSize; }
106 BOOL GetPos() const { return Value.Flags.bPos; }
107 USHORT GetValue() const { return Value.nVal; }
111 class RTFSurround
113 union {
114 struct {
115 USHORT nGoldCut : 1;
116 USHORT nOrder : 4;
117 } Flags;
118 BYTE nVal;
119 } Value;
120 public:
121 RTFSurround( BYTE nValue ) { Value.nVal = nValue; }
123 RTFSurround( BOOL bGoldCut, BYTE nOrder ) {
124 Value.Flags.nOrder = nOrder;
125 Value.Flags.nGoldCut = bGoldCut;
128 BYTE GetOrder() const { return (BYTE)Value.Flags.nOrder; }
129 BOOL GetGoldCut() const { return (BOOL)Value.Flags.nGoldCut; }
130 USHORT GetValue() const { return Value.nVal; }
133 #endif // _RTF_HXX