LibreOffice Module sw (master)  1
fmtline.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_FMTLINE_HXX
20 #define INCLUDED_SW_INC_FMTLINE_HXX
21 
22 #include <svl/poolitem.hxx>
23 #include "hintids.hxx"
24 #include "swdllapi.h"
25 #include "swatrset.hxx"
26 
27 class IntlWrapper;
28 
30 {
31  sal_uLong nStartValue :24;
32  bool bCountLines :1;
33 
34 public:
36  virtual ~SwFormatLineNumber() override;
37 
38  SwFormatLineNumber(SwFormatLineNumber const &) = default;
40  SwFormatLineNumber & operator =(SwFormatLineNumber const &) = delete; // due to SfxPoolItem
41  SwFormatLineNumber & operator =(SwFormatLineNumber &&) = delete; // due to SfxPoolItem
42 
43  static SfxPoolItem* CreateDefault();
44 
46  virtual bool operator==( const SfxPoolItem& ) const override;
47  virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
48  virtual bool GetPresentation( SfxItemPresentation ePres,
49  MapUnit eCoreMetric,
50  MapUnit ePresMetric,
51  OUString &rText,
52  const IntlWrapper& rIntl ) const override;
53  virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
54  virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
55 
56  sal_uLong GetStartValue() const { return nStartValue; }
57  bool IsCount() const { return bCountLines; }
58 
59  void SetStartValue( sal_uLong nNew ) { nStartValue = nNew; }
60  void SetCountLines( bool b ) { bCountLines = b; }
61 };
62 
63 inline const SwFormatLineNumber &SwAttrSet::GetLineNumber(bool bInP) const
64  { return Get( RES_LINENUMBER,bInP); }
65 
66 #endif
67 
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool operator==(const SfxPoolItem &) const =0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
sal_uIntPtr sal_uLong
SfxPoolItem & operator=(const SfxPoolItem &)=delete
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
sal_uLong GetStartValue() const
Definition: fmtline.hxx:56
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
SfxItemPresentation
#define RES_LINENUMBER
Definition: hintids.hxx:221
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
void SetCountLines(bool b)
Definition: fmtline.hxx:60
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
unsigned char sal_uInt8
MapUnit
void SetStartValue(sal_uLong nNew)
Definition: fmtline.hxx:59
bool IsCount() const
Definition: fmtline.hxx:57
const SwFormatLineNumber & GetLineNumber(bool=true) const
Definition: fmtline.hxx:63