LibreOffice Module sc (master)  1
futext.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 <svx/svddef.hxx>
21 #include <svx/svdoutl.hxx>
22 #include <editeng/outlobj.hxx>
23 #include <svx/sdtaaitm.hxx>
24 #include <svx/sdtacitm.hxx>
25 #include <svx/svdotext.hxx>
26 #include <svx/sdtagitm.hxx>
27 #include <editeng/unolingu.hxx>
28 #include <sfx2/bindings.hxx>
29 #include <sfx2/dispatch.hxx>
30 #include <sfx2/viewfrm.hxx>
31 #include <svx/svxids.hrc>
32 #include <editeng/eeitem.hxx>
33 #include <svl/itemset.hxx>
34 #include <osl/diagnose.h>
35 
36 #include <futext.hxx>
37 #include <drwlayer.hxx>
38 #include <sc.hrc>
39 #include <tabvwsh.hxx>
40 #include <drawview.hxx>
41 
42 // maximum of mouse movement which allows to start Drag&Drop
44 #define SC_MAXDRAGMOVE 3
45 
46 static void lcl_InvalidateAttribs( SfxBindings& rBindings )
47 {
48  rBindings.Invalidate( SID_ATTR_CHAR_WEIGHT );
49  rBindings.Invalidate( SID_ATTR_CHAR_POSTURE );
50  rBindings.Invalidate( SID_ATTR_CHAR_UNDERLINE );
51  rBindings.Invalidate( SID_ULINE_VAL_NONE );
52  rBindings.Invalidate( SID_ULINE_VAL_SINGLE );
53  rBindings.Invalidate( SID_ULINE_VAL_DOUBLE );
54  rBindings.Invalidate( SID_ULINE_VAL_DOTTED );
55  rBindings.Invalidate( SID_ATTR_CHAR_OVERLINE );
56  rBindings.Invalidate( SID_ATTR_CHAR_COLOR );
57  rBindings.Invalidate( SID_ATTR_CHAR_BACK_COLOR );
58  rBindings.Invalidate( SID_ATTR_CHAR_FONT );
59  rBindings.Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
60  rBindings.Invalidate( SID_ATTR_PARA_ADJUST_LEFT );
61  rBindings.Invalidate( SID_ATTR_PARA_ADJUST_RIGHT );
62  rBindings.Invalidate( SID_ATTR_PARA_ADJUST_BLOCK );
63  rBindings.Invalidate( SID_ATTR_PARA_ADJUST_CENTER);
64  rBindings.Invalidate( SID_ALIGNLEFT );
65  rBindings.Invalidate( SID_ALIGNCENTERHOR );
66  rBindings.Invalidate( SID_ALIGNRIGHT );
67  rBindings.Invalidate( SID_ALIGNBLOCK );
68  rBindings.Invalidate( SID_ATTR_PARA_LINESPACE_10 );
69  rBindings.Invalidate( SID_ATTR_PARA_LINESPACE_15 );
70  rBindings.Invalidate( SID_ATTR_PARA_LINESPACE_20 );
71  rBindings.Invalidate( SID_SET_SUPER_SCRIPT );
72  rBindings.Invalidate( SID_SET_SUB_SCRIPT );
73  rBindings.Invalidate( SID_HYPERLINK_GETLINK );
74  rBindings.Invalidate( SID_TEXTDIRECTION_LEFT_TO_RIGHT );
75  rBindings.Invalidate( SID_TEXTDIRECTION_TOP_TO_BOTTOM );
76  rBindings.Invalidate( SID_ATTR_PARA_LEFT_TO_RIGHT );
77  rBindings.Invalidate( SID_ATTR_PARA_RIGHT_TO_LEFT );
78  rBindings.Invalidate( SID_TABLE_VERT_NONE );
79  rBindings.Invalidate( SID_TABLE_VERT_CENTER );
80  rBindings.Invalidate( SID_TABLE_VERT_BOTTOM );
81  // pseudo slots for Format menu
82  rBindings.Invalidate( SID_ALIGN_ANY_LEFT );
83  rBindings.Invalidate( SID_ALIGN_ANY_HCENTER );
84  rBindings.Invalidate( SID_ALIGN_ANY_RIGHT );
85  rBindings.Invalidate( SID_ALIGN_ANY_JUSTIFIED );
86  rBindings.Invalidate( SID_ATTR_CHAR_KERNING );
87  rBindings.Invalidate( SID_SET_SUPER_SCRIPT );
88  rBindings.Invalidate( SID_SET_SUB_SCRIPT );
89  rBindings.Invalidate( SID_ATTR_CHAR_STRIKEOUT );
90  rBindings.Invalidate( SID_ATTR_CHAR_SHADOWED );
91 }
92 
93 static void lcl_UpdateHyphenator( Outliner& rOutliner, const SdrObject* pObj )
94 {
95  // use hyphenator only if hyphenation attribute is set
96  if ( pObj && pObj->GetMergedItem(EE_PARA_HYPHENATE).GetValue() ) {
97  css::uno::Reference<css::linguistic2::XHyphenator> xHyphenator( LinguMgr::GetHyphenator() );
98  rOutliner.SetHyphenator( xHyphenator );
99  }
100 }
101 
103  SdrModel* pDoc, const SfxRequest& rReq)
104  : FuConstruct(rViewSh, pWin, pViewP, pDoc, rReq)
105 {
106 }
107 
109 {
110 // StopEditMode(); // in Deactivate !
111 }
112 
114 {
115  // remember button state for creation of own MouseEvents
117  bool bStraightEnter = true;
118 
119  if ( pView->MouseButtonDown(rMEvt, pWindow->GetOutDev()) )
120  return true; // event handled from SdrView
121 
122  if ( pView->IsTextEdit() )
123  {
124  if ( IsEditingANote() )
125  {
126  if( !IsSizingOrMovingNote(rMEvt) )
127  {
128  StopEditMode(); // Clicked outside, ending edit
129  bStraightEnter = false;
130  }
131  }
132  else
133  {
134  StopEditMode(); // Clicked outside, ending edit
135  pView->UnmarkAll();
136  bStraightEnter = false;
137  }
138  pView->SetCreateMode();
139  }
140 
141  aMDPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
142 
143  if ( rMEvt.IsLeft() )
144  {
145  SdrHdl* pHdl = pView->PickHandle(aMDPos);
146  const size_t nHdlNum = pView->GetHdlNum(pHdl);
147  if (pHdl != nullptr)
148  {
149  if (pView->HasMarkablePoints() && pView->IsPointMarkable(*pHdl))
150  {
151  bool bPointMarked=pView->IsPointMarked(*pHdl);
152 
153  if ( rMEvt.IsShift() )
154  {
155  if (!bPointMarked)
156  {
157  pView->MarkPoint(*pHdl);
158  }
159  else
160  {
161  pView->UnmarkPoint(*pHdl);
162  }
163  }
164  else
165  {
166  if (!bPointMarked)
167  {
169  pView->MarkPoint(*pHdl);
170  }
171  }
172  pHdl=pView->GetHdl(nHdlNum);
173  }
174  }
175 
176  SdrPageView* pPV = nullptr;
177 
178  if ( pHdl != nullptr || pView->IsMarkedHit(aMDPos) )
179  {
180  SdrObject* pObj = (pHdl == nullptr) ?
181  pView->PickObj(aMDPos, pView->getHitTolLog(), pPV, SdrSearchOptions::PICKTEXTEDIT) :
182  nullptr;
183  if (pObj)
184  {
185  std::unique_ptr<SdrOutliner> pO = MakeOutliner();
186  lcl_UpdateHyphenator( *pO, pObj );
187 
188  // vertical flag:
189  // deduced from slot ids only if text object has no content
190  sal_uInt16 nSlotID = aSfxRequest.GetSlot();
191  bool bVertical = ( nSlotID == SID_DRAW_TEXT_VERTICAL );
193  if ( pOPO )
194  bVertical = pOPO->IsVertical(); // content wins
195  pO->SetVertical( bVertical );
196 
198  auto pOTemp = pO.get();
199  if ( pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, pO.release()) )
200  {
201  // subscribe EditEngine-UndoManager
202  rViewShell.SetDrawTextUndo( &pOTemp->GetUndoManager() );
203 
205  if ( pOLV->MouseButtonDown(rMEvt) )
206  return true; // Event to the Outliner
207  }
208  }
209  else
210  {
211  // disable tail & circular move for caption objects.
212  bool bDrag = false;
213  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
214  if( rMarkList.GetMarkCount() == 1 )
215  {
216  SdrObject* pMarkedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
217  if( ScDrawLayer::IsNoteCaption( pMarkedObj ) )
218  {
219  if(pHdl->GetKind() != SdrHdlKind::Poly && pHdl->GetKind() != SdrHdlKind::Circle)
220  bDrag = true;
221  }
222  else
223  bDrag = true; // different object
224  }
225  else
226  bDrag = true; // several objects
227 
228  if ( bDrag )
229  {
230  aDragTimer.Start();
231  pView->BegDragObj(aMDPos, nullptr, pHdl);
232  }
233  }
234  }
235  else
236  {
237  if (pView->IsEditMode())
238  {
239  bool bPointMode=pView->HasMarkablePoints();
240 
241  if (!rMEvt.IsShift())
242  {
243  if (bPointMode)
244  {
246  }
247  else
248  {
249  pView->UnmarkAll();
250  }
251 
252  pView->SetDragMode(SdrDragMode::Move);
254  rBindings.Invalidate( SID_OBJECT_ROTATE );
255  rBindings.Invalidate( SID_OBJECT_MIRROR );
256  }
257 
258  if ( pView->MarkObj(aMDPos, -2, false, rMEvt.IsMod1()) )
259  {
260  aDragTimer.Start();
261 
262  pHdl=pView->PickHandle(aMDPos);
263 
264  if (pHdl!=nullptr)
265  {
266  pView->MarkPoint(*pHdl);
267  pHdl=pView->GetHdl(nHdlNum);
268  }
269 
270  pView->BegDragObj(aMDPos, nullptr, pHdl);
271  }
272  else
273  {
274  if (bPointMode)
275  {
277  }
278  else
279  {
281  }
282  }
283  }
284  else if (aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT )
285  {
286  // Edit notes -> create no new text objects
287  // and leave text mode
289  Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
290  }
291  else
292  {
293  if (bStraightEnter)//Hack for that silly idea that creating text fields is inside the text routine
294  {
295  // create object
297  }
298  else if (SdrObject* pObj = pView->PickObj(aMDPos, pView->getHitTolLog(), pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK))
299  {
300  pView->UnmarkAllObj();
301  ScViewData& rViewData = rViewShell.GetViewData();
302  rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
303  pView->MarkObj(pObj,pPV);
304 
305  pHdl=pView->PickHandle(aMDPos);
306  pView->BegDragObj(aMDPos, nullptr, pHdl);
307  return true;
308  }
309  }
310  }
311  }
312 
313  if (!bIsInDragMode)
314  {
316 // ForcePointer(&rMEvt);
318  }
319 
322  if (!bStraightEnter)
323  {
324  pView->UnmarkAll();
325  ScViewData& rViewData = rViewShell.GetViewData();
326  rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
327  }
328 
329  return true;
330 }
331 
332 bool FuText::MouseMove(const MouseEvent& rMEvt)
333 {
336 
337  if (aDragTimer.IsActive() )
338  {
339  Point aOldPixel = pWindow->LogicToPixel( aMDPos );
340  Point aNewPixel = rMEvt.GetPosPixel();
341  if ( std::abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE ||
342  std::abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE )
343  aDragTimer.Stop();
344  }
345 
346  Point aPix(rMEvt.GetPosPixel());
347  Point aPnt(pWindow->PixelToLogic(aPix));
348 
349  if ( pView->MouseMove(rMEvt, pWindow->GetOutDev()) )
350  return true; // event handled from SdrView
351 
352  if ( pView->IsAction() )
353  {
354  ForceScroll(aPix);
355  pView->MovAction(aPnt);
356  }
357 
358  return false;
359 }
360 
362 {
363  // remember button state for creation of own MouseEvents
365 
366  if (aDragTimer.IsActive() )
367  {
368  aDragTimer.Stop();
369  }
370 
372 
373  Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
374 
375  if ( pView->MouseButtonUp(rMEvt, pWindow->GetOutDev()) )
376  return true; // Event evaluated by SdrView
377 
378  if ( pView->IsDragObj() )
379  {
380  pView->EndDragObj( rMEvt.IsShift() );
382  }
383  else if ( pView->IsCreateObj() )
384  {
385  if (rMEvt.IsLeft())
386  {
387  pView->EndCreateObj(SdrCreateCmd::ForceEnd);
388  if (aSfxRequest.GetSlot() == SID_DRAW_TEXT_MARQUEE)
389  {
390  // create marquee-object?
391  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
392  if (rMarkList.GetMark(0))
393  {
394  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
395 
396  // set needed attributes for scrolling
397  SfxItemSet aItemSet( pDrDoc->GetItemPool(),
399 
400  aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
401  aItemSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
402  aItemSet.Put( SdrTextAniKindItem( SdrTextAniKind::Slide ) );
403  aItemSet.Put( SdrTextAniDirectionItem( SdrTextAniDirection::Left ) );
404  aItemSet.Put( SdrTextAniCountItem( 1 ) );
405  aItemSet.Put( SdrTextAniAmountItem(
406  static_cast<sal_Int16>(pWindow->PixelToLogic(Size(2,1)).Width())) );
407  pObj->SetMergedItemSetAndBroadcast(aItemSet);
408  }
409  }
410 
411  // init object different when vertical writing
412  sal_uInt16 nSlotID(aSfxRequest.GetSlot());
413  bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotID);
414  if(bVertical)
415  {
416  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
417  if(rMarkList.GetMark(0))
418  {
419  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
420  if(auto pText = dynamic_cast<SdrTextObj*>( pObj))
421  {
422  SfxItemSet aSet(pDrDoc->GetItemPool());
423 
424  pText->SetVerticalWriting(true);
425 
426  aSet.Put(makeSdrTextAutoGrowWidthItem(true));
427  aSet.Put(makeSdrTextAutoGrowHeightItem(false));
430 
431  pText->SetMergedItemSet(aSet);
432  }
433  }
434  }
435 
436  SetInEditMode();
437 
438  // leave mode when sole click (-> fuconstr)
439  if ( !pView->AreObjectsMarked() )
440  {
441  pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
442 
444  if ( pView->AreObjectsMarked() )
445  rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
446  else
447  rDisp.Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
448  }
449  }
450  }
451  else if ( pView->IsAction() )
452  {
453  pView->EndAction();
454  }
455  else if( !pView->IsAction() )
456  {
458 
459  if ( !pView->AreObjectsMarked() && rMEvt.GetClicks() < 2 )
460  {
461  pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
462 
464  if ( pView->AreObjectsMarked() )
465  rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
466  else
467  rDisp.Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
468  }
469  }
470 
471  return false;
472 }
473 
474 // switch mouse-pointer
475 void FuText::ForcePointer(const MouseEvent* /* pMEvt */)
476 {
478 }
479 
480 // modify keyboard events
481 // if a KeyEvent is being processed, then the return value is sal_True, else FALSE.
482 bool FuText::KeyInput(const KeyEvent& rKEvt)
483 {
484  bool bReturn = false;
485 
486  if ( pView->KeyInput(rKEvt, pWindow) )
487  {
488  bReturn = true;
490  }
491  else
492  {
493  bReturn = FuDraw::KeyInput(rKEvt);
494  }
495 
496  return bReturn;
497 }
498 
500 {
501  pView->SetDragMode(SdrDragMode::Move);
503  rBindings.Invalidate( SID_OBJECT_ROTATE );
504  rBindings.Invalidate( SID_OBJECT_MIRROR );
505 
506 // instant set the edit mode
507 // SetInEditMode();
508 
509 // if (!pTextObj)
510  {
511  // no text object in EditMode, therefore set CreateMode
512 
514 
515  pView->SetCreateMode();
516  }
517 
518  aNewPointer = PointerStyle::Text;
519 
522 
524 }
525 
527 {
530  StopEditMode();
531 }
532 
533 // switch object to Edit-Mode
534 void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
535  bool bCursorToEnd, const KeyEvent* pInitialKey)
536 {
537  /* It is possible to pass a special (unselected) object in pObj, e.g. the
538  caption object of a cell note. If pObj is 0, then the selected object
539  is used. The layer will be relocked in FuText::StopEditMode(). */
540  if ( pObj && (pObj->GetLayer() == SC_LAYER_INTERN) )
542 
543  if ( !pObj && pView->AreObjectsMarked() )
544  {
545  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
546  if (rMarkList.GetMarkCount() == 1)
547  {
548  SdrMark* pMark = rMarkList.GetMark(0);
549  pObj = pMark->GetMarkedSdrObj();
550  }
551  }
552 
553  if ( !pObj )
554  return;
555 
556  sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
557 
558  if (!(nSdrObjKind == OBJ_TEXT ||
559  nSdrObjKind == OBJ_TITLETEXT ||
560  nSdrObjKind == OBJ_OUTLINETEXT ||
561  dynamic_cast<const SdrTextObj*>( pObj) != nullptr))
562  return;
563 
564  SdrPageView* pPV = pView->GetSdrPageView();
565 
566  if ( !pObj->HasTextEdit() )
567  return;
568 
569  std::unique_ptr<SdrOutliner> pO = MakeOutliner();
570  lcl_UpdateHyphenator( *pO, pObj );
571 
572  // vertical flag:
573  // deduced from slot ids only if text object has no content
574 
575  sal_uInt16 nSlotID = aSfxRequest.GetSlot();
576  bool bVertical = ( nSlotID == SID_DRAW_TEXT_VERTICAL );
578  if ( pOPO )
579  bVertical = pOPO->IsVertical(); // content wins
580  pO->SetVertical( bVertical );
581 
583  auto pOTemp = pO.get();
584  if ( !pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, pO.release()) )
585  return;
586 
587  // Toggle out of paste mode if we are in it, otherwise
588  // pressing return in this object will instead go to the
589  // sheet and be considered an overwrite-cell instruction
592 
593  // EditEngine-UndoManager anmelden
594  rViewShell.SetDrawTextUndo( &pOTemp->GetUndoManager() );
595 
596  pView->SetEditMode();
597 
598  // set text cursor to click position or to end,
599  // pass initial key event to outliner view
600  if ( !(pMousePixel || bCursorToEnd || pInitialKey) )
601  return;
602 
604  if (!pOLV)
605  return;
606 
607  if ( pMousePixel )
608  {
609  MouseEvent aEditEvt( *pMousePixel, 1, MouseEventModifiers::SYNTHETIC, MOUSE_LEFT, 0 );
610  pOLV->MouseButtonDown(aEditEvt);
611  pOLV->MouseButtonUp(aEditEvt);
612  }
613  else if ( bCursorToEnd )
614  {
616  pOLV->SetSelection(aNewSelection);
617  }
618 
619  if ( pInitialKey )
620  pOLV->PostKeyEvent( *pInitialKey );
621 }
622 
623 // Create default drawing objects via keyboard
624 SdrObjectUniquePtr FuText::CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle)
625 {
626  // case SID_DRAW_TEXT:
627  // case SID_DRAW_TEXT_VERTICAL:
628  // case SID_DRAW_TEXT_MARQUEE:
629  // case SID_DRAW_NOTEEDIT:
630 
632  *pDrDoc,
635 
636  if(pObj)
637  {
638  if(auto pText = dynamic_cast<SdrTextObj*>( pObj.get() ))
639  {
640  pText->SetLogicRect(rRectangle);
641 
642  // don't set default text, start edit mode instead
643  // String aText(ScResId(STR_CAPTION_DEFAULT_TEXT));
644  // pText->SetText(aText);
645 
646  bool bVertical = (SID_DRAW_TEXT_VERTICAL == nID);
647  bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nID);
648 
649  pText->SetVerticalWriting(bVertical);
650 
651  if(bVertical)
652  {
653  SfxItemSet aSet(pDrDoc->GetItemPool());
654 
655  aSet.Put(makeSdrTextAutoGrowWidthItem(true));
656  aSet.Put(makeSdrTextAutoGrowHeightItem(false));
659 
660  pText->SetMergedItemSet(aSet);
661  }
662 
663  if(bMarquee)
664  {
666 
667  aSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
668  aSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
669  aSet.Put( SdrTextAniKindItem( SdrTextAniKind::Slide ) );
670  aSet.Put( SdrTextAniDirectionItem( SdrTextAniDirection::Left ) );
671  aSet.Put( SdrTextAniCountItem( 1 ) );
672  aSet.Put( SdrTextAniAmountItem( static_cast<sal_Int16>(pWindow->PixelToLogic(Size(2,1)).Width())) );
673 
674  pObj->SetMergedItemSetAndBroadcast(aSet);
675  }
676 
677  SetInEditMode( pObj.get() ); // start edit mode
678  }
679  else
680  {
681  OSL_FAIL("Object is NO text object");
682  }
683  }
684 
685  return pObj;
686 }
687 
688 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool MouseButtonDown(const MouseEvent &)
SfxViewFrame * GetViewFrame() const
virtual bool HasTextEdit() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true) override
Definition: drawview.cxx:543
bool UnmarkPoint(SdrHdl &rHdl)
void CaptureMouse()
SDRTEXTVERTADJUST_TOP
bool EndCreateObj(SdrCreateCmd eCmd)
PointerStyle aOldPointer
Definition: fudraw.hxx:31
size_t GetMarkCount() const
PointerStyle GetPreferredPointer(const Point &rMousePos, const OutputDevice *pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const
size_t GetHdlNum(SdrHdl const *pHdl) const
bool bIsInDragMode
Definition: fupoor.hxx:56
virtual bool KeyInput(const KeyEvent &rKEvt) override
Definition: futext.cxx:482
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
virtual bool KeyInput(const KeyEvent &rKEvt) override
Definition: fudraw.cxx:190
bool IsVertical() const
bool AreObjectsMarked() const
void SetPasteMode(ScPasteFlags nFlags)
Definition: viewdata.hxx:447
bool EndDragObj(bool bCopy=false)
#define EE_INDEX_NOT_FOUND
bool MouseButtonUp(const MouseEvent &)
bool IsShift() const
static SdrObject * MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
virtual void ForcePointer(const MouseEvent *pMEvt) override
Definition: futext.cxx:475
SdrModel * pDrDoc
Definition: fupoor.hxx:45
SdrMark * GetMark(size_t nNum) const
void Invalidate(sal_uInt16 nId)
static void lcl_InvalidateAttribs(SfxBindings &rBindings)
Definition: futext.cxx:46
virtual SdrObjKind GetObjIdentifier() const
void SetDrawTextUndo(SfxUndoManager *pUndoMgr)
Definition: tabvwsh4.cxx:1016
Draw rectangle.
Definition: fuconstr.hxx:27
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
bool IsActive() const
void UpdateCopySourceOverlay()
Definition: tabview2.cxx:979
#define EE_PARA_NOT_FOUND
sal_uInt16 GetClicks() const
virtual void MovAction(const Point &rPnt) override
ESelection aNewSelection(GetSelection())
bool IsEditMode() const
sal_uInt16 GetButtons() const
void SetMouseButtonCode(sal_uInt16 nNew)
Definition: fupoor.hxx:70
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: futext.cxx:113
SdrHdl * GetHdl(size_t nHdlNum) const
void SetEditMode(SdrViewEditMode eMode)
#define SC_MAXDRAGMOVE
fusel,fuconstr,futext - combined!
Definition: futext.cxx:44
ScTabViewShell & rViewShell
Definition: fupoor.hxx:43
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
bool IsMarkedHit(const Point &rPnt, short nTol=-2) const
Timer aDragTimer
Definition: fupoor.hxx:53
void UnmarkAll()
void ForceScroll(const Point &aPixPos)
Definition: fupoor.cxx:70
ScViewData & GetViewData()
Definition: tabview.hxx:333
#define MOUSE_LEFT
bool IsSizingOrMovingNote(const MouseEvent &rMEvt) const
Definition: fudraw.cxx:743
bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
SdrObject * GetMarkedSdrObj() const
PointerStyle GetPointer() const
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
Point LogicToPixel(const Point &rLogicPt) const
void SetActivePointer(PointerStyle nPointer)
Definition: tabview.cxx:894
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
SfxBindings & GetBindings()
static css::uno::Reference< css::linguistic2::XHyphenator > GetHyphenator()
const SdrMarkList & GetMarkedObjectList() const
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
SdrHdl * PickHandle(const Point &rPnt) const
void SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent=SdrInventor::Default)
virtual void Start() override
const OutlinerView * GetTextEditOutlinerView() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
virtual bool MouseButtonDown(const MouseEvent &_rMEvt, OutputDevice *_pWin) override
const ::avmedia::MediaItem * Execute(SdrMarkView *pSdrView, SfxRequest const &rReq)
SfxRequest aSfxRequest
Definition: fupoor.hxx:47
Point PixelToLogic(const Point &rDevicePt) const
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
virtual void Activate() override
Definition: futext.cxx:499
Point aMDPos
Definition: fupoor.hxx:57
virtual SdrLayerID GetLayer() const
bool IsCreateObj() const
void ReleaseMouse()
virtual bool IsAction() const override
SDRTEXTHORZADJUST_RIGHT
FuText(ScTabViewShell &rViewSh, vcl::Window *pWin, ScDrawView *pView, SdrModel *pDoc, const SfxRequest &rReq)
Definition: futext.cxx:102
void UnlockInternalLayer()
Unlocks the internal layer that contains caption objects of cell notes.
Definition: drawview.hxx:137
sal_uInt16 GetSlot() const
void SetSelection(const ESelection &)
bool UnmarkAllPoints()
virtual bool IsTextEdit() const final override
void Stop()
virtual SdrObjectUniquePtr CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle &rRectangle) override
Definition: futext.cxx:624
static void lcl_UpdateHyphenator(Outliner &rOutliner, const SdrObject *pObj)
Definition: futext.cxx:93
void StopEditMode()
Definition: futext3.cxx:42
::OutputDevice const * GetOutDev() const
bool PostKeyEvent(const KeyEvent &rKEvt, vcl::Window const *pFrameWin=nullptr)
bool IsLeft() const
SfxDispatcher & GetDispatcher()
Definition: viewdata.cxx:3093
constexpr SdrLayerID SC_LAYER_INTERN(2)
ScDrawView * pView
Definition: fupoor.hxx:42
void SetCreateMode(bool bOn=true)
constexpr TypedWhichId< SfxBoolItem > EE_PARA_HYPHENATE(EE_PARA_START+6)
bool IsPointMarked(const SdrHdl &rHdl) const
void SetDragMode(SdrDragMode eMode)
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: futext.cxx:361
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
const Point & GetPosPixel() const
OBJ_TITLETEXT
PointerStyle aNewPointer
Definition: fudraw.hxx:30
SdrPageView * GetSdrPageView() const
virtual void Deactivate() override
Definition: futext.cxx:526
virtual ~FuText() override
Definition: futext.cxx:108
bool IsDragObj() const
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
static bool IsNoteCaption(SdrObject *pObj)
Returns true, if the passed object is the caption of a cell note.
Definition: drwlayer.cxx:2618
void SetInEditMode(SdrObject *pObj=nullptr, const Point *pMousePixel=nullptr, bool bCursorToEnd=false, const KeyEvent *pInitialKey=nullptr)
Definition: futext.cxx:534
const SfxItemPool & GetItemPool() const
SdrObjKind GetCurrentObjIdentifier() const
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: futext.cxx:332
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
void SetHyphenator(css::uno::Reference< css::linguistic2::XHyphenator > const &xHyph)
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr) override
std::unique_ptr< SdrOutliner > MakeOutliner()
Definition: futext2.cxx:27
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
bool IsPointMarkable(const SdrHdl &rHdl) const
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false)
bool IsEditingANote() const
Definition: fudraw.cxx:728
OBJ_OUTLINETEXT
OBJ_TEXT
sal_uInt16 getHitTolLog() const
virtual OutlinerParaObject * GetOutlinerParaObject() const
virtual void Activate()
Definition: fupoor.cxx:59
VclPtr< vcl::Window > pWindow
Definition: fupoor.hxx:44
SdrInventor GetCurrentObjInventor() const
SdrHdlKind GetKind() const
void ForceMarkedToAnotherPage()
virtual void EndAction() override
virtual bool HasMarkablePoints() const
bool IsMod1() const
virtual void Deactivate()
Definition: fupoor.cxx:63