28#include <svx/svxids.hrc>
49using ::com::sun::star::frame::XFrame;
50using ::com::sun::star::uno::Reference;
52#define TRANSCOL COL_WHITE
56 , mxDocumentFrame(rxDocumentFrame)
59 SID_ATTR_MACROITEM, SID_ATTR_MACROITEM,
maItemInfos );
114 if (pNewObj && pPage)
141 if (
pModel->IsChanged() )
158 pModel->SetChanged(
false );
170 pModel->SetChanged(
false );
181 case IMapObjectType::Rectangle:
194 case IMapObjectType::Circle:
199 const Point aOffset( nRadius, nRadius );
215 case IMapObjectType::Polygon:
240 aDrawPoly.
Clip( aClipRect );
276 pSdrObj->SetMergedItemSetAndBroadcast(aSet);
278 pSdrObj->AppendUserData( std::unique_ptr<SdrObjUserData>(
new IMapUserData( pCloneIMapObj )) );
293 pView->SetAttributes( aSet );
294 pView->SetFrameDragSingles();
304 auto pObj = std::make_shared<IMapRectangleObject>( pRectObj->
GetLogicRect(),
"",
"",
"",
"",
"",
true,
false );
318 auto pObj = std::make_shared<IMapPolygonObject>( aPoly,
"",
"",
"",
"",
"",
true,
false );
332 if ( rXPolyPoly.
count() )
335 auto pObj = std::make_shared<IMapPolygonObject>( aPoly,
"",
"",
"",
"",
"",
true,
false );
362 aURL = pIMapObj->GetURL();
363 aAltText = pIMapObj->GetAltText();
364 aDesc = pIMapObj->GetDesc();
365 aTarget = pIMapObj->GetTarget();
366 bActive = pIMapObj->IsActive();
373 pUserData->
ReplaceObject( std::make_shared<IMapRectangleObject>(
static_cast<const SdrRectObj&
>(rObj).GetLogicRect(),
374 aURL, aAltText, aDesc, aTarget,
"", bActive,
false ) );
384 auto pObj = std::make_shared<IMapPolygonObject>( aPoly,
aURL, aAltText, aDesc, aTarget,
"", bActive,
false );
401 if ( rXPolyPoly.
count() )
404 auto pObj = std::make_shared<IMapPolygonObject>( aPoly,
aURL, aAltText, aDesc, aTarget,
"", bActive,
false );
446 if ( pIMapObj && pIMapObj->
IsHit( aPt ) )
475 if ( rCEvt.
GetCommand() == CommandEventId::ContextMenu )
485 mxPopupMenu->set_sensitive(
"selectall",
pModel->GetPage(0)->GetObjCount() !=
pView->GetMarkedObjectCount());
514 return CustomWidgetController::Command(rCEvt);
518 : DropTargetHelper(rImapWindow.GetDrawingArea()->get_drop_target())
519 , m_rImapWindow(rImapWindow)
542 if (
mxDropTargetHelper->IsDropFormatSupported(SotClipboardFormatId::NETSCAPE_BOOKMARK))
555 pView->MarkObj( pSdrObj,
pView->GetSdrPageView() );
578 if ( !
aStr.isEmpty() )
613 pView->SetAttributes( aSet );
658 aNamesItem.
AddEvent(
"MouseOver",
"", SvMacroItemId::OnMouseOver );
659 aNamesItem.
AddEvent(
"MouseOut",
"", SvMacroItemId::OnMouseOut );
660 aSet.
Put( aNamesItem );
665 aSet.
Put( aMacroItem );
670 if ( pMacroDlg->Execute() ==
RET_OK )
672 const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
673 pIMapObj->
SetMacroTable( pOutSet->
Get( SID_ATTR_MACROITEM ).GetMacroTable() );
690 if ( aDlg->Execute() !=
RET_OK )
693 const OUString aURLText( aDlg->GetURL() );
695 if ( !aURLText.isEmpty() )
702 pIMapObj->
SetURL( aURLText );
705 pIMapObj->
SetDesc( aDlg->GetDesc() );
706 pIMapObj->
SetTarget( aDlg->GetTarget() );
707 pIMapObj->
SetName( aDlg->GetName() );
716 else if (rId ==
"macro")
718 else if (rId ==
"active")
720 const bool bNewState = !
mxPopupMenu->get_active(rId);
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")
734 else if (rId ==
"delete")
735 pView->DeleteMarked();
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
SdrObjUserCall * GetSdrUserCall()
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
SdrModel * GetSdrModel() const
std::unique_ptr< SdrView > pView
std::unique_ptr< SdrModel > pModel
virtual void MarkListHasChanged()
SdrView * GetSdrView() const
virtual void InitSdrModel()
const Size & GetGraphicSize() const
sal_Int32 GetRadius(bool bPixelCoords=true) const
Point GetCenter(bool bPixelCoords=true) const
IMapWindow & m_rImapWindow
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
IMapDropTargetHelper(IMapWindow &rImapWindow)
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
void SetTarget(const OUString &rTarget)
const OUString & GetAltText() const
const OUString & GetName() const
virtual IMapObjectType GetType() const=0
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)
const IMapObjectPtr & GetObject() const
void SetTargetList(const TargetList &rTargetList)
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
void MenuSelectHdl(const OUString &rId)
static IMapObject * GetIMapObj(const SdrObject *pSdrObj)
Link< IMapWindow &, void > aInfoLink
void SetImageMap(const ImageMap &rImageMap)
css::uno::Reference< css::frame::XFrame > mxDocumentFrame
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
SdrObject * GetHitSdrObj(const Point &rPosPixel) const
std::unique_ptr< IMapDropTargetHelper > mxDropTargetHelper
const ImageMap & GetImageMap()
virtual void InitSdrModel() override
rtl::Reference< SfxItemPool > pIMapPool
virtual bool Command(const CommandEvent &rCEvt) override
void ReplaceActualIMapInfo(const NotifyInfo &rNewInfo)
sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt)
virtual OUString RequestHelp(tools::Rectangle &rHelpArea) override
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
void SetCurrentObjState(bool bActive)
virtual void SdrObjChanged(const SdrObject &rObj) override
SfxItemInfo maItemInfos[1]
virtual ~IMapWindow() override
std::unique_ptr< weld::Menu > mxPopupMenu
void ReplaceImageMap(const ImageMap &rNewImageMap)
void UpdateInfo(bool bNewObj)
virtual void MarkListHasChanged() override
virtual void SdrObjCreated(const SdrObject &rObj) override
rtl::Reference< SdrObject > CreateObj(const IMapObject *pIMapObj)
IMapWindow(const css::uno::Reference< css::frame::XFrame > &rxDocumentFrame, weld::Dialog *pDialog)
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
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
size_t GetMarkCount() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
void AppendUserData(std::unique_ptr< SdrObjUserData > pData)
rtl::Reference< SdrObject > ConvertToPolyObj(bool bBezier, bool bLineToArea) const
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
virtual SdrObjKind GetObjIdentifier() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
const basegfx::B2DPolyPolygon & GetPathPoly() const
Rectangle objects (rectangle, circle, ...)
virtual const tools::Rectangle & GetLogicRect() const override
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()
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
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
virtual OutputDevice & get_ref_device()=0
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define DBG_ASSERT(sCon, aError)
::std::vector< OUString > TargetList
std::shared_ptr< IMapObject > IMapObjectPtr
const css::datatransfer::dnd::DropTargetDropEvent maDropEvent
@ PathFill
open Bezier-curve
@ CircleOrEllipse
rectangle (round corners optional)
@ FreehandFill
open free-hand line