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 // MyEDITVIEW, wegen exportiertem EditView 24*b1cdbd2cSJim Jagielski #ifndef _MyEDITVIEW_HXX 25*b1cdbd2cSJim Jagielski #define _MyEDITVIEW_HXX 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski #include <com/sun/star/i18n/WordType.hpp> 28*b1cdbd2cSJim Jagielski 29*b1cdbd2cSJim Jagielski #include <rsc/rscsfx.hxx> 30*b1cdbd2cSJim Jagielski #include <i18npool/lang.h> 31*b1cdbd2cSJim Jagielski #include <tools/color.hxx> 32*b1cdbd2cSJim Jagielski #include <tools/gen.hxx> 33*b1cdbd2cSJim Jagielski 34*b1cdbd2cSJim Jagielski class EditEngine; 35*b1cdbd2cSJim Jagielski class ImpEditEngine; 36*b1cdbd2cSJim Jagielski class ImpEditView; 37*b1cdbd2cSJim Jagielski class SvxSearchItem; 38*b1cdbd2cSJim Jagielski class SvxFieldItem; 39*b1cdbd2cSJim Jagielski class Window; 40*b1cdbd2cSJim Jagielski class Pointer; 41*b1cdbd2cSJim Jagielski class Cursor; 42*b1cdbd2cSJim Jagielski class KeyEvent; 43*b1cdbd2cSJim Jagielski class MouseEvent; 44*b1cdbd2cSJim Jagielski class DropEvent; 45*b1cdbd2cSJim Jagielski class CommandEvent; 46*b1cdbd2cSJim Jagielski class Rectangle; 47*b1cdbd2cSJim Jagielski class Link; 48*b1cdbd2cSJim Jagielski class Pair; 49*b1cdbd2cSJim Jagielski class Point; 50*b1cdbd2cSJim Jagielski class Range; 51*b1cdbd2cSJim Jagielski class SvStream; 52*b1cdbd2cSJim Jagielski class SvKeyValueIterator; 53*b1cdbd2cSJim Jagielski class SfxStyleSheet; 54*b1cdbd2cSJim Jagielski class Font; 55*b1cdbd2cSJim Jagielski class FontList; 56*b1cdbd2cSJim Jagielski class OutputDevice; 57*b1cdbd2cSJim Jagielski 58*b1cdbd2cSJim Jagielski #ifndef _EDITDATA_HXX 59*b1cdbd2cSJim Jagielski #include <editeng/editdata.hxx> 60*b1cdbd2cSJim Jagielski #endif 61*b1cdbd2cSJim Jagielski #include <com/sun/star/uno/Reference.h> 62*b1cdbd2cSJim Jagielski #include "editeng/editengdllapi.h" 63*b1cdbd2cSJim Jagielski 64*b1cdbd2cSJim Jagielski namespace com { 65*b1cdbd2cSJim Jagielski namespace sun { 66*b1cdbd2cSJim Jagielski namespace star { 67*b1cdbd2cSJim Jagielski namespace datatransfer { 68*b1cdbd2cSJim Jagielski class XTransferable; 69*b1cdbd2cSJim Jagielski }}}} 70*b1cdbd2cSJim Jagielski 71*b1cdbd2cSJim Jagielski class EDITENG_DLLPUBLIC EditView 72*b1cdbd2cSJim Jagielski { 73*b1cdbd2cSJim Jagielski friend class EditEngine; 74*b1cdbd2cSJim Jagielski friend class ImpEditEngine; 75*b1cdbd2cSJim Jagielski friend class EditSelFunctionSet; 76*b1cdbd2cSJim Jagielski 77*b1cdbd2cSJim Jagielski public: // brauche ich fuer Undo GetImpEditView() const78*b1cdbd2cSJim Jagielski ImpEditView* GetImpEditView() const { return pImpEditView; } 79*b1cdbd2cSJim Jagielski ImpEditEngine* GetImpEditEngine() const; 80*b1cdbd2cSJim Jagielski 81*b1cdbd2cSJim Jagielski private: 82*b1cdbd2cSJim Jagielski ImpEditView* pImpEditView; 83*b1cdbd2cSJim Jagielski 84*b1cdbd2cSJim Jagielski EDITENG_DLLPRIVATE EditView( const EditView& ); 85*b1cdbd2cSJim Jagielski EDITENG_DLLPRIVATE EditView& operator=( const EditView& ); 86*b1cdbd2cSJim Jagielski 87*b1cdbd2cSJim Jagielski public: 88*b1cdbd2cSJim Jagielski EditView( EditEngine* pEng, Window* pWindow ); 89*b1cdbd2cSJim Jagielski virtual ~EditView(); 90*b1cdbd2cSJim Jagielski 91*b1cdbd2cSJim Jagielski void SetEditEngine( EditEngine* pEditEngine ); 92*b1cdbd2cSJim Jagielski EditEngine* GetEditEngine() const; 93*b1cdbd2cSJim Jagielski 94*b1cdbd2cSJim Jagielski void SetWindow( Window* pWin ); 95*b1cdbd2cSJim Jagielski Window* GetWindow() const; 96*b1cdbd2cSJim Jagielski 97*b1cdbd2cSJim Jagielski void Paint( const Rectangle& rRect, OutputDevice* pTargetDevice = 0 ); 98*b1cdbd2cSJim Jagielski void Invalidate(); 99*b1cdbd2cSJim Jagielski Pair Scroll( long nHorzScroll, long nVertScroll, sal_uInt8 nRangeCheck = RGCHK_NEG ); 100*b1cdbd2cSJim Jagielski 101*b1cdbd2cSJim Jagielski void ShowCursor( sal_Bool bGotoCursor = sal_True, sal_Bool bForceVisCursor = sal_True ); 102*b1cdbd2cSJim Jagielski void HideCursor(); 103*b1cdbd2cSJim Jagielski 104*b1cdbd2cSJim Jagielski EESelectionMode GetSelectionMode() const; 105*b1cdbd2cSJim Jagielski void SetSelectionMode( EESelectionMode eMode ); 106*b1cdbd2cSJim Jagielski 107*b1cdbd2cSJim Jagielski void SetReadOnly( sal_Bool bReadOnly ); 108*b1cdbd2cSJim Jagielski sal_Bool IsReadOnly() const; 109*b1cdbd2cSJim Jagielski 110*b1cdbd2cSJim Jagielski sal_Bool HasSelection() const; 111*b1cdbd2cSJim Jagielski ESelection GetSelection() const; 112*b1cdbd2cSJim Jagielski void SetSelection( const ESelection& rNewSel ); 113*b1cdbd2cSJim Jagielski sal_Bool SelectCurrentWord( sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); 114*b1cdbd2cSJim Jagielski 115*b1cdbd2cSJim Jagielski void IndentBlock(); 116*b1cdbd2cSJim Jagielski void UnindentBlock(); 117*b1cdbd2cSJim Jagielski 118*b1cdbd2cSJim Jagielski sal_Bool IsInsertMode() const; 119*b1cdbd2cSJim Jagielski void SetInsertMode( sal_Bool bInsert ); 120*b1cdbd2cSJim Jagielski 121*b1cdbd2cSJim Jagielski void ReplaceSelected( const String& rStr ); 122*b1cdbd2cSJim Jagielski String GetSelected(); 123*b1cdbd2cSJim Jagielski void DeleteSelected(); 124*b1cdbd2cSJim Jagielski 125*b1cdbd2cSJim Jagielski sal_uInt16 GetSelectedScriptType() const; 126*b1cdbd2cSJim Jagielski 127*b1cdbd2cSJim Jagielski // Position der VisArea im Ausgabefenster. 128*b1cdbd2cSJim Jagielski // Eine Groessenaenderung betrifft auch die VisArea 129*b1cdbd2cSJim Jagielski void SetOutputArea( const Rectangle& rRec ); 130*b1cdbd2cSJim Jagielski const Rectangle& GetOutputArea() const; 131*b1cdbd2cSJim Jagielski 132*b1cdbd2cSJim Jagielski // Dokumentposition. 133*b1cdbd2cSJim Jagielski // Eine Groessenaenderung betrifft auch die VisArea 134*b1cdbd2cSJim Jagielski void SetVisArea( const Rectangle& rRec ); 135*b1cdbd2cSJim Jagielski const Rectangle& GetVisArea() const; 136*b1cdbd2cSJim Jagielski 137*b1cdbd2cSJim Jagielski void SetPointer( const Pointer& rPointer ); 138*b1cdbd2cSJim Jagielski const Pointer& GetPointer() const; 139*b1cdbd2cSJim Jagielski 140*b1cdbd2cSJim Jagielski void SetCursor( const Cursor& rCursor ); 141*b1cdbd2cSJim Jagielski Cursor* GetCursor() const; 142*b1cdbd2cSJim Jagielski 143*b1cdbd2cSJim Jagielski void InsertText( const String& rNew, sal_Bool bSelect = sal_False ); 144*b1cdbd2cSJim Jagielski 145*b1cdbd2cSJim Jagielski sal_Bool PostKeyEvent( const KeyEvent& rKeyEvent ); 146*b1cdbd2cSJim Jagielski 147*b1cdbd2cSJim Jagielski sal_Bool MouseButtonUp( const MouseEvent& rMouseEvent ); 148*b1cdbd2cSJim Jagielski sal_Bool MouseButtonDown( const MouseEvent& rMouseEvent ); 149*b1cdbd2cSJim Jagielski sal_Bool MouseMove( const MouseEvent& rMouseEvent ); 150*b1cdbd2cSJim Jagielski void Command( const CommandEvent& rCEvt ); 151*b1cdbd2cSJim Jagielski 152*b1cdbd2cSJim Jagielski sal_Bool Drop( const DropEvent& rEvt ); 153*b1cdbd2cSJim Jagielski sal_Bool QueryDrop( DropEvent& rEvt ); 154*b1cdbd2cSJim Jagielski ESelection GetDropPos(); 155*b1cdbd2cSJim Jagielski 156*b1cdbd2cSJim Jagielski void Cut(); 157*b1cdbd2cSJim Jagielski void Copy(); 158*b1cdbd2cSJim Jagielski void Paste(); 159*b1cdbd2cSJim Jagielski void PasteSpecial(); 160*b1cdbd2cSJim Jagielski 161*b1cdbd2cSJim Jagielski void EnablePaste( sal_Bool bEnable ); 162*b1cdbd2cSJim Jagielski sal_Bool IsPasteEnabled() const; 163*b1cdbd2cSJim Jagielski 164*b1cdbd2cSJim Jagielski void Undo(); 165*b1cdbd2cSJim Jagielski void Redo(); 166*b1cdbd2cSJim Jagielski 167*b1cdbd2cSJim Jagielski // speziell fuer Olli 168*b1cdbd2cSJim Jagielski sal_uInt16 GetParagraph( const Point& rMousePosPixel ); 169*b1cdbd2cSJim Jagielski Point GetWindowPosTopLeft( sal_uInt16 nParagraph ); 170*b1cdbd2cSJim Jagielski void MoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos ); 171*b1cdbd2cSJim Jagielski void MoveParagraphs( long nDiff ); 172*b1cdbd2cSJim Jagielski 173*b1cdbd2cSJim Jagielski const SfxItemSet& GetEmptyItemSet(); 174*b1cdbd2cSJim Jagielski SfxItemSet GetAttribs(); 175*b1cdbd2cSJim Jagielski void SetAttribs( const SfxItemSet& rSet ); 176*b1cdbd2cSJim Jagielski void SetParaAttribs( const SfxItemSet& rSet, sal_uInt16 nPara ); 177*b1cdbd2cSJim Jagielski void RemoveAttribs( sal_Bool bRemoveParaAttribs = sal_False, sal_uInt16 nWhich = 0 ); 178*b1cdbd2cSJim Jagielski void RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0 ); 179*b1cdbd2cSJim Jagielski void RemoveAttribsKeepLanguages( sal_Bool bRemoveParaAttribs = sal_False ); 180*b1cdbd2cSJim Jagielski 181*b1cdbd2cSJim Jagielski sal_uLong Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, sal_Bool bSelect = sal_False, SvKeyValueIterator* pHTTPHeaderAttrs = NULL ); 182*b1cdbd2cSJim Jagielski sal_uLong Write( SvStream& rOutput, EETextFormat eFormat ); 183*b1cdbd2cSJim Jagielski 184*b1cdbd2cSJim Jagielski void SetBackgroundColor( const Color& rColor ); 185*b1cdbd2cSJim Jagielski Color GetBackgroundColor() const; 186*b1cdbd2cSJim Jagielski 187*b1cdbd2cSJim Jagielski void SetControlWord( sal_uInt32 nWord ); 188*b1cdbd2cSJim Jagielski sal_uInt32 GetControlWord() const; 189*b1cdbd2cSJim Jagielski 190*b1cdbd2cSJim Jagielski EditTextObject* CreateTextObject(); 191*b1cdbd2cSJim Jagielski void InsertText( const EditTextObject& rTextObject ); 192*b1cdbd2cSJim Jagielski void InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xDataObj, const String& rBaseURL, sal_Bool bUseSpecial ); 193*b1cdbd2cSJim Jagielski 194*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > GetTransferable(); 195*b1cdbd2cSJim Jagielski 196*b1cdbd2cSJim Jagielski // An EditView, damit bei sal_True flackerfreies Update: 197*b1cdbd2cSJim Jagielski void SetEditEngineUpdateMode( sal_Bool bUpdate ); 198*b1cdbd2cSJim Jagielski void ForceUpdate(); 199*b1cdbd2cSJim Jagielski 200*b1cdbd2cSJim Jagielski SfxStyleSheet* GetStyleSheet() const; 201*b1cdbd2cSJim Jagielski void SetStyleSheet( SfxStyleSheet* pStyle ); 202*b1cdbd2cSJim Jagielski 203*b1cdbd2cSJim Jagielski void SetAnchorMode( EVAnchorMode eMode ); 204*b1cdbd2cSJim Jagielski EVAnchorMode GetAnchorMode() const; 205*b1cdbd2cSJim Jagielski 206*b1cdbd2cSJim Jagielski sal_Bool MatchGroup(); 207*b1cdbd2cSJim Jagielski 208*b1cdbd2cSJim Jagielski void CompleteAutoCorrect(); 209*b1cdbd2cSJim Jagielski 210*b1cdbd2cSJim Jagielski EESpellState StartSpeller( sal_Bool bMultipleDoc = sal_False ); 211*b1cdbd2cSJim Jagielski EESpellState StartThesaurus(); 212*b1cdbd2cSJim Jagielski sal_uInt16 StartSearchAndReplace( const SvxSearchItem& rSearchItem ); 213*b1cdbd2cSJim Jagielski 214*b1cdbd2cSJim Jagielski // for text conversion 215*b1cdbd2cSJim Jagielski void StartTextConversion( LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, sal_Int32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc ); 216*b1cdbd2cSJim Jagielski sal_Bool HasConvertibleTextPortion( LanguageType nLang ); 217*b1cdbd2cSJim Jagielski 218*b1cdbd2cSJim Jagielski void TransliterateText( sal_Int32 nTransliterationMode ); 219*b1cdbd2cSJim Jagielski 220*b1cdbd2cSJim Jagielski sal_Bool IsCursorAtWrongSpelledWord( sal_Bool bMarkIfWrong = sal_False ); 221*b1cdbd2cSJim Jagielski sal_Bool IsWrongSpelledWordAtPos( const Point& rPosPixel, sal_Bool bMarkIfWrong = sal_False ); 222*b1cdbd2cSJim Jagielski sal_Bool IsShapeParaFocusable( ) ; 223*b1cdbd2cSJim Jagielski sal_Bool WrongSpelledBreakPara(sal_Int32 nPara,sal_uInt16& nStartIndex, sal_uInt16& nEndIndex,sal_Int32 nIndex); 224*b1cdbd2cSJim Jagielski void SpellIgnoreWord(); 225*b1cdbd2cSJim Jagielski void ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack = 0 ); 226*b1cdbd2cSJim Jagielski 227*b1cdbd2cSJim Jagielski void InsertField( const SvxFieldItem& rFld ); 228*b1cdbd2cSJim Jagielski const SvxFieldItem* GetFieldUnderMousePointer() const; 229*b1cdbd2cSJim Jagielski const SvxFieldItem* GetFieldUnderMousePointer( sal_uInt16& nPara, xub_StrLen& nPos ) const; 230*b1cdbd2cSJim Jagielski const SvxFieldItem* GetField( const Point& rPos, sal_uInt16* pnPara = NULL, xub_StrLen* pnPos = NULL ) const; 231*b1cdbd2cSJim Jagielski 232*b1cdbd2cSJim Jagielski const SvxFieldItem* GetFieldAtSelection() const; 233*b1cdbd2cSJim Jagielski 234*b1cdbd2cSJim Jagielski String GetWordUnderMousePointer() const; 235*b1cdbd2cSJim Jagielski String GetWordUnderMousePointer( Rectangle& rWordRect ) const; 236*b1cdbd2cSJim Jagielski 237*b1cdbd2cSJim Jagielski void SetInvalidateMore( sal_uInt16 nPixel ); 238*b1cdbd2cSJim Jagielski sal_uInt16 GetInvalidateMore() const; 239*b1cdbd2cSJim Jagielski 240*b1cdbd2cSJim Jagielski // grows or shrinks the font height for the current selection 241*b1cdbd2cSJim Jagielski void ChangeFontSize( bool bGrow, const FontList* pList ); 242*b1cdbd2cSJim Jagielski 243*b1cdbd2cSJim Jagielski static bool ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFontList ); 244*b1cdbd2cSJim Jagielski 245*b1cdbd2cSJim Jagielski String GetSurroundingText() const; 246*b1cdbd2cSJim Jagielski Selection GetSurroundingTextSelection() const; 247*b1cdbd2cSJim Jagielski }; 248*b1cdbd2cSJim Jagielski 249*b1cdbd2cSJim Jagielski #endif // _MyEDITVIEW_HXX 250