Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _FMTORNT_HXX
29 : : #define _FMTORNT_HXX
30 : :
31 : : #include <com/sun/star/text/HoriOrientation.hpp>
32 : : #include <com/sun/star/text/VertOrientation.hpp>
33 : : #include <com/sun/star/text/RelOrientation.hpp>
34 : : #include "swdllapi.h"
35 : : #include <hintids.hxx>
36 : : #include <swtypes.hxx>
37 : : #include <format.hxx>
38 : : #include <svl/poolitem.hxx>
39 : :
40 : :
41 : : class IntlWrapper;
42 : :
43 [ - + ]: 215094 : class SW_DLLPUBLIC SwFmtVertOrient: public SfxPoolItem
44 : : {
45 : : SwTwips nYPos; // Contains *always* the current RelPos.
46 : : sal_Int16 eOrient;
47 : : sal_Int16 eRelation;
48 : : public:
49 : : TYPEINFO();
50 : : SwFmtVertOrient( SwTwips nY = 0, sal_Int16 eVert = com::sun::star::text::VertOrientation::NONE,
51 : : sal_Int16 eRel = com::sun::star::text::RelOrientation::PRINT_AREA );
52 : : inline SwFmtVertOrient &operator=( const SwFmtVertOrient &rCpy );
53 : :
54 : : // "Pure virtual methods" of SfxPoolItem.
55 : : virtual int operator==( const SfxPoolItem& ) const;
56 : : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
57 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
58 : : SfxMapUnit eCoreMetric,
59 : : SfxMapUnit ePresMetric,
60 : : String &rText,
61 : : const IntlWrapper* pIntl = 0 ) const;
62 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
63 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
64 : :
65 : : SvStream& Store(SvStream &rStream, sal_uInt16 itemVersion) const;
66 : : SfxPoolItem* Create(SvStream &rStream, sal_uInt16 itemVersion) const;
67 : :
68 : 15170 : sal_Int16 GetVertOrient() const { return eOrient; }
69 : 1496 : sal_Int16 GetRelationOrient() const { return eRelation; }
70 : 60468 : void SetVertOrient( sal_Int16 eNew ) { eOrient = eNew; }
71 : 0 : void SetRelationOrient( sal_Int16 eNew ) { eRelation = eNew; }
72 : :
73 : 7946 : SwTwips GetPos() const { return nYPos; }
74 : 1409 : void SetPos( SwTwips nNew ) { nYPos = nNew; }
75 : : };
76 : :
77 : :
78 [ - + ]: 6769 : class SW_DLLPUBLIC SwFmtHoriOrient: public SfxPoolItem
79 : : {
80 : : SwTwips nXPos; // Contains *always* the current RelPos.
81 : : sal_Int16 eOrient;
82 : : sal_Int16 eRelation;
83 : : sal_Bool bPosToggle : 1; // Flip position on even pages.
84 : : public:
85 : : TYPEINFO();
86 : : SwFmtHoriOrient( SwTwips nX = 0, sal_Int16 eHori = com::sun::star::text::HoriOrientation::NONE,
87 : : sal_Int16 eRel = com::sun::star::text::RelOrientation::PRINT_AREA, sal_Bool bPos = sal_False );
88 : : inline SwFmtHoriOrient &operator=( const SwFmtHoriOrient &rCpy );
89 : :
90 : : // "Pure virtual methods" of SfxPoolItem.
91 : : virtual int operator==( const SfxPoolItem& ) const;
92 : : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
93 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
94 : : SfxMapUnit eCoreMetric,
95 : : SfxMapUnit ePresMetric,
96 : : String &rText,
97 : : const IntlWrapper* pIntl = 0 ) const;
98 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
99 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
100 : :
101 : 2981 : sal_Int16 GetHoriOrient() const { return eOrient; }
102 : 984 : sal_Int16 GetRelationOrient() const { return eRelation; }
103 : 3 : void SetHoriOrient( sal_Int16 eNew ) { eOrient = eNew; }
104 : 0 : void SetRelationOrient( sal_Int16 eNew ) { eRelation = eNew; }
105 : :
106 : 1835 : SwTwips GetPos() const { return nXPos; }
107 : 838 : void SetPos( SwTwips nNew ) { nXPos = nNew; }
108 : :
109 : 547 : sal_Bool IsPosToggle() const { return bPosToggle; }
110 : 63 : void SetPosToggle( sal_Bool bNew ) { bPosToggle = bNew; }
111 : : };
112 : :
113 : 0 : inline SwFmtVertOrient &SwFmtVertOrient::operator=( const SwFmtVertOrient &rCpy )
114 : : {
115 : 0 : nYPos = rCpy.GetPos();
116 : 0 : eOrient = rCpy.GetVertOrient();
117 : 0 : eRelation = rCpy.GetRelationOrient();
118 : 0 : return *this;
119 : : }
120 : 0 : inline SwFmtHoriOrient &SwFmtHoriOrient::operator=( const SwFmtHoriOrient &rCpy )
121 : : {
122 : 0 : nXPos = rCpy.GetPos();
123 : 0 : eOrient = rCpy.GetHoriOrient();
124 : 0 : eRelation = rCpy.GetRelationOrient();
125 : 0 : bPosToggle = rCpy.IsPosToggle();
126 : 0 : return *this;
127 : : }
128 : :
129 : 14198 : inline const SwFmtVertOrient &SwAttrSet::GetVertOrient(sal_Bool bInP) const
130 : 14198 : { return (const SwFmtVertOrient&)Get( RES_VERT_ORIENT,bInP); }
131 : 1876 : inline const SwFmtHoriOrient &SwAttrSet::GetHoriOrient(sal_Bool bInP) const
132 : 1876 : { return (const SwFmtHoriOrient&)Get( RES_HORI_ORIENT,bInP); }
133 : :
134 : 10356 : inline const SwFmtVertOrient &SwFmt::GetVertOrient(sal_Bool bInP) const
135 : 10356 : { return aSet.GetVertOrient(bInP); }
136 : 1876 : inline const SwFmtHoriOrient &SwFmt::GetHoriOrient(sal_Bool bInP) const
137 : 1876 : { return aSet.GetHoriOrient(bInP); }
138 : :
139 : : #endif
140 : :
141 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|