27#include <osl/diagnose.h>
73 CommandEvent aDragEvent( rPosPixel, CommandEventId::StartDrag,
true );
84 bool bStart =
false, bDelSelect =
false;
110 bStart = bDelSelect =
true;
240 GetDataFlavorExVector(),
243 nUserOpt,
m_nDropFormat, nEventAction, SotClipboardFormatId::NONE,
252 else if (
SW_MOD()->m_pDragDrop )
254 SW_MOD()->m_pDragDrop->SetCleanUp(
false );
266 return SotExchangeDest::NONE;
281 return SotExchangeDest::NONE;
299 if ( bLink && bIMap )
300 nDropDestination = SotExchangeDest::DOC_LNKD_GRAPH_W_IMAP;
302 nDropDestination = SotExchangeDest::DOC_LNKD_GRAPHOBJ;
304 nDropDestination = SotExchangeDest::DOC_GRAPH_W_IMAP;
306 nDropDestination = SotExchangeDest::DOC_GRAPHOBJ;
311 nDropDestination = SotExchangeDest::DOC_TEXTFRAME_WEB;
313 nDropDestination = SotExchangeDest::DOC_TEXTFRAME;
315 case OBJCNT_OLE: nDropDestination = SotExchangeDest::DOC_OLEOBJ;
break;
317 case OBJCNT_SIMPLE: nDropDestination = SotExchangeDest::DOC_DRAWOBJ;
break;
318 case OBJCNT_URLBUTTON: nDropDestination = SotExchangeDest::DOC_URLBUTTON;
break;
319 case OBJCNT_GROUPOBJ: nDropDestination = SotExchangeDest::DOC_GROUPOBJ;
break;
321 default: OSL_ENSURE(
false,
"new ObjectType?" );
324 if ( nDropDestination == SotExchangeDest::NONE )
327 nDropDestination = SotExchangeDest::SWDOC_FREE_AREA_WEB;
329 nDropDestination = SotExchangeDest::SWDOC_FREE_AREA;
333 return nDropDestination;
354 const int nMargin = 10;
360 static sal_uInt64 last_tick = 0;
362 if((current_tick-last_tick) > 500) {
363 last_tick = current_tick;
370 if(aPixPt.X() > aWin.
Right()) aPixPt.AdjustX(nMargin );
371 if(aPixPt.X() < aWin.
Left()) aPixPt.AdjustX( -nMargin );
372 if(aPixPt.Y() > aWin.
Bottom()) aPixPt.AdjustY(nMargin );
373 if(aPixPt.Y() < aWin.
Top()) aPixPt.AdjustY( -nMargin );
395 GetDataFlavorExVector(),
408 bool bCleanup =
false;
446 if( (SotClipboardFormatId::SBA_FIELDDATAEXCHANGE ==
m_nDropFormat &&
448 SotClipboardFormatId::SBA_CTRLDATAEXCHANGE ==
m_nDropFormat )
457 nUserOpt =
static_cast<sal_Int8>(nEventAction);
466 rSh.SwCursorShell::SetVisibleCursor( aDocPt );
495 m_aTimer.SetTimeout(240);
496 m_bMBPressed =
false;
vcl::Window * GetWindow() const
tools::Rectangle const & GetOutputArea() const
bool IsDesignMode() const
const OutlinerView * GetTextEditOutlinerView() const
virtual const tools::Rectangle & GetLogicRect() const
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
void InvalidateAll(bool bWithMsg)
bool isContentExtractionLocked() const
SfxBindings & GetBindings()
SfxViewFrame & GetViewFrame() const
virtual SfxObjectShell * GetObjectShell() override
static sal_uInt8 GetExchangeAction(const DataFlavorExVector &rDataFlavorExVector, SotExchangeDest nDestination, sal_uInt16 nSourceOptions, sal_uInt8 nUserAction, SotClipboardFormatId &rFormat, sal_uInt8 &rDefaultAction, SotClipboardFormatId nOnlyTestFormat=SotClipboardFormatId::NONE, const css::uno::Reference< css::datatransfer::XTransferable > *pxTransferable=nullptr, SotExchangeActionFlags *pActionFlags=nullptr)
bool IsOverReadOnlyPos(const Point &rPt) const
bool TestCurrPam(const Point &rPt, bool bTstHit=false)
Search in the selected area for a Selection that covers the given point.
bool DocPtInsideInputField(const Point &rDocPt) const
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
void UnSetVisibleCursor()
void StartAllAction()
For all views of this document.
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
virtual void StartDrag(sal_Int8 nAction, const Point &rPosPixel) override
static tools::Long s_nDDStartPosY
std::unique_ptr< SdrDropMarkerOverlay > m_pUserMarker
static tools::Long s_nDDStartPosX
SotClipboardFormatId m_nDropFormat
bool IsDrawAction() const
SotExchangeDest GetDropDestination(const Point &rPixPnt, SdrObject **ppObj=nullptr)
SotExchangeDest m_nDropDestination
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
void CleanupDropUserMarker()
const SwView & GetView() const
SdrObject * m_pUserMarkerObj
std::unique_ptr< SwAnchorMarker > m_pAnchorMarker
void StopDDTimer(SwWrtShell *, const Point &)
std::unique_ptr< SwApplyTemplate > m_pApplyTempl
const Graphic * GetGrfAtPos(const Point &rDocPos, OUString &rName, bool &rbLink) const
Deliver graphic in rName besides graphic name.
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
FrameTypeFlags GetSelFrameType() const
const SwFrameFormat * GetFormatFromObj(const Point &rPt, SwRect **pRectToFill=nullptr) const
bool IsSelContainsControl() const
check whether selected frame contains a control; companion method to GetSelFrameType,...
bool IsDrawCreate() const
static ObjCntType GetObjCntType(const SdrObject &rObj)
bool SelectObj(const Point &rSelPt, sal_uInt8 nFlag=0, SdrObject *pObj=nullptr)
If an object has been given, exactly this object is selected (instead of searching over position).
bool IsInsideSelectedObj(const Point &rPt)
returns enum values
SwTransferable * m_pDragDrop
Of course Writer needs its own rectangles.
static bool PasteData(TransferableDataHelper &rData, SwWrtShell &rSh, sal_uInt8 nAction, SotExchangeActionFlags nActionFlags, SotClipboardFormatId nFormat, SotExchangeDest nDestination, bool bIsPasteFormat, bool bIsDefault, const Point *pDDPos=nullptr, sal_Int8 nDropAction=0, bool bPasteSelection=false, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA, bool bIgnoreComments=false, SwPasteContext *pContext=nullptr, PasteTableType nPaste=PasteTableType::PASTE_DEFAULT)
void SetIdle(bool b) const
const SwViewOption * GetViewOptions() const
void UnlockPaint(bool bVirDev=false)
void MakeVisible(const SwRect &)
SwWrtShell & GetWrtShell() const
virtual void SelectShell()
void SelectShellForDrop()
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
bool IsSelFrameMode() const
tools::Long CallSetCursor(const Point *pPt, bool bProp)
const SwView & GetView() const
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
IMPL_LINK_NOARG(SwEditWin, DDHandler, Timer *, void)
#define EXCHG_IN_ACTION_LINK
#define EXCHG_INOUT_ACTION_NONE
#define EXCHG_IN_ACTION_DEFAULT
#define LINK(Instance, Class, Member)
constexpr OUStringLiteral aData
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent