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 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
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() );
176 SdrObject* pSdrObj = nullptr;
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 SdrPathObj* pPathObj = static_cast<SdrPathObj*>( pCircObj->ConvertToPolyObj( false, false ).release() );
314 tools::Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0));
315
316 // always use SdrObject::Free(...) for SdrObjects (!)
317 SdrObject* pTemp(pPathObj);
318 SdrObject::Free(pTemp);
319
320 auto pObj = std::make_shared<IMapPolygonObject>( aPoly, "", "", "", "", "", true, false );
321 pObj->SetExtraEllipse( aPoly.GetBoundRect() );
322 pCircObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pObj )) );
323 }
324 break;
325
330 {
331 SdrPathObj* pPathObj = const_cast<SdrPathObj*>( static_cast<const SdrPathObj*>(&rObj) );
332 const basegfx::B2DPolyPolygon& rXPolyPoly = pPathObj->GetPathPoly();
333
334 if ( rXPolyPoly.count() )
335 {
336 tools::Polygon aPoly(rXPolyPoly.getB2DPolygon(0));
337 auto pObj = std::make_shared<IMapPolygonObject>( aPoly, "", "", "", "", "", true, false );
338 pPathObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new IMapUserData( pObj )) );
339 }
340 }
341 break;
342
343 default:
344 break;
345 }
346}
347
349{
350 IMapUserData* pUserData = static_cast<IMapUserData*>( rObj.GetUserData( 0 ) );
351
352 if ( !pUserData )
353 return;
354
355 OUString aURL;
356 OUString aAltText;
357 OUString aDesc;
358 OUString aTarget;
359 IMapObjectPtr pIMapObj = pUserData->GetObject();
360 bool bActive = true;
361
362 if ( pIMapObj )
363 {
364 aURL = pIMapObj->GetURL();
365 aAltText = pIMapObj->GetAltText();
366 aDesc = pIMapObj->GetDesc();
367 aTarget = pIMapObj->GetTarget();
368 bActive = pIMapObj->IsActive();
369 }
370
371 switch( rObj.GetObjIdentifier() )
372 {
374 {
375 pUserData->ReplaceObject( std::make_shared<IMapRectangleObject>( static_cast<const SdrRectObj&>(rObj).GetLogicRect(),
376 aURL, aAltText, aDesc, aTarget, "", bActive, false ) );
377 }
378 break;
379
381 {
382 const SdrCircObj& rCircObj = static_cast<const SdrCircObj&>(rObj);
383 SdrPathObj* pPathObj = static_cast<SdrPathObj*>( rCircObj.ConvertToPolyObj( false, false ).release() );
384 tools::Polygon aPoly(pPathObj->GetPathPoly().getB2DPolygon(0));
385
386 auto pObj = std::make_shared<IMapPolygonObject>( aPoly, aURL, aAltText, aDesc, aTarget, "", bActive, false );
387 pObj->SetExtraEllipse( aPoly.GetBoundRect() );
388
389 // was only created by us temporarily
390 // always use SdrObject::Free(...) for SdrObjects (!)
391 SdrObject* pTemp(pPathObj);
392 SdrObject::Free(pTemp);
393
394 pUserData->ReplaceObject( pObj );
395 }
396 break;
397
402 {
403 const SdrPathObj& rPathObj = static_cast<const SdrPathObj&>(rObj);
404 const basegfx::B2DPolyPolygon& rXPolyPoly = rPathObj.GetPathPoly();
405
406 if ( rXPolyPoly.count() )
407 {
408 tools::Polygon aPoly(rPathObj.GetPathPoly().getB2DPolygon(0));
409 auto pObj = std::make_shared<IMapPolygonObject>( aPoly, aURL, aAltText, aDesc, aTarget, "", bActive, false );
410 pUserData->ReplaceObject( pObj );
411 }
412 }
413 break;
414
415 default:
416 break;
417 }
418}
419
421{
422 bool bRet = GraphCtrl::MouseButtonUp( rMEvt );
423 UpdateInfo( true );
424 return bRet;
425}
426
428{
430 UpdateInfo( false );
431}
432
433SdrObject* IMapWindow::GetHitSdrObj( const Point& rPosPixel ) const
434{
436
437 SdrObject* pObj = nullptr;
438 Point aPt = rDevice.PixelToLogic( rPosPixel );
439
440 if ( tools::Rectangle( Point(), GetGraphicSize() ).Contains( aPt ) )
441 {
442 SdrPage* pPage = pModel->GetPage( 0 );
443 if ( pPage )
444 {
445 for ( size_t i = pPage->GetObjCount(); i > 0; )
446 {
447 --i;
448 SdrObject* pTestObj = pPage->GetObj( i );
449 IMapObject* pIMapObj = GetIMapObj( pTestObj );
450
451 if ( pIMapObj && pIMapObj->IsHit( aPt ) )
452 {
453 pObj = pTestObj;
454 break;
455 }
456 }
457 }
458 }
459
460 return pObj;
461}
462
464{
465 IMapObject* pIMapObj = nullptr;
466
467 if ( pSdrObj )
468 {
469 IMapUserData* pUserData = static_cast<IMapUserData*>( pSdrObj->GetUserData( 0 ) );
470
471 if ( pUserData )
472 pIMapObj = pUserData->GetObject().get();
473 }
474
475 return pIMapObj;
476}
477
479{
480 if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
481 {
482 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDrawingArea(), "svx/ui/imapmenu.ui"));
483 mxPopupMenu = xBuilder->weld_menu("menu");
484 const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
485 const size_t nMarked = rMarkList.GetMarkCount();
486
487 mxPopupMenu->set_sensitive("url", false);
488 mxPopupMenu->set_sensitive("active", false);
489 mxPopupMenu->set_sensitive("macro", false);
490 mxPopupMenu->set_sensitive("selectall", pModel->GetPage(0)->GetObjCount() != pView->GetMarkedObjectCount());
491
492 if ( !nMarked )
493 {
494 mxPopupMenu->set_sensitive("arrange", false);
495 mxPopupMenu->set_sensitive("delete", false);
496 }
497 else
498 {
499 if ( nMarked == 1 )
500 {
501 SdrObject* pSdrObj = GetSelectedSdrObject();
502
503 mxPopupMenu->set_sensitive("url", true);
504 mxPopupMenu->set_sensitive("active", true);
505 mxPopupMenu->set_sensitive("macro", true);
506 mxPopupMenu->set_active("active", GetIMapObj(pSdrObj)->IsActive());
507 }
508
509 mxPopupMenu->set_sensitive("arrange", true);
510 mxPopupMenu->set_sensitive("delete", true);
511 }
512
514
515 mxPopupMenu.reset();
516
517 return true;
518 }
519 return CustomWidgetController::Command(rCEvt);
520}
521
523 : DropTargetHelper(rImapWindow.GetDrawingArea()->get_drop_target())
524 , m_rImapWindow(rImapWindow)
525{
526}
527
529{
530 return m_rImapWindow.AcceptDrop(rEvt);
531}
532
534{
535 return m_rImapWindow.ExecuteDrop(rEvt);
536}
537
539{
540 return( ( GetHitSdrObj( rEvt.maPosPixel ) != nullptr ) ? rEvt.mnAction : DND_ACTION_NONE );
541}
542
544{
546
547 if (mxDropTargetHelper->IsDropFormatSupported(SotClipboardFormatId::NETSCAPE_BOOKMARK))
548 {
549 INetBookmark aBookMark( "", "" );
550 SdrObject* pSdrObj = GetHitSdrObj( rEvt.maPosPixel );
551
552 if( pSdrObj && TransferableDataHelper( rEvt.maDropEvent.Transferable ).GetINetBookmark( SotClipboardFormatId::NETSCAPE_BOOKMARK, aBookMark ) )
553 {
554 IMapObject* pIMapObj = GetIMapObj( pSdrObj );
555
556 pIMapObj->SetURL( aBookMark.GetURL() );
557 pIMapObj->SetAltText( aBookMark.GetDescription() );
558 pModel->SetChanged();
559 pView->UnmarkAll();
560 pView->MarkObj( pSdrObj, pView->GetSdrPageView() );
561 UpdateInfo( true );
562 nRet = rEvt.mnAction;
563 }
564 }
565
566 return nRet;
567}
568
570{
572
573 Point aPos = rDevice.PixelToLogic(rHelpArea.TopLeft());
574
575 SdrPageView* pPageView = nullptr;
576 SdrObject* pSdrObj = pView->PickObj(aPos, pView->getHitTolLog(), pPageView);
577 if (pSdrObj)
578 {
579 const IMapObject* pIMapObj = GetIMapObj( pSdrObj );
580 if ( pIMapObj )
581 {
582 OUString aStr = pIMapObj->GetURL();
583 if ( !aStr.isEmpty() )
584 {
585 rHelpArea = rDevice.LogicToPixel(tools::Rectangle( Point(), GetGraphicSize()));
586 return aStr;
587 }
588 }
589 }
590
591 return OUString();
592}
593
595{
597
598 if ( !pObj )
599 return;
600
601 SfxItemSet aSet( pModel->GetItemPool() );
602
603 GetIMapObj( pObj )->SetActive( bActive );
604
605 aSet.Put( XFillColorItem( "", TRANSCOL ) );
606
607 if ( !bActive )
608 {
609 aSet.Put( XFillTransparenceItem( 100 ) );
610 aSet.Put( XLineColorItem( "", COL_RED ) );
611 }
612 else
613 {
614 aSet.Put( XFillTransparenceItem( 50 ) );
615 aSet.Put( XLineColorItem( "", COL_BLACK ) );
616 }
617
618 pView->SetAttributes( aSet );
619}
620
621void IMapWindow::UpdateInfo( bool bNewObj )
622{
623 if ( !aInfoLink.IsSet() )
624 return;
625
626 const SdrObject* pSdrObj = GetSelectedSdrObject();
627 const IMapObject* pIMapObj = pSdrObj ? GetIMapObj( pSdrObj ) : nullptr;
628
629 aInfo.bNewObj = bNewObj;
630
631 if ( pIMapObj )
632 {
633 aInfo.bOneMarked = true;
634 aInfo.aMarkURL = pIMapObj->GetURL();
635 aInfo.aMarkAltText = pIMapObj->GetAltText();
636 aInfo.aMarkTarget = pIMapObj->GetTarget();
637 aInfo.bActivated = pIMapObj->IsActive();
638 aInfoLink.Call( *this );
639 }
640 else
641 {
642 aInfo.aMarkURL.clear();
643 aInfo.aMarkAltText.clear();
644 aInfo.aMarkTarget.clear();
645 aInfo.bOneMarked = false;
646 aInfo.bActivated = false;
647 }
648
649 aInfoLink.Call( *this );
650}
651
653{
654 SdrObject* pSdrObj = GetSelectedSdrObject();
655
656 if ( !pSdrObj )
657 return;
658
660 aSet(*pIMapPool);
661
662 SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
663 aNamesItem.AddEvent( "MouseOver", "", SvMacroItemId::OnMouseOver );
664 aNamesItem.AddEvent( "MouseOut", "", SvMacroItemId::OnMouseOut );
665 aSet.Put( aNamesItem );
666
667 SvxMacroItem aMacroItem(SID_ATTR_MACROITEM);
668 IMapObject* pIMapObj = GetIMapObj( pSdrObj );
669 aMacroItem.SetMacroTable( pIMapObj->GetMacroTable() );
670 aSet.Put( aMacroItem );
671
674
675 if ( pMacroDlg->Execute() == RET_OK )
676 {
677 const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
678 pIMapObj->SetMacroTable( pOutSet->Get( SID_ATTR_MACROITEM ).GetMacroTable() );
679 pModel->SetChanged();
680 UpdateInfo( false );
681 }
682}
683
685{
686 SdrObject* pSdrObj = GetSelectedSdrObject();
687
688 if ( !pSdrObj )
689 return;
690
691 IMapObject* pIMapObj = GetIMapObj( pSdrObj );
693 ScopedVclPtr<AbstractURLDlg> aDlg(pFact->CreateURLDialog(GetDrawingArea(), pIMapObj->GetURL(), pIMapObj->GetAltText(), pIMapObj->GetDesc(),
694 pIMapObj->GetTarget(), pIMapObj->GetName(), aTargetList));
695 if ( aDlg->Execute() != RET_OK )
696 return;
697
698 const OUString aURLText( aDlg->GetURL() );
699
700 if ( !aURLText.isEmpty() )
701 {
702 INetURLObject aObj( aURLText, INetProtocol::File );
703 DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NotValid, "Invalid URL" );
705 }
706 else
707 pIMapObj->SetURL( aURLText );
708
709 pIMapObj->SetAltText( aDlg->GetAltText() );
710 pIMapObj->SetDesc( aDlg->GetDesc() );
711 pIMapObj->SetTarget( aDlg->GetTarget() );
712 pIMapObj->SetName( aDlg->GetName() );
713 pModel->SetChanged();
714 UpdateInfo( true );
715}
716
717void IMapWindow::MenuSelectHdl(const OString& rId)
718{
719 if (rId == "url")
721 else if (rId == "macro")
723 else if (rId == "active")
724 {
725 const bool bNewState = !mxPopupMenu->get_active(rId);
726 SetCurrentObjState(bNewState);
727 UpdateInfo( false );
728 }
729 else if (rId == "front")
730 pView->PutMarkedToTop();
731 else if (rId == "forward")
732 pView->MovMarkedToTop();
733 else if (rId == "backward")
734 pView->MovMarkedToBtm();
735 else if (rId == "back")
736 pView->PutMarkedToBtm();
737 else if (rId == "selectall")
738 pView->MarkAll();
739 else if (rId == "delete")
740 pView->DeleteMarked();
741}
742
743/* 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:690
SdrObjUserCall * GetSdrUserCall()
Definition: graphctl.hxx:92
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: graphctl.cxx:668
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:280
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:71
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
Definition: imapwnd.cxx:533
IMapDropTargetHelper(IMapWindow &rImapWindow)
Definition: imapwnd.cxx:522
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
Definition: imapwnd.cxx:528
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:64
const IMapObjectPtr & GetObject() const
Definition: imapwnd.hxx:63
TargetList aTargetList
Definition: imapwnd.hxx:84
void SetTargetList(const TargetList &rTargetList)
Definition: imapwnd.cxx:164
SdrObject * CreateObj(const IMapObject *pIMapObj)
Definition: imapwnd.cxx:173
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: imapwnd.cxx:67
NotifyInfo aInfo
Definition: imapwnd.hxx:82
static IMapObject * GetIMapObj(const SdrObject *pSdrObj)
Definition: imapwnd.cxx:463
Link< IMapWindow &, void > aInfoLink
Definition: imapwnd.hxx:85
void DoMacroAssign()
Definition: imapwnd.cxx:652
ImageMap aIMap
Definition: imapwnd.hxx:83
void SetImageMap(const ImageMap &rImageMap)
Definition: imapwnd.cxx:79
css::uno::Reference< css::frame::XFrame > mxDocumentFrame
Definition: imapwnd.hxx:89
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
Definition: imapwnd.cxx:543
SdrObject * GetHitSdrObj(const Point &rPosPixel) const
Definition: imapwnd.cxx:433
void MenuSelectHdl(const OString &rId)
Definition: imapwnd.cxx:717
std::unique_ptr< IMapDropTargetHelper > mxDropTargetHelper
Definition: imapwnd.hxx:90
const ImageMap & GetImageMap()
Definition: imapwnd.cxx:139
virtual void InitSdrModel() override
Definition: imapwnd.cxx:285
void DoPropertyDialog()
Definition: imapwnd.cxx:684
rtl::Reference< SfxItemPool > pIMapPool
Definition: imapwnd.hxx:86
virtual bool Command(const CommandEvent &rCEvt) override
Definition: imapwnd.cxx:478
void ReplaceActualIMapInfo(const NotifyInfo &rNewInfo)
Definition: imapwnd.cxx:121
sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt)
Definition: imapwnd.cxx:538
virtual OUString RequestHelp(tools::Rectangle &rHelpArea) override
Definition: imapwnd.cxx:569
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
Definition: imapwnd.cxx:420
void SetCurrentObjState(bool bActive)
Definition: imapwnd.cxx:594
virtual void SdrObjChanged(const SdrObject &rObj) override
Definition: imapwnd.cxx:348
SfxItemInfo maItemInfos[1]
Definition: imapwnd.hxx:87
virtual ~IMapWindow() override
Definition: imapwnd.cxx:63
std::unique_ptr< weld::Menu > mxPopupMenu
Definition: imapwnd.hxx:91
void ReplaceImageMap(const ImageMap &rNewImageMap)
Definition: imapwnd.cxx:84
void UpdateInfo(bool bNewObj)
Definition: imapwnd.cxx:621
virtual void MarkListHasChanged() override
Definition: imapwnd.cxx:427
virtual void SdrObjCreated(const SdrObject &rObj) override
Definition: imapwnd.cxx:297
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:2558
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1798
void ClearSdrObjList()
Definition: svdpage.cxx:105
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:327
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:805
size_t GetObjCount() const
Definition: svdpage.cxx:799
Abstract DrawObject.
Definition: svdobj.hxx:261
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:476
void AppendUserData(std::unique_ptr< SdrObjUserData > pData)
Definition: svdobj.cxx:2733
void SetUserCall(SdrObjUserCall *pUser)
Definition: svdobj.cxx:2761
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
Definition: svdobj.cxx:2727
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:2017
virtual SdrObjKind GetObjIdentifier() const
Definition: svdobj.cxx:654
SdrObjectUniquePtr ConvertToPolyObj(bool bBezier, bool bLineToArea) const
Definition: svdobj.cxx:2623
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:374
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:69
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:44
aStr
int i
long Long
sal_Int8 mnAction
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
bool bOneMarked
Definition: imapwnd.hxx:37
bool bNewObj
Definition: imapwnd.hxx:36
OUString aMarkURL
Definition: imapwnd.hxx:33
OUString aMarkTarget
Definition: imapwnd.hxx:35
OUString aMarkAltText
Definition: imapwnd.hxx:34
bool bActivated
Definition: imapwnd.hxx:38
@ 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