/* -*- 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 SdrOutliner; class SdrPathObj; class SdrTextObjTest; class SvxFieldItem; class ImpSdrObjTextLink; class EditStatus; class TextChain;
enumclass EEAnchorMode; enumclass EETextFormat;
namespace sdr::properties { class TextProperties;
}
namespace drawinglayer::primitive2d { class SdrContourTextPrimitive2D; class SdrPathTextPrimitive2D; class SdrBlockTextPrimitive2D; class SdrAutoFitTextPrimitive2D; class SdrStretchTextPrimitive2D; class SdrChainedTextPrimitive2D;
}
namespace drawinglayer::animation { class AnimationEntryList;
}
namespace drawinglayer::geometry { class ViewInformation2D;
}
namespace sdr::table { class Cell; class SdrTableRtfExporter; class SdrTableRTFParser; class SdrTableHTMLParser;
}
// helper class SdrTextObjGeoData class SdrTextObjGeoData : public SdrObjGeoData
{ public:
tools::Rectangle maRect;
GeoStat maGeo;
};
// helper class ImpSdrObjTextLinkUserData class ImpSdrObjTextLinkUserData final : public SdrObjUserData
{ friendclass SdrTextObj; friendclass ImpSdrObjTextLink;
OUString maFileName; // name of the referenced document
OUString maFilterName; // a filter, if need be
DateTime maFileDate0; // avoiding unnecessary reload
tools::SvRef<ImpSdrObjTextLink> mpLink;
rtl_TextEncoding meCharSet;
private: // This method is only allowed for sdr::properties::TextProperties
SVX_DLLPRIVATE SdrOutliner* GetTextEditOutliner() const
{ return mpEditingOutliner;
}
// to allow sdr::properties::TextProperties access to SetPortionInfoChecked() // and GetTextEditOutliner() friendclass sdr::properties::TextProperties; friendclass sdr::properties::CellProperties;
friendclass ImpSdrObjTextLink; friendclass ImpSdrObjTextLinkUserData; friendclass SdrPowerPointImport; // for PowerPointImport friendclass SdrExchangeView; // for ImpGetDrawOutliner friendclass SdrView; // for ImpGetDrawOutliner friendclass SdrObjEditView; // for TextEdit friendclass SdrMeasureObj; // for ImpGetDrawOutliner friendclass SvxMSDffManager; // for ImpGetDrawOutliner friendclass SdrObjCustomShape; // for ImpGetDrawOutliner friendclass SdrText; // for ImpGetDrawOutliner
protected: // The "aRect" is also the rect of RectObj and CircObj. // When mbTextFrame=true the text will be formatted into this rect // When mbTextFrame=false the text will be centered around its middle
tools::Rectangle maRectangle;
// The GeoStat contains the rotation and shear angles
GeoStat maGeo;
// this is the active text
rtl::Reference<SdrText> mxText;
// This contains the dimensions of the text
Size maTextSize;
// an Outliner*, so that // 1. the TextObj won't be edited simultaneously by multiple views, and // 2. when streaming while editing Flush() can be done
SdrOutliner* mpEditingOutliner;
// Possible values for eTextKind are: // SdrObjKind::Text regular text frame // SdrObjKind::TitleText TitleText for presentations // SdrObjKind::OutlineText OutlineText for presentations // eTextKind only has meaning when mbTextFrame=true, since otherwise // we're dealing with a labeled graphical object
SdrObjKind meTextKind;
// For text editing in SW Header/Footer it is necessary to be // able to set an offset for the text edit to allow text editing at the // position of the virtual object. This offset is used when setting up // and maintaining the OutlinerView.
Point maTextEditOffset;
// the successor in a chain
SdrTextObj* mpNextInChain = nullptr;
SdrTextObj* mpPrevInChain = nullptr;
// For labeled graphical objects bTextFrame is FALSE. The block of text // will then be centered horizontally and vertically on aRect. // For mbTextFrame=true the text will be formatted into aRect. // The actual text frame is realized by an SdrRectObj with // mbTextFrame=true. bool mbTextFrame : 1; bool mbNoShear : 1; // disable shearing (->graphic+Ole+TextFrame) bool mbTextSizeDirty : 1;
bool mbInEditMode : 1; // Is this text object in edit mode?
// For objects with free size (flow text). The flag is set by the // application on create. If the object width is later resized, // AutoGrowWidth will be disabled (set to sal_False). This flag will // then also be set to sal_False, so that the object behaves like a // normal text object. // Width resize can result from: // - Interactive Resize in single or multiple selections // - position/size dialog bool mbDisableAutoWidthOnDragging : 1;
// Flag for allowing text animation. Default is sal_true. bool mbTextAnimationAllowed : 1;
// flag for preventing recursive onEditOutlinerStatusEvent calls bool mbInDownScale : 1;
/** Appends the style family to a provided style name */ staticvoid AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily family);
/** Reads the style family from a style name to which the family has been appended. */ static SfxStyleFamily ReadFamilyFromStyleName(std::u16string_view styleName);
// #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set // SdrTextMinFrameWidthItem and SdrTextMinFrameHeightItem based on all settings, necessities // and object sizes virtualvoid AdaptTextMinSize();
// Currently ASCII and RTF are supported and the differentiation is done // internally. // rFilterName has no meaning and must be empty // Normally the application only has to call SetTextLink() - the // remainder is automatic (SfxLinkManager). // The LoadText() method can also be used to load a file into a text // object (without linking.) // TextLinks can't be edited (if needed later could be ReadOnly). // Setting attributes can only be done on the text frame. void SetTextLink(const OUString& rFileName, const OUString& rFilterName); void ReleaseTextLink(); bool IsLinkedText() const { return m_pPlusData != nullptr && GetLinkUserData() != nullptr; } bool ReloadLinkedText(bool bForceLoad); bool LoadText(const OUString& rFileName, rtl_TextEncoding eCharSet);
virtualbool AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool bHgt = true, bool bWdt = true) const; virtualbool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true); virtualbool AdjustTextFrameWidthAndHeight(); bool IsTextFrame() const { return mbTextFrame; } bool IsOutlText() const { return mbTextFrame && (meTextKind==SdrObjKind::OutlineText || meTextKind==SdrObjKind::TitleText); } /// returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false! bool IsAutoFit() const; /// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false! bool IsFitToSize() const;
// Simultaneously sets the text into the Outliner (possibly // the one of the EditOutliner) and sets the PaperSize. virtualvoid TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText,
tools::Rectangle* pAnchorRect, bool bLineWidth = true ) const; // Takes writing direction into account when adjusting the rectangle void AdjustRectToTextDistance(tools::Rectangle& rAnchorRect, double fExtraRot = 0.0) const; virtualvoid TakeTextAnchorRect(::tools::Rectangle& rAnchorRect) const; const GeoStat& GetGeoStat() const { return maGeo; }
/** Setup given Outliner equivalently to SdrTextObj::Paint()
To setup an arbitrary Outliner in the same way as the draw outliner on SdrTextObj::Paint(). Among others, the paper size, control word and character stretching are initialized, such that the formatting should match the screen representation. The textual content of the outliner is not touched, i.e. no Init() or Clear() is called on the Outliner.
@param rOutl The Outliner to setup.
@param rPaintRect The region to paint the outliner content into. This is useful to e.g. determine the top, left position of text in shapes.
*/ void SetupOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const;
/** Update given Outliner equivalently to SdrTextObj::Paint()
Same functionality as in SetupOutlinerFormatting(), except that the outliner content is not cleared.
@param rOutl The Outliner to update.
@param rPaintRect The region to paint the outliner content into. This is useful to e.g. determine the top, left position of text in shapes.
*/ void UpdateOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const; void ForceOutlinerParaObject(); virtualbool IsVerticalWriting() const; virtualvoid SetVerticalWriting(bool bVertical); bool IsTopToBottom() const;
/** called from the SdrObjEditView during text edit when the status of the edit outliner changes */ virtualvoid onEditOutlinerStatusEvent( EditStatus* pEditStatus );
/** called from the SdrObjEditView during text edit when a chain of boxes is to be updated */ void onChainingEvent();
// transformation interface for StarOfficeAPI. This implements support for // homogen 3x3 matrices containing the transformation of the SdrObject. At the // moment it contains a shearX, rotation and translation, but for setting all linear // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported.
// gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon // with the base geometry and returns TRUE. Otherwise it returns FALSE. virtualbool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const override;
// sets the base geometry of the object using infos contained in the homogen 3x3 matrix. // If it's an SdrPathObj it will use the provided geometry information. The Polygon has // to use (0,0) as upper left and will be scaled to the given size in the matrix. virtualvoid TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override;
// #103836# iterates over the paragraphs of a given SdrObject and removes all // hard set character attributes with the which ids contained in the // given vector void RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>& rCharWhichIds );
// Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a // painting rectangle. Rotation is taken from the object.
GDIMetaFile* GetTextScrollMetaFileAndRectangle(tools::Rectangle& rScrollRectangle, tools::Rectangle& rPaintRectangle);
// Access to TextAnimationAllowed flag void SetTextAnimationAllowed(bool bNew);
// #i8824# // Set single item at the local ItemSet. *Does not use* AllowItemChange(), // ItemChange(), PostItemChange() and ItemSetChanged() calls. void SetObjectItemNoBroadcast(const SfxPoolItem& rItem); double GetCameraZRotation() const;
// Direct decomposer for text visualization when you already have a prepared // Outliner containing all the needed information staticvoid impDecomposeBlockTextPrimitiveDirect(
drawinglayer::primitive2d::Primitive2DContainer& rTarget,
SdrOutliner& rOutliner, const basegfx::B2DHomMatrix& rNewTransformA, const basegfx::B2DHomMatrix& rNewTransformB, const basegfx::B2DRange& rClipRange);
/** returns false if the given pointer is NULL or if the given SdrOutliner contains no text. Also checks for one empty paragraph.
*/ staticbool HasTextImpl( SdrOutliner const * pOutliner );
virtualbool IsSdrTextObj() const final { returntrue; }
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.