LibreOffice Module sw (master) 1
itratr.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 <o3tl/deleter.hxx>
22#include "atrhndl.hxx"
23#include <swfont.hxx>
24
25namespace sw { struct MergedPara; }
26class SwTextAttr;
27class SwTextNode;
28class SwRedlineItr;
29class SwViewShell;
30class SwTextFrame;
31
33{
34 friend class SwFontSave;
35protected:
36
41
42private:
45 short m_nChgCnt;
46 std::unique_ptr<SwRedlineItr, o3tl::default_delete<SwRedlineItr>> m_pRedline;
52 sal_Int32 m_nPosition;
59
60 void SeekFwd(sal_Int32 nOldPos, sal_Int32 nNewPos);
61 void SetFnt( SwFont* pNew ) { m_pFont = pNew; }
63 SwTextNode const& rPropsNode, SwTextNode const& rTextNode,
64 std::u16string_view aText, bool const* pbVertLayout,
65 bool const* pbVertLayoutLRBT);
66
67protected:
68 void Chg( SwTextAttr const *pHt );
69 void Rst( SwTextAttr const *pHt );
70 void CtorInitAttrIter(SwTextNode& rTextNode, SwScriptInfo& rScrInf, SwTextFrame const* pFrame = nullptr);
71 explicit SwAttrIter(SwTextNode const * pTextNode);
72
73public:
77 SwAttrIter(SwTextNode& rTextNode, SwScriptInfo& rScrInf, SwTextFrame const*const pFrame = nullptr);
78
79 virtual ~SwAttrIter();
80
81 SwRedlineItr *GetRedln() { return m_pRedline.get(); }
82 // The parameter returns the position of the next change before or at the
83 // char position.
86 bool Seek(TextFrameIndex nPos);
87 // Creates the font at the specified position via Seek() and checks
88 // if it's a symbol font.
89 bool IsSymbol(TextFrameIndex nPos);
90
95 bool SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFont );
96
97 // Do we possibly have nasty things like footnotes?
98 bool MaybeHasHints() const;
99
100 // Returns the attribute for a position
101 SwTextAttr *GetAttr(TextFrameIndex nPos) const;
102
103 SwFont *GetFnt() { return m_pFont; }
104 const SwFont *GetFnt() const { return m_pFont; }
105
107 void SetPropFont( const sal_uInt8 nNew ) { m_nPropFont = nNew; }
108
110};
111
112/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Used by Attribute Iterators to organize attributes on stacks to find the valid attribute in each cate...
Definition: atrhndl.hxx:38
size_t m_nStartIndex
current iteration index in HintStarts
Definition: itratr.hxx:48
sal_Int32 m_nPosition
current iteration index in text node
Definition: itratr.hxx:52
void Rst(SwTextAttr const *pHt)
Definition: itratr.cxx:110
size_t m_nEndIndex
current iteration index in HintEnds
Definition: itratr.hxx:50
SwAttrHandler & GetAttrHandler()
Definition: itratr.hxx:109
void SetFnt(SwFont *pNew)
Definition: itratr.hxx:61
bool SeekAndChgAttrIter(TextFrameIndex nPos, OutputDevice *pOut)
Executes ChgPhysFnt if Seek() returns true and change font to merge character border with neighbours.
Definition: itratr.cxx:155
SwRedlineItr * GetRedln()
Definition: itratr.hxx:81
SwFont * GetFnt()
Definition: itratr.hxx:103
virtual ~SwAttrIter()
Definition: itratr.cxx:121
o3tl::enumarray< SwFontScript, sal_uInt16 > m_aFontIdx
Definition: itratr.hxx:55
void SeekFwd(sal_Int32 nOldPos, sal_Int32 nNewPos)
Definition: itratr.cxx:263
o3tl::enumarray< SwFontScript, const void * > m_aFontCacheIds
Definition: itratr.hxx:54
bool MaybeHasHints() const
Definition: itratr.cxx:127
void SetPropFont(const sal_uInt8 nNew)
Definition: itratr.hxx:107
bool IsSymbol(TextFrameIndex nPos)
Definition: itratr.cxx:181
sal_uInt8 m_nPropFont
Definition: itratr.hxx:53
bool SeekStartAndChgAttrIter(OutputDevice *pOut, const bool bParaFont)
Definition: itratr.cxx:197
short m_nChgCnt
count currently open hints, redlines, ext-input
Definition: itratr.hxx:45
void Chg(SwTextAttr const *pHt)
Definition: itratr.cxx:100
std::unique_ptr< SwRedlineItr, o3tl::default_delete< SwRedlineItr > > m_pRedline
Definition: itratr.hxx:46
void CtorInitAttrIter(SwTextNode &rTextNode, SwScriptInfo &rScrInf, SwTextFrame const *pFrame=nullptr)
Definition: redlnitr.cxx:582
SwAttrHandler m_aAttrHandler
Definition: itratr.hxx:37
sw::MergedPara const * m_pMergedPara
Definition: itratr.hxx:58
sal_uInt8 GetPropFont() const
Definition: itratr.hxx:106
SwScriptInfo * m_pScriptInfo
Definition: itratr.hxx:40
SwAttrIter(SwTextNode const *pTextNode)
Definition: itratr.cxx:71
TextFrameIndex GetNextAttr() const
Definition: itratr.cxx:734
SwViewShell * m_pViewShell
Definition: itratr.hxx:38
bool Seek(TextFrameIndex nPos)
Enables the attributes used at char pos nPos in the logical font.
Definition: itratr.cxx:306
SwTextAttr * GetAttr(TextFrameIndex nPos) const
Returns the attribute for a position.
Definition: itratr.cxx:147
const SwFont * GetFnt() const
Definition: itratr.hxx:104
VclPtr< OutputDevice > m_pLastOut
Definition: itratr.hxx:43
void InitFontAndAttrHandler(SwTextNode const &rPropsNode, SwTextNode const &rTextNode, std::u16string_view aText, bool const *pbVertLayout, bool const *pbVertLayoutLRBT)
Definition: redlnitr.cxx:506
const SwTextNode * m_pTextNode
input: the current text node
Definition: itratr.hxx:57
SwFont * m_pFont
Definition: itratr.hxx:39
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
Definition: swfont.hxx:135
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:168
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
Dialog to specify the properties of date form field.
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
Definition: txtfrm.hxx:991
unsigned char sal_uInt8