/* -*- 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 SvxRTFItemStackType; using SvxRTFItemStackList = std::vector<std::unique_ptr<SvxRTFItemStackType>>;
// Mapper-Classes for the various requirements on Document positions // Swg - NodePosition is a SwContentIndex, which is used internally // EditEngine - ULONG to list of paragraphs
class EditEngine; class ContentNode; class EditNodeIdx
{ public:
EditNodeIdx(EditEngine* pEE, ContentNode* pNd);
sal_Int32 GetIdx() const;
ContentNode* GetNode() { return mpNode; } private:
EditEngine* mpEditEngine;
ContentNode* mpNode;
};
class EditSelection; class EditPosition
{ private:
EditEngine* mpEditEngine;
EditSelection* mpCurSel;
// Sets all the attributes that are different from the current void SetAttrSet( SvxRTFItemStackType &rSet ); void SetDefault( int nToken, int nValue );
// is called for each token that is recognized in CallParser virtualvoid NextToken( int nToken ) override;
void ReadStyleTable(); void ReadColorTable(); void ReadFontTable(); void ReadAttr( int nToken, SfxItemSet* pSet ); void ReadTabAttr( int nToken, SfxItemSet& rSet );
inline SfxItemSet& GetAttrSet(); // no text yet inserted? (SttPos from the top stack entry!) bool IsAttrSttPos(); void AttrGroupEnd(); // edit the current, delete from stack void SetAllAttrOfStk(); // end all Attr. and set it into doc
virtualvoid InsertText() = 0; virtualvoid MovePos( bool bForward = true ) = 0; virtualvoid SetEndPrevPara( std::optional<EditNodeIdx>& rpNodePos,
sal_Int32& rCntPos )=0; virtualvoid SetAttrInDoc( SvxRTFItemStackType &rSet ); // for Tokens, which are not evaluated in ReadAttr virtualvoid UnknownAttrToken( int nToken );
// if no-one would like to have any twips virtualvoid CalcValue();
SvxRTFParser( SfxItemPool& rAttrPool, SvStream& rIn ); virtual ~SvxRTFParser() override;
// to set a different attribute pool. May only be done prior to CallParser! // The maps are not generated anew! void SetAttrPool( SfxItemPool* pNewPool ) { pAttrPool = pNewPool; } // to set different WhichIds for a different pool. template<class T> void SetPardMap(TypedWhichId<T> wid, TypedWhichId<T> widTrue) { aPardMap.set(wid, widTrue); } // to be able to assign them from the outside as for example table cells void ReadBorderAttr( int nToken, SfxItemSet& rSet, bool bTableDef=false ); void ReadBackgroundAttr( int nToken, SfxItemSet& rSet, bool bTableDef=false );
// for asynchronous read from the SvStream virtualvoidContinue( int nToken ) override;
// get RTF default ItemSets. Must be used by pard/plain tokens or in // reset of Style-Items const SfxItemSet& GetRTFDefaults();
};
// The stack for the attributes: // this class may only be used by SvxRTFParser! class SvxRTFItemStackType
{ friendclass SvxRTFParser;
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 ist noch experimentell.