28#include <com/sun/star/linguistic2/XDictionary.hpp>
29#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
30#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
31#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
32#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
43#include <LibreOfficeKit/LibreOfficeKitEnums.h>
47#include <boost/property_tree/ptree.hpp>
69 const Point& rVisDocStartPos) :
70 mrImpEditView(rImpEditView),
71 maOutArea(rOutputArea),
72 maVisDocStartPos(rVisDocStartPos),
185 mpViewShell(nullptr),
186 mpOtherShell(nullptr),
196 bClickedInSelection(false),
197 bActiveDragAndDropListener(false),
198 aOutArea(
Point(), pEng->GetPaperSize() ),
201 mpEditViewCallbacks(nullptr),
203 mbSuppressLOKMessages(false),
261 if (rDoc.
Count() > 1 &&
262 pmEnd == rEditSelection.
Min() &&
263 pmEnd == rEditSelection.
Max())
288 if (aOrigin.
getX() != 0 || aOrigin.
getY() != 0)
320 pCallbacks->EditViewSelectionChange();
329 if (pParent && pParent->GetLOKWindowId() != 0)
334 std::vector<tools::Rectangle> aRectangles;
337 std::vector<OString>
v;
340 rRectangle =
pOutWin->LogicToPixel(rRectangle);
341 rRectangle.Move(nX, nY);
342 v.emplace_back(rRectangle.toString().getStr());
347 std::vector<vcl::LOKPayloadItem> aItems;
348 aItems.emplace_back(
"rectangles", sRectangle);
349 aItems.emplace_back(
"startHandleVisible", OString::boolean(bStartHandleVisible));
350 aItems.emplace_back(
"endHandleVisible", OString::boolean(bEndHandleVisible));
351 pNotifier->
notifyWindow(pParent->GetLOKWindowId(),
"text_selection", aItems);
356 if (
pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
375 (
pOutWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM);
378 if (
pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip)
380 aOrigin =
pOutWin->GetMapMode().GetOrigin();
387 std::vector<tools::Rectangle> aRectangles;
390 if (!aRectangles.empty())
397 Point aOffsetPx =
pOutWin->GetOffsetPixelFrom(*pViewShellWindow);
400 rRect.Move(aLogicOffset.
getX(), aLogicOffset.
getY());
404 std::vector<OString>
v;
411 rRectangle.Move(aOrigin.getX(), aOrigin.getY());
412 v.emplace_back(rRectangle.toString().getStr());
417 sRectangle +=
":: " + sRefPoint;
422 OString aPayload = aStart.
toString();
424 aPayload +=
":: " + sRefPoint;
433 aPayload +=
":: " + sRefPoint;
487 bool bClipRegion =
rTarget.IsClipRegion();
490 std::optional<tools::PolyPolygon> pPolyPoly;
507 rTarget.IntersectClipRegion( aTmpOutArea );
526 bool bStartHandleVisible =
false;
527 bool bEndHandleVisible =
false;
531 auto DrawHighlight = [&, nStartLine = sal_Int32(0), nEndLine = sal_Int32(0)](
535 if (rInfo.nPortion < nStartPara)
537 if (rInfo.nPortion > nEndPara)
539 DBG_ASSERT(!rInfo.rPortion.IsInvalid(),
"Portion in Selection not formatted!");
540 if (rInfo.rPortion.IsInvalid())
543 if (rInfo.nPortion == nStartPara)
544 nStartLine = rInfo.rPortion.GetLines().FindLine(aTmpSel.
Min().
GetIndex(),
false);
548 if (rInfo.nPortion == nEndPara)
549 nEndLine = rInfo.rPortion.GetLines().FindLine(aTmpSel.
Max().
GetIndex(),
true);
551 nEndLine = rInfo.rPortion.GetLines().Count() - 1;
555 if (rInfo.nLine < nStartLine)
557 if (rInfo.nLine > nEndLine)
560 bool bPartOfLine =
false;
561 sal_Int32 nStartIndex = rInfo.pLine->GetStart();
562 sal_Int32 nEndIndex = rInfo.pLine->GetEnd();
563 if ((rInfo.nPortion == nStartPara) && (rInfo.nLine == nStartLine)
569 if ((rInfo.nPortion == nEndPara) && (rInfo.nLine == nEndLine)
577 if (nEndIndex < nStartIndex)
578 nEndIndex = nStartIndex;
592 if ((rInfo.nPortion == nStartPara) && (rInfo.nLine == nStartLine))
593 bStartHandleVisible =
true;
594 if ((rInfo.nPortion == nEndPara) && (rInfo.nLine == nEndLine))
595 bEndHandleVisible =
true;
600 Range aLineXPosStartEnd
606 pPolyPoly ? &*pPolyPoly :
nullptr, bLOKCalcRTL);
610 sal_Int32 nTmpStartIndex = nStartIndex;
611 sal_Int32 nWritingDirStart, nTmpEndIndex;
613 while (nTmpStartIndex < nEndIndex)
616 &nWritingDirStart, &nTmpEndIndex);
617 if (nTmpEndIndex > nEndIndex)
618 nTmpEndIndex = nEndIndex;
620 DBG_ASSERT(nTmpEndIndex > nTmpStartIndex,
"DrawSelectionXOR, Start >= End?");
627 aTmpRect.
SetLeft(std::min(nX1, nX2));
628 aTmpRect.
SetRight(std::max(nX1, nX2));
632 pPolyPoly ? &*pPolyPoly :
nullptr, bLOKCalcRTL);
633 nTmpStartIndex = nTmpEndIndex;
656 rTarget.SetClipRegion(aOldRegion);
671 if ( rDocPosTopLeft.
X() == rDocPosBottomRight.
X() )
681 aSelRect.
Move(-aRefPointLogical.
X(), -aRefPointLogical.
Y());
686 aSelRect.
SetLeft(nMirrorW - nRight);
687 aSelRect.
SetRight(nMirrorW - nLeft);
693 aTmpPoly[0] = aSelRect.
TopLeft();
697 pPolyPoly->
Insert(aTmpPoly);
701 bool bPixelMode =
rTarget.GetMapMode().GetMapUnit() == MapUnit::MapPixel;
725 pPolyPoly->
Insert( aTmpPoly );
740 rTarget.SetRasterOp(RasterOp::Invert);
849 return pCallbacks->EditViewOutputDevice();
857 weld::Widget* pParent = pCallbacks->EditViewPopupParent();
895 pCallbacks->EditViewInvalidate(
mbNegativeX ? lcl_negateRectX(rRect) : rRect);
1101boost::property_tree::ptree getHyperlinkPropTree(
const OUString& sText,
const OUString& sLink)
1103 boost::property_tree::ptree aTree;
1104 aTree.put(
"text", sText);
1105 aTree.put(
"link", sLink);
1133 if ( aTmpRect.
Top() != aEditCursor.
Top() )
1141 if ( aEditCursor.
GetHeight() > nMaxHeight )
1143 aEditCursor.
SetBottom( aEditCursor.
Top() + nMaxHeight - 1 );
1153 sal_Int32 nTextPortionStart = 0;
1171 return ImplGetEditCursor(aPaM, nShowCursorFlags, nTextPortionStart, pParaPortion);
1200 sal_Int32 nTextPortionStart = 0;
1231 if ( aTmpVisArea.
GetWidth() > nMaxTextWidth )
1232 aTmpVisArea.
SetRight( aTmpVisArea.
Left() + nMaxTextWidth );
1236 nDocDiffY = aEditCursor.
Bottom() - aTmpVisArea.
Bottom();
1238 else if ( aEditCursor.
Top() < aTmpVisArea.
Top() )
1240 nDocDiffY = aEditCursor.
Top() - aTmpVisArea.
Top();
1243 if ( aEditCursor.
Right() > aTmpVisArea.
Right() )
1246 nDocDiffX = aEditCursor.
Right() - aTmpVisArea.
Right();
1255 nDocDiffX += (
n > 0 ?
n : -
n );
1258 else if ( aEditCursor.
Left() < aTmpVisArea.
Left() )
1261 nDocDiffX = aEditCursor.
Left() - aTmpVisArea.
Left();
1266 nDocDiffX -= aEditCursor.
Left();
1274 nDocDiffX = -aTmpVisArea.
Left();
1278 if ( nDocDiffX | nDocDiffY )
1287 Scroll( -nDiffX, -nDiffY );
1321 if ( !aCursorSz.
Width() )
1323 if ( !aCursorSz.
Height() )
1329 Size aOldSz( aCursorSz );
1344 boost::property_tree::ptree aMessageParams;
1356 aCursorRectPureLogical =
GetWindowPos(aCursorRectPureLogical);
1359 aCursorRectPureLogical.
Move(-aRefPointLogical.
X(), -aRefPointLogical.
Y());
1364 aCursorRectPureLogical.
SetLeft(nMirrorW - nRight);
1365 aCursorRectPureLogical.
SetRight(nMirrorW - nLeft);
1371 aMessageParams.put(
"relrect", aCursorRectPureLogical.
toString());
1372 aMessageParams.put(
"refpoint", aRefPoint.
toString());
1380 Point aOffsetPx =
pOutWin->GetOffsetPixelFrom(*pViewShellWindow);
1404 aMessageParams.put(
"rectangle", sRect);
1410 if (pOtherShell && pThisShell != pOtherShell)
1414 LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, aMessageParams);
1423 boost::property_tree::ptree aHyperlinkTree;
1427 if (
auto pUrlField =
dynamic_cast<const SvxURLField*
>(pFld->GetField()))
1428 aHyperlinkTree = getHyperlinkPropTree(pUrlField->GetRepresentation(), pUrlField->GetURL());
1438 if (
auto pUrlField =
dynamic_cast<const SvxURLField*
>( pField) )
1440 aHyperlinkTree = getHyperlinkPropTree(pUrlField->GetRepresentation(), pUrlField->GetURL());
1448 LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, aMessageParams);
1450 aMessageParams.put(
"mispelledWord", bIsWrong ? 1 : 0);
1451 aMessageParams.add_child(
"hyperlink", aHyperlinkTree);
1455 LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, aMessageParams);
1458 OString(aMessageParams.get<std::string>(
"rectangle")));
1468 nCursorDir = CursorDirection::RTL;
1470 nCursorDir = CursorDirection::LTR;
1475 if ( bForceVisCursor )
1481 InputContext aInputContext(std::move(aFont), InputContextFlags::Text | InputContextFlags::ExtText);
1483 pCallbacks->EditViewInputContext(aInputContext);
1485 xWindow->SetInputContext(aInputContext);
1503 pCallbacks->EditViewScrollStateChange();
1510 return Pair( 0, 0 );
1546 aNewVisArea.
Move( 0, nDiff );
1548 if ( aNewVisArea.
Top() < 0 )
1549 aNewVisArea.
Move( 0, -aNewVisArea.
Top() );
1573 aNewVisArea.
Move( nDiff, 0 );
1575 if ( aNewVisArea.
Left() < 0 )
1576 aNewVisArea.
Move( -aNewVisArea.
Left(), 0 );
1582 Size aDiffs( nDiffX, nDiffY );
1590 if ( nRealDiffX || nRealDiffY )
1614 pOutWin->Scroll( nRealDiffX, nRealDiffY, aRect, ScrollFlags::Clip );
1640 pCallbacks->EditViewScrollStateChange();
1648 return Pair( nRealDiffX, nRealDiffY );
1654 return pCallbacks->GetClipboard();
1656 return pWindow->GetClipboard();
1657 SAL_WARN(
"editeng",
"falling back to using GetSystemClipboard");
1666 if ( eFunc != KeyFuncType::DONTKNOW )
1670 case KeyFuncType::CUT:
1674 Reference<css::datatransfer::clipboard::XClipboard> aClipBoard(
GetClipboard());
1680 case KeyFuncType::COPY:
1682 Reference<css::datatransfer::clipboard::XClipboard> aClipBoard(
GetClipboard());
1687 case KeyFuncType::PASTE:
1692 Reference<css::datatransfer::clipboard::XClipboard> aClipBoard(
GetClipboard());
1721 Paste( aClipBoard );
1773 bool bIsWrong =
false;
1778 if ( bIsWrong && bMarkIfWrong )
1808 if ( !aWord.isEmpty() )
1812 xDic->add( aWord,
false, OUString() );
1814 sal_Int32 nNodes = rDoc.
Count();
1815 for ( sal_Int32
n = 0;
n < nNodes;
n++ )
1862 const sal_Int32 nXPos = aPaM.
GetIndex();
1863 for (
size_t nAttr = rAttrs.size(); nAttr; )
1902 if ( ( aDocPos.
Y() > ( nY + aBulletArea.
Top() ) ) &&
1903 ( aDocPos.
Y() < ( nY + aBulletArea.
Bottom() ) ) &&
1904 ( aDocPos.
X() > ( aBulletArea.
Left() ) ) &&
1905 ( aDocPos.
X() < ( aBulletArea.
Right() ) ) )
1916void ImpEditView::CutCopy( css::uno::Reference< css::datatransfer::clipboard::XClipboard >
const & rxClipboard,
bool bCut )
1928 rxClipboard->setContents( xData,
nullptr );
1931 uno::Reference< datatransfer::clipboard::XFlushableClipboard > xFlushableClipboard( rxClipboard, uno::UNO_QUERY );
1932 if( xFlushableClipboard.is() )
1933 xFlushableClipboard->flushClipboard();
1935 catch(
const css::uno::Exception& )
1949void ImpEditView::Paste( css::uno::Reference< css::datatransfer::clipboard::XClipboard >
const & rxClipboard,
bool bUseSpecial )
1951 if ( !rxClipboard.is() )
1954 uno::Reference< datatransfer::XTransferable > xDataObj;
1959 xDataObj = rxClipboard->getContents();
1961 catch(
const css::uno::Exception& )
1983 datatransfer::DataFlavor aFlavor;
1985 if ( xDataObj->isDataFlavorSupported( aFlavor ) )
1993 aText = aText.replaceAll( OUStringChar(
LINE_SEP),
" " );
2008 xDataObj, OUString(), aSel.
Min(),
2035 if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) )
2038 if ( nStartNode == nEndNode )
2040 if ( nCurNode == nStartNode )
2073 if (pParent && pParent->GetLOKWindowId())
2076 std::vector<vcl::LOKPayloadItem> aItems;
2077 aItems.emplace_back(
"rectangles",
"");
2078 pNotifier->
notifyWindow(pParent->GetLOKWindowId(),
"text_selection", aItems);
2106 Point aMousePos( rPointPixel );
2132 aNewEditSelection.
Max() = aPaM;
2135 if ( aNewEditSelection.
Min() != aPaM )
2137 aNewEditSelection.
Min() = aPaM;
2197 bool bDone =
pDragAndDropInfo->pBackground->SetOutputSizePixel( aNewSzPx );
2198 DBG_ASSERT( bDone,
"Virtual Device broken?" );
2224 Point aMousePosPixel( rDGE.DragOriginX, rDGE.DragOriginY );
2290 sal_Int8 nActions =
bReadOnly ? datatransfer::dnd::DNDConstants::ACTION_COPY : datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE;
2292 rDGE.DragSource->startDrag( rDGE, nActions, 0 , 0 , xData,
mxDnDListener );
2307 if ( !
bReadOnly && rDSDE.DropSuccess && !
pDragAndDropInfo->bOutlinerMode && ( rDSDE.DropAction & datatransfer::dnd::DNDConstants::ACTION_MOVE ) )
2318 if ( bBeforeSelection )
2327 sal_uInt16 nMoreChars;
2336 aToBeDelSel.
nEndPos + nMoreChars;
2349 sal_uInt16 nLessChars;
2364 if ( !bBeforeSelection )
2399 bool bChanges =
false;
2416 uno::Reference< datatransfer::XTransferable > xDataObj = rDTDE.Transferable;
2417 if ( xDataObj.is() )
2450 rDTDE.Context->acceptDrop( rDTDE.DropAction );
2458 rDTDE.Context->dropComplete( bChanges );
2472 datatransfer::DataFlavor aTextFlavor;
2474 const css::datatransfer::DataFlavor* pFlavors = rDTDEE.SupportedDataFlavors.getConstArray();
2475 int nFlavors = rDTDEE.SupportedDataFlavors.getLength();
2476 for (
int n = 0;
n < nFlavors;
n++ )
2506 Point aMousePos( rDTDE.LocationX, rDTDE.LocationY );
2509 bool bAccept =
false;
2551 if ( nRel < ( pPPortion->
GetHeight() / 2 ) )
2574 if ( !(aDestSel < aCurSel) && !(aDestSel > aCurSel) )
2595 Point aStartPos( 0, nDDYPos );
2624 aEditCursor.
SetPos( aTopLeft );
2631 if ( bCursorChanged )
2637 rDTDE.Context->acceptDrag( rDTDE.DropAction );
2647 rDTDE.Context->rejectDrag();
2656 css::uno::Reference<css::datatransfer::dnd::XDropTarget> xDropTarget;
2658 xDropTarget = pCallbacks->GetDropTarget();
2660 xDropTarget = xWindow->GetDropTarget();
2662 if (!xDropTarget.is())
2667 css::uno::Reference<css::datatransfer::dnd::XDragGestureRecognizer> xDragGestureRecognizer(xDropTarget, uno::UNO_QUERY);
2668 if (xDragGestureRecognizer.is())
2670 uno::Reference<datatransfer::dnd::XDragGestureListener> xDGL(
mxDnDListener, uno::UNO_QUERY);
2671 xDragGestureRecognizer->addDragGestureListener(xDGL);
2674 uno::Reference<datatransfer::dnd::XDropTargetListener> xDTL(
mxDnDListener, uno::UNO_QUERY);
2675 xDropTarget->addDropTargetListener(xDTL);
2676 xDropTarget->setActive(
true);
2677 xDropTarget->setDefaultActions(datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE);
2687 css::uno::Reference<css::datatransfer::dnd::XDropTarget> xDropTarget;
2689 xDropTarget = pCallbacks->GetDropTarget();
2691 xDropTarget = xWindow->GetDropTarget();
2693 if (xDropTarget.is())
2695 css::uno::Reference<css::datatransfer::dnd::XDragGestureRecognizer> xDragGestureRecognizer(xDropTarget, uno::UNO_QUERY);
2696 if (xDragGestureRecognizer.is())
2698 uno::Reference<datatransfer::dnd::XDragGestureListener> xDGL(
mxDnDListener, uno::UNO_QUERY);
2699 xDragGestureRecognizer->removeDragGestureListener(xDGL);
2702 uno::Reference<datatransfer::dnd::XDropTargetListener> xDTL(
mxDnDListener, uno::UNO_QUERY);
2703 xDropTarget->removeDropTargetListener(xDTL);
2717 const Point& rVisDocStartPos)
const MouseSettings & GetMouseSettings() const
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
AttribsType & GetAttribs()
std::vector< std::unique_ptr< EditCharAttrib > > AttribsType
CharAttribList & GetCharAttribs()
WrongList * GetWrongList()
const SfxPoolItem * GetItem() const
EditPaM GetEndPaM() const
sal_Int32 GetPos(const ContentNode *pNode) const
const ContentNode * GetObject(sal_Int32 nPos) const
EditPaM GetStartPaM() const
EDITENG_DLLPRIVATE tools::Long GetXPos(const ParaPortion *pParaPortion, const EditLine *pLine, sal_Int32 nIndex, bool bPreferPortionStart=false) const
EDITENG_DLLPRIVATE InternalEditStatus & GetInternalEditStatus()
EditPaM CursorRight(const EditPaM &rPaM, sal_uInt16 nCharacterIteratorMode=css::i18n::CharacterIteratorMode::SKIPCELL)
EditPaM DeleteSelection(const EditSelection &rSel)
EDITENG_DLLPRIVATE const EditSelectionEngine & GetSelectionEngine() const
EDITENG_DLLPRIVATE void HandleEndPasteOrDrop(PasteOrDropInfos &rInfos)
EDITENG_DLLPRIVATE css::uno::Reference< css::datatransfer::XTransferable > CreateTransferable(const EditSelection &rSelection)
EDITENG_DLLPRIVATE void SetInSelectionMode(bool b)
void SeekCursor(ContentNode *pNode, sal_Int32 nPos, SvxFont &rFont)
bool IsEffectivelyVertical() const
virtual tools::Rectangle GetBulletArea(sal_Int32 nPara)
EditSelection InsertText(css::uno::Reference< css::datatransfer::XTransferable > const &rxDataObj, const OUString &rBaseURL, const EditPaM &rPaM, bool bUseSpecial)
EDITENG_DLLPRIVATE bool IsIdleFormatterActive() const
Link< EditView *, void > const & GetEndDropHdl() const
bool IsRightToLeft(sal_Int32 nPara) const
const SfxPoolItem & GetParaAttrib(sal_Int32 nPara, sal_uInt16 nWhich) const
EDITENG_DLLPRIVATE void HandleBeginPasteOrDrop(PasteOrDropInfos &rInfos)
Link< EditView *, void > const & GetBeginDropHdl() const
EDITENG_DLLPRIVATE void CheckIdleFormatter()
EDITENG_DLLPRIVATE void CursorMoved(const ContentNode *pPrevNode)
ParaPortionList & GetParaPortions()
EDITENG_DLLPRIVATE bool PostKeyEvent(const KeyEvent &rKeyEvent, EditView *pView, vcl::Window const *pFrameWin)
EDITENG_DLLPRIVATE EditPaM GetPaM(const Point &aDocPos, bool bSmart=true)
std::unique_ptr< ImpEditEngine > pImpEditEngine
EDITENG_DLLPRIVATE bool HasText() const
EDITENG_DLLPRIVATE EditSelection SelectWord(const EditSelection &rCurSelection, sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES)
static bool HasValidData(const css::uno::Reference< css::datatransfer::XTransferable > &rTransferable)
Point GetDocPosTopLeft(sal_Int32 nParagraph)
EDITENG_DLLPRIVATE Range GetLineXPosStartEnd(const ParaPortion *pParaPortion, const EditLine *pLine) const
void SetIndex(sal_Int32 n)
void SetNode(ContentNode *p)
const ContentNode * GetNode() const
sal_Int32 GetIndex() const
bool DbgIsBuggy(EditDoc const &rDoc) const
void Adjust(const EditDoc &rNodes)
EditStatusFlags GetStatusWord() const
void MoveParagraphs(Range aParagraphs, sal_Int32 nNewPos)
const SvxFieldItem * GetFieldAtSelection() const
void SetBackgroundColor(const Color &rColor)
bool DoInvalidateMore() const
void CutCopy(css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &rxClipboard, bool bCut)
void AddDragAndDropListeners()
bool IsTopToBottom() const
vcl::Cursor * GetCursor()
sal_uInt16 nCursorBidiLevel
void RegisterOtherShell(OutlinerViewShell *pViewShell)
Informs this edit view about which other shell listens to it.
void ShowDDCursor(const tools::Rectangle &rRect)
ImpEditView(EditView *pView, EditEngine *pEng, vcl::Window *pWindow)
bool IsBulletArea(const Point &rPos, sal_Int32 *pPara)
std::optional< Color > mxBackgroundColor
EditViewCallbacks * getEditViewCallbacks() const
const tools::Rectangle & GetLOKSpecialOutputArea() const
tools::Rectangle ImplGetEditCursor(EditPaM &aPaM, GetCursorFlags nShowCursorFlags, sal_Int32 &nTextPortionStart, const ParaPortion *pParaPortion) const
bool mbBroadcastLOKViewCursor
vcl::Window * GetWindow() const
void SetLOKSpecialFlags(LOKSpecialFlags eFlags)
void Paste(css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &rxClipboard, bool bUseSpecial=false)
OUString SpellIgnoreWord()
const tools::Rectangle & GetOutputArea() const
void SetOutputArea(const tools::Rectangle &rRect)
bool DoAutoScroll() const
void InvalidateAtWindow(const tools::Rectangle &rRect)
bool MouseMove(const MouseEvent &rMouseEvent)
void dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent &dtdee) override
bool mbSuppressLOKMessages
void drop(const css::datatransfer::dnd::DropTargetDropEvent &dtde) override
void GetSelectionRectangles(EditSelection aTmpSel, std::vector< tools::Rectangle > &rLogicRects)
EESelectionMode eSelectionMode
void dragGestureRecognized(const css::datatransfer::dnd::DragGestureEvent &dge) override
void dragExit(const css::datatransfer::dnd::DropTargetEvent &dte) override
EditSelection aEditSelection
tools::Rectangle GetVisDocArea() const
const SvxFieldItem * GetField(const Point &rPos, sal_Int32 *pPara, sal_Int32 *pPos) const
bool MouseButtonUp(const MouseEvent &rMouseEvent)
tools::Rectangle GetEditCursor() const
bool DoAutoHeight() const
bool MouseButtonDown(const MouseEvent &rMouseEvent)
bool HasLOKSpecialPositioning() const
sal_uInt16 GetCursorBidiLevel() const
tools::Long GetVisDocTop() const
void dragOver(const css::datatransfer::dnd::DropTargetDragEvent &dtde) override
void SetSelectionMode(EESelectionMode eMode)
bool HasSelection() const
void lokSelectionCallback(const std::optional< tools::PolyPolygon > &pPolyPoly, bool bStartHandleVisible, bool bEndHandleVisible)
void SetInsertMode(bool bInsert)
css::uno::Reference< css::datatransfer::dnd::XDragSourceListener > mxDnDListener
std::unique_ptr< DragAndDropInfo > pDragAndDropInfo
EditView * GetEditViewPtr()
virtual ~ImpEditView() override
const OutlinerViewShell * GetViewShell() const
void SetAnchorMode(EEAnchorMode eMode)
bool IsInsertMode() const
tools::Long GetVisDocRight() const
void dragDropEnd(const css::datatransfer::dnd::DragSourceDropEvent &dsde) override
const EditSelection & GetEditSelection() const
tools::Rectangle aOutArea
tools::Long GetVisDocBottom() const
std::unique_ptr< LOKSpecialPositioning > mpLOKSpecialPositioning
void SetLOKSpecialVisArea(const tools::Rectangle &rVisArea)
sal_uInt16 GetScrollDiffX() const
VclPtr< vcl::Window > pOutWin
void RegisterViewShell(OutlinerViewShell *pViewShell)
Informs this edit view about which view shell contains it.
void SetScrollDiffX(sal_uInt16 n)
tools::Long GetVisDocLeft() const
std::unique_ptr< vcl::Cursor, o3tl::default_delete< vcl::Cursor > > pCursor
OutlinerViewShell * mpViewShell
Containing view shell, if any.
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard() const
bool IsInSelection(const EditPaM &rPaM)
bool IsWrongSpelledWord(const EditPaM &rPaM, bool bMarkIfWrong)
bool PostKeyEvent(const KeyEvent &rKeyEvent, vcl::Window const *pFrameWin)
void ShowCursor(bool bGotoCursor, bool bForceVisCursor)
Point GetWindowPos(const Point &rDocPos) const
bool SetCursorAtPoint(const Point &rPointPixel)
Point GetDocPos(const Point &rWindowPos) const
OutlinerViewShell * mpOtherShell
Another shell, just listening to our state, if any.
void ImplDrawHighlightRect(OutputDevice &rTarget, const Point &rDocPosTopLeft, const Point &rDocPosBottomRight, tools::PolyPolygon *pPolyPoly, bool bLOKCalcRTL)
bool IsSelectionAtPoint(const Point &rPosPixel)
bool IsPasteEnabled() const
bool Command(const CommandEvent &rCEvt)
OutputDevice & GetOutputDevice() const
void SetLOKSpecialOutputArea(const tools::Rectangle &rOutputArea)
const Color & GetBackgroundColor() const
void InitLOKSpecialPositioning(MapUnit eUnit, const tools::Rectangle &rOutputArea, const Point &rVisDocStartPos)
void SetEditSelection(const EditSelection &rEditSelection)
GetCursorFlags nExtraCursorFlags
bool bActiveDragAndDropListener
weld::Widget * GetPopupParent(tools::Rectangle &rRect) const
bool DoSingleLinePaste() const
void RemoveDragAndDropListeners()
void ResetOutputArea(const tools::Rectangle &rRect)
Pair Scroll(tools::Long ndX, tools::Long ndY, ScrollRangeCheck nRangeCheck=ScrollRangeCheck::NoNegative)
tools::Rectangle GetLOKSpecialVisArea() const
bool AllowPasteSpecial() const
const vcl::KeyCode & GetKeyCode() const
This is meant just for Calc, where all positions in logical units (twips for LOK) are computed by doi...
tools::Rectangle maOutArea
void SetOutputArea(const tools::Rectangle &rOutputArea)
LOKSpecialPositioning(const ImpEditView &rImpEditView, MapUnit eUnit, const tools::Rectangle &rOutputArea, const Point &rVisDocStartPos)
bool IsTopToBottom() const
const ImpEditView & mrImpEditView
tools::Long GetVisDocBottom() const
tools::Long GetVisDocRight() const
Point GetRefPoint() const
tools::Rectangle GetVisDocArea() const
Point GetWindowPos(const Point &rDocPos, MapUnit eDocPosUnit) const
tools::Long GetVisDocTop() const
const tools::Rectangle & GetOutputArea() const
void ReInit(MapUnit eUnit, const tools::Rectangle &rOutputArea, const Point &rVisDocStartPos)
tools::Long GetVisDocLeft() const
Point convertUnit(const Point &rPos, MapUnit ePosUnit) const
void SetVisDocStartPos(const Point &rVisDocStartPos)
static css::uno::Reference< css::linguistic2::XDictionary > GetIgnoreAllList()
void SetOrigin(const Point &rOrigin)
void SetScaleY(const Fraction &rScaleY)
const Fraction & GetScaleX() const
MapUnit GetMapUnit() const
void SetMapUnit(MapUnit eUnit)
const Point & GetOrigin() const
const Fraction & GetScaleY() const
void SetScaleX(const Fraction &rScaleX)
const Point & GetPosPixel() const
MouseMiddleButtonAction GetMiddleButtonAction() const
Interface class to not depend on SfxViewShell in editeng.
virtual vcl::Window * GetEditWindowForActiveOLEObj() const =0
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const =0
virtual void NotifyOtherViews(int nType, const OString &rKey, const OString &rPayload)=0
Wrapper around SfxLokHelper::notifyOtherViews().
virtual void NotifyOtherView(OutlinerViewShell *pOtherShell, int nType, const OString &rKey, const OString &rPayload)=0
Wrapper around SfxLokHelper::notifyOtherView().
void EnableMapMode(bool bEnable=true)
tools::Long GetOutOffYPixel() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void DrawRect(const tools::Rectangle &rRect)
const Wallpaper & GetBackground() const
void Invert(const tools::Rectangle &rRect, InvertFlags nFlags=InvertFlags::NONE)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
const MapMode & GetMapMode() const
tools::Long GetOutOffXPixel() const
const AllSettings & GetSettings() const
bool IsMapModeEnabled() const
const Color & GetFillColor() const
tools::Long GetYOffset(const ParaPortion *pPPortion) const
const ParaPortion * SafeGetObject(sal_Int32 nPos) const
TextPortionList & GetTextPortions()
tools::Long GetHeight() const
sal_Int32 GetFirstLineOffset() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void Move(tools::Long nHorzMove, tools::Long nVertMove)
TOOLS_DLLPUBLIC rtl::OString toString() const
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
sal_Int16 GetValue() const
static void notifyOtherView(const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, std::string_view rKey, const OString &rPayload)
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
static bool GetFormatDataFlavor(SotClipboardFormatId nFormat, css::datatransfer::DataFlavor &rFlavor)
sal_Int32 GetCursorSize() const
This item stores a field (SvxFieldData).
const SvxFieldData * GetField() const
sal_Int32 FindPortion(sal_Int32 nCharPos, sal_Int32 &rPortionStart, bool bPreferStartingPortion=false) const
PortionKind GetKind() const
bool IsRightToLeft() const
const Size & GetSize() const
static bool IsEqual(const css::datatransfer::DataFlavor &rInternalFlavor, const css::datatransfer::DataFlavor &rRequestFlavor)
static bool IsCursorAtURLField(const EditView &pEditView)
static VclPtr< reference_type > Create(Arg &&... arg)
const Color & GetColor() const
bool HasWrong(size_t nStart, size_t nEnd) const
const Point & GetPos() const
void SetPos(const Point &rNewPos)
void SetOrientation(Degree10 nOrientation=0_deg10)
void SetSize(const Size &rNewSize)
void SetDirection(CursorDirection nDirection=CursorDirection::NONE)
const Size & GetSize() const
virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString &rAction, const std::vector< LOKPayloadItem > &rPayload=std::vector< LOKPayloadItem >()) const=0
KeyFuncType GetFunction() const
void GetRegionRectangles(RectangleVector &rTarget) const
vcl::Window * GetParent() const
tools::Long GetOutOffXPixel() const
tools::Long GetOutOffYPixel() const
::OutputDevice const * GetOutDev() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
bool IsAncestorOf(const vcl::Window &rWindow) const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define DBG_ASSERT(sCon, aError)
ESelection aNewSelection(GetSelection())
#define EE_PARA_NOT_FOUND
@ EE_NOTIFY_TEXTVIEWSCROLLED
The view area of the EditEngine scrolled.
@ EE_NOTIFY_TEXTVIEWSELECTIONCHANGED
The selection and/or the cursor position has changed.
@ EE_NOTIFY_PROCESSNOTIFICATIONS
The EditEngine is in a valid state again. Process pending notifications.
@ EE_NOTIFY_TEXTVIEWSELECTIONCHANGED_ENDD_PARA
#define EDITUNDO_DRAGANDDROP
void SetFlags(EVControlBits &rBits, EVControlBits nMask, bool bOn)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SfxInt16Item > EE_PARA_OUTLLEVEL(EE_PARA_START+11)
static void lcl_translateTwips(const OutputDevice &rParent, OutputDevice &rChild)
Translate absolute <-> relative twips: LOK wants absolute coordinates as output and gives absolute co...
static void lcl_AlignToPixel(Point &rPoint, const OutputDevice &rOutDev, short nDiffX, short nDiffY)
#define TRAVEL_X_DONTKNOW
#define CURSOR_BIDILEVEL_DONTKNOW
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
bool isViewIdForVisCursorInvalidation()
OString join(std::string_view rSeparator, const std::vector< OString > &rSequence)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
css::uno::Reference< css::datatransfer::clipboard::XClipboard > VCL_DLLPUBLIC GetSystemClipboard()
css::uno::Reference< css::datatransfer::clipboard::XClipboard > VCL_DLLPUBLIC GetSystemPrimarySelection()
const tools::Long nScrollX
const tools::Long nScrollY