/* -*- 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 .
*/ #ifndef INCLUDED_SW_INC_FRMFMT_HXX #define INCLUDED_SW_INC_FRMFMT_HXX
class Graphic; class IMapObject; class ImageMap; class SdrObject; class SwAnchoredObject; class SwDrawFrameFormat; class SwFlyDrawContact; class SwFlyFrame; class SwFlyFrameFormat; class SwRect; class SwRootFrame; class SwTableBox;
namespace sw
{ class DocumentLayoutManager; // This is cheating: we are not really decoupling much with this hint. // SwDrawFrameFormat should probably bookkeep its SdrObject (and // SwDrawFrameFormat too) as members struct SW_DLLPUBLIC FindSdrObjectHint final : SfxHint
{
SdrObject*& m_rpObject;
FindSdrObjectHint(SdrObject*& rpObject)
: SfxHint(SfxHintId::SwFindSdrObject), m_rpObject(rpObject) {}; virtual ~FindSdrObjectHint() override;
};
} class SwFormatsBase; class SwTableFormat;
/// Style of a layout element. class SW_DLLPUBLIC SwFrameFormat
: public SwFormat
{ friendclass SwDoc; friendclass SwPageDesc; ///< Is allowed to call protected CTor. friendclass ::sw::DocumentLayoutManager; ///< Is allowed to call protected CTor. friendclass sw::FrameFormats<SwTableFormat*>; ///< Is allowed to update the list backref. friendclass sw::FrameFormats<sw::SpzFrameFormat*>; ///< Is allowed to update the list backref. friendclass sw::FrameFormats<SwFrameFormat*>; ///< Is allowed to update the list backref. friendclass SwTextBoxHelper; friendclass SwUndoFlyBase; ///< calls SetOtherTextBoxFormat
/** @return the IMapObject defined at format (Fly) in the ImageMap at position Point. rPoint - test on DocPosition.
pFly - optional FlyFrame, in case it is already known. */
IMapObject* GetIMapObject( const Point& rPoint, const SwFlyFrame *pFly = nullptr ) const;
/** @return the real size of the frame - or an empty rectangle if no layout exists.
If pPoint is given, look for the frame closest to it. */
SwRect FindLayoutRect( constbool bPrtArea = false, const Point* pPoint = nullptr ) const;
/** @return the SdrObject, that is connected to the ContactObject. Only DrawFrameFormats are connected to the "real SdrObject". FlyFrameFormats are connected to a Master and all FlyFrames has the "real SdrObject".
"Real SdrObject" has position and a Z-order. */
SdrObject* FindSdrObject()
{
SdrObject* pObject(nullptr);
CallSwClientNotify(sw::FindSdrObjectHint(pObject)); return pObject;
} const SdrObject *FindSdrObject() const
{ returnconst_cast<SwFrameFormat*>(this)->FindSdrObject(); }
// Access to DrawingLayer FillAttributes in a preprocessed form for primitive usage virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const override; virtualbool supportsFullDrawingLayerFillAttributeSet() const override;
class SW_DLLPUBLIC SwFlyFrameFormat final : public sw::SpzFrameFormat
{ friendclass SwDoc;
OUString msTitle;
OUString msDesc; /// A tooltip has priority over an SwFormatURL and is not persisted to files.
OUString msTooltip;
/** Both not existent. it stores the previous position of Prt rectangle from RequestObjectResize so it can be used to move frames of non-resizable objects to align them correctly
when they get borders (this is done in SwWrtShell::CalcAndGetScale) */
Point m_aLastFlyFramePrtRectPos;
std::unique_ptr<SwFlyDrawContact> m_pContact;
Override virtual method and its default implementation, because format of fly frame provides transparent backgrounds. Method determines, if background of fly frame is transparent.
@return true, if background color is transparent, but not "no fill" or an existing background graphic is transparent.
*/ virtualbool IsBackgroundTransparent() const override;
/** SwFlyFrameFormat::IsBackgroundBrushInherited
Method to determine, if the brush for drawing the background is "inherited" from its parent/grandparent. This is the case, if no background graphic is set and the background color is "no fill"/"auto fill"
@return true, if background brush is "inherited" from parent/grandparent
*/ bool IsBackgroundBrushInherited() const;
const Point & GetLastFlyFramePrtRectPos() const { return m_aLastFlyFramePrtRectPos; } void SetLastFlyFramePrtRectPos( const Point &rPoint ) { m_aLastFlyFramePrtRectPos = rPoint; }
SwFlyDrawContact* GetOrCreateContact();
};
//The DrawFrame-Format
class SwDrawFrameFormat; class SwDrawContact; class SdrTextObj;
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.