1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SVX_UNOFORED_HXX 25 #define _SVX_UNOFORED_HXX 26 27 #include <editeng/editeng.hxx> 28 #include <editeng/unoedsrc.hxx> 29 #include "editeng/editengdllapi.h" 30 31 // SvxEditEngineForwarder - SvxTextForwarder fuer EditEngine 32 33 class EDITENG_DLLPUBLIC SvxEditEngineForwarder : public SvxTextForwarder 34 { 35 private: 36 EditEngine& rEditEngine; 37 38 public: 39 SvxEditEngineForwarder( EditEngine& rEngine ); 40 virtual ~SvxEditEngineForwarder(); 41 42 virtual sal_uInt32 GetParagraphCount() const; 43 virtual sal_uInt16 GetTextLen( sal_uInt32 nParagraph ) const; 44 virtual String GetText( const ESelection& rSel ) const; 45 virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All ) const; 46 virtual SfxItemSet GetParaAttribs( sal_uInt32 nPara ) const; 47 virtual void SetParaAttribs( sal_uInt32 nPara, const SfxItemSet& rSet ); 48 virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); 49 virtual void GetPortions( sal_uInt32 nPara, SvUShorts& rList ) const; 50 51 virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; 52 virtual sal_uInt16 GetItemState( sal_uInt32 nPara, sal_uInt16 nWhich ) const; 53 54 virtual void QuickInsertText( const String& rText, const ESelection& rSel ); 55 virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ); 56 virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ); 57 virtual void QuickInsertLineBreak( const ESelection& rSel ); 58 59 virtual SfxItemPool* GetPool() const; 60 61 virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ); 62 virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt32 nPara, xub_StrLen nPos ); 63 virtual sal_Bool IsValid() const; 64 65 virtual LanguageType GetLanguage( sal_uInt32 nPara, sal_uInt16 nIndex ) const; 66 virtual sal_uInt16 GetFieldCount( sal_uInt32 nPara ) const; 67 virtual EFieldInfo GetFieldInfo( sal_uInt32 nPara, sal_uInt16 nField ) const; 68 virtual EBulletInfo GetBulletInfo( sal_uInt32 nPara ) const; 69 virtual Rectangle GetCharBounds( sal_uInt32 nPara, sal_uInt16 nIndex ) const; 70 virtual Rectangle GetParaBounds( sal_uInt32 nPara ) const; 71 virtual MapMode GetMapMode() const; 72 virtual OutputDevice* GetRefDevice() const; 73 virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt32& nPara, sal_uInt16& nIndex ) const; 74 virtual sal_Bool GetWordIndices( sal_uInt32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const; 75 virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt32 nPara, sal_uInt16 nIndex, sal_Bool bInCell = sal_False ) const; 76 virtual sal_uInt16 GetLineCount( sal_uInt32 nPara ) const; 77 virtual sal_uInt16 GetLineLen( sal_uInt32 nPara, sal_uInt16 nLine ) const; 78 virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt32 nParagraph, sal_uInt16 nLine ) const; 79 virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt32 nPara, sal_uInt16 nIndex ) const; 80 virtual sal_Bool Delete( const ESelection& ); 81 virtual sal_Bool InsertText( const String&, const ESelection& ); 82 virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False ); 83 virtual sal_Int16 GetDepth( sal_uInt32 nPara ) const; 84 virtual sal_Bool SetDepth( sal_uInt32 nPara, sal_Int16 nNewDepth ); 85 86 virtual const SfxItemSet* GetEmptyItemSetPtr(); 87 88 // implementation functions for XParagraphAppend and XTextPortionAppend 89 virtual void AppendParagraph(); 90 virtual xub_StrLen AppendTextPortion( sal_uInt32 nPara, const String &rText, const SfxItemSet &rSet ); 91 //XTextCopy 92 virtual void CopyText(const SvxTextForwarder& rSource); 93 }; 94 95 #endif 96 97