fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / editeng / adjustitem.hxx
blobe19907cd173738b2ce736853b853e824a7fb5835
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _SVX_ADJITEM_HXX
20 #define _SVX_ADJITEM_HXX
22 #include <svl/eitem.hxx>
23 #include <editeng/svxenum.hxx>
24 #include <editeng/eeitem.hxx>
25 #include <editeng/editengdllapi.h>
27 class SvXMLUnitConverter;
29 // class SvxAdjustItem ---------------------------------------------------
32 [Description]
33 This item describes the row orientation.
35 #define ADJUST_LASTBLOCK_VERSION ((sal_uInt16)0x0001)
37 class EDITENG_DLLPUBLIC SvxAdjustItem : public SfxEnumItemInterface
39 sal_Bool bLeft : 1;
40 sal_Bool bRight : 1;
41 sal_Bool bCenter : 1;
42 sal_Bool bBlock : 1;
44 // only activ when bBlock
45 sal_Bool bOneBlock : 1;
46 sal_Bool bLastCenter : 1;
47 sal_Bool bLastBlock : 1;
49 friend SvStream& operator<<( SvStream&, SvxAdjustItem& ); //$ ostream
50 public:
51 TYPEINFO();
53 SvxAdjustItem( const SvxAdjust eAdjst /*= SVX_ADJUST_LEFT*/,
54 const sal_uInt16 nId );
56 // "pure virtual Methods" from SfxPoolItem
57 virtual int operator==( const SfxPoolItem& ) const;
59 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
60 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
62 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
63 SfxMapUnit eCoreMetric,
64 SfxMapUnit ePresMetric,
65 OUString &rText, const IntlWrapper * = 0 ) const;
66 virtual sal_uInt16 GetValueCount() const;
67 virtual OUString GetValueTextByPos( sal_uInt16 nPos ) const;
68 virtual sal_uInt16 GetEnumValue() const;
69 virtual void SetEnumValue( sal_uInt16 nNewVal );
70 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
71 virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
72 virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
73 virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
75 inline void SetOneWord( const SvxAdjust eType )
77 bOneBlock = eType == SVX_ADJUST_BLOCK;
80 inline void SetLastBlock( const SvxAdjust eType )
82 bLastBlock = eType == SVX_ADJUST_BLOCK;
83 bLastCenter = eType == SVX_ADJUST_CENTER;
86 inline void SetAdjust( const SvxAdjust eType )
88 bLeft = eType == SVX_ADJUST_LEFT;
89 bRight = eType == SVX_ADJUST_RIGHT;
90 bCenter = eType == SVX_ADJUST_CENTER;
91 bBlock = eType == SVX_ADJUST_BLOCK;
94 inline SvxAdjust GetLastBlock() const
96 SvxAdjust eRet = SVX_ADJUST_LEFT;
98 if ( bLastBlock )
99 eRet = SVX_ADJUST_BLOCK;
100 else if( bLastCenter )
101 eRet = SVX_ADJUST_CENTER;
102 return eRet;
105 inline SvxAdjust GetOneWord() const
107 SvxAdjust eRet = SVX_ADJUST_LEFT;
109 if ( bBlock && bOneBlock )
110 eRet = SVX_ADJUST_BLOCK;
111 return eRet;
114 inline SvxAdjust GetAdjust() const
116 SvxAdjust eRet = SVX_ADJUST_LEFT;
118 if ( bRight )
119 eRet = SVX_ADJUST_RIGHT;
120 else if ( bCenter )
121 eRet = SVX_ADJUST_CENTER;
122 else if ( bBlock )
123 eRet = SVX_ADJUST_BLOCK;
124 return eRet;
128 #endif
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */