22#include <svx/svxids.hrc>
43#include <com/sun/star/embed/EmbedVerbs.hpp>
49#include <editeng/editeng.hxx>
65 mpDocSh( pDrDoc->GetDocSh() ),
67 nSlotId( rReq.GetSlot() ),
68 aScrollTimer(
"sd FuPoor aScrollTimer"),
69 aDragTimer(
"sd FuPoor aDragTimer"),
71 bNoScrollUntilInside (true),
72 aDelayToScrollTimer(
"sd FuPoor aDelayToScrollTimer"),
75 bFirstMouseMove (false),
134 if ( rRect.Contains(aPos) )
139 short dx = 0, dy = 0;
141 if ( aPos.
X() <= rRect.Left() ) dx = -1;
142 if ( aPos.
X() >= rRect.Right() ) dx = 1;
143 if ( aPos.
Y() <= rRect.Top() ) dy = -1;
144 if ( aPos.
Y() >= rRect.Bottom() ) dy = 1;
146 if ( dx != 0 || dy != 0 )
178 bool bReturn =
false;
189 SdPage* pActualPage = pDrawViewShell->GetActualPage();
196 while(aIter.
IsMore() && !pCandidate)
205 if(SdrInventor::Default == nInv &&
206 (SdrObjKind::TitleText == nKnd || SdrObjKind::OutlineText == nKnd || SdrObjKind::Text == nKnd))
208 pCandidate = pTextObj;
220 SID_ATTR_CHAR, SfxCallMode::ASYNCHRON);
226 SID_INSERTPAGE_QUICK, SfxCallMode::ASYNCHRON);
273 const_cast<SdrHdlList&
>(rHdlList).TravelFocusHdl(bForward);
305 pViewShell->SetZoomOnPage(
false);
320 pViewShell->SetZoomOnPage(
false);
333 Execute(SID_SIZE_PAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
345 Execute(SID_SIZE_OPTIMAL, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
383 pDrawViewShell->SwitchPage(0);
395 SdPage* pPage = pDrawViewShell->GetActualPage();
422 SdPage* pPage = pDrawViewShell->GetActualPage();
423 sal_uInt16 nSdPage = (pPage->
GetPageNum() - 1) / 2;
431 pDrawViewShell->GetPageTabControl();
432 if (rPageTabControl.IsReallyShown())
434 pDrawViewShell->SwitchPage(nSdPage - 1);
435 if (rPageTabControl.IsReallyShown())
442 if (pDrawViewShell->IsLayerModeActive())
468 sal_uInt16 nSdPage = (pPage->
GetPageNum() - 1) / 2;
470 if (nSdPage < mpDoc->GetSdPageCount(pPage->
GetPageKind()) - 1)
477 if (rPageTabControl.IsReallyShown())
480 if (rPageTabControl.IsReallyShown())
506 if(pHdl->
GetKind() == SdrHdlKind::Poly)
532 SdrHdl* pNewOne =
nullptr;
539 && pAct->
GetKind() == SdrHdlKind::Poly
549 const_cast<SdrHdlList&
>(rHdlList).SetFocusHdl(pNewOne);
600 bool bIsMoveOfConnectedHandle(
false);
601 bool bOldSuppress =
false;
612 bIsMoveOfConnectedHandle =
true;
619 bIsMoveOfConnectedHandle =
true;
631 if(bIsMoveOfConnectedHandle)
634 Size aHalfConSiz(nMarkHdSiz + 1, nMarkHdSiz + 1);
635 aHalfConSiz =
mpWindow->PixelToLogic(aHalfConSiz);
637 if(100 < aHalfConSiz.
Width())
638 nX *= aHalfConSiz.
Width();
642 if(100 < aHalfConSiz.
Height())
643 nY *= aHalfConSiz.
Height();
651 nX *= aLogicSizeOnePixel.
Width();
652 nY *= aLogicSizeOnePixel.
Height();
674 if(!rWorkArea.IsEmpty())
677 aMarkRect.
Move(nX, nY);
681 if(aMarkRect.
Left() < rWorkArea.Left())
683 nX += rWorkArea.Left() - aMarkRect.
Left();
686 if(aMarkRect.
Right() > rWorkArea.Right())
688 nX -= aMarkRect.
Right() - rWorkArea.Right();
691 if(aMarkRect.
Top() < rWorkArea.Top())
693 nY += rWorkArea.Top() - aMarkRect.
Top();
696 if(aMarkRect.
Bottom() > rWorkArea.Bottom())
698 nY -= aMarkRect.
Bottom() - rWorkArea.Bottom();
704 if(0 != nX || 0 != nY)
727 bool bWasNoSnap = rDragStat.
IsNoSnap();
741 const_cast<SdrDragStat&
>(rDragStat).SetNoSnap(bWasNoSnap);
801 SfxCallMode::ASYNCHRON,
823 while(aIter.
IsMore() && !pCandidate)
832 if(SdrInventor::Default == nInv && SdrObjKind::TitleText == nKnd)
834 pCandidate = pTextObj;
849 SfxCallMode::ASYNCHRON,
871 const_cast<SdrHdlList&
>(rHdlList).ResetFocusHdl();
920 nAction,
false, SotClipboardFormatId::STRING);
933 sal_uInt16 nHitLog = sal_uInt16 (
mpWindow->PixelToLogic(
Size(HITPIX,0)).
Width() );
936 if ( pHdl==
nullptr &&
mpView->IsMarkedHit(aMDPos, nHitLog)
937 && !
mpView->IsPresObjSelected(
false) )
940 bIsInDragMode =
true;
955 aDelayToScrollTimer.Stop ();
991 bool bReturn =
false;
1041 sal_Int32
nIndex = pDrawViewShell->GetActiveTabLayerIndex() + nOffset;
1046 else if (
nIndex >= pDrawViewShell->GetTabLayerCount ())
1047 nIndex = pDrawViewShell->GetTabLayerCount() - 1;
1050 if (
nIndex != pDrawViewShell->GetActiveTabLayerIndex ())
1054 if (pLayerTabControl !=
nullptr)
1057 pDrawViewShell->SetActiveTabLayerIndex (
nIndex);
1059 if (pLayerTabControl !=
nullptr)
1072 if (
dynamic_cast< const FuSelection *
>(
this ) ==
nullptr )
1085 bool bResizeKeepRatio =
false;
1093 bResizeKeepRatio = aObjIdentifier == SdrObjKind::Graphic ||
1094 aObjIdentifier == SdrObjKind::Media ||
1095 aObjIdentifier == SdrObjKind::OLE2;
1101 bResizeKeepRatio = bResizeKeepRatio && pHdl->
IsCornerHdl();
1106 SID_DRAW_CIRCLEARC ==
nSlotId ||
1108 SID_DRAW_SQUARE_NOFILL ==
nSlotId ||
1109 SID_DRAW_SQUARE_ROUND ==
nSlotId ||
1110 SID_DRAW_SQUARE_ROUND_NOFILL ==
nSlotId ||
1112 SID_DRAW_CIRCLE_NOFILL ==
nSlotId ||
1113 SID_DRAW_CIRCLEPIE ==
nSlotId ||
1114 SID_DRAW_CIRCLEPIE_NOFILL ==
nSlotId ||
1115 SID_DRAW_CIRCLECUT ==
nSlotId ||
1116 SID_DRAW_CIRCLECUT_NOFILL ==
nSlotId ||
1117 SID_DRAW_XPOLYGON ==
nSlotId ||
1118 SID_DRAW_XPOLYGON_NOFILL ==
nSlotId ||
1122 SID_3D_HALF_SPHERE ==
nSlotId ||
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr) override
virtual void MovAction(const Point &rPnt) override
static bool IsSimpleCharInput(const KeyEvent &rKeyEvent)
static bool RequestHelp(vcl::Window *pWin, SdrView const *pView, const HelpEvent &rEvt)
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetButtons() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
PageKind GetPageKind() const
bool EndDragObj(bool bCopy=false)
const tools::Rectangle & GetWorkArea() const
void SetSuppressDefaultConnect(bool bNew)
SdrObjConnection & GetConnection(bool bTail1)
bool GetSuppressDefaultConnect() const
bool IsMoveAllowed() const
void MoveAllMarked(const Size &rSiz, bool bCopy=false)
size_t GetHdlCount() const
SdrHdl * GetFocusHdl() const
SdrHdl * GetHdl(size_t nNum) const
SdrHdlKind GetKind() const
sal_uInt32 GetPolyNum() const
SdrObject * GetObj() const
const Point & GetPos() const
sal_uInt32 GetPointNum() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrHdl * PickHandle(const Point &rPnt) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
const SdrHdlList & GetHdlList() const
void UnMarkAll(SdrPageView const *pPV=nullptr)
SdrDragMode GetDragMode() const
sal_uInt16 GetMarkHdlSizePixel() const
const tools::Rectangle & GetMarkedObjRect() const
const tools::Rectangle & GetAllMarkedRect() const
bool UnmarkPoint(SdrHdl &rHdl)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
bool IsPointMarked(const SdrHdl &rHdl) const
SdrObject * GetMarkedSdrObj() const
SdrObject * GetObject() const
virtual bool IsTextEdit() const final override
virtual SdrInventor GetObjInventor() const
bool IsEmptyPresObj() const
virtual bool HasTextEdit() const
virtual SdrObjKind GetObjIdentifier() const
SdrPage * GetPage() const
sal_uInt16 GetPageNum() const
virtual void MakeVisible(const tools::Rectangle &rRect, vcl::Window &rWin)
const SdrDragStat & GetDragStat() const
SdrPageView * GetSdrPageView() const
bool IsSetPageOrg() const
void SetSnapEnabled(bool bOn)
bool IsSnapEnabled() const
bool IsDragHelpLine() const
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
SfxDispatcher * GetDispatcher()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable() const
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
bool IsLayerModeActive() const
virtual SdPage * GetActualPage() override
Base class for all functions.
virtual bool doConstructOrthogonal() const
Decide if the object to be created should be created orthogonal.
virtual bool Command(const CommandEvent &rCEvt)
Timer aScrollTimer
for auto-scrolling
virtual void DoCopy()
Copy object to clipboard.
FuPoor(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
void SwitchLayer(sal_Int32 nOffset)
Switch to another layer.
virtual bool MouseButtonDown(const MouseEvent &rMEvt)
virtual bool MouseMove(const MouseEvent &)
void StartDelayToScrollTimer()
virtual bool MouseButtonUp(const MouseEvent &rMEvt)
virtual bool RequestHelp(const HelpEvent &rHEvt)
virtual bool KeyInput(const KeyEvent &rKEvt)
handle keyboard events
void SetWindow(::sd::Window *pWin)
virtual void Activate()
activates the function
VclPtr< ::sd::Window > mpWindow
Point aMDPos
position of MouseButtonDown
static void ImpForceQuadratic(::tools::Rectangle &rRect)
virtual void DoCut()
Cut object to clipboard.
virtual void DoPasteUnformatted()
Paste unformatted text from clipboard.
bool bNoScrollUntilInside
Flag to prevent auto-scrolling until one drags from outside into the window.
void SetMouseButtonCode(sal_uInt16 nNew)
virtual void DoPaste()
Paste object from clipboard.
virtual ~FuPoor() override
virtual void SelectionHasChanged()
void ForceScroll(const Point &aPixPos)
scroll when approached the border of the window; is called by MouseMove
virtual void Deactivate()
deactivates the function
virtual void ReceiveRequest(SfxRequest &rReq)
Timer aDragTimer
for Drag&Drop
virtual rtl::Reference< SdrObject > CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle &rRectangle)
virtual bool cancel()
is called when the current function should be aborted.
virtual void DoExecute(SfxRequest &rReq)
Timer aDelayToScrollTimer
timer to delay scrolling (~ 1 sec) when dragging out of the window
void SendDeactivatePageEvent()
Inform all listeners of this control that the current layer has been deactivated.
void SendActivatePageEvent()
Inform all listeners of this control that the current layer has been activated.
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
void SendDeactivatePageEvent()
Inform all listeners of this control that the current page has been deactivated.
void SendActivatePageEvent()
Inform all listeners of this control that the current page has been activated.
Base class of the stacked shell hierarchy.
virtual void SetZoom(::tools::Long nZoom)
Set zoom factor for all split windows.
virtual bool ActivateObject(SdrOle2Obj *pObj, sal_Int32 nVerb)
const ::tools::Rectangle & GetAllWindowRect()
Return the rectangle that encloses all windows of the view.
void ScrollLines(::tools::Long nX, ::tools::Long nY)
Scroll a specific number of lines.
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
virtual void SetZoomRect(const ::tools::Rectangle &rZoomRect)
Set zoom rectangle for active window.
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
bool InsertData(const TransferableDataHelper &rDataHelper, const Point &rPos, sal_Int8 &rDnDAction, bool bDrag, SotClipboardFormatId nFormat=SotClipboardFormatId::NONE, sal_uInt16 nPage=SDRPAGE_NOTFOUND, SdrLayerID nLayer=SDRLAYER_NOTFOUND)
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false) override
void DoPaste(::sd::Window *pWindow=nullptr)
An SdWindow contains the actual working area of ViewShell.
bool IsPreviousPossible() const
bool IsNextPossible() const
::tools::Rectangle const & GetNextZoomRect()
::tools::Rectangle const & GetPreviousZoomRect()
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_ADD
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_COMMA
constexpr sal_uInt16 KEY_POINT
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SPACE
constexpr sal_uInt16 KEY_PAGEUP
constexpr sal_uInt16 KEY_SUBTRACT
constexpr sal_uInt16 KEY_DIVIDE
constexpr sal_uInt16 KEY_END
constexpr sal_uInt16 KEY_MULTIPLY
#define LINK(Instance, Class, Member)
IMPL_LINK_NOARG(MainSequence, onTimerHdl, Timer *, void)
#define SELENG_AUTOREPEAT_INTERVAL
#define SELENG_DRAGDROP_TIMEOUT
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
VclPtr< vcl::Window > mpWindow