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 
35 #include <futext.hxx>
36 #include <drwlayer.hxx>
37 #include <sc.hrc>
38 #include <tabvwsh.hxx>
39 #include <drawview.hxx>
40 
41 // maximum of mouse movement which allows to start Drag&Drop
43 #define SC_MAXDRAGMOVE 3
44 
45 static void lcl_InvalidateAttribs( SfxBindings& rBindings )
46 {
47  rBindings.Invalidate( SID_ATTR_CHAR_WEIGHT );
48  rBindings.Invalidate( SID_ATTR_CHAR_POSTURE );
49  rBindings.Invalidate( SID_ATTR_CHAR_UNDERLINE );
50  rBindings.Invalidate( SID_ULINE_VAL_NONE );
51  rBindings.Invalidate( SID_ULINE_VAL_SINGLE );
52  rBindings.Invalidate( SID_ULINE_VAL_DOUBLE );
53  rBindings.Invalidate( SID_ULINE_VAL_DOTTED );
54  rBindings.Invalidate( SID_ATTR_CHAR_OVERLINE );
55  rBindings.Invalidate( SID_ATTR_CHAR_COLOR );
56  rBindings.Invalidate( SID_ATTR_CHAR_BACK_COLOR );
57  rBindings.Invalidate( SID_ATTR_CHAR_FONT );
58  rBindings.Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
59  rBindings.Invalidate( SID_ATTR_PARA_ADJUST_LEFT );
60  rBindings.Invalidate( SID_ATTR_PARA_ADJUST_RIGHT );
61  rBindings.Invalidate( SID_ATTR_PARA_ADJUST_BLOCK );
62  rBindings.Invalidate( SID_ATTR_PARA_ADJUST_CENTER);
63  rBindings.Invalidate( SID_ALIGNLEFT );
64  rBindings.Invalidate( SID_ALIGNCENTERHOR );
65  rBindings.Invalidate( SID_ALIGNRIGHT );
66  rBindings.Invalidate( SID_ALIGNBLOCK );
67  rBindings.Invalidate( SID_ATTR_PARA_LINESPACE_10 );
68  rBindings.Invalidate( SID_ATTR_PARA_LINESPACE_15 );
69  rBindings.Invalidate( SID_ATTR_PARA_LINESPACE_20 );
70  rBindings.Invalidate( SID_SET_SUPER_SCRIPT );
71  rBindings.Invalidate( SID_SET_SUB_SCRIPT );
72  rBindings.Invalidate( SID_HYPERLINK_GETLINK );
73  rBindings.Invalidate( SID_TEXTDIRECTION_LEFT_TO_RIGHT );
74  rBindings.Invalidate( SID_TEXTDIRECTION_TOP_TO_BOTTOM );
75  rBindings.Invalidate( SID_ATTR_PARA_LEFT_TO_RIGHT );
76  rBindings.Invalidate( SID_ATTR_PARA_RIGHT_TO_LEFT );
77  rBindings.Invalidate( SID_TABLE_VERT_NONE );
78  rBindings.Invalidate( SID_TABLE_VERT_CENTER );
79  rBindings.Invalidate( SID_TABLE_VERT_BOTTOM );
80  // pseudo slots for Format menu
81  rBindings.Invalidate( SID_ALIGN_ANY_LEFT );
82  rBindings.Invalidate( SID_ALIGN_ANY_HCENTER );
83  rBindings.Invalidate( SID_ALIGN_ANY_RIGHT );
84  rBindings.Invalidate( SID_ALIGN_ANY_JUSTIFIED );
85  rBindings.Invalidate( SID_ATTR_CHAR_KERNING );
86  rBindings.Invalidate( SID_SET_SUPER_SCRIPT );
87  rBindings.Invalidate( SID_SET_SUB_SCRIPT );
88  rBindings.Invalidate( SID_ATTR_CHAR_STRIKEOUT );
89  rBindings.Invalidate( SID_ATTR_CHAR_SHADOWED );
90 }
91 
92 static void lcl_UpdateHyphenator( Outliner& rOutliner, const SdrObject* pObj )
93 {
94  // use hyphenator only if hyphenation attribute is set
95  if ( pObj && pObj->GetMergedItem(EE_PARA_HYPHENATE).GetValue() ) {
96  css::uno::Reference<css::linguistic2::XHyphenator> xHyphenator( LinguMgr::GetHyphenator() );
97  rOutliner.SetHyphenator( xHyphenator );
98  }
99 }
100 
102  SdrModel* pDoc, const SfxRequest& rReq)
103  : FuConstruct(rViewSh, pWin, pViewP, pDoc, rReq)
104 {
105 }
106 
108 {
109 // StopEditMode(); // in Deactivate !
110 }
111 
113 {
114  // remember button state for creation of own MouseEvents
116  bool bStraightEnter = true;
117 
118  if ( pView->MouseButtonDown(rMEvt, pWindow) )
119  return true; // event handled from SdrView
120 
121  if ( pView->IsTextEdit() )
122  {
123  if ( IsEditingANote() )
124  {
125  if( !IsSizingOrMovingNote(rMEvt) )
126  {
127  StopEditMode(); // Clicked outside, ending edit
128  bStraightEnter = false;
129  }
130  }
131  else
132  {
133  StopEditMode(); // Clicked outside, ending edit
134  pView->UnmarkAll();
135  bStraightEnter = false;
136  }
137  pView->SetCreateMode();
138  }
139 
140  aMDPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
141 
142  if ( rMEvt.IsLeft() )
143  {
144  SdrHdl* pHdl = pView->PickHandle(aMDPos);
145  const size_t nHdlNum = pView->GetHdlNum(pHdl);
146  if (pHdl != nullptr)
147  {
148  if (pView->HasMarkablePoints() && pView->IsPointMarkable(*pHdl))
149  {
150  bool bPointMarked=pView->IsPointMarked(*pHdl);
151 
152  if ( rMEvt.IsShift() )
153  {
154  if (!bPointMarked)
155  {
156  pView->MarkPoint(*pHdl);
157  }
158  else
159  {
160  pView->UnmarkPoint(*pHdl);
161  }
162  }
163  else
164  {
165  if (!bPointMarked)
166  {
168  pView->MarkPoint(*pHdl);
169  }
170  }
171  pHdl=pView->GetHdl(nHdlNum);
172  }
173  }
174 
175  SdrPageView* pPV = nullptr;
176 
177  if ( pHdl != nullptr || pView->IsMarkedHit(aMDPos) )
178  {
179  SdrObject* pObj = (pHdl == nullptr) ?
180  pView->PickObj(aMDPos, pView->getHitTolLog(), pPV, SdrSearchOptions::PICKTEXTEDIT) :
181  nullptr;
182  if (pObj)
183  {
184  std::unique_ptr<SdrOutliner> pO = MakeOutliner();
185  lcl_UpdateHyphenator( *pO, pObj );
186 
187  // vertical flag:
188  // deduced from slot ids only if text object has no content
189  sal_uInt16 nSlotID = aSfxRequest.GetSlot();
190  bool bVertical = ( nSlotID == SID_DRAW_TEXT_VERTICAL );
192  if ( pOPO )
193  bVertical = pOPO->IsVertical(); // content wins
194  pO->SetVertical( bVertical );
195 
197  auto pOTemp = pO.get();
198  if ( pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, pO.release()) )
199  {
200  // subscribe EditEngine-UndoManager
201  rViewShell.SetDrawTextUndo( &pOTemp->GetUndoManager() );
202 
204  if ( pOLV->MouseButtonDown(rMEvt) )
205  return true; // Event to the Outliner
206  }
207  }
208  else
209  {
210  // disable tail & circular move for caption objects.
211  bool bDrag = false;
212  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
213  if( rMarkList.GetMarkCount() == 1 )
214  {
215  SdrObject* pMarkedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
216  if( ScDrawLayer::IsNoteCaption( pMarkedObj ) )
217  {
218  if(pHdl->GetKind() != SdrHdlKind::Poly && pHdl->GetKind() != SdrHdlKind::Circle)
219  bDrag = true;
220  }
221  else
222  bDrag = true; // different object
223  }
224  else
225  bDrag = true; // several objects
226 
227  if ( bDrag )
228  {
229  aDragTimer.Start();
230  pView->BegDragObj(aMDPos, nullptr, pHdl);
231  }
232  }
233  }
234  else
235  {
236  if (pView->IsEditMode())
237  {
238  bool bPointMode=pView->HasMarkablePoints();
239 
240  if (!rMEvt.IsShift())
241  {
242  if (bPointMode)
243  {
245  }
246  else
247  {
248  pView->UnmarkAll();
249  }
250 
251  pView->SetDragMode(SdrDragMode::Move);
253  rBindings.Invalidate( SID_OBJECT_ROTATE );
254  rBindings.Invalidate( SID_OBJECT_MIRROR );
255  }
256 
257  if ( pView->MarkObj(aMDPos, -2, false, rMEvt.IsMod1()) )
258  {
259  aDragTimer.Start();
260 
261  pHdl=pView->PickHandle(aMDPos);
262 
263  if (pHdl!=nullptr)
264  {
265  pView->MarkPoint(*pHdl);
266  pHdl=pView->GetHdl(nHdlNum);
267  }
268 
269  pView->BegDragObj(aMDPos, nullptr, pHdl);
270  }
271  else
272  {
273  if (bPointMode)
274  {
276  }
277  else
278  {
280  }
281  }
282  }
283  else if (aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT )
284  {
285  // Edit notes -> create no new text objects
286  // and leave text mode
288  Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
289  }
290  else
291  {
292  if (bStraightEnter)//Hack for that silly idea that creating text fields is inside the text routine
293  {
294  // create object
296  }
297  else if (SdrObject* pObj = pView->PickObj(aMDPos, pView->getHitTolLog(), pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK))
298  {
299  pView->UnmarkAllObj();
300  ScViewData& rViewData = rViewShell.GetViewData();
301  rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
302  pView->MarkObj(pObj,pPV);
303 
304  pHdl=pView->PickHandle(aMDPos);
305  pView->BegDragObj(aMDPos, nullptr, pHdl);
306  return true;
307  }
308  }
309  }
310  }
311 
312  if (!bIsInDragMode)
313  {
315 // ForcePointer(&rMEvt);
317  }
318 
320  pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow ));
321  if (!bStraightEnter)
322  {
323  pView->UnmarkAll();
324  ScViewData& rViewData = rViewShell.GetViewData();
325  rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
326  }
327 
328  return true;
329 }
330 
331 bool FuText::MouseMove(const MouseEvent& rMEvt)
332 {
334  pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow ));
335 
336  if (aDragTimer.IsActive() )
337  {
338  Point aOldPixel = pWindow->LogicToPixel( aMDPos );
339  Point aNewPixel = rMEvt.GetPosPixel();
340  if ( std::abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE ||
341  std::abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE )
342  aDragTimer.Stop();
343  }
344 
345  Point aPix(rMEvt.GetPosPixel());
346  Point aPnt(pWindow->PixelToLogic(aPix));
347 
348  if ( pView->MouseMove(rMEvt, pWindow) )
349  return true; // event handled from SdrView
350 
351  if ( pView->IsAction() )
352  {
353  ForceScroll(aPix);
354  pView->MovAction(aPnt);
355  }
356 
357  return false;
358 }
359 
361 {
362  // remember button state for creation of own MouseEvents
364 
365  if (aDragTimer.IsActive() )
366  {
367  aDragTimer.Stop();
368  }
369 
371 
372  Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
373 
374  if ( pView->MouseButtonUp(rMEvt, pWindow) )
375  return true; // Event evaluated by SdrView
376 
377  if ( pView->IsDragObj() )
378  {
379  pView->EndDragObj( rMEvt.IsShift() );
381  }
382  else if ( pView->IsCreateObj() )
383  {
384  if (rMEvt.IsLeft())
385  {
386  pView->EndCreateObj(SdrCreateCmd::ForceEnd);
387  if (aSfxRequest.GetSlot() == SID_DRAW_TEXT_MARQUEE)
388  {
389  // create marquee-object?
390  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
391  if (rMarkList.GetMark(0))
392  {
393  SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
394 
395  // set needed attributes for scrolling
396  SfxItemSet aItemSet( pDrDoc->GetItemPool(),
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 
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  sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier();
556 
557  if (!(nSdrObjKind == OBJ_TEXT ||
558  nSdrObjKind == OBJ_TITLETEXT ||
559  nSdrObjKind == OBJ_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->IsVertical(); // 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  {
605  if ( pMousePixel )
606  {
607  MouseEvent aEditEvt( *pMousePixel, 1, MouseEventModifiers::SYNTHETIC, MOUSE_LEFT, 0 );
608  pOLV->MouseButtonDown(aEditEvt);
609  pOLV->MouseButtonUp(aEditEvt);
610  }
611  else if ( bCursorToEnd )
612  {
614  pOLV->SetSelection(aNewSelection);
615  }
616 
617  if ( pInitialKey )
618  pOLV->PostKeyEvent( *pInitialKey );
619  }
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:541
bool UnmarkPoint(SdrHdl &rHdl)
void CaptureMouse()
SDRTEXTVERTADJUST_TOP
bool EndCreateObj(SdrCreateCmd eCmd)
PointerStyle aOldPointer
Definition: fudraw.hxx:32
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:57
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 IsVertical() const
OBJ_TEXT
bool AreObjectsMarked() const
void SetPasteMode(ScPasteFlags nFlags)
Definition: viewdata.hxx:448
bool EndDragObj(bool bCopy=false)
#define EE_INDEX_NOT_FOUND
bool MouseButtonUp(const MouseEvent &)
bool IsShift() const
virtual void ForcePointer(const MouseEvent *pMEvt) override
Definition: futext.cxx:474
SdrModel * pDrDoc
Definition: fupoor.hxx:46
SdrMark * GetMark(size_t nNum) const
void Invalidate(sal_uInt16 nId)
static void lcl_InvalidateAttribs(SfxBindings &rBindings)
Definition: futext.cxx:45
void SetDrawTextUndo(SfxUndoManager *pUndoMgr)
Definition: tabvwsh4.cxx:1001
Draw rectangle.
Definition: fuconstr.hxx:26
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
bool IsActive() const
void UpdateCopySourceOverlay()
Definition: tabview2.cxx:978
#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:71
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
Definition: futext.cxx:112
sal_uInt16 GetCurrentObjIdentifier() const
SdrHdl * GetHdl(size_t nHdlNum) const
void SetEditMode(SdrViewEditMode eMode)
static SdrObject * MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, sal_uInt16 nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
#define SC_MAXDRAGMOVE
fusel,fuconstr,futext - combined!
Definition: futext.cxx:43
ScTabViewShell & rViewShell
Definition: fupoor.hxx:44
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
bool IsMarkedHit(const Point &rPnt, short nTol=-2) const
Timer aDragTimer
Definition: fupoor.hxx:54
void UnmarkAll()
void ForceScroll(const Point &aPixPos)
Definition: fupoor.cxx:70
ScViewData & GetViewData()
Definition: tabview.hxx:332
#define MOUSE_LEFT
bool IsSizingOrMovingNote(const MouseEvent &rMEvt) const
Definition: fudraw.cxx:740
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
virtual sal_uInt16 GetObjIdentifier() const
void SetActivePointer(PointerStyle nPointer)
Definition: tabview.cxx:891
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
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
SfxRequest aSfxRequest
Definition: fupoor.hxx:48
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
virtual void Activate() override
Definition: futext.cxx:498
Point aMDPos
Definition: fupoor.hxx:58
virtual SdrLayerID GetLayer() const
bool IsCreateObj() const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) 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:101
void UnlockInternalLayer()
Unlocks the internal layer that contains caption objects of cell notes.
Definition: drawview.hxx:138
sal_uInt16 GetSlot() const
OBJ_OUTLINETEXT
void SetSelection(const ESelection &)
bool UnmarkAllPoints()
virtual bool IsTextEdit() const final override
void Stop()
void SetCurrentObj(sal_uInt16 nIdent, SdrInventor nInvent=SdrInventor::Default)
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:92
void StopEditMode()
Definition: futext3.cxx:41
bool PostKeyEvent(const KeyEvent &rKEvt, vcl::Window const *pFrameWin=nullptr)
bool IsLeft() const
SfxDispatcher & GetDispatcher()
Definition: viewdata.cxx:3021
constexpr SdrLayerID SC_LAYER_INTERN(2)
ScDrawView * pView
Definition: fupoor.hxx:43
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:360
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
const Point & GetPosPixel() const
PointerStyle aNewPointer
Definition: fudraw.hxx:31
SdrPageView * GetSdrPageView() const
virtual void Deactivate() override
Definition: futext.cxx:525
virtual ~FuText() override
Definition: futext.cxx:107
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:2309
void SetInEditMode(SdrObject *pObj=nullptr, const Point *pMousePixel=nullptr, bool bCursorToEnd=false, const KeyEvent *pInitialKey=nullptr)
Definition: futext.cxx:533
const SfxItemPool & GetItemPool() const
virtual bool MouseMove(const MouseEvent &rMEvt) override
Definition: futext.cxx:331
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:725
sal_uInt16 getHitTolLog() const
virtual OutlinerParaObject * GetOutlinerParaObject() const
OBJ_TITLETEXT
virtual void Activate()
Definition: fupoor.cxx:59
VclPtr< vcl::Window > pWindow
Definition: fupoor.hxx:45
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