29#include <com/sun/star/form/FormButtonType.hpp>
30#include <com/sun/star/beans/XPropertySet.hpp>
31#include <com/sun/star/beans/XPropertySetInfo.hpp>
34#include <osl/diagnose.h>
40#include <drformsh.hxx>
46#define ShellClass_SwDrawFormShell
56 GetStaticInterface()->RegisterPopupMenu(
"form");
58 GetStaticInterface()->RegisterObjectBar(
SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Text_Toolbox_Sw);
70 case SID_HYPERLINK_SETLINK:
73 pArgs->
GetItemState(SID_HYPERLINK_SETLINK,
false, &pItem);
94 SID_HYPERLINK_SETLINK, SfxCallMode::ASYNCHRON,
99 const uno::Reference< awt::XControlModel >& xControlModel = pUnoCtrl->
GetUnoControlModel();
101 OSL_ENSURE( xControlModel.is(),
"UNO-Control without Model" );
102 if( !xControlModel.is() )
105 uno::Reference< beans::XPropertySet > xPropSet(xControlModel, uno::UNO_QUERY);
108 OUString sTargetURL(
"TargetURL" );
109 uno::Reference< beans::XPropertySetInfo > xPropInfoSet = xPropSet->getPropertySetInfo();
110 if( xPropInfoSet->hasPropertyByName( sTargetURL ))
112 beans::Property aProp = xPropInfoSet->getPropertyByName( sTargetURL );
113 if( !aProp.Name.isEmpty() )
117 OUString sLabel(
"Label");
118 if( xPropInfoSet->hasPropertyByName(sLabel) )
121 xPropSet->setPropertyValue(sLabel, aTmp );
129 xPropSet->setPropertyValue( sTargetURL, aTmp );
134 xPropSet->setPropertyValue(
"TargetFrame", aTmp );
137 aTmp <<= form::FormButtonType_URL;
138 xPropSet->setPropertyValue(
"ButtonType", aTmp );
149 OSL_ENSURE(
false,
"wrong dispatcher");
164 case SID_HYPERLINK_GETLINK:
172 if (pUnoCtrl && SdrInventor::FmForm == pUnoCtrl->
GetObjInventor())
174 const uno::Reference< awt::XControlModel >& xControlModel = pUnoCtrl->
GetUnoControlModel();
176 OSL_ENSURE( xControlModel.is(),
"UNO-Control without Model" );
177 if( !xControlModel.is() )
180 uno::Reference< beans::XPropertySet > xPropSet(xControlModel, uno::UNO_QUERY);
183 uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
184 if(xInfo->hasPropertyByName(
"ButtonType" ))
186 form::FormButtonType eButtonType = form::FormButtonType_URL;
187 aTmp = xPropSet->getPropertyValue(
"ButtonType" );
188 if( aTmp >>= eButtonType )
191 if(xInfo->hasPropertyByName(
"Label" ))
193 aTmp = xPropSet->getPropertyValue(
"Label" );
195 if( (aTmp >>= sTmp) && !sTmp.isEmpty())
202 if(xInfo->hasPropertyByName(
"TargetURL" ))
204 aTmp = xPropSet->getPropertyValue(
"TargetURL" );
206 if( (aTmp >>= sTmp) && !sTmp.isEmpty())
213 if(xInfo->hasPropertyByName(
"TargetFrame" ))
215 aTmp = xPropSet->getPropertyValue(
"TargetFrame" );
217 if( (aTmp >>= sTmp) && !sTmp.isEmpty())
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
SdrObject * GetMarkedSdrObj() const
virtual SdrInventor GetObjInventor() const
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const INetURLObject & GetURLObject() const
SfxMedium * GetMedium() const
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void SetContextName(const OUString &rsContextName)
void SetName(const OUString &rName)
SfxDispatcher * GetDispatcher()
SfxViewFrame & GetViewFrame() const
SvxLinkInsertMode GetInsertMode() const
const OUString & GetName() const
const OUString & GetURL() const
void SetName(const OUString &rName)
void SetInsertMode(SvxLinkInsertMode eNew)
void SetURL(const OUString &rURL)
const OUString & GetTargetFrame() const
void SetTargetFrame(const OUString &rTarget)
SdrView * GetDrawViewWithValidMarkList()
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
void NoEdit(bool bHideCursor=true)
static const OUString & GetContextName(const Context eContext)
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
#define SFX_OBJECTBAR_OBJECT
#define SFX_IMPL_INTERFACE(Class, SuperClass)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)