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