72 CommandEvent aDragEvent( rPosPixel, CommandEventId::StartDrag,
true );
83 bool bStart =
false, bDelSelect =
false;
108 bStart = bDelSelect =
true;
208 if ( aRect.IsInside(aPos) )
231 nUserOpt,
m_nDropFormat, nEventAction, SotClipboardFormatId::NONE,
240 else if (
SW_MOD()->m_pDragDrop )
242 SW_MOD()->m_pDragDrop->SetCleanUp(
false );
254 return SotExchangeDest::NONE;
268 if( aRect.IsInside( aPos ) )
269 return SotExchangeDest::NONE;
287 if ( bLink && bIMap )
288 nDropDestination = SotExchangeDest::DOC_LNKD_GRAPH_W_IMAP;
290 nDropDestination = SotExchangeDest::DOC_LNKD_GRAPHOBJ;
292 nDropDestination = SotExchangeDest::DOC_GRAPH_W_IMAP;
294 nDropDestination = SotExchangeDest::DOC_GRAPHOBJ;
299 nDropDestination = SotExchangeDest::DOC_TEXTFRAME_WEB;
301 nDropDestination = SotExchangeDest::DOC_TEXTFRAME;
303 case OBJCNT_OLE: nDropDestination = SotExchangeDest::DOC_OLEOBJ;
break;
305 case OBJCNT_SIMPLE: nDropDestination = SotExchangeDest::DOC_DRAWOBJ;
break;
306 case OBJCNT_URLBUTTON: nDropDestination = SotExchangeDest::DOC_URLBUTTON;
break;
307 case OBJCNT_GROUPOBJ: nDropDestination = SotExchangeDest::DOC_GROUPOBJ;
break;
309 default: OSL_ENSURE(
false,
"new ObjectType?" );
312 if ( !
bool(nDropDestination) )
315 nDropDestination = SotExchangeDest::SWDOC_FREE_AREA_WEB;
317 nDropDestination = SotExchangeDest::SWDOC_FREE_AREA;
321 return nDropDestination;
342 const int nMargin = 10;
348 static sal_uInt64 last_tick = 0;
350 if((current_tick-last_tick) > 500) {
351 last_tick = current_tick;
358 if(aPixPt.X() > aWin.
Right()) aPixPt.AdjustX(nMargin );
359 if(aPixPt.X() < aWin.
Left()) aPixPt.AdjustX( -nMargin );
360 if(aPixPt.Y() > aWin.
Bottom()) aPixPt.AdjustY(nMargin );
361 if(aPixPt.Y() < aWin.
Top()) aPixPt.AdjustY( -nMargin );
396 bool bCleanup =
false;
434 if( (SotClipboardFormatId::SBA_FIELDDATAEXCHANGE ==
m_nDropFormat &&
436 SotClipboardFormatId::SBA_CTRLDATAEXCHANGE ==
m_nDropFormat )
445 nUserOpt =
static_cast<sal_Int8>(nEventAction);
454 rSh.SwCursorShell::SetVisibleCursor( aDocPt );
483 m_aTimer.SetTimeout(240);
484 m_bMBPressed =
false;
488 if ( m_rView.GetViewFrame() )
SfxViewFrame * GetViewFrame() const
#define LINK(Instance, Class, Member)
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
bool isContentExtractionLocked() const
const Graphic * GetGrfAtPos(const Point &rDocPos, OUString &rName, bool &rbLink) const
Deliver graphic in rName besides graphic name.
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
const SwView & GetView() const
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)
tools::Rectangle const & GetOutputArea() const
bool IsDesignMode() const
SdrObject * m_pUserMarkerObj
bool IsInsideSelectedObj(const Point &rPt)
returns enum values
Of course Writer needs its own rectangles.
std::unique_ptr< SdrDropMarkerOverlay > m_pUserMarker
SwWrtShell & GetWrtShell() const
static tools::Long m_nDDStartPosY
SotExchangeDest GetDropDestination(const Point &rPixPnt, SdrObject **ppObj=nullptr)
#define EXCHG_IN_ACTION_DEFAULT
Used by the UI to modify the document model.
std::unique_ptr< SwAnchorMarker > m_pAnchorMarker
const SwView & GetView() const
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
virtual void SelectShell()
#define EXCHG_INOUT_ACTION_NONE
const DataFlavorExVector & GetDataFlavorExVector() const
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)
std::unique_ptr< SwApplyTemplate > m_pApplyTempl
void MakeVisible(const SwRect &)
constexpr OUStringLiteral aData
IMPL_LINK_NOARG(SwEditWin, DDHandler, Timer *, void)
SotClipboardFormatId m_nDropFormat
bool IsOverReadOnlyPos(const Point &rPt) const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
bool IsSelContainsControl() const
check whether selected frame contains a control; companion method to GetSelFrameType, used for preventing drag&drop of controls into header
SfxBindings & GetBindings()
void CleanupDropUserMarker()
SotExchangeDest m_nDropDestination
virtual void Start() override
const OutlinerView * GetTextEditOutlinerView() const
Size GetOutputSizePixel() const
void SetTimeout(sal_uInt64 nTimeoutMs)
static tools::Long m_nDDStartPosX
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
SwDocShell * GetDocShell()
tools::Long CallSetCursor(const Point *pPt, bool bProp)
Point PixelToLogic(const Point &rDevicePt) const
bool DocPtInsideInputField(const Point &rDocPt) const
const SwFrameFormat * GetFormatFromObj(const Point &rPt, SwRect **pRectToFill=nullptr) const
bool TestCurrPam(const Point &rPt, bool bTstHit=false)
Search in the selected area for a Selection that covers the given point.
const SwViewOption * GetViewOptions() const
void SetIdle(bool b) const
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
vcl::Window * GetWindow() const
void SetInvokeHandler(const Link< Timer *, void > &rLink)
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)...
void StopDDTimer(SwWrtShell *, const Point &)
void UnSetVisibleCursor()
#define EXCHG_IN_ACTION_LINK
virtual SfxObjectShell * GetObjectShell() override
void InvalidateAll(bool bWithMsg)
virtual const tools::Rectangle & GetLogicRect() const
SwTransferable * m_pDragDrop
void SelectShellForDrop()
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
static ObjCntType GetObjCntType(const SdrObject &rObj)
bool IsDrawAction() const
void StartAllAction()
For all views of this document.
bool IsDrawCreate() const
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
virtual void StartDrag(sal_Int8 nAction, const Point &rPosPixel) override
void UnlockPaint(bool bVirDev=false)
bool IsSelFrameMode() const
FrameTypeFlags GetSelFrameType() const