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 );
264 return SotExchangeDest::NONE;
279 return SotExchangeDest::NONE;
297 if ( bLink && bIMap )
298 nDropDestination = SotExchangeDest::DOC_LNKD_GRAPH_W_IMAP;
300 nDropDestination = SotExchangeDest::DOC_LNKD_GRAPHOBJ;
302 nDropDestination = SotExchangeDest::DOC_GRAPH_W_IMAP;
304 nDropDestination = SotExchangeDest::DOC_GRAPHOBJ;
309 nDropDestination = SotExchangeDest::DOC_TEXTFRAME_WEB;
311 nDropDestination = SotExchangeDest::DOC_TEXTFRAME;
313 case OBJCNT_OLE: nDropDestination = SotExchangeDest::DOC_OLEOBJ;
break;
315 case OBJCNT_SIMPLE: nDropDestination = SotExchangeDest::DOC_DRAWOBJ;
break;
316 case OBJCNT_URLBUTTON: nDropDestination = SotExchangeDest::DOC_URLBUTTON;
break;
317 case OBJCNT_GROUPOBJ: nDropDestination = SotExchangeDest::DOC_GROUPOBJ;
break;
319 default: OSL_ENSURE(
false,
"new ObjectType?" );
322 if ( nDropDestination == SotExchangeDest::NONE )
325 nDropDestination = SotExchangeDest::SWDOC_FREE_AREA_WEB;
327 nDropDestination = SotExchangeDest::SWDOC_FREE_AREA;
331 return nDropDestination;
352 const int nMargin = 10;
358 static sal_uInt64 last_tick = 0;
360 if((current_tick-last_tick) > 500) {
361 last_tick = current_tick;
369 if(aPixPt.
X() < aWin.
Left()) aPixPt.
AdjustX( -nMargin );
371 if(aPixPt.
Y() < aWin.
Top()) aPixPt.
AdjustY( -nMargin );
393 GetDataFlavorExVector(),
406 bool bCleanup =
false;
444 if( (SotClipboardFormatId::SBA_FIELDDATAEXCHANGE ==
m_nDropFormat &&
446 SotClipboardFormatId::SBA_CTRLDATAEXCHANGE ==
m_nDropFormat )
455 nUserOpt =
static_cast<sal_Int8>(nEventAction);
464 rSh.SwCursorShell::SetVisibleCursor( aDocPt );
493 m_aTimer.SetTimeout(240);
494 m_bMBPressed =
false;
vcl::Window * GetWindow() const
tools::Rectangle const & GetOutputArea() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() 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 LockPaint(LockPaintReason eReason)
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