LibreOffice Module svx (master)  1
imapwnd.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 <tools/urlobj.hxx>
21 #include <vcl/commandevent.hxx>
22 #include <vcl/imaprect.hxx>
23 #include <vcl/imapcirc.hxx>
24 #include <vcl/imappoly.hxx>
25 #include <vcl/svapp.hxx>
26 #include <svl/urlbmk.hxx>
27 
28 #include <svx/svxids.hrc>
29 #include "imapwnd.hxx"
30 #include <svx/svdpage.hxx>
31 #include <svx/svdorect.hxx>
32 #include <svx/svdocirc.hxx>
33 #include <svx/svdopath.hxx>
34 #include <svx/xfltrit.hxx>
35 #include <svx/svdpagv.hxx>
36 #include <svx/xfillit0.hxx>
37 #include <svx/xflclit.hxx>
38 #include <svx/xlnclit.hxx>
39 
40 #include <sfx2/evntconf.hxx>
41 
42 #include <sot/formats.hxx>
43 
44 #include <svx/svxdlg.hxx>
46 #include <memory>
47 
48 using namespace com::sun::star;
49 using ::com::sun::star::frame::XFrame;
50 using ::com::sun::star::uno::Reference;
51 
52 #define TRANSCOL COL_WHITE
53 
54 IMapWindow::IMapWindow(const Reference< XFrame >& rxDocumentFrame, weld::Dialog* pDialog)
55  : GraphCtrl(pDialog)
56  , mxDocumentFrame(rxDocumentFrame)
57 {
58  pIMapPool = new SfxItemPool( "IMapItemPool",
59  SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, maItemInfos );
60  pIMapPool->FreezeIdRanges();
61 }
62 
64 {
65 }
66 
68 {
69  Size aSize(pDrawingArea->get_ref_device().LogicToPixel(Size(270, 170), MapMode(MapUnit::MapAppFont)));
70  pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
71  SetOutputSizePixel(aSize);
73 
74  SetSdrMode(true);
75 
76  mxDropTargetHelper.reset(new IMapDropTargetHelper(*this));
77 }
78 
79 void IMapWindow::SetImageMap( const ImageMap& rImageMap )
80 {
81  ReplaceImageMap( rImageMap );
82 }
83 
84 void IMapWindow::ReplaceImageMap( const ImageMap& rImageMap )
85 {
86  SdrPage* pPage = nullptr;
87  aIMap = rImageMap;
88 
89  if(GetSdrModel())
90  {
91  // try to access page
92  pPage = GetSdrModel()->GetPage(0);
93  }
94 
95  if(pPage)
96  {
97  // clear SdrObjects with broadcasting
98  pPage->ClearSdrObjList();
99  }
100 
101  if(GetSdrView())
102  {
103  // #i63762# reset selection at view
105  }
106 
107  // create new drawing objects
108  const sal_uInt16 nCount(rImageMap.GetIMapObjectCount());
109 
110  for ( sal_uInt16 i(nCount); i > 0; i-- )
111  {
112  SdrObject* pNewObj = CreateObj( rImageMap.GetIMapObject( i - 1 ) );
113 
114  if (pNewObj && pPage)
115  {
116  pPage->InsertObject( pNewObj );
117  }
118  }
119 }
120 
122 {
123  const SdrObject* pSdrObj = GetSelectedSdrObject();
124 
125  if ( pSdrObj )
126  {
127  IMapObject* pIMapObj = GetIMapObj( pSdrObj );
128  if (pIMapObj)
129  {
130  pIMapObj->SetURL( rNewInfo.aMarkURL );
131  pIMapObj->SetAltText( rNewInfo.aMarkAltText );
132  pIMapObj->SetTarget( rNewInfo.aMarkTarget );
133  pModel->SetChanged();
134  UpdateInfo( false );
135  }
136  }
137 }
138 
140 {
141  if ( pModel->IsChanged() )
142  {
143  SdrPage* pPage = pModel->GetPage( 0 );
144 
145  if ( pPage )
146  {
147  const size_t nCount = pPage->GetObjCount();
148 
150 
151  for ( size_t i = nCount; i; )
152  {
153  --i;
154  aIMap.InsertIMapObject( *( static_cast<IMapUserData*>( pPage->GetObj( i )->GetUserData( 0 ) )->GetObject() ) );
155  }
156  }
157 
158  pModel->SetChanged( false );
159  }
160 
161  return aIMap;
162 }
163 
165 {
166  // Delete old List
167  aTargetList.clear();
168 
169  // Fill with the provided list
170  for(const OUString & s : rTargetList)
171  aTargetList.push_back( s );
172 
173  pModel->SetChanged( false );
174 }
175 
177 {
178  tools::Rectangle aClipRect( Point(), GetGraphicSize() );
179  SdrObject* pSdrObj = nullptr;
180  IMapObjectPtr pCloneIMapObj;
181 
182  switch( pIMapObj->GetType() )
183  {
184  case IMapObjectType::Rectangle:
185  {
186  const IMapRectangleObject* pIMapRectObj = static_cast<const IMapRectangleObject*>(pIMapObj);
187  tools::Rectangle aDrawRect( pIMapRectObj->GetRectangle( false ) );
188 
189  // clipped on CanvasPane
190  aDrawRect.Intersection( aClipRect );
191 
192  pSdrObj = new SdrRectObj(*pModel, aDrawRect);
193  pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapRectangleObject( *pIMapRectObj )));
194  }
195  break;
196 
197  case IMapObjectType::Circle:
198  {
199  const IMapCircleObject* pIMapCircleObj = static_cast<const IMapCircleObject*>(pIMapObj);
200  const Point aCenter( pIMapCircleObj->GetCenter( false ) );
201  const tools::Long nRadius = pIMapCircleObj->GetRadius( false );
202  const Point aOffset( nRadius, nRadius );
203  tools::Rectangle aCircle( aCenter - aOffset, aCenter + aOffset );
204 
205  // limited to CanvasPane
206  aCircle.Intersection( aClipRect );
207 
208  pSdrObj = new SdrCircObj(
209  *pModel,
211  aCircle,
212  0_deg100,
213  36000_deg100);
214  pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapCircleObject( *pIMapCircleObj )));
215  }
216  break;
217 
218  case IMapObjectType::Polygon:
219  {
220  const IMapPolygonObject* pIMapPolyObj = static_cast<const IMapPolygonObject*>(pIMapObj);
221 
222  // If it actually is an ellipse, then another ellipse is created again
223  if ( pIMapPolyObj->HasExtraEllipse() )
224  {
225  tools::Rectangle aDrawRect( pIMapPolyObj->GetExtraEllipse() );
226 
227  // clipped on CanvasPane
228  aDrawRect.Intersection( aClipRect );
229 
230  pSdrObj = new SdrCircObj(
231  *pModel,
233  aDrawRect,
234  0_deg100,
235  36000_deg100);
236  }
237  else
238  {
239  const tools::Polygon& rPoly = pIMapPolyObj->GetPolygon( false );
240  tools::Polygon aDrawPoly( rPoly );
241 
242  // clipped on CanvasPane
243  aDrawPoly.Clip( aClipRect );
244 
245  basegfx::B2DPolygon aPolygon;
246  aPolygon.append(aDrawPoly.getB2DPolygon());
247  pSdrObj = new SdrPathObj(
248  *pModel,
249  OBJ_POLY,
250  basegfx::B2DPolyPolygon(aPolygon));
251  }
252 
253  pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapPolygonObject( *pIMapPolyObj )));
254  }
255  break;
256 
257  default:
258  break;
259  }
260 
261  if ( pSdrObj )
262  {
263  SfxItemSet aSet( pModel->GetItemPool() );
264 
265  aSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
266  aSet.Put( XFillColorItem( "", TRANSCOL ) );
267 
268  if ( !pIMapObj->IsActive() )
269  {
270  aSet.Put( XFillTransparenceItem( 100 ) );
271  aSet.Put( XLineColorItem( "", COL_RED ) );
272  }
273  else
274  {
275  aSet.Put( XFillTransparenceItem( 50 ) );
276  aSet.Put( XLineColorItem( "", COL_BLACK ) );
277  }
278 
279  pSdrObj->SetMergedItemSetAndBroadcast(aSet);
280 
281  pSdrObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pCloneIMapObj )) );
282  pSdrObj->SetUserCall( GetSdrUserCall() );
283  }
284 
285  return pSdrObj;
286 }
287 
289 {
291 
292  SfxItemSet aSet( pModel->GetItemPool() );
293 
294  aSet.Put( XFillColorItem( "", TRANSCOL ) );
295  aSet.Put( XFillTransparenceItem( 50 ) );
296  pView->SetAttributes( aSet );
297  pView->SetFrameDragSingles();
298 }
299 
301 {
302  switch( rObj.GetObjIdentifier() )
303  {
304  case OBJ_RECT:
305  {
306  SdrRectObj* pRectObj = const_cast<SdrRectObj*>(static_cast<const SdrRectObj*>(&rObj));
307  auto pObj = std::make_shared<IMapRectangleObject>( pRectObj->GetLogicRect(), "", "", "", "", "", true, false );
308 
309  pRectObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pObj )) );
310  }
311  break;
312 
313  case OBJ_CIRC:
314  {
315  SdrCircObj* pCircObj = const_cast<SdrCircObj*>( static_cast<const SdrCircObj*>(&rObj) );
316  SdrPathObj* pPathObj = static_cast<SdrPathObj*>( pCircObj->ConvertToPolyObj( false, false ).release() );
317  tools::Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0));
318 
319  // always use SdrObject::Free(...) for SdrObjects (!)
320  SdrObject* pTemp(pPathObj);
321  SdrObject::Free(pTemp);
322 
323  auto pObj = std::make_shared<IMapPolygonObject>( aPoly, "", "", "", "", "", true, false );
324  pObj->SetExtraEllipse( aPoly.GetBoundRect() );
325  pCircObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pObj )) );
326  }
327  break;
328 
329  case OBJ_POLY:
330  case OBJ_FREEFILL:
331  case OBJ_PATHPOLY:
332  case OBJ_PATHFILL:
333  {
334  SdrPathObj* pPathObj = const_cast<SdrPathObj*>( static_cast<const SdrPathObj*>(&rObj) );
335  const basegfx::B2DPolyPolygon& rXPolyPoly = pPathObj->GetPathPoly();
336 
337  if ( rXPolyPoly.count() )
338  {
339  tools::Polygon aPoly(rXPolyPoly.getB2DPolygon(0));
340  auto pObj = std::make_shared<IMapPolygonObject>( aPoly, "", "", "", "", "", true, false );
341  pPathObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pObj )) );
342  }
343  }
344  break;
345 
346  default:
347  break;
348  }
349 }
350 
352 {
353  IMapUserData* pUserData = static_cast<IMapUserData*>( rObj.GetUserData( 0 ) );
354 
355  if ( !pUserData )
356  return;
357 
358  OUString aURL;
359  OUString aAltText;
360  OUString aDesc;
361  OUString aTarget;
362  IMapObjectPtr pIMapObj = pUserData->GetObject();
363  bool bActive = true;
364 
365  if ( pIMapObj )
366  {
367  aURL = pIMapObj->GetURL();
368  aAltText = pIMapObj->GetAltText();
369  aDesc = pIMapObj->GetDesc();
370  aTarget = pIMapObj->GetTarget();
371  bActive = pIMapObj->IsActive();
372  }
373 
374  switch( rObj.GetObjIdentifier() )
375  {
376  case OBJ_RECT:
377  {
378  pUserData->ReplaceObject( std::make_shared<IMapRectangleObject>( static_cast<const SdrRectObj&>(rObj).GetLogicRect(),
379  aURL, aAltText, aDesc, aTarget, "", bActive, false ) );
380  }
381  break;
382 
383  case OBJ_CIRC:
384  {
385  const SdrCircObj& rCircObj = static_cast<const SdrCircObj&>(rObj);
386  SdrPathObj* pPathObj = static_cast<SdrPathObj*>( rCircObj.ConvertToPolyObj( false, false ).release() );
387  tools::Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0));
388 
389  auto pObj = std::make_shared<IMapPolygonObject>( aPoly, aURL, aAltText, aDesc, aTarget, "", bActive, false );
390  pObj->SetExtraEllipse( aPoly.GetBoundRect() );
391 
392  // was only created by us temporarily
393  // always use SdrObject::Free(...) for SdrObjects (!)
394  SdrObject* pTemp(pPathObj);
395  SdrObject::Free(pTemp);
396 
397  pUserData->ReplaceObject( pObj );
398  }
399  break;
400 
401  case OBJ_POLY:
402  case OBJ_FREEFILL:
403  case OBJ_PATHPOLY:
404  case OBJ_PATHFILL:
405  {
406  const SdrPathObj& rPathObj = static_cast<const SdrPathObj&>(rObj);
407  const basegfx::B2DPolyPolygon& rXPolyPoly = rPathObj.GetPathPoly();
408 
409  if ( rXPolyPoly.count() )
410  {
411  tools::Polygon aPoly(rPathObj.GetPathPoly().getB2DPolygon(0));
412  auto pObj = std::make_shared<IMapPolygonObject>( aPoly, aURL, aAltText, aDesc, aTarget, "", bActive, false );
413  pUserData->ReplaceObject( pObj );
414  }
415  }
416  break;
417 
418  default:
419  break;
420  }
421 }
422 
424 {
425  bool bRet = GraphCtrl::MouseButtonUp( rMEvt );
426  UpdateInfo( true );
427  return bRet;
428 }
429 
431 {
433  UpdateInfo( false );
434 }
435 
436 SdrObject* IMapWindow::GetHitSdrObj( const Point& rPosPixel ) const
437 {
439 
440  SdrObject* pObj = nullptr;
441  Point aPt = rDevice.PixelToLogic( rPosPixel );
442 
443  if ( tools::Rectangle( Point(), GetGraphicSize() ).IsInside( aPt ) )
444  {
445  SdrPage* pPage = pModel->GetPage( 0 );
446  if ( pPage )
447  {
448  for ( size_t i = pPage->GetObjCount(); i > 0; )
449  {
450  --i;
451  SdrObject* pTestObj = pPage->GetObj( i );
452  IMapObject* pIMapObj = GetIMapObj( pTestObj );
453 
454  if ( pIMapObj && pIMapObj->IsHit( aPt ) )
455  {
456  pObj = pTestObj;
457  break;
458  }
459  }
460  }
461  }
462 
463  return pObj;
464 }
465 
467 {
468  IMapObject* pIMapObj = nullptr;
469 
470  if ( pSdrObj )
471  {
472  IMapUserData* pUserData = static_cast<IMapUserData*>( pSdrObj->GetUserData( 0 ) );
473 
474  if ( pUserData )
475  pIMapObj = pUserData->GetObject().get();
476  }
477 
478  return pIMapObj;
479 }
480 
482 {
483  if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
484  {
485  std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDrawingArea(), "svx/ui/imapmenu.ui"));
486  mxPopupMenu = xBuilder->weld_menu("menu");
487  const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
488  const size_t nMarked = rMarkList.GetMarkCount();
489 
490  mxPopupMenu->set_sensitive("url", false);
491  mxPopupMenu->set_sensitive("active", false);
492  mxPopupMenu->set_sensitive("macro", false);
493  mxPopupMenu->set_sensitive("selectall", pModel->GetPage(0)->GetObjCount() != pView->GetMarkedObjectCount());
494 
495  if ( !nMarked )
496  {
497  mxPopupMenu->set_sensitive("arrange", false);
498  mxPopupMenu->set_sensitive("delete", false);
499  }
500  else
501  {
502  if ( nMarked == 1 )
503  {
504  SdrObject* pSdrObj = GetSelectedSdrObject();
505 
506  mxPopupMenu->set_sensitive("url", true);
507  mxPopupMenu->set_sensitive("active", true);
508  mxPopupMenu->set_sensitive("macro", true);
509  mxPopupMenu->set_active("active", GetIMapObj(pSdrObj)->IsActive());
510  }
511 
512  mxPopupMenu->set_sensitive("arrange", true);
513  mxPopupMenu->set_sensitive("delete", true);
514  }
515 
517 
518  mxPopupMenu.reset();
519 
520  return true;
521  }
522  return CustomWidgetController::Command(rCEvt);
523 }
524 
526  : DropTargetHelper(rImapWindow.GetDrawingArea()->get_drop_target())
527  , m_rImapWindow(rImapWindow)
528 {
529 }
530 
532 {
533  return m_rImapWindow.AcceptDrop(rEvt);
534 }
535 
537 {
538  return m_rImapWindow.ExecuteDrop(rEvt);
539 }
540 
542 {
543  return( ( GetHitSdrObj( rEvt.maPosPixel ) != nullptr ) ? rEvt.mnAction : DND_ACTION_NONE );
544 }
545 
547 {
548  sal_Int8 nRet = DND_ACTION_NONE;
549 
550  if (mxDropTargetHelper->IsDropFormatSupported(SotClipboardFormatId::NETSCAPE_BOOKMARK))
551  {
552  INetBookmark aBookMark( "", "" );
553  SdrObject* pSdrObj = GetHitSdrObj( rEvt.maPosPixel );
554 
555  if( pSdrObj && TransferableDataHelper( rEvt.maDropEvent.Transferable ).GetINetBookmark( SotClipboardFormatId::NETSCAPE_BOOKMARK, aBookMark ) )
556  {
557  IMapObject* pIMapObj = GetIMapObj( pSdrObj );
558 
559  pIMapObj->SetURL( aBookMark.GetURL() );
560  pIMapObj->SetAltText( aBookMark.GetDescription() );
561  pModel->SetChanged();
562  pView->UnmarkAll();
563  pView->MarkObj( pSdrObj, pView->GetSdrPageView() );
564  UpdateInfo( true );
565  nRet = rEvt.mnAction;
566  }
567  }
568 
569  return nRet;
570 }
571 
573 {
575 
576  Point aPos = rDevice.PixelToLogic(rHelpArea.TopLeft());
577 
578  SdrPageView* pPageView = nullptr;
579  SdrObject* pSdrObj = pView->PickObj(aPos, pView->getHitTolLog(), pPageView);
580  if (pSdrObj)
581  {
582  const IMapObject* pIMapObj = GetIMapObj( pSdrObj );
583  if ( pIMapObj )
584  {
585  OUString aStr = pIMapObj->GetURL();
586  if ( !aStr.isEmpty() )
587  {
588  rHelpArea = rDevice.LogicToPixel(tools::Rectangle( Point(), GetGraphicSize()));
589  return aStr;
590  }
591  }
592  }
593 
594  return OUString();
595 }
596 
597 void IMapWindow::SetCurrentObjState( bool bActive )
598 {
600 
601  if ( !pObj )
602  return;
603 
604  SfxItemSet aSet( pModel->GetItemPool() );
605 
606  GetIMapObj( pObj )->SetActive( bActive );
607 
608  aSet.Put( XFillColorItem( "", TRANSCOL ) );
609 
610  if ( !bActive )
611  {
612  aSet.Put( XFillTransparenceItem( 100 ) );
613  aSet.Put( XLineColorItem( "", COL_RED ) );
614  }
615  else
616  {
617  aSet.Put( XFillTransparenceItem( 50 ) );
618  aSet.Put( XLineColorItem( "", COL_BLACK ) );
619  }
620 
621  pView->SetAttributes( aSet );
622 }
623 
624 void IMapWindow::UpdateInfo( bool bNewObj )
625 {
626  if ( !aInfoLink.IsSet() )
627  return;
628 
629  const SdrObject* pSdrObj = GetSelectedSdrObject();
630  const IMapObject* pIMapObj = pSdrObj ? GetIMapObj( pSdrObj ) : nullptr;
631 
632  aInfo.bNewObj = bNewObj;
633 
634  if ( pIMapObj )
635  {
636  aInfo.bOneMarked = true;
637  aInfo.aMarkURL = pIMapObj->GetURL();
638  aInfo.aMarkAltText = pIMapObj->GetAltText();
639  aInfo.aMarkTarget = pIMapObj->GetTarget();
640  aInfo.bActivated = pIMapObj->IsActive();
641  aInfoLink.Call( *this );
642  }
643  else
644  {
645  aInfo.aMarkURL.clear();
646  aInfo.aMarkAltText.clear();
647  aInfo.aMarkTarget.clear();
648  aInfo.bOneMarked = false;
649  aInfo.bActivated = false;
650  }
651 
652  aInfoLink.Call( *this );
653 }
654 
656 {
657  SdrObject* pSdrObj = GetSelectedSdrObject();
658 
659  if ( !pSdrObj )
660  return;
661 
663 
664  SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
665  aNamesItem.AddEvent( "MouseOver", "", SvMacroItemId::OnMouseOver );
666  aNamesItem.AddEvent( "MouseOut", "", SvMacroItemId::OnMouseOut );
667  aSet.Put( aNamesItem );
668 
669  SvxMacroItem aMacroItem(SID_ATTR_MACROITEM);
670  IMapObject* pIMapObj = GetIMapObj( pSdrObj );
671  aMacroItem.SetMacroTable( pIMapObj->GetMacroTable() );
672  aSet.Put( aMacroItem );
673 
676 
677  if ( pMacroDlg->Execute() == RET_OK )
678  {
679  const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
680  pIMapObj->SetMacroTable( pOutSet->Get( SID_ATTR_MACROITEM ).GetMacroTable() );
681  pModel->SetChanged();
682  UpdateInfo( false );
683  }
684 }
685 
687 {
688  SdrObject* pSdrObj = GetSelectedSdrObject();
689 
690  if ( !pSdrObj )
691  return;
692 
693  IMapObject* pIMapObj = GetIMapObj( pSdrObj );
695  ScopedVclPtr<AbstractURLDlg> aDlg(pFact->CreateURLDialog(GetDrawingArea(), pIMapObj->GetURL(), pIMapObj->GetAltText(), pIMapObj->GetDesc(),
696  pIMapObj->GetTarget(), pIMapObj->GetName(), aTargetList));
697  if ( aDlg->Execute() != RET_OK )
698  return;
699 
700  const OUString aURLText( aDlg->GetURL() );
701 
702  if ( !aURLText.isEmpty() )
703  {
704  INetURLObject aObj( aURLText, INetProtocol::File );
705  DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NotValid, "Invalid URL" );
707  }
708  else
709  pIMapObj->SetURL( aURLText );
710 
711  pIMapObj->SetAltText( aDlg->GetAltText() );
712  pIMapObj->SetDesc( aDlg->GetDesc() );
713  pIMapObj->SetTarget( aDlg->GetTarget() );
714  pIMapObj->SetName( aDlg->GetName() );
715  pModel->SetChanged();
716  UpdateInfo( true );
717 }
718 
719 void IMapWindow::MenuSelectHdl(const OString& rId)
720 {
721  if (rId == "url")
723  else if (rId == "macro")
724  DoMacroAssign();
725  else if (rId == "active")
726  {
727  const bool bNewState = !mxPopupMenu->get_active(rId);
728  SetCurrentObjState(bNewState);
729  UpdateInfo( false );
730  }
731  else if (rId == "front")
732  pView->PutMarkedToTop();
733  else if (rId == "forward")
734  pView->MovMarkedToTop();
735  else if (rId == "backward")
736  pView->MovMarkedToBtm();
737  else if (rId == "back")
738  pView->PutMarkedToBtm();
739  else if (rId == "selectall")
740  pView->MarkAll();
741  else if (rId == "delete")
742  pView->DeleteMarked();
743 }
744 
745 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsActive() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
Definition: svdmrkv.cxx:2507
const OUString & GetTarget() const
virtual bool IsHit(const Point &rPoint) const =0
URL aURL
caption object
Definition: svdobjkind.hxx:49
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
virtual bool Command(const CommandEvent &rCEvt) override
Definition: imapwnd.cxx:481
line
Definition: svdobjkind.hxx:29
size_t GetMarkCount() const
Definition: svdmark.hxx:180
std::unique_ptr< SdrModel > pModel
Definition: graphctl.hxx:74
std::shared_ptr< IMapObject > IMapObjectPtr
Definition: imapwnd.hxx:44
void SetImageMap(const ImageMap &rImageMap)
Definition: imapwnd.cxx:79
tools::Rectangle & Intersection(const tools::Rectangle &rRect)
const OUString & GetName() const
void InsertIMapObject(const IMapObject &rIMapObject)
signed char sal_Int8
virtual OUString GetAltText() const =0
rectangle (round corners optional)
Definition: svdobjkind.hxx:30
constexpr::Color COL_RED(0x80, 0x00, 0x00)
static SvxAbstractDialogFactory * Create()
Definition: svxdlg.cxx:22
long Long
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:770
size_t GetObjCount() const
Definition: svdpage.cxx:764
circle cut
Definition: svdobjkind.hxx:34
virtual VclPtr< SfxAbstractDialog > CreateEventConfigDialog(weld::Widget *pParent, const SfxItemSet &rAttr, const css::uno::Reference< css::frame::XFrame > &rFrame)=0
static weld::Builder * CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false)
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: imapwnd.cxx:67
OUString aMarkURL
Definition: imapwnd.hxx:33
virtual void MarkListHasChanged()
Definition: graphctl.cxx:273
sal_Int32 GetRadius(bool bPixelCoords=true) const
bool bNewObj
Definition: imapwnd.hxx:36
tools::Rectangle GetRectangle(bool bPixelCoords=true) const
size_t GetIMapObjectCount() const
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:473
void SetTarget(const OUString &rTarget)
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:661
bool GetINetBookmark(SotClipboardFormatId nFormat, INetBookmark &rBmk)
virtual short Execute()=0
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:338
SdrObjUserCall * GetSdrUserCall()
Definition: graphctl.hxx:92
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
void DoPropertyDialog()
Definition: imapwnd.cxx:686
Point GetCenter(bool bPixelCoords=true) const
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void SetCurrentObjState(bool bActive)
Definition: imapwnd.cxx:597
bool bActivated
Definition: imapwnd.hxx:38
virtual OUString GetName() const =0
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: imapwnd.cxx:546
Link< IMapWindow &, void > aInfoLink
Definition: imapwnd.hxx:85
std::unique_ptr< IMapDropTargetHelper > mxDropTargetHelper
Definition: imapwnd.hxx:90
int nCount
tools::Polygon GetPolygon(bool bPixelCoords=true) const
#define DND_ACTION_NONE
const Size & GetGraphicSize() const
Definition: graphctl.hxx:102
virtual void SdrObjChanged(const SdrObject &rObj) override
Definition: imapwnd.cxx:351
virtual OutputDevice & get_ref_device()=0
SdrObject * CreateObj(const IMapObject *pIMapObj)
Definition: imapwnd.cxx:176
void SetAltText(const OUString &rAltText)
void SetDesc(const OUString &rDesc)
IMapWindow(const css::uno::Reference< css::frame::XFrame > &rxDocumentFrame, weld::Dialog *pDialog)
Definition: imapwnd.cxx:54
open Bezier-curve
Definition: svdobjkind.hxx:37
void SetMacroTable(const SvxMacroTableDtor &rTbl)
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
Definition: imapwnd.cxx:531
#define DBG_ASSERT(sCon, aError)
int i
void ReplaceImageMap(const ImageMap &rNewImageMap)
Definition: imapwnd.cxx:84
virtual void InitSdrModel()
Definition: graphctl.cxx:107
const OUString & GetAltText() const
virtual OUString GetDesc() const =0
const SvxMacroTableDtor & GetMacroTable() const
virtual void MarkListHasChanged() override
Definition: imapwnd.cxx:430
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1810
virtual ~IMapWindow() override
Definition: imapwnd.cxx:63
CommandEventId GetCommand() const
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:2021
virtual void InitSdrModel() override
Definition: imapwnd.cxx:288
open free-hand line
Definition: svdobjkind.hxx:39
virtual VclPtr< AbstractURLDlg > CreateURLDialog(weld::Widget *pParent, const OUString &rURL, const OUString &rAltText, const OUString &rDescription, const OUString &rTarget, const OUString &rName, TargetList &rTargetList)=0
SdrView * GetSdrView() const
Definition: graphctl.hxx:114
SfxItemInfo maItemInfos[1]
Definition: imapwnd.hxx:87
bool bOneMarked
Definition: imapwnd.hxx:37
void DoMacroAssign()
Definition: imapwnd.cxx:655
virtual OUString RequestHelp(tools::Rectangle &rHelpArea) override
Definition: imapwnd.cxx:572
const OUString & GetDescription() const
void SetName(const OUString &rName)
rtl::Reference< SfxItemPool > pIMapPool
Definition: imapwnd.hxx:86
SdrModel * GetSdrModel() const
Definition: graphctl.hxx:113
::basegfx::B2DPolygon getB2DPolygon() const
void SetUserCall(SdrObjUserCall *pUser)
Definition: svdobj.cxx:2736
bool HasExtraEllipse() const
virtual OUString GetURL() const =0
Abstract DrawObject.
Definition: svdobj.hxx:258
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: imapwnd.cxx:423
void SetOutputSizePixel(const Size &rSize)
sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt)
Definition: imapwnd.cxx:541
IMapWindow & m_rImapWindow
Definition: imapwnd.hxx:71
OUString aMarkAltText
Definition: imapwnd.hxx:34
static IMapObject * GetIMapObj(const SdrObject *pSdrObj)
Definition: imapwnd.cxx:466
void AppendUserData(std::unique_ptr< SdrObjUserData > pData)
Definition: svdobj.cxx:2708
constexpr Point TopLeft() const
const ImageMap & GetImageMap()
Definition: imapwnd.cxx:139
const Point & GetMousePosPixel() const
#define TRANSCOL
Definition: imapwnd.cxx:52
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
const tools::Rectangle & GetExtraEllipse() const
virtual void SdrObjCreated(const SdrObject &rObj) override
Definition: imapwnd.cxx:300
NotifyInfo aInfo
Definition: imapwnd.hxx:82
std::unique_ptr< weld::Menu > mxPopupMenu
Definition: imapwnd.hxx:91
SdrObjectUniquePtr ConvertToPolyObj(bool bBezier, bool bLineToArea) const
Definition: svdobj.cxx:2598
weld::DrawingArea * GetDrawingArea() const
sal_uInt32 count() const
void SetTargetList(TargetList &rTargetList)
Definition: imapwnd.cxx:164
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void MenuSelectHdl(const OString &rId)
Definition: imapwnd.cxx:719
void ClearSdrObjList()
Definition: svdpage.cxx:114
void SetActive(bool bSetActive)
void SetMacroTable(const SvxMacroTableDtor &rTbl)
INetProtocol GetProtocol() const
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
Definition: svdobj.cxx:2702
RET_OK
TargetList aTargetList
Definition: imapwnd.hxx:84
std::unique_ptr< SdrView > pView
Definition: graphctl.hxx:75
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
SdrObject * GetSelectedSdrObject() const
Definition: graphctl.cxx:683
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
const OUString & GetURL() const
void Clip(const tools::Rectangle &rRect)
SdrObject * GetHitSdrObj(const Point &rPosPixel) const
Definition: imapwnd.cxx:436
IMapDropTargetHelper(IMapWindow &rImapWindow)
Definition: imapwnd.cxx:525
const basegfx::B2DPolyPolygon & GetPathPoly() const
Definition: svdopath.hxx:141
ImageMap aIMap
Definition: imapwnd.hxx:83
::std::vector< OUString > TargetList
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
Definition: imapwnd.cxx:536
IMapObject * GetIMapObject(size_t nPos) const
void SetURL(const OUString &rURL)
virtual IMapObjectType GetType() const =0
void SetSdrMode(bool b)
Definition: graphctl.cxx:87
const OUString & GetDesc() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:366
virtual OUString GetTarget() const =0
void ReplaceActualIMapInfo(const NotifyInfo &rNewInfo)
Definition: imapwnd.cxx:121
void UpdateInfo(bool bNewObj)
Definition: imapwnd.cxx:624
sal_Int8 mnAction
virtual void set_size_request(int nWidth, int nHeight)=0
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: graphctl.cxx:661
void ReplaceObject(const IMapObjectPtr &pNewIMapObject)
Definition: imapwnd.hxx:64
aStr
const OUString & GetURL() const
OUString aMarkTarget
Definition: imapwnd.hxx:35
css::uno::Reference< css::frame::XFrame > mxDocumentFrame
Definition: imapwnd.hxx:89
void ClearImageMap()
const IMapObjectPtr & GetObject() const
Definition: imapwnd.hxx:63
virtual const tools::Rectangle & GetLogicRect() const override
Definition: svdotxtr.cxx:69