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