/* -*- 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 SwPaM; struct SwPosition; class SwNode; class SwNodeRange; class Graphic; class SfxItemSet; class SfxPoolItem; class SdrObject; class SwFrameFormat; class SwDrawFrameFormat; class SwFlyFrameFormat; class SwRootFrame; class SwTextAttr;
namespace utl { class TransliterationWrapper; } namespace svt { class EmbeddedObjectRef; }
// constants for inserting text enumclass SwInsertFlags
{ DEFAULT = 0x00, // no extras
EMPTYEXPAND = 0x01, // expand empty hints at insert position
NOHINTEXPAND = 0x02, // do not expand any hints at insert pos
FORCEHINTEXPAND = 0x04 // expand all hints at insert position
}; namespace o3tl
{ template<> struct typed_flags<SwInsertFlags> : is_typed_flags<SwInsertFlags, 0x07> {};
}
enumclass SwCopyFlags
{ Default = 0,
CopyAll = (1<<0), ///< copy break attributes even when source is single node
CheckPosInFly = (1<<1), ///< check if target position is in fly anchored at source range
IsMoveToFly = (1<<2), ///< MakeFlyAndMove // TODO: mbCopyIsMove? mbIsRedlineMove?
}; namespace o3tl
{ template<> struct typed_flags<SwCopyFlags> : is_typed_flags<SwCopyFlags, 0x07> {};
}
/** Text operation/manipulation interface
*/ class IDocumentContentOperations
{ public: public: /** Copy a selected content range to a position
The position can be in the same or in an another document. It can also be within the range!
\warning The range has to include at least two nodes or has to be a SwDoc::IsColumnSelection, because the rPam is treated [mark, point[.
Normally this function should work only with content nodes. But there is a special case used by SwDoc::Paste, which starts the SwPaM at the content start node. This position doesn't contain any content:
This is important, because it prevents merging of the first node of the range into the node pointed to by \p rPos. As a result this keeps all properties of the first real content node, which is the 2nd, including the Flys and the page description. In this case the first (fake) node is silently dropped and all other nodes are just copied.
@param rPam The source node range to copy
@param rPos The target copy destination
@param flags SwCopyFlags::CheckPos: If this function should check if rPos is in a fly frame anchored in rPam. If false, then no such check will be performed, and it is assumed that the caller took care of verifying this constraint already.
*/ virtualbool CopyRange(SwPaM& rPam, SwPosition& rPos, SwCopyFlags flags, sal_uInt32 nMovedID = 0) const = 0;
/** Split a node at rPos (implemented only for TextNode).
*/ virtualbool SplitNode(const SwPosition &rPos, bool bChkTableStart) = 0;
virtualbool AppendTextNode(SwPosition& rPos) = 0;
/** Replace selected range in a TextNode with string. Intended for search & replace. bRegExpRplc - replace tabs (\\t) and insert the found string ( not \& ). E.g.: Find: "zzz", Replace: "xx\t\\t..&..\&" --> "xx\t<Tab>..zzz..&"
*/ virtualbool ReplaceRange(SwPaM& rPam, const OUString& rNewStr, constbool bRegExReplace) = 0;
/** Insert an attribute. If rRg spans several nodes the attribute is split, provided it makes sense. Nodes, where this attribute does not make sense are ignored. In nodes completely enclosed in the selection the attribute becomes hard-formatted, in all other (text-) nodes the attribute is inserted into the attribute array. For a character attribute, in cases where no selection exists an "empty" hint is inserted. If there is a selection the attribute is hard-formatted and added to the node at rRg.Start(). If the attribute could not be inserted, the method returns false.
*/ virtualbool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&, const SetAttrMode nFlags = SetAttrMode::DEFAULT,
SwRootFrame const* pLayout = nullptr,
SwTextAttr **ppNewTextAttr = nullptr) = 0;
/** Removes any leading white space from the paragraph
*/ virtualvoid RemoveLeadingWhiteSpace(const SwPosition & rPos ) = 0; virtualvoid RemoveLeadingWhiteSpace(SwPaM& rPaM) = 0;
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.