LibreOffice Module sw (master) 1
fmtornt.hxx
Go to the documentation of this file.
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 INCLUDED_SW_INC_FMTORNT_HXX
20#define INCLUDED_SW_INC_FMTORNT_HXX
21
22#include <com/sun/star/text/HoriOrientation.hpp>
23#include <com/sun/star/text/VertOrientation.hpp>
24#include <com/sun/star/text/RelOrientation.hpp>
25#include "swdllapi.h"
26#include "hintids.hxx"
27#include "swtypes.hxx"
28#include "format.hxx"
29#include <svl/poolitem.hxx>
30
31class IntlWrapper;
32
37{
39 sal_Int16 m_eOrient;
40 sal_Int16 m_eRelation;
41public:
43 sal_Int16 eRel = css::text::RelOrientation::PRINT_AREA );
44 SwFormatVertOrient(SwFormatVertOrient const &) = default; // SfxPoolItem copy function dichotomy
45
47 virtual bool operator==( const SfxPoolItem& ) const override;
48 virtual SwFormatVertOrient* Clone( SfxItemPool* pPool = nullptr ) const override;
49 virtual bool GetPresentation( SfxItemPresentation ePres,
50 MapUnit eCoreMetric,
51 MapUnit ePresMetric,
52 OUString &rText,
53 const IntlWrapper& rIntl ) const override;
54 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
55 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
56
57 sal_Int16 GetVertOrient() const { return m_eOrient; }
58 sal_Int16 GetRelationOrient() const { return m_eRelation; }
59 void SetVertOrient( sal_Int16 eNew ) { m_eOrient = eNew; }
60 void SetRelationOrient( sal_Int16 eNew ) { m_eRelation = eNew; }
61
62 SwTwips GetPos() const { return m_nYPos; }
63 void SetPos( SwTwips nNew ) { m_nYPos = nNew; }
64
65 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
66};
67
73{
75 sal_Int16 m_eOrient;
76 sal_Int16 m_eRelation;
77 bool m_bPosToggle : 1;
78public:
80 sal_Int16 eRel = css::text::RelOrientation::PRINT_AREA, bool bPos = false );
81 SwFormatHoriOrient(SwFormatHoriOrient const &) = default; // SfxPoolItem copy function dichotomy
82
84 virtual bool operator==( const SfxPoolItem& ) const override;
85 virtual SwFormatHoriOrient* Clone( SfxItemPool* pPool = nullptr ) const override;
86 virtual bool GetPresentation( SfxItemPresentation ePres,
87 MapUnit eCoreMetric,
88 MapUnit ePresMetric,
89 OUString &rText,
90 const IntlWrapper& rIntl ) const override;
91 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
92 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
93
94 sal_Int16 GetHoriOrient() const { return m_eOrient; }
95 sal_Int16 GetRelationOrient() const { return m_eRelation; }
96 void SetHoriOrient( sal_Int16 eNew ) { m_eOrient = eNew; }
97 void SetRelationOrient( sal_Int16 eNew ) { m_eRelation = eNew; }
98
99 SwTwips GetPos() const { return m_nXPos; }
100 void SetPos( SwTwips nNew ) { m_nXPos = nNew; }
101
102 bool IsPosToggle() const { return m_bPosToggle; }
103 void SetPosToggle( bool bNew ) { m_bPosToggle = bNew; }
104
105 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
106};
107
108inline const SwFormatVertOrient &SwAttrSet::GetVertOrient(bool bInP) const
109 { return Get( RES_VERT_ORIENT,bInP); }
110inline const SwFormatHoriOrient &SwAttrSet::GetHoriOrient(bool bInP) const
111 { return Get( RES_HORI_ORIENT,bInP); }
112
113inline const SwFormatVertOrient &SwFormat::GetVertOrient(bool bInP) const
114 { return m_aSet.GetVertOrient(bInP); }
115inline const SwFormatHoriOrient &SwFormat::GetHoriOrient(bool bInP) const
116 { return m_aSet.GetHoriOrient(bInP); }
117
118namespace sw {
119
120 bool GetAtPageRelOrientation(sal_Int16 & rOrientation, bool const isIgnorePrintArea);
121
122}
123
124#endif
125
126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:110
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:108
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:100
bool m_bPosToggle
Flip position on even pages.
Definition: fmtornt.hxx:77
sal_Int16 m_eOrient
Definition: fmtornt.hxx:75
void SetPosToggle(bool bNew)
Definition: fmtornt.hxx:103
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:96
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:94
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:97
sal_Int16 m_eRelation
Definition: fmtornt.hxx:76
SwFormatHoriOrient(SwFormatHoriOrient const &)=default
SwTwips GetPos() const
Definition: fmtornt.hxx:99
bool IsPosToggle() const
Definition: fmtornt.hxx:102
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:95
SwTwips m_nXPos
Contains always the current RelPos.
Definition: fmtornt.hxx:74
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:58
SwFormatVertOrient(SwFormatVertOrient const &)=default
SwTwips m_nYPos
Contains always the current RelPos.
Definition: fmtornt.hxx:38
SwTwips GetPos() const
Definition: fmtornt.hxx:62
sal_Int16 m_eRelation
Definition: fmtornt.hxx:40
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:59
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:63
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:60
sal_Int16 m_eOrient
Definition: fmtornt.hxx:39
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:57
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:113
SwAttrSet m_aSet
Definition: format.hxx:51
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:115
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
MapUnit
Dialog to specify the properties of date form field.
bool GetAtPageRelOrientation(sal_Int16 &rOrientation, bool const isIgnorePrintArea)
Definition: atrfrm.cxx:108
SfxItemPresentation
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
tools::Long SwTwips
Definition: swtypes.hxx:51
unsigned char sal_uInt8