14c5491eaSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 34c5491eaSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 44c5491eaSAndrew Rist * or more contributor license agreements. See the NOTICE file 54c5491eaSAndrew Rist * distributed with this work for additional information 64c5491eaSAndrew Rist * regarding copyright ownership. The ASF licenses this file 74c5491eaSAndrew Rist * to you under the Apache License, Version 2.0 (the 84c5491eaSAndrew Rist * "License"); you may not use this file except in compliance 94c5491eaSAndrew Rist * with the License. You may obtain a copy of the License at 104c5491eaSAndrew Rist * 114c5491eaSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 124c5491eaSAndrew Rist * 134c5491eaSAndrew Rist * Unless required by applicable law or agreed to in writing, 144c5491eaSAndrew Rist * software distributed under the License is distributed on an 154c5491eaSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 164c5491eaSAndrew Rist * KIND, either express or implied. See the License for the 174c5491eaSAndrew Rist * specific language governing permissions and limitations 184c5491eaSAndrew Rist * under the License. 194c5491eaSAndrew Rist * 204c5491eaSAndrew Rist *************************************************************/ 214c5491eaSAndrew Rist 224c5491eaSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVX_UNOFOROU_HXX 25cdf0e10cSrcweir #define _SVX_UNOFOROU_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <editeng/unoedsrc.hxx> 28cdf0e10cSrcweir #include "editeng/editengdllapi.h" 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include <editeng/editdata.hxx> 31cdf0e10cSrcweir 32cdf0e10cSrcweir class Outliner; 33cdf0e10cSrcweir 34cdf0e10cSrcweir // SvxOutlinerForwarder - SvxTextForwarder fuer Outliner 35cdf0e10cSrcweir 36cdf0e10cSrcweir class EDITENG_DLLPUBLIC SvxOutlinerForwarder : public SvxTextForwarder 37cdf0e10cSrcweir { 38cdf0e10cSrcweir private: 39cdf0e10cSrcweir Outliner& rOutliner; 40cdf0e10cSrcweir sal_Bool bOutlinerText; 41cdf0e10cSrcweir 42cdf0e10cSrcweir /** this pointer may be null or point to an item set for the attribs of 43cdf0e10cSrcweir the selection maAttribsSelection */ 44cdf0e10cSrcweir mutable SfxItemSet* mpAttribsCache; 45cdf0e10cSrcweir 46cdf0e10cSrcweir /** if we have a chached attribute item set, this is the selection of it */ 47cdf0e10cSrcweir mutable ESelection maAttribCacheSelection; 48cdf0e10cSrcweir 49cdf0e10cSrcweir /** this pointer may be null or point to an item set for the paragraph 50cdf0e10cSrcweir mnParaAttribsCache */ 51cdf0e10cSrcweir mutable SfxItemSet* mpParaAttribsCache; 52cdf0e10cSrcweir 53cdf0e10cSrcweir /** if we have a cached para attribute item set, this is the paragraph of it */ 54cdf0e10cSrcweir mutable sal_uInt16 mnParaAttribsCache; 55cdf0e10cSrcweir 56cdf0e10cSrcweir public: 57cdf0e10cSrcweir SvxOutlinerForwarder( Outliner& rOutl, sal_Bool bOutlText = sal_False ); 58cdf0e10cSrcweir virtual ~SvxOutlinerForwarder(); 59cdf0e10cSrcweir 60cdf0e10cSrcweir virtual sal_uInt16 GetParagraphCount() const; 61cdf0e10cSrcweir virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const; 62cdf0e10cSrcweir virtual String GetText( const ESelection& rSel ) const; 63cdf0e10cSrcweir virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const; 64cdf0e10cSrcweir virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const; 65cdf0e10cSrcweir virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); 66cdf0e10cSrcweir virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); 67cdf0e10cSrcweir virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const; 68cdf0e10cSrcweir 69cdf0e10cSrcweir virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; 70cdf0e10cSrcweir virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const; 71cdf0e10cSrcweir 72cdf0e10cSrcweir virtual void QuickInsertText( const String& rText, const ESelection& rSel ); 73cdf0e10cSrcweir virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ); 74cdf0e10cSrcweir virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ); 75cdf0e10cSrcweir virtual void QuickInsertLineBreak( const ESelection& rSel ); 76cdf0e10cSrcweir 77cdf0e10cSrcweir virtual SfxItemPool* GetPool() const; 78cdf0e10cSrcweir 79cdf0e10cSrcweir virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ); 80cdf0e10cSrcweir virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos ); 81cdf0e10cSrcweir 82cdf0e10cSrcweir virtual sal_Bool IsValid() const; 83cdf0e10cSrcweir GetOutliner() const84cdf0e10cSrcweir Outliner& GetOutliner() const { return rOutliner; } 85cdf0e10cSrcweir 86cdf0e10cSrcweir virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const; 87cdf0e10cSrcweir virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const; 88cdf0e10cSrcweir virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const; 89cdf0e10cSrcweir virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const; 90cdf0e10cSrcweir virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const; 91cdf0e10cSrcweir virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const; 92cdf0e10cSrcweir virtual MapMode GetMapMode() const; 93cdf0e10cSrcweir virtual OutputDevice* GetRefDevice() const; 94cdf0e10cSrcweir virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const; 95cdf0e10cSrcweir virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const; 96*9b8096d0SSteve Yin virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex, sal_Bool bInCell = sal_False ) const; 97cdf0e10cSrcweir virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const; 98cdf0e10cSrcweir virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const; 99cdf0e10cSrcweir virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const; 100cdf0e10cSrcweir virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const; 101cdf0e10cSrcweir virtual sal_Bool Delete( const ESelection& ); 102cdf0e10cSrcweir virtual sal_Bool InsertText( const String&, const ESelection& ); 103cdf0e10cSrcweir virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False ); 104cdf0e10cSrcweir virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const; 105cdf0e10cSrcweir virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth ); 106cdf0e10cSrcweir virtual sal_Int16 GetNumberingStartValue( sal_uInt16 nPara ); 107cdf0e10cSrcweir virtual void SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingStartValue ); 108cdf0e10cSrcweir 109cdf0e10cSrcweir virtual sal_Bool IsParaIsNumberingRestart( sal_uInt16 nPara ); 110cdf0e10cSrcweir virtual void SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart ); 111cdf0e10cSrcweir 112cdf0e10cSrcweir /* this method flushes internal caches for this forwarder */ 113cdf0e10cSrcweir void flushCache(); 114cdf0e10cSrcweir 115cdf0e10cSrcweir virtual const SfxItemSet* GetEmptyItemSetPtr(); 116cdf0e10cSrcweir 117cdf0e10cSrcweir // implementation functions for XParagraphAppend and XTextPortionAppend 118cdf0e10cSrcweir virtual void AppendParagraph(); 119cdf0e10cSrcweir virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet ); 120cdf0e10cSrcweir //XTextCopy 121cdf0e10cSrcweir virtual void CopyText(const SvxTextForwarder& rSource); 122cdf0e10cSrcweir }; 123cdf0e10cSrcweir 124cdf0e10cSrcweir #endif 125cdf0e10cSrcweir 126