/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ #pragma once
class IDocumentSettingAccess; class SwTextFormatInfo; class SwTextCursor; class SwTextPaintInfo; class SwTextAttr; class SfxPoolItem; class SwFont;
// SwMultiCreator is a small structure to create a multiportion. // It contains the kind of multiportion and a textattribute // or a poolitem. // The GetMultiCreator-function fills this structure and // the Ctor of the SwMultiPortion uses it. enumclass SwMultiCreatorId
{ Double, Ruby, Rotate, Bidi
};
// A two-line-portion (SwMultiPortion) could have surrounding brackets, // in this case the structure SwBracket will be used. struct SwBracket
{
TextFrameIndex nStart; // Start of text attribute determines the font
sal_uInt16 nAscent; // Ascent of the brackets
sal_uInt16 nHeight; // Height of them
sal_uInt16 nPreWidth; // Width of the opening bracket
sal_uInt16 nPostWidth; // Width of the closing bracket
sal_Unicode cPre; // Initial character, e.g. '('
sal_Unicode cPost; // Final character, e.g. ')'
SwFontScript nPreScript; // Script of the initial character
SwFontScript nPostScript; // Script of the final character
};
// The SwMultiPortion is line portion inside a line portion, // it's a group of portions, // e.g. a double line portion in a line // or phonetics (ruby) // or combined characters // or a rotated portion. class SAL_DLLPUBLIC_RTTI SwMultiPortion : public SwLinePortion
{
SwLineLayout m_aRoot; // One or more lines bool m_bTab1 :1; // First line tabulator bool m_bTab2 :1; // Second line includes tabulator bool m_bDouble :1; // Double line bool m_bRuby :1; // Phonetics bool m_bBidi :1; bool m_bFormatted :1; // Already formatted bool m_bFollowField :1; // Field follow inside bool m_bFlyInContent:1; // Fly as character inside
RubyPosition m_eRubyPosition; // Phonetic position
sal_uInt8 m_nDirection:2; // Direction (0/90/180/270 degrees) protected: explicit SwMultiPortion(TextFrameIndex const nEnd)
: m_bTab1(false)
, m_bTab2(false)
, m_bDouble(false)
, m_bRuby(false)
, m_bBidi(false)
, m_bFormatted(false)
, m_bFollowField(false)
, m_bFlyInContent(false)
, m_eRubyPosition( RubyPosition::ABOVE )
, m_nDirection(0)
{
SetWhichPor(PortionType::Multi);
SetLen(nEnd);
} void SetDouble() { m_bDouble = true; } void SetRuby() { m_bRuby = true; } void SetBidi() { m_bBidi = true; } void SetRubyPosition( RubyPosition eNew ) { m_eRubyPosition = eNew; } void SetTab1( bool bNew ) { m_bTab1 = bNew; } void SetTab2( bool bNew ) { m_bTab2 = bNew; } void SetDirection( sal_uInt8 nNew ) { m_nDirection = nNew; } bool GetTab1() const { return m_bTab1; } bool GetTab2() const { return m_bTab2; } public: virtual ~SwMultiPortion() override; const SwLineLayout& GetRoot() const { return m_aRoot; }
SwLineLayout& GetRoot() { return m_aRoot; }
class SwDoubleLinePortion : public SwMultiPortion
{
std::unique_ptr<SwBracket> m_pBracket; // Surrounding brackets
SwTwips m_nLineDiff; // Difference of the width of the both lines
TextFrameIndex m_nBlank1; ///< Number of blanks in the first line
TextFrameIndex m_nBlank2; ///< Number of blanks in the second line public:
SwDoubleLinePortion(SwDoubleLinePortion& rDouble, TextFrameIndex nEnd);
SwDoubleLinePortion(const SwMultiCreator& rCreate, TextFrameIndex nEnd); virtual ~SwDoubleLinePortion() override;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.