LibreOffice Module sw (master) 1
portab.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#pragma once
20
21#include "porglue.hxx"
22
24{
25 const sal_uInt16 m_nTabPos;
27 const bool m_bAutoTabStop;
28
29 // Format() branches either into PreFormat() or PostFormat()
30 bool PreFormat( SwTextFormatInfo &rInf );
31public:
32 SwTabPortion( const sal_uInt16 nTabPos, const sal_Unicode cFill, const bool bAutoTab = true );
33 virtual void Paint( const SwTextPaintInfo &rInf ) const override;
34 virtual bool Format( SwTextFormatInfo &rInf ) override;
35 virtual void FormatEOL( SwTextFormatInfo &rInf ) override;
36 bool PostFormat( SwTextFormatInfo &rInf );
37 bool IsFilled() const { return 0 != m_cFill; }
38 sal_uInt16 GetTabPos() const { return m_nTabPos; }
39
40 // Accessibility: pass information about this portion to the PortionHandler
41 virtual void HandlePortion( SwPortionHandler& rPH ) const override;
42};
43
45{
46public:
47 SwTabLeftPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar, bool bAutoTab )
48 : SwTabPortion( nTabPosVal, cFillChar, bAutoTab )
50};
51
53{
54public:
55 SwTabRightPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar )
56 : SwTabPortion( nTabPosVal, cFillChar )
58};
59
61{
62public:
63 SwTabCenterPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar )
64 : SwTabPortion( nTabPosVal, cFillChar )
66};
67
69{
71
72 /*
73 * During text formatting, we already store the width of the portions
74 * following the tab stop up to the decimal position. This value is
75 * evaluated during pLastTab->FormatEOL. FME 2006-01-06 #127428#.
76 */
78
79public:
80 SwTabDecimalPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cTab,
81 const sal_Unicode cFillChar )
82 : SwTabPortion( nTabPosVal, cFillChar ),
83 mcTab(cTab),
86
87 sal_Unicode GetTabDecimal() const { return mcTab; }
88
90 {
92 }
94 {
96 }
97};
98
100{
101public:
102 SwAutoTabDecimalPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cTab,
103 const sal_Unicode cFillChar )
104 : SwTabDecimalPortion( nTabPosVal, cTab, cFillChar )
105 {
107 }
108 virtual void Paint( const SwTextPaintInfo &rInf ) const override;
109};
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
SwAutoTabDecimalPortion(const sal_uInt16 nTabPosVal, const sal_Unicode cTab, const sal_Unicode cFillChar)
Definition: portab.hxx:102
virtual void Paint(const SwTextPaintInfo &rInf) const override
Ex: LineIter::DrawTab()
Definition: txttab.cxx:652
void SetLen(TextFrameIndex const nLen)
Definition: porlin.hxx:78
void SetWhichPor(const PortionType nNew)
Definition: porlin.hxx:101
The SwPortionHandler interface implements a visitor for the layout engine's text portions.
SwTabCenterPortion(const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar)
Definition: portab.hxx:63
sal_Unicode GetTabDecimal() const
Definition: portab.hxx:87
sal_uInt16 GetWidthOfPortionsUpToDecimalPosition() const
Definition: portab.hxx:93
void SetWidthOfPortionsUpToDecimalPosition(sal_uInt16 nNew)
Definition: portab.hxx:89
sal_uInt16 mnWidthOfPortionsUpTpDecimalPosition
Definition: portab.hxx:77
const sal_Unicode mcTab
Definition: portab.hxx:70
SwTabDecimalPortion(const sal_uInt16 nTabPosVal, const sal_Unicode cTab, const sal_Unicode cFillChar)
Definition: portab.hxx:80
SwTabLeftPortion(const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar, bool bAutoTab)
Definition: portab.hxx:47
bool PreFormat(SwTextFormatInfo &rInf)
Definition: txttab.cxx:354
const sal_Unicode m_cFill
Definition: portab.hxx:26
virtual bool Format(SwTextFormatInfo &rInf) override
Definition: txttab.cxx:338
const sal_uInt16 m_nTabPos
Definition: portab.hxx:25
virtual void Paint(const SwTextPaintInfo &rInf) const override
Ex: LineIter::DrawTab()
Definition: txttab.cxx:573
bool PostFormat(SwTextFormatInfo &rInf)
Definition: txttab.cxx:487
virtual void FormatEOL(SwTextFormatInfo &rInf) override
Definition: txttab.cxx:348
sal_uInt16 GetTabPos() const
Definition: portab.hxx:38
SwTabPortion(const sal_uInt16 nTabPos, const sal_Unicode cFill, const bool bAutoTab=true)
The base class is initialized without setting anything.
Definition: txttab.cxx:330
const bool m_bAutoTabStop
Definition: portab.hxx:27
bool IsFilled() const
Definition: portab.hxx:37
virtual void HandlePortion(SwPortionHandler &rPH) const override
Definition: txttab.cxx:656
SwTabRightPortion(const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar)
Definition: portab.hxx:55
sal_uInt16 sal_Unicode