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->IsEffectivelyVertical(); // 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
398 
399  aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
400  aItemSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
401  aItemSet.Put( SdrTextAniKindItem( SdrTextAniKind::Slide ) );
402  aItemSet.Put( SdrTextAniDirectionItem( SdrTextAniDirection::Left ) );
403  aItemSet.Put( SdrTextAniCountItem( 1 ) );
404  aItemSet.Put( SdrTextAniAmountItem(
405  static_cast<sal_Int16>(pWindow->PixelToLogic(Size(2,1)).Width())) );
406  pObj->SetMergedItemSetAndBroadcast(aItemSet);
407  }
408  }
409 
410  // init object different when vertical writing
411  sal_uInt16 nSlotID(aSfxRequest.GetSlot());
412  bool bVertical = (SID_DRAW_TEXT_VERTICAL == nSlotID);
413  if(bVertical)
414  {
415  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
416  if(rMarkList.GetMark(0))
417  {
418  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
419  if(auto pText = dynamic_cast<SdrTextObj*>( pObj))
420  {
421  SfxItemSet aSet(pDrDoc->GetItemPool());
422 
423  pText->SetVerticalWriting(true);
424 
425  aSet.Put(makeSdrTextAutoGrowWidthItem(true));
426  aSet.Put(makeSdrTextAutoGrowHeightItem(false));
429 
430  pText->SetMergedItemSet(aSet);
431  }
432  }
433  }
434 
435  SetInEditMode();
436 
437  // leave mode when sole click (-> fuconstr)
438  if ( !pView->AreObjectsMarked() )
439  {
440  pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
441 
443  if ( pView->AreObjectsMarked() )
444  rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
445  else
446  rDisp.Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
447  }
448  }
449  }
450  else if ( pView->IsAction() )
451  {
452  pView->EndAction();
453  }
454  else if( !pView->IsAction() )
455  {
457 
458  if ( !pView->AreObjectsMarked() && rMEvt.GetClicks() < 2 )
459  {
460  pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
461 
463  if ( pView->AreObjectsMarked() )
464  rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
465  else
466  rDisp.Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
467  }
468  }
469 
470  return false;
471 }
472 
473 // switch mouse-pointer
474 void FuText::ForcePointer(const MouseEvent* /* pMEvt */)
475 {
477 }
478 
479 // modify keyboard events
480 // if a KeyEvent is being processed, then the return value is sal_True, else FALSE.
481 bool FuText::KeyInput(const KeyEvent& rKEvt)
482 {
483  bool bReturn = false;
484 
485  if ( pView->KeyInput(rKEvt, pWindow) )
486  {
487  bReturn = true;
489  }
490  else
491  {
492  bReturn = FuDraw::KeyInput(rKEvt);
493  }
494 
495  return bReturn;
496 }
497 
499 {
500  pView->SetDragMode(SdrDragMode::Move);
502  rBindings.Invalidate( SID_OBJECT_ROTATE );
503  rBindings.Invalidate( SID_OBJECT_MIRROR );
504 
505 // instant set the edit mode
506 // SetInEditMode();
507 
508 // if (!pTextObj)
509  {
510  // no text object in EditMode, therefore set CreateMode
511 
512  pView->SetCurrentObj(SdrObjKind::Text);
513 
514  pView->SetCreateMode();
515  }
516 
517  aNewPointer = PointerStyle::Text;
518 
521 
523 }
524 
526 {
529  StopEditMode();
530 }
531 
532 // switch object to Edit-Mode
533 void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
534  bool bCursorToEnd, const KeyEvent* pInitialKey)
535 {
536  /* It is possible to pass a special (unselected) object in pObj, e.g. the
537  caption object of a cell note. If pObj is 0, then the selected object
538  is used. The layer will be relocked in FuText::StopEditMode(). */
539  if ( pObj && (pObj->GetLayer() == SC_LAYER_INTERN) )
541 
542  if ( !pObj && pView->AreObjectsMarked() )
543  {
544  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
545  if (rMarkList.GetMarkCount() == 1)
546  {
547  SdrMark* pMark = rMarkList.GetMark(0);
548  pObj = pMark->GetMarkedSdrObj();
549  }
550  }
551 
552  if ( !pObj )
553  return;
554 
555  SdrObjKind nSdrObjKind = pObj->GetObjIdentifier();
556 
557  if (!(nSdrObjKind == SdrObjKind::Text ||
558  nSdrObjKind == SdrObjKind::TitleText ||
559  nSdrObjKind == SdrObjKind::OutlineText ||
560  dynamic_cast<const SdrTextObj*>( pObj) != nullptr))
561  return;
562 
563  SdrPageView* pPV = pView->GetSdrPageView();
564 
565  if ( !pObj->HasTextEdit() )
566  return;
567 
568  std::unique_ptr<SdrOutliner> pO = MakeOutliner();
569  lcl_UpdateHyphenator( *pO, pObj );
570 
571  // vertical flag:
572  // deduced from slot ids only if text object has no content
573 
574  sal_uInt16 nSlotID = aSfxRequest.GetSlot();
575  bool bVertical = ( nSlotID == SID_DRAW_TEXT_VERTICAL );
577  if ( pOPO )
578  bVertical = pOPO->IsEffectivelyVertical(); // content wins
579  pO->SetVertical( bVertical );
580 
582  auto pOTemp = pO.get();
583  if ( !pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, pO.release()) )
584  return;
585 
586  // Toggle out of paste mode if we are in it, otherwise
587  // pressing return in this object will instead go to the
588  // sheet and be considered an overwrite-cell instruction
591 
592  // EditEngine-UndoManager anmelden
593  rViewShell.SetDrawTextUndo( &pOTemp->GetUndoManager() );
594 
595  pView->SetEditMode();
596 
597  // set text cursor to click position or to end,
598  // pass initial key event to outliner view
599  if ( !(pMousePixel || bCursorToEnd || pInitialKey) )
600  return;
601 
603  if (!pOLV)
604  return;
605 
606  if ( pMousePixel )
607  {
608  MouseEvent aEditEvt( *pMousePixel, 1, MouseEventModifiers::SYNTHETIC, MOUSE_LEFT, 0 );
609  pOLV->MouseButtonDown(aEditEvt);
610  pOLV->MouseButtonUp(aEditEvt);
611  }
612  else if ( bCursorToEnd )
613  {
615  pOLV->SetSelection(aNewSelection);
616  }
617 
618  if ( pInitialKey )
619  pOLV->PostKeyEvent( *pInitialKey );
620 }
621 
622 // Create default drawing objects via keyboard
623 SdrObjectUniquePtr FuText::CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle)
624 {
625  // case SID_DRAW_TEXT:
626  // case SID_DRAW_TEXT_VERTICAL:
627  // case SID_DRAW_TEXT_MARQUEE:
628  // case SID_DRAW_NOTEEDIT:
629 
631  *pDrDoc,
634 
635  if(pObj)
636  {
637  if(auto pText = dynamic_cast<SdrTextObj*>( pObj.get() ))
638  {
639  pText->SetLogicRect(rRectangle);
640 
641  // don't set default text, start edit mode instead
642  // String aText(ScResId(STR_CAPTION_DEFAULT_TEXT));
643  // pText->SetText(aText);
644 
645  bool bVertical = (SID_DRAW_TEXT_VERTICAL == nID);
646  bool bMarquee = (SID_DRAW_TEXT_MARQUEE == nID);
647 
648  pText->SetVerticalWriting(bVertical);
649 
650  if(bVertical)
651  {
652  SfxItemSet aSet(pDrDoc->GetItemPool());
653 
654  aSet.Put(makeSdrTextAutoGrowWidthItem(true));
655  aSet.Put(makeSdrTextAutoGrowHeightItem(false));
658 
659  pText->SetMergedItemSet(aSet);
660  }
661 
662  if(bMarquee)
663  {
665 
666  aSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
667  aSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
668  aSet.Put( SdrTextAniKindItem( SdrTextAniKind::Slide ) );
669  aSet.Put( SdrTextAniDirectionItem( SdrTextAniDirection::Left ) );
670  aSet.Put( SdrTextAniCountItem( 1 ) );
671  aSet.Put( SdrTextAniAmountItem( static_cast<sal_Int16>(pWindow->PixelToLogic(Size(2,1)).Width())) );
672 
673  pObj->SetMergedItemSetAndBroadcast(aSet);
674  }
675 
676  SetInEditMode( pObj.get() ); // start edit mode
677  }
678  else
679  {
680  OSL_FAIL("Object is NO text object");
681  }
682  }
683 
684  return pObj;
685 }
686 
687 /* 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:481
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
virtual bool KeyInput(const KeyEvent &rKEvt) override
Definition: fudraw.cxx:190
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 &)
const ::avmedia::MediaItem * Execute(const SdrMarkView *pSdrView, SfxRequest const &rReq)
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:474
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)
SdrObjKind
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:72
ScViewData & GetViewData()
Definition: tabview.hxx:333
#define MOUSE_LEFT
bool IsSizingOrMovingNote(const MouseEvent &rMEvt) const
Definition: fudraw.cxx:745
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)
virtual void Start(bool bStartTimer=true) override
SdrHdl * PickHandle(const Point &rPnt) const
void SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent=SdrInventor::Default)
const OutlinerView * GetTextEditOutlinerView() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
virtual bool MouseButtonDown(const MouseEvent &_rMEvt, OutputDevice *_pWin) override
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:498
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
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
bool IsEffectivelyVertical() 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:623
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:3103
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
PointerStyle aNewPointer
Definition: fudraw.hxx:30
SdrPageView * GetSdrPageView() const
virtual void Deactivate() override
Definition: futext.cxx:525
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:2630
void SetInEditMode(SdrObject *pObj=nullptr, const Point *pMousePixel=nullptr, bool bCursorToEnd=false, const KeyEvent *pInitialKey=nullptr)
Definition: futext.cxx:533
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:730
sal_uInt16 getHitTolLog() const
virtual OutlinerParaObject * GetOutlinerParaObject() const
virtual void Activate()
Definition: fupoor.cxx:61
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:65