bump product version to 4.1.6.2
[LibreOffice.git] / writerfilter / source / rtftok / rtffly.hxx
blobd07a8aca3a580ab26b20691c74ed7016e2a12763
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #ifndef _RTFFLY_HXX_
11 #define _RTFFLY_HXX_
13 namespace writerfilter {
14 namespace rtftok {
15 /// Stores the vertical orientation properties of an RTF fly frame.
16 class RTFVertOrient
18 public:
19 RTFVertOrient(sal_uInt16 nValue)
20 : nVal(nValue)
24 sal_uInt16 GetOrient() const
26 return OSL_LONIBBLE(OSL_LOBYTE(nVal));
29 sal_uInt16 GetRelation() const
31 return OSL_HINIBBLE(OSL_LOBYTE(nVal));
34 sal_Int32 GetAlign() const
36 sal_Int32 nAlign = 0;
37 switch( GetOrient( ) )
39 case text::VertOrientation::CENTER:
40 nAlign = NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_center;
41 break;
42 case text::VertOrientation::TOP:
43 nAlign = NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_top;
44 break;
45 case text::VertOrientation::BOTTOM:
46 nAlign = NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_bottom;
47 break;
50 return nAlign;
53 sal_Int32 GetAnchor() const
55 sal_Int32 nAnchor = 0;
56 switch( GetRelation( ) )
58 case text::RelOrientation::FRAME:
59 nAnchor = NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_text;
60 break;
61 case text::RelOrientation::PAGE_FRAME:
62 nAnchor = NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_page;
63 break;
64 case text::RelOrientation::PAGE_PRINT_AREA:
65 nAnchor = NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_margin;
66 break;
69 return nAnchor;
72 sal_uInt16 GetValue() const
74 return nVal;
77 private:
78 sal_uInt16 nVal;
81 /// Stores the horizontal orientation properties of an RTF fly frame.
82 class RTFHoriOrient
84 public:
85 RTFHoriOrient(sal_uInt16 nValue)
86 : nVal(nValue)
90 sal_uInt16 GetOrient() const
92 return OSL_LONIBBLE(OSL_LOBYTE(nVal));
95 sal_uInt16 GetRelation() const
97 return OSL_LONIBBLE(OSL_HIBYTE(nVal));
100 sal_uInt16 GetRelAnchor() const
102 return OSL_HINIBBLE(OSL_LOBYTE(nVal));
105 sal_Int32 GetAlign() const
107 sal_Int32 nAlign = 0;
108 switch( GetOrient( ) )
110 case text::HoriOrientation::CENTER:
111 nAlign = NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_center;
112 break;
113 case text::HoriOrientation::RIGHT:
114 nAlign = NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_right;
115 break;
116 case text::HoriOrientation::LEFT:
117 nAlign = NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_left;
118 break;
119 case text::HoriOrientation::INSIDE:
120 nAlign = NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_inside;
121 break;
122 case text::HoriOrientation::OUTSIDE:
123 nAlign = NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_outside;
124 break;
127 return nAlign;
130 sal_Int32 GetAnchor() const
132 sal_Int32 nAnchor = 0;
133 switch( GetRelation( ) )
135 case text::RelOrientation::FRAME:
136 nAnchor = NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_text;
137 break;
138 case text::RelOrientation::PAGE_FRAME:
139 nAnchor = NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_page;
140 break;
141 case text::RelOrientation::PAGE_PRINT_AREA:
142 nAnchor = NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_margin;
143 break;
146 return nAnchor;
149 sal_uInt16 GetValue() const
151 return nVal;
154 private:
155 sal_uInt16 nVal;
157 } // namespace rtftok
158 } // namespace writerfilter
160 #endif // _RTFFLY_HXX_
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */