LibreOffice Module sc (master)  1
fudraw.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <editeng/editeng.hxx>
21 #include <editeng/outlobj.hxx>
22 #include <svx/svdobj.hxx>
23 #include <svx/svdoole2.hxx>
24 #include <svx/svdouno.hxx>
25 #include <svx/ImageMapInfo.hxx>
26 #include <sfx2/dispatch.hxx>
27 #include <sfx2/viewfrm.hxx>
28 #include <sfx2/lokhelper.hxx>
29 
30 #include <sc.hrc>
31 #include <fudraw.hxx>
32 #include <futext.hxx>
33 #include <tabvwsh.hxx>
34 #include <drwlayer.hxx>
35 #include <userdat.hxx>
36 #include <docsh.hxx>
37 #include <drawview.hxx>
38 #include <comphelper/lok.hxx>
39 
40 // base class for draw module specific functions
42  SdrModel* pDoc, const SfxRequest& rReq)
43  : FuPoor(rViewSh, pWin, pViewP, pDoc, rReq)
44  , aNewPointer(PointerStyle::Arrow)
45  , aOldPointer(PointerStyle::Arrow)
46 {
47 }
48 
50 {
51 }
52 
53 void FuDraw::DoModifiers(const MouseEvent& rMEvt)
54 {
55  // Shift = Ortho and AngleSnap
56  // Control = Snap (Toggle)
57  // Alt = centric
58 
59  bool bShift = rMEvt.IsShift();
60  bool bAlt = rMEvt.IsMod2();
61 
62  bool bOrtho = bShift;
63  bool bAngleSnap = bShift;
64  bool bCenter = bAlt;
65 
66  // #i33136#
68  {
69  bOrtho = !bShift;
70  }
71 
72  if (pView->IsOrtho() != bOrtho)
73  pView->SetOrtho(bOrtho);
74  if (pView->IsAngleSnapEnabled() != bAngleSnap)
75  pView->SetAngleSnapEnabled(bAngleSnap);
76 
77  if (pView->IsCreate1stPointAsCenter() != bCenter)
79  if (pView->IsResizeAtCenter() != bCenter)
80  pView->SetResizeAtCenter(bCenter);
81 
82 }
83 
85 {
86  if (!pView)
87  return;
88 
89  ScViewData& rViewData = rViewShell.GetViewData();
90  const ScViewOptions& rOpt = rViewData.GetOptions();
91  const ScGridOptions& rGrid = rOpt.GetGridOptions();
92  bool bGridOpt = rGrid.GetUseGridSnap();
93 
94  if (pView->IsOrtho())
95  pView->SetOrtho(false);
97  pView->SetAngleSnapEnabled(false);
98 
99  if (pView->IsGridSnap() != bGridOpt)
100  pView->SetGridSnap(bGridOpt);
101  if (pView->IsSnapEnabled() != bGridOpt)
102  pView->SetSnapEnabled(bGridOpt);
103 
106  if (pView->IsResizeAtCenter())
107  pView->SetResizeAtCenter(false);
108 }
109 
111 {
112  // remember button state for creation of own MouseEvents
114 
115  DoModifiers( rMEvt );
116  return false;
117 }
118 
119 bool FuDraw::MouseMove(const MouseEvent& rMEvt)
120 {
121  // evaluate modifiers only if in a drawing layer action
122  // (don't interfere with keyboard shortcut handling)
123  if (pView->IsAction())
124  DoModifiers( rMEvt );
125 
126  return false;
127 }
128 
130 {
131  // remember button state for creation of own MouseEvents
133 
134  ResetModifiers();
135  return false;
136 }
137 
138 // Process Keyboard events. Return true if an event is being handled
139 static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell& rViewShell, const KeyEvent* pInitialKey )
140 {
141  bool bReturn = false;
142  if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
143  {
144  // start text edit - like FuSelection::MouseButtonUp,
145  // but with bCursorToEnd instead of mouse position
146 
148  bool bVertical = ( pOPO && pOPO->IsVertical() );
149  sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
150 
151  // don't switch shells if text shell is already active
152  FuPoor* pPoor = rViewShell.GetViewData().GetView()->GetDrawFuncPtr();
153  if ( !pPoor || pPoor->GetSlotID() != nTextSlotId )
154  {
155  rViewShell.GetViewData().GetDispatcher().
156  Execute(nTextSlotId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
157  }
158 
159  // get the resulting FuText and set in edit mode
160  pPoor = rViewShell.GetViewData().GetView()->GetDrawFuncPtr();
161  if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // no RTTI
162  {
163  FuText* pText = static_cast<FuText*>(pPoor);
164  pText->SetInEditMode( pObj, nullptr, true, pInitialKey );
166  }
167  bReturn = true;
168  }
169  return bReturn;
170 }
171 
172 bool FuDraw::KeyInput(const KeyEvent& rKEvt)
173 {
174  bool bReturn = false;
175  ScViewData& rViewData = rViewShell.GetViewData();
176 
177  switch ( rKEvt.GetKeyCode().GetCode() )
178  {
179  case KEY_ESCAPE:
180  if ( rViewShell.IsDrawTextShell() || aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT )
181  {
182  // if object selected -> normal draw-shell, else turn off drawing
183  rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
184  bReturn = true;
185  }
186  else if ( rViewShell.IsDrawSelMode() )
187  {
188  pView->UnmarkAll();
189  rViewData.GetDispatcher().Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
190  bReturn = true;
191  }
192  else if ( pView->AreObjectsMarked() )
193  {
194  // III
195  SdrHdlList& rHdlList = const_cast< SdrHdlList& >( pView->GetHdlList() );
196  if( rHdlList.GetFocusHdl() )
197  rHdlList.ResetFocusHdl();
198  else
199  pView->UnmarkAll();
200 
201  // while bezier editing, object is selected
202  if (!pView->AreObjectsMarked())
203  rViewShell.SetDrawShell( false );
204 
205  bReturn = true;
206  }
207  break;
208 
209  case KEY_DELETE:
210  pView->DeleteMarked();
211  bReturn = true;
212  break;
213 
214  case KEY_RETURN:
215  {
216  if( rKEvt.GetKeyCode().GetModifier() == 0 )
217  {
218  // activate OLE object on RETURN for selected object
219  // put selected text object in edit mode
220  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
221  if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
222  {
223  bool bOle = rViewShell.GetViewFrame()->GetFrame().IsInPlace();
224  SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
225  if( dynamic_cast<const SdrOle2Obj*>( pObj) && !bOle )
226  {
227  rViewShell.ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 );
228 
229  // consumed
230  bReturn = true;
231  }
232  else if ( lcl_KeyEditMode( pObj, rViewShell, nullptr ) ) // start text edit for suitable object
233  bReturn = true;
234  }
235  }
236  }
237  break;
238 
239  case KEY_F2:
240  {
241  if( rKEvt.GetKeyCode().GetModifier() == 0 )
242  {
243  // put selected text object in edit mode
244  // (this is not SID_SETINPUTMODE, but F2 hardcoded, like in Writer)
245  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
246  if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
247  {
248  SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
250  // Double tapping on charts on phone may result in activating the edit mode which is not wanted.
251  // It happens due to the delay of selection message of the object from kit to javascript
252  // in that case F2 is sent instead of double click
253  if (isMobilePhone && ScDocument::IsChart(pObj))
254  {
255  rViewShell.ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 );
256  break;
257  }
258  if ( lcl_KeyEditMode( pObj, rViewShell, nullptr ) ) // start text edit for suitable object
259  bReturn = true;
260  }
261  }
262  }
263  break;
264 
265  case KEY_TAB:
266  {
267  // in calc do NOT start draw object selection using TAB/SHIFT-TAB when
268  // there is not yet an object selected
269  if(pView->AreObjectsMarked())
270  {
271  vcl::KeyCode aCode = rKEvt.GetKeyCode();
272 
273  if ( !aCode.IsMod1() && !aCode.IsMod2() )
274  {
275  // changeover to the next object
276  if(!pView->MarkNextObj( !aCode.IsShift() ))
277  {
278  //If there is only one object, don't do the UnmarkAllObj() & MarkNextObj().
280  {
281  // No next object: go over open end and
282  // get first from the other side
283  pView->UnmarkAllObj();
284  pView->MarkNextObj(!aCode.IsShift());
285  }
286  }
287 
288  // II
289  if(pView->AreObjectsMarked())
291 
292  bReturn = true;
293  }
294 
295  // handle Mod1 and Mod2 to get travelling running on different systems
296  if(rKEvt.GetKeyCode().IsMod1() || rKEvt.GetKeyCode().IsMod2())
297  {
298  // II do something with a selected handle?
299  const SdrHdlList& rHdlList = pView->GetHdlList();
300  bool bForward(!rKEvt.GetKeyCode().IsShift());
301 
302  const_cast<SdrHdlList&>(rHdlList).TravelFocusHdl(bForward);
303 
304  // guarantee visibility of focused handle
305  SdrHdl* pHdl = rHdlList.GetFocusHdl();
306 
307  if(pHdl)
308  {
309  Point aHdlPosition(pHdl->GetPos());
310  tools::Rectangle aVisRect(aHdlPosition - Point(100, 100), Size(200, 200));
311  pView->MakeVisible(aVisRect, *pWindow);
312  }
313 
314  // consumed
315  bReturn = true;
316  }
317  }
318  }
319  break;
320 
321  case KEY_END:
322  {
323  // in calc do NOT select the last draw object when
324  // there is not yet an object selected
325  if(pView->AreObjectsMarked())
326  {
327  vcl::KeyCode aCode = rKEvt.GetKeyCode();
328 
329  if ( aCode.IsMod1() )
330  {
331  // mark last object
332  pView->UnmarkAllObj();
333  pView->MarkNextObj();
334 
335  // II
336  if(pView->AreObjectsMarked())
338 
339  bReturn = true;
340  }
341  }
342  }
343  break;
344 
345  case KEY_HOME:
346  {
347  // in calc do NOT select the first draw object when
348  // there is not yet an object selected
349  if(pView->AreObjectsMarked())
350  {
351  vcl::KeyCode aCode = rKEvt.GetKeyCode();
352 
353  if ( aCode.IsMod1() )
354  {
355  // mark first object
356  pView->UnmarkAllObj();
357  pView->MarkNextObj(true);
358 
359  // II
360  if(pView->AreObjectsMarked())
362 
363  bReturn = true;
364  }
365  }
366  }
367  break;
368 
369  case KEY_UP:
370  case KEY_DOWN:
371  case KEY_LEFT:
372  case KEY_RIGHT:
373  {
374  // in calc do cursor travelling of draw objects only when
375  // there is an object selected yet
376  if(pView->AreObjectsMarked())
377  {
378 
379  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
380  if(rMarkList.GetMarkCount() == 1)
381  {
382  // disable cursor travelling on note objects as the tail connector position
383  // must not move.
384  SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
385  if( ScDrawLayer::IsNoteCaption( pObj ) )
386  break;
387  }
388 
389  long nX = 0;
390  long nY = 0;
391  sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
392 
393  if (nCode == KEY_UP)
394  {
395  // scroll up
396  nX = 0;
397  nY =-1;
398  }
399  else if (nCode == KEY_DOWN)
400  {
401  // scroll down
402  nX = 0;
403  nY = 1;
404  }
405  else if (nCode == KEY_LEFT)
406  {
407  // scroll left
408  nX =-1;
409  nY = 0;
410  }
411  else if (nCode == KEY_RIGHT)
412  {
413  // scroll right
414  nX = 1;
415  nY = 0;
416  }
417 
418  bool bReadOnly = rViewData.GetDocShell()->IsReadOnly();
419 
420  if(!rKEvt.GetKeyCode().IsMod1() && !bReadOnly)
421  {
422  if(rKEvt.GetKeyCode().IsMod2())
423  {
424  // move in 1 pixel distance
425  Size aLogicSizeOnePixel = pWindow ? pWindow->PixelToLogic(Size(1,1)) : Size(100, 100);
426  nX *= aLogicSizeOnePixel.Width();
427  nY *= aLogicSizeOnePixel.Height();
428  }
429  else if(rKEvt.GetKeyCode().IsShift()) // #i121236# Support for shift key in calc
430  {
431  nX *= 1000;
432  nY *= 1000;
433  }
434  else
435  {
436  // old, fixed move distance
437  nX *= 100;
438  nY *= 100;
439  }
440 
441  // is there a movement to do?
442  if(0 != nX || 0 != nY)
443  {
444  // II
445  const SdrHdlList& rHdlList = pView->GetHdlList();
446  SdrHdl* pHdl = rHdlList.GetFocusHdl();
447 
448  if(nullptr == pHdl)
449  {
450  // only take action when move is allowed
451  if(pView->IsMoveAllowed())
452  {
453  // restrict movement to WorkArea
454  const tools::Rectangle& rWorkArea = pView->GetWorkArea();
455 
456  if(!rWorkArea.IsEmpty())
457  {
459  aMarkRect.Move(nX, nY);
460 
461  if(!aMarkRect.IsInside(rWorkArea))
462  {
463  if(aMarkRect.Left() < rWorkArea.Left())
464  {
465  nX += rWorkArea.Left() - aMarkRect.Left();
466  }
467 
468  if(aMarkRect.Right() > rWorkArea.Right())
469  {
470  nX -= aMarkRect.Right() - rWorkArea.Right();
471  }
472 
473  if(aMarkRect.Top() < rWorkArea.Top())
474  {
475  nY += rWorkArea.Top() - aMarkRect.Top();
476  }
477 
478  if(aMarkRect.Bottom() > rWorkArea.Bottom())
479  {
480  nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
481  }
482  }
483  }
484 
485  // now move the selected draw objects
486  pView->MoveAllMarked(Size(nX, nY));
487 
488  // II
490 
491  bReturn = true;
492  }
493  }
494  else
495  {
496  // move handle with index nHandleIndex
497  if (nX || nY)
498  {
499  // now move the Handle (nX, nY)
500  Point aStartPoint(pHdl->GetPos());
501  Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
502  const SdrDragStat& rDragStat = pView->GetDragStat();
503 
504  // start dragging
505  pView->BegDragObj(aStartPoint, nullptr, pHdl, 0);
506 
507  if(pView->IsDragObj())
508  {
509  bool bWasNoSnap = rDragStat.IsNoSnap();
510  bool bWasSnapEnabled = pView->IsSnapEnabled();
511 
512  // switch snapping off
513  if(!bWasNoSnap)
514  const_cast<SdrDragStat&>(rDragStat).SetNoSnap();
515  if(bWasSnapEnabled)
516  pView->SetSnapEnabled(false);
517 
518  pView->MovAction(aEndPoint);
519  pView->EndDragObj();
520 
521  // restore snap
522  if(!bWasNoSnap)
523  const_cast<SdrDragStat&>(rDragStat).SetNoSnap(bWasNoSnap);
524  if(bWasSnapEnabled)
525  pView->SetSnapEnabled(bWasSnapEnabled);
526  }
527 
528  // make moved handle visible
529  tools::Rectangle aVisRect(aEndPoint - Point(100, 100), Size(200, 200));
530  pView->MakeVisible(aVisRect, *pWindow);
531 
532  bReturn = true;
533  }
534  }
535  }
536  }
537  }
538  }
539  break;
540 
541  case KEY_SPACE:
542  {
543  // in calc do only something when draw objects are selected
544  if(pView->AreObjectsMarked())
545  {
546  const SdrHdlList& rHdlList = pView->GetHdlList();
547  SdrHdl* pHdl = rHdlList.GetFocusHdl();
548 
549  if(pHdl)
550  {
551  if(pHdl->GetKind() == SdrHdlKind::Poly)
552  {
553  // rescue ID of point with focus
554  sal_uInt32 nPol(pHdl->GetPolyNum());
555  sal_uInt32 nPnt(pHdl->GetPointNum());
556 
557  if(pView->IsPointMarked(*pHdl))
558  {
559  if(rKEvt.GetKeyCode().IsShift())
560  {
561  pView->UnmarkPoint(*pHdl);
562  }
563  }
564  else
565  {
566  if(!rKEvt.GetKeyCode().IsShift())
567  {
569  }
570 
571  pView->MarkPoint(*pHdl);
572  }
573 
574  if(nullptr == rHdlList.GetFocusHdl())
575  {
576  // restore point with focus
577  SdrHdl* pNewOne = nullptr;
578 
579  for(size_t a = 0; !pNewOne && a < rHdlList.GetHdlCount(); ++a)
580  {
581  SdrHdl* pAct = rHdlList.GetHdl(a);
582 
583  if(pAct
584  && pAct->GetKind() == SdrHdlKind::Poly
585  && pAct->GetPolyNum() == nPol
586  && pAct->GetPointNum() == nPnt)
587  {
588  pNewOne = pAct;
589  }
590  }
591 
592  if(pNewOne)
593  {
594  const_cast<SdrHdlList&>(rHdlList).SetFocusHdl(pNewOne);
595  }
596  }
597 
598  bReturn = true;
599  }
600  }
601  }
602  }
603  break;
604  }
605 
606  if (!bReturn)
607  {
608  bReturn = FuPoor::KeyInput(rKEvt);
609  }
610 
611  if (!bReturn)
612  {
613  // allow direct typing into a selected text object
614 
615  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
616  if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() && EditEngine::IsSimpleCharInput(rKEvt) )
617  {
618  SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
619 
620  // start text edit for suitable object, pass key event to OutlinerView
621  if ( lcl_KeyEditMode( pObj, rViewShell, &rKEvt ) )
622  bReturn = true;
623  }
624  }
625 
626  return bReturn;
627 }
628 
629 // toggle mouse-pointer
630 static bool lcl_UrlHit( const SdrView* pView, const Point& rPosPixel, const vcl::Window* pWindow )
631 {
632  SdrViewEvent aVEvt;
633  MouseEvent aMEvt( rPosPixel, 1, MouseEventModifiers::NONE, MOUSE_LEFT );
634  SdrHitKind eHit = pView->PickAnything( aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt );
635 
636  if ( eHit != SdrHitKind::NONE && aVEvt.pObj != nullptr )
637  {
639  aVEvt.pObj, pWindow->PixelToLogic(rPosPixel), pWindow ) )
640  return true;
641 
642  if ( aVEvt.eEvent == SdrEventKind::ExecuteUrl )
643  return true;
644  }
645 
646  return false;
647 }
648 
650 {
651  if ( !pView->IsAction() )
652  {
653  Point aPosPixel = pWindow->GetPointerPosPixel();
654  bool bAlt = pMEvt && pMEvt->IsMod2();
655  Point aPnt = pWindow->PixelToLogic( aPosPixel );
656  SdrHdl* pHdl = pView->PickHandle(aPnt);
657  SdrPageView* pPV;
658 
659  ScMacroInfo* pInfo = nullptr;
660  SdrObject* pObj = pView->PickObj(aPnt, pView->getHitTolLog(), pPV, SdrSearchOptions::ALSOONMASTER);
661  if (pObj)
662  {
663  if ( pObj->IsGroupObject() )
664  {
665  SdrObject* pHit = pView->PickObj(aMDPos, pView->getHitTolLog(), pPV, SdrSearchOptions::DEEP);
666  if (pHit)
667  pObj = pHit;
668  }
669  pInfo = ScDrawLayer::GetMacroInfo( pObj );
670  }
671 
672  if ( pView->IsTextEdit() )
673  {
674  rViewShell.SetActivePointer(PointerStyle::Text); // can't be ?
675  }
676  else if ( pHdl )
677  {
679  pView->GetPreferredPointer( aPnt, pWindow ) );
680  }
681  else if ( pView->IsMarkedHit(aPnt) )
682  {
683  rViewShell.SetActivePointer( PointerStyle::Move );
684  }
685  else if ( !bAlt && ( !pMEvt || !pMEvt->GetButtons() )
686  && lcl_UrlHit( pView, aPosPixel, pWindow ) )
687  {
688  // could be suppressed with ALT
689  pWindow->SetPointer( PointerStyle::RefHand ); // Text-URL / ImageMap
690  }
691  else if ( !bAlt && (pObj = pView->PickObj(aPnt, pView->getHitTolLog(), pPV, SdrSearchOptions::PICKMACRO)) )
692  {
693  // could be suppressed with ALT
694  SdrObjMacroHitRec aHitRec;
695  rViewShell.SetActivePointer( pObj->GetMacroPointer(aHitRec) );
696  }
697  else if ( !bAlt && pInfo && (!pInfo->GetMacro().isEmpty() || !pInfo->GetHlink().isEmpty()) )
698  pWindow->SetPointer( PointerStyle::RefHand );
699  else if ( IsDetectiveHit( aPnt ) )
700  rViewShell.SetActivePointer( PointerStyle::Detective );
701  else
703  }
704 }
705 
707 {
708  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
709  const size_t backval=rMarkList.GetMarkCount();
710  for (size_t nlv1=0; nlv1<backval; ++nlv1)
711  {
712  SdrObject* pObj = rMarkList.GetMark( nlv1 )->GetMarkedSdrObj();
713  if ( ScDrawLayer::IsNoteCaption( pObj ) )
714  {
715  return true;
716  }
717  }
718  return false;
719 }
720 
721 bool FuDraw::IsSizingOrMovingNote( const MouseEvent& rMEvt ) const
722 {
723  bool bIsSizingOrMoving = false;
724  if ( rMEvt.IsLeft() )
725  {
726  const SdrMarkList& rNoteMarkList = pView->GetMarkedObjectList();
727  if(rNoteMarkList.GetMarkCount() == 1)
728  {
729  SdrObject* pObj = rNoteMarkList.GetMark( 0 )->GetMarkedSdrObj();
730  if ( ScDrawLayer::IsNoteCaption( pObj ) )
731  {
732  Point aMPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
733  bIsSizingOrMoving =
734  pView->PickHandle( aMPos ) || // handles to resize the note
735  pView->IsTextEditFrameHit( aMPos ); // frame for moving the note
736  }
737  }
738  }
739  return bIsSizingOrMoving;
740 }
741 
742 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxViewFrame * GetViewFrame() const
ScDBFunc * GetView() const
Definition: viewdata.hxx:356
long Width() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
bool UnmarkPoint(SdrHdl &rHdl)
Point GetPointerPosPixel()
bool IsDrawSelMode() const
Definition: tabview.hxx:315
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
size_t GetMarkCount() const
sal_uInt32 GetPolyNum() const
PointerStyle GetPreferredPointer(const Point &rMousePos, const OutputDevice *pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const
bool isLOKMobilePhone() const
const OUString & GetMacro() const
Definition: userdat.hxx:84
bool HasMarkableObj() const
long Height() const
virtual bool KeyInput(const KeyEvent &rKEvt) override
Definition: fudraw.cxx:172
virtual ~FuDraw() override
Definition: fudraw.cxx:49
bool IsVertical() const
bool AreObjectsMarked() const
static ScMacroInfo * GetMacroInfo(SdrObject *pObj, bool bCreate=false)
Definition: drwlayer.cxx:2321
const SdrDragStat & GetDragStat() const
bool EndDragObj(bool bCopy=false)
static bool IsSimpleCharInput(const KeyEvent &rKeyEvent)
sal_uInt32 GetPointNum() const
bool IsShift() const
virtual bool doConstructOrthogonal() const
Definition: fupoor.cxx:240
sal_uInt16 GetCode() const
SdrMark * GetMark(size_t nNum) const
const Point & GetPos() const
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
bool IsResizeAtCenter() const
constexpr sal_uInt16 KEY_SPACE
bool bReadOnly
bool IsMoveAllowed() const
void ResetFocusHdl()
constexpr sal_uInt16 KEY_UP
const tools::Rectangle & GetMarkedObjRect() const
void Move(long nHorzMoveDelta, long nVertMoveDelta)
constexpr sal_uInt16 KEY_END
bool IsEmpty() const
void SetGridSnap(bool bOn)
virtual void MovAction(const Point &rPnt) override
bool IsTextEditFrameHit(const Point &rHit) const
virtual void DeleteMarked() override
Definition: drawview.cxx:854
long Right() const
bool IsOrtho() const
sal_uInt16 GetButtons() const
void SetMouseButtonCode(sal_uInt16 nNew)
Definition: fupoor.hxx:71
bool HasMultipleMarkableObjects() const
SfxFrame & GetFrame() const
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: fudraw.cxx:119
void SetResizeAtCenter(bool bOn)
constexpr sal_uInt16 KEY_F2
bool IsDetectiveHit(const Point &rLogicPos)
Definition: fupoor.cxx:184
bool IsDrawTextShell() const
Definition: tabvwsh4.cxx:991
sal_uInt16 GetModifier() const
ScTabViewShell & rViewShell
Definition: fupoor.hxx:44
long Top() const
bool IsMarkedHit(const Point &rPnt, short nTol=-2) const
void UnmarkAll()
sal_uInt16 nCode
virtual bool KeyInput(const KeyEvent &rKEvt)
Definition: fupoor.cxx:135
ScViewData & GetViewData()
Definition: tabview.hxx:332
sal_uInt16 GetSlotID() const
Definition: fupoor.hxx:91
void SetSnapEnabled(bool bOn)
#define MOUSE_LEFT
bool IsSizingOrMovingNote(const MouseEvent &rMEvt) const
Definition: fudraw.cxx:721
Base class for Text functions.
Definition: futext.hxx:28
constexpr sal_uInt16 KEY_DOWN
SdrObject * GetMarkedSdrObj() const
SdrHitKind
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
static bool lcl_KeyEditMode(SdrObject *pObj, ScTabViewShell &rViewShell, const KeyEvent *pInitialKey)
Definition: fudraw.cxx:139
bool GetUseGridSnap() const
uno_Any a
bool IsMod2() const
constexpr sal_uInt16 KEY_HOME
void SetActivePointer(PointerStyle nPointer)
Definition: tabview.cxx:891
void ResetModifiers()
Definition: fudraw.cxx:84
bool IsSnapEnabled() const
SdrEventKind eEvent
const SdrMarkList & GetMarkedObjectList() const
bool IsAngleSnapEnabled() const
void SetDrawShell(bool bActive)
Definition: tabvwsh4.cxx:596
SdrHdl * PickHandle(const Point &rPnt) const
long Bottom() const
bool IsGroupObject() const
const ScGridOptions & GetGridOptions() const
Definition: viewopti.hxx:96
bool IsCreate1stPointAsCenter() const
void DoModifiers(const MouseEvent &rMEvt)
Definition: fudraw.cxx:53
SfxRequest aSfxRequest
Definition: fupoor.hxx:48
static bool lcl_UrlHit(const SdrView *pView, const Point &rPosPixel, const vcl::Window *pWindow)
Definition: fudraw.cxx:630
Base class for all functions.
Definition: fupoor.hxx:40
bool MarkNextObj(bool bPrev=false)
Point aMDPos
Definition: fupoor.hxx:58
const tools::Rectangle & GetAllMarkedRect() const
bool IsReadOnly() const
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_RIGHT
Point PixelToLogic(const Point &rDevicePt) const
SdrHdl * GetFocusHdl() const
virtual bool IsAction() const override
void SetAngleSnapEnabled(bool bOn)
size_t GetHdlCount() const
void SetPointer(PointerStyle)
SdrHdl * GetHdl(size_t nNum) const
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetSlot() const
bool IsShift() const
bool UnmarkAllPoints()
virtual bool IsTextEdit() const final override
void ActivateObject(SdrOle2Obj *pObj, long nVerb)
Definition: tabvwshb.cxx:144
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
static IMapObject * GetHitIMapObject(const SdrObject *pObj, const Point &rWinPoint, const vcl::Window *rCmpWnd=nullptr)
bool IsInPlace() const
constexpr sal_uInt16 KEY_ESCAPE
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: fudraw.cxx:110
void SetOrtho(bool bOn)
bool IsLeft() const
SfxDispatcher & GetDispatcher()
Definition: viewdata.cxx:3047
FuPoor * GetDrawFuncPtr()
Definition: tabview.hxx:320
bool IsGridSnap() const
bool IsMod1() const
ScDrawView * pView
Definition: fupoor.hxx:43
const ScViewOptions & GetOptions() const
Definition: viewdata.hxx:537
bool IsPointMarked(const SdrHdl &rHdl) const
const Point & GetPosPixel() const
SdrObject * pObj
long Left() const
PointerStyle
static bool IsChart(const SdrObject *pObject)
Definition: documen9.cxx:201
PointerStyle aNewPointer
Definition: fudraw.hxx:31
FuDraw(ScTabViewShell &rViewSh, vcl::Window *pWin, ScDrawView *pView, SdrModel *pDoc, const SfxRequest &rReq)
Definition: fudraw.cxx:41
bool IsDragObj() const
static bool IsNoteCaption(SdrObject *pObj)
Returns true, if the passed object is the caption of a cell note.
Definition: drwlayer.cxx:2309
void SetInEditMode(SdrObject *pObj=nullptr, const Point *pMousePixel=nullptr, bool bCursorToEnd=false, const KeyEvent *pInitialKey=nullptr)
Definition: futext.cxx:533
const OUString & GetHlink() const
Definition: userdat.hxx:87
constexpr sal_uInt16 KEY_DELETE
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr) override
constexpr sal_uInt16 KEY_LEFT
const SdrHdlList & GetHdlList() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false)
bool IsEditingANote() const
Definition: fudraw.cxx:706
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: fudraw.cxx:129
void SetCreate1stPointAsCenter(bool bOn)
void MoveAllMarked(const Size &rSiz, bool bCopy=false)
sal_uInt16 getHitTolLog() const
virtual void MakeVisible(const tools::Rectangle &rRect, vcl::Window &rWin) override
Definition: drawview.cxx:840
virtual OutlinerParaObject * GetOutlinerParaObject() const
const tools::Rectangle & GetWorkArea() const
VclPtr< vcl::Window > pWindow
Definition: fupoor.hxx:45
constexpr sal_uInt16 KEY_TAB
SdrHdlKind GetKind() const
virtual void ForcePointer(const MouseEvent *pMEvt)
Definition: fudraw.cxx:649
bool IsMod2() const
static SvxIMapInfo * GetIMapInfo(const SdrObject *pObject)