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