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 
31 class IntlWrapper;
32 
34 {
36  sal_Int16 m_eOrient;
37  sal_Int16 m_eRelation;
38 public:
40  sal_Int16 eRel = css::text::RelOrientation::PRINT_AREA );
41  SwFormatVertOrient(SwFormatVertOrient const &) = default; // SfxPoolItem copy function dichotomy
42 
44  virtual bool operator==( const SfxPoolItem& ) const override;
45  virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
46  virtual bool GetPresentation( SfxItemPresentation ePres,
47  MapUnit eCoreMetric,
48  MapUnit ePresMetric,
49  OUString &rText,
50  const IntlWrapper& rIntl ) const override;
51  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
52  virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
53 
54  sal_Int16 GetVertOrient() const { return m_eOrient; }
55  sal_Int16 GetRelationOrient() const { return m_eRelation; }
56  void SetVertOrient( sal_Int16 eNew ) { m_eOrient = eNew; }
57  void SetRelationOrient( sal_Int16 eNew ) { m_eRelation = eNew; }
58 
59  SwTwips GetPos() const { return m_nYPos; }
60  void SetPos( SwTwips nNew ) { m_nYPos = nNew; }
61 
62  void dumpAsXml(xmlTextWriterPtr pWriter) const override;
63 };
64 
66 {
68  sal_Int16 m_eOrient;
69  sal_Int16 m_eRelation;
70  bool m_bPosToggle : 1;
71 public:
73  sal_Int16 eRel = css::text::RelOrientation::PRINT_AREA, bool bPos = false );
74  SwFormatHoriOrient(SwFormatHoriOrient const &) = default; // SfxPoolItem copy function dichotomy
75 
77  virtual bool operator==( const SfxPoolItem& ) const override;
78  virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
79  virtual bool GetPresentation( SfxItemPresentation ePres,
80  MapUnit eCoreMetric,
81  MapUnit ePresMetric,
82  OUString &rText,
83  const IntlWrapper& rIntl ) const override;
84  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
85  virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
86 
87  sal_Int16 GetHoriOrient() const { return m_eOrient; }
88  sal_Int16 GetRelationOrient() const { return m_eRelation; }
89  void SetHoriOrient( sal_Int16 eNew ) { m_eOrient = eNew; }
90  void SetRelationOrient( sal_Int16 eNew ) { m_eRelation = eNew; }
91 
92  SwTwips GetPos() const { return m_nXPos; }
93  void SetPos( SwTwips nNew ) { m_nXPos = nNew; }
94 
95  bool IsPosToggle() const { return m_bPosToggle; }
96  void SetPosToggle( bool bNew ) { m_bPosToggle = bNew; }
97 
98  void dumpAsXml(xmlTextWriterPtr pWriter) const override;
99 };
100 
101 inline const SwFormatVertOrient &SwAttrSet::GetVertOrient(bool bInP) const
102  { return Get( RES_VERT_ORIENT,bInP); }
103 inline const SwFormatHoriOrient &SwAttrSet::GetHoriOrient(bool bInP) const
104  { return Get( RES_HORI_ORIENT,bInP); }
105 
106 inline const SwFormatVertOrient &SwFormat::GetVertOrient(bool bInP) const
107  { return m_aSet.GetVertOrient(bInP); }
108 inline const SwFormatHoriOrient &SwFormat::GetHoriOrient(bool bInP) const
109  { return m_aSet.GetHoriOrient(bInP); }
110 
111 #endif
112 
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetPosToggle(bool bNew)
Definition: fmtornt.hxx:96
virtual bool operator==(const SfxPoolItem &) const =0
sal_Int16 m_eRelation
Definition: fmtornt.hxx:69
#define RES_HORI_ORIENT
Definition: hintids.hxx:208
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:106
SwTwips GetPos() const
Definition: fmtornt.hxx:92
sal_Int16 m_eRelation
Definition: fmtornt.hxx:37
long SwTwips
Definition: swtypes.hxx:49
SwAttrSet m_aSet
Definition: format.hxx:48
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:55
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:89
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
sal_Int16 m_eOrient
Definition: fmtornt.hxx:36
sal_Int16 m_eOrient
Definition: fmtornt.hxx:68
struct _xmlTextWriter * xmlTextWriterPtr
SfxItemPresentation
SwTwips m_nYPos
Contains always the current RelPos.
Definition: fmtornt.hxx:35
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:56
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:108
#define RES_VERT_ORIENT
Definition: hintids.hxx:207
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:60
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:103
SwTwips m_nXPos
Contains always the current RelPos.
Definition: fmtornt.hxx:67
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:90
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:87
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:101
bool IsPosToggle() const
Definition: fmtornt.hxx:95
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:88
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
unsigned char sal_uInt8
SwTwips GetPos() const
Definition: fmtornt.hxx:59
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:54
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:57
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:93
MapUnit
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const