29 #include <com/sun/star/form/FormButtonType.hpp>
30 #include <com/sun/star/beans/XPropertySet.hpp>
31 #include <com/sun/star/beans/XPropertySetInfo.hpp>
39 #include <drformsh.hxx>
45 #define ShellClass_SwDrawFormShell
47 #include <swslots.hxx>
55 GetStaticInterface()->RegisterPopupMenu(
"form");
57 GetStaticInterface()->RegisterObjectBar(
SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Text_Toolbox_Sw);
69 case SID_HYPERLINK_SETLINK:
72 pArgs->
GetItemState(SID_HYPERLINK_SETLINK,
false, &pItem);
93 SID_HYPERLINK_SETLINK, SfxCallMode::ASYNCHRON,
98 const uno::Reference< awt::XControlModel >& xControlModel = pUnoCtrl->
GetUnoControlModel();
100 OSL_ENSURE( xControlModel.is(),
"UNO-Control without Model" );
101 if( !xControlModel.is() )
104 uno::Reference< beans::XPropertySet > xPropSet(xControlModel, uno::UNO_QUERY);
107 OUString sTargetURL(
"TargetURL" );
108 uno::Reference< beans::XPropertySetInfo > xPropInfoSet = xPropSet->getPropertySetInfo();
109 if( xPropInfoSet->hasPropertyByName( sTargetURL ))
111 beans::Property aProp = xPropInfoSet->getPropertyByName( sTargetURL );
112 if( !aProp.Name.isEmpty() )
116 OUString sLabel(
"Label");
117 if( xPropInfoSet->hasPropertyByName(sLabel) )
120 xPropSet->setPropertyValue(sLabel, aTmp );
128 xPropSet->setPropertyValue( sTargetURL, aTmp );
133 xPropSet->setPropertyValue(
"TargetFrame", aTmp );
136 aTmp <<= form::FormButtonType_URL;
137 xPropSet->setPropertyValue(
"ButtonType", aTmp );
148 OSL_ENSURE(
false,
"wrong dispatcher");
163 case SID_HYPERLINK_GETLINK:
171 if (pUnoCtrl && SdrInventor::FmForm == pUnoCtrl->
GetObjInventor())
173 const uno::Reference< awt::XControlModel >& xControlModel = pUnoCtrl->
GetUnoControlModel();
175 OSL_ENSURE( xControlModel.is(),
"UNO-Control without Model" );
176 if( !xControlModel.is() )
179 uno::Reference< beans::XPropertySet > xPropSet(xControlModel, uno::UNO_QUERY);
182 uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
183 if(xInfo->hasPropertyByName(
"ButtonType" ))
185 form::FormButtonType eButtonType = form::FormButtonType_URL;
186 aTmp = xPropSet->getPropertyValue(
"ButtonType" );
187 if( aTmp >>= eButtonType )
190 if(xInfo->hasPropertyByName(
"Label" ))
192 aTmp = xPropSet->getPropertyValue(
"Label" );
194 if( (aTmp >>= sTmp) && !sTmp.isEmpty())
201 if(xInfo->hasPropertyByName(
"TargetURL" ))
203 aTmp = xPropSet->getPropertyValue(
"TargetURL" );
205 if( (aTmp >>= sTmp) && !sTmp.isEmpty())
212 if(xInfo->hasPropertyByName(
"TargetFrame" ))
214 aTmp = xPropSet->getPropertyValue(
"TargetFrame" );
216 if( (aTmp >>= sTmp) && !sTmp.isEmpty())
230 rSet.
Put(aHLinkItem);
void SetURL(const OUString &rURL)
SfxViewFrame * GetViewFrame() const
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 * >())
#define SFX_IMPL_INTERFACE(Class, SuperClass)
const OUString & GetTargetFrame() const
SfxDispatcher * GetDispatcher()
SdrMark * GetMark(size_t nNum) const
const SfxItemSet * GetArgs() const
void NoEdit(bool bHideCursor=true)
Used by the UI to modify the document model.
void SetTargetFrame(const OUString &rTarget)
SdrObject * GetMarkedSdrObj() const
const OUString & GetURL() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SdrMarkList & GetMarkedObjectList() const
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
void SetName(const OUString &rName)
void SetName(const OUString &rName)
SwDocShell * GetDocShell()
virtual SdrInventor GetObjInventor() const
#define SFX_OBJECTBAR_OBJECT
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
static const OUString & GetContextName(const Context eContext)
SdrView * GetDrawViewWithValidMarkList()
const INetURLObject & GetURLObject() const
void SetInsertMode(SvxLinkInsertMode eNew)
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
const OUString & GetName() const
SvxLinkInsertMode GetInsertMode() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
void SetContextName(const OUString &rsContextName)
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)
SfxMedium * GetMedium() const