/* -*- 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 .
*/
class SwTableBox; class SwTable; class SwHTMLTableLayout; class SwDoc; class SwFrameFormat;
#define HTMLTABLE_RESIZE_NOW (ULONG_MAX)
class SwHTMLTableLayoutCnts
{
std::shared_ptr<SwHTMLTableLayoutCnts> m_xNext; ///< The next content.
/// Only one of the following two pointers may be set!
SwTableBox *m_pBox; ///< A Box.
std::shared_ptr<SwHTMLTableLayout> m_xTable; ///< A "table within a table".
/** During first run there are still no boxes. In this case
pStartNode is used instead of pBox. */ const SwStartNode *m_pStartNode;
/** The following counters indicate how often a pass has been done for this content. Therefore they are compared against a reference value. If 255 is reached the continue with 0.
This avoids reinitialization on every resize. */
sal_uInt8 m_nPass1Done; ///< How many times has Pass 1 been called?
sal_uInt8 m_nWidthSet; ///< How many times has the width been set?
bool m_bNoBreakTag; ///< <NOBR>-Tag over complete content.
class SwHTMLTableLayoutCell
{
std::shared_ptr<SwHTMLTableLayoutCnts> m_xContents; ///< Content of cell.
sal_uInt16 m_nRowSpan; ///< ROWSPAN of cell.
sal_uInt16 m_nColSpan; ///< COLSPAN of cell.
sal_uInt16 m_nWidthOption; ///< Given width of cell in Twip or %.
/// Set or get content of a cell. void SetContents(std::shared_ptr<SwHTMLTableLayoutCnts> const& rCnts) { m_xContents = rCnts; } const std::shared_ptr<SwHTMLTableLayoutCnts>& GetContents() const { return m_xContents; }
inlinevoid SetProtected();
/// Set or get ROWSPAN/COLSPAN of cell. void SetRowSpan( sal_uInt16 nRSpan ) { m_nRowSpan = nRSpan; }
sal_uInt16 GetRowSpan() const { return m_nRowSpan; }
sal_uInt16 GetColSpan() const { return m_nColSpan; }
sal_uInt16 m_nLeftMargin; ///< Space to left margin (from paragraph).
sal_uInt16 m_nRightMargin; ///< Space to left margin (from paragraph).
sal_uInt16 m_nInhAbsLeftSpace; ///< Space inherited from surrounding box
sal_uInt16 m_nInhAbsRightSpace; ///< that was added to boxes.
sal_uInt16 m_nRelLeftFill; ///< Width of boxes relative to alignment
sal_uInt16 m_nRelRightFill; ///< of tables in tables.
sal_uInt16 m_nRelTabWidth; ///< Relative width of table.
sal_uInt16 m_nWidthOption; ///< Width of table (in Twips or %).
sal_uInt16 m_nCellPadding; ///< Space to contents (in Twips).
sal_uInt16 m_nCellSpacing; ///< Cell spacing (in Twips).
sal_uInt16 m_nBorder; /** Line strength of outer border, or rather the
space needed for it as calculated by Netscape. */
sal_uInt16 m_nDelayedResizeAbsAvail; ///< Param for delayed Resize.
sal_uInt16 m_nLastResizeAbsAvail;
sal_uInt8 m_nPass1Done; ///< Reference-values for
sal_uInt8 m_nWidthSet; ///< the runs through loop.
SvxAdjust m_eTableAdjust; ///< Alignment of table.
bool m_bColsOption : 1; ///< Table has a COLS-option. bool m_bColTags : 1; ///< Table has COL/COLGRP tags. bool m_bPercentWidthOption : 1; ///< Width is given in percent. bool m_bUseRelWidth : 1; ///< SwTable gets relative width.
bool m_bMustResize : 1; ///< Table width must be defined. bool m_bExportable : 1; ///< Layout may be used for export. bool m_bBordersChanged : 1; ///< Borders have been changed. bool m_bMayBeInFlyFrame : 1; ///< Table could be within frame.
bool m_bDelayedResizeRecalc : 1; ///< Param for delayed Resize. bool m_bMustNotResize : 1; ///< Table may not be resized. bool m_bMustNotRecalc : 1; ///< Table may not be adapted to its contents.
/** Recalculation of table widths for available width that has been passed. - If bRecalc is set, contents of boxes are included into calculation. - If bForce is set, table will be recalculated even if this was disallowed by SetMustNotResize. - If nDelay > 0 the calculation is delayed accordingly. Resizing calls occurring during delay-time are ignored, but the delay may be counted under certain circumstances. - If nDelay == HTMLTABLE_RESIZE_NOW, resize immediately and do not consider any resize-calls that might possibly be in order.
- The return value indicates whether the table has been changed. */ bool Resize( sal_uInt16 nAbsAvail, bool bRecalc=false, bool bForce=false,
sal_uLong nDelay=0 );
void BordersChanged( sal_uInt16 nAbsAvail );
/** Calculate available width. This works only if a layout or a SwViewShell exists. Otherwise returns 0.
This is needed by HTML-filter because it doesn't have access to the layout.) */ static sal_uInt16 GetBrowseWidth( const SwDoc& rDoc );
/// Calculates available width by table-frame.
sal_uInt16 GetBrowseWidthByTabFrame( const SwTabFrame& rTabFrame ) const;
/** Calculates available width by the table-frame or
static GetBrowseWidth if no layout exists. */
sal_uInt16 GetBrowseWidthByTable( const SwDoc& rDoc ) const;
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.