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