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 <tools/solar.h>
24#include "hintids.hxx"
25#include "swdllapi.h"
26#include "swatrset.hxx"
27
28class IntlWrapper;
29
33{
35 bool m_bCountLines :1;
36
37public:
39 virtual ~SwFormatLineNumber() override;
40
43 SwFormatLineNumber & operator =(SwFormatLineNumber const &) = delete; // due to SfxPoolItem
44 SwFormatLineNumber & operator =(SwFormatLineNumber &&) = delete; // due to SfxPoolItem
45
46 static SfxPoolItem* CreateDefault();
47
49 virtual bool operator==( const SfxPoolItem& ) const override;
50 virtual SwFormatLineNumber* Clone( SfxItemPool* pPool = nullptr ) const override;
51 virtual bool GetPresentation( SfxItemPresentation ePres,
52 MapUnit eCoreMetric,
53 MapUnit ePresMetric,
54 OUString &rText,
55 const IntlWrapper& rIntl ) const override;
56 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
57 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
58
59 sal_uLong GetStartValue() const { return m_nStartValue; }
60 bool IsCount() const { return m_bCountLines; }
61
62 void SetStartValue( sal_uLong nNew ) { m_nStartValue = nNew; }
63 void SetCountLines( bool b ) { m_bCountLines = b; }
64};
65
66inline const SwFormatLineNumber &SwAttrSet::GetLineNumber(bool bInP) const
67 { return Get( RES_LINENUMBER,bInP); }
68
69#endif
70
71/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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 bool operator==(const SfxPoolItem &) const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
SfxPoolItem & operator=(const SfxPoolItem &)=delete
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
const SwFormatLineNumber & GetLineNumber(bool=true) const
Definition: fmtline.hxx:66
Contains the line numbering properties of this paragraph.
Definition: fmtline.hxx:33
bool IsCount() const
Definition: fmtline.hxx:60
sal_uLong m_nStartValue
Starting value for the paragraph. 0 == no starting value.
Definition: fmtline.hxx:34
bool m_bCountLines
Also count lines of paragraph.
Definition: fmtline.hxx:35
sal_uLong GetStartValue() const
Definition: fmtline.hxx:59
SwFormatLineNumber(SwFormatLineNumber &&)=default
void SetCountLines(bool b)
Definition: fmtline.hxx:63
SwFormatLineNumber(SwFormatLineNumber const &)=default
void SetStartValue(sal_uLong nNew)
Definition: fmtline.hxx:62
constexpr TypedWhichId< SwFormatLineNumber > RES_LINENUMBER(122)
MapUnit
SfxItemPresentation
sal_uIntPtr sal_uLong
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
unsigned char sal_uInt8