23#include <com/sun/star/awt/XTopWindow.hpp>
24#include <com/sun/star/frame/Desktop.hpp>
25#include <com/sun/star/task/XInteractionHandler.hpp>
26#include <com/sun/star/util/XURLTransformer.hpp>
33#include <osl/file.hxx>
34#include <rtl/ustring.hxx>
39#include <sfx2/sfxsids.hrc>
57 addStatusListener(
".uno:CurrentURL");
108 return ChildKeyInput(rKEvt);
126 if ( aObj.
GetProtocol() == INetProtocol::NotValid )
133 if (
aName.isEmpty() )
136 Reference< XDispatchProvider > xDispatchProvider(
getFrameInterface(), UNO_QUERY );
137 if ( !xDispatchProvider.is() )
144 Reference< XDispatch >
xDispatch = xDispatchProvider->queryDispatch(
aTargetURL,
"_default", 0 );
148 Sequence< PropertyValue > aArgs{
156 pExecuteInfo->
aArgs = aArgs;
163 ExecuteInfo* pExecuteInfo =
static_cast<ExecuteInfo*
>(
p);
169 pExecuteInfo->xDispatch->dispatch( pExecuteInfo->aTargetURL, pExecuteInfo->aArgs );
181 SvtURLBox* pURLBox = xURLBox->GetURLBox();
195 if (rComboBox.changed_by_direct_pick() && !
aName.isEmpty())
202 OpenURL( pURLBox->
GetURL() );
204 Reference< XDesktop2 > xDesktop = Desktop::create(
m_xContext );
205 Reference< XFrame >
xFrame = xDesktop->getActiveFrame();
209 auto xWin =
xFrame->getContainerWindow();
213 Reference<css::awt::XTopWindow> xTop(xWin, UNO_QUERY);
227 if ( nSID == SID_OPENURL )
236 if( nSID == SID_FOCUSURLBOX )
241 else if ( !
m_bModified && SfxItemState::DEFAULT == eState )
249 if (!lProps.sURL.isEmpty())
255 if (osl::FileBase::getSystemPathFromFileURL(sMainURL, sFile) == osl::FileBase::E_None)
266 if ( eProt == INetProtocol::File )
Reference< XComponentContext > m_xContext
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
const OUString & GetValue() const
INetProtocol GetProtocol() const
virtual void dispose() override
std::unique_ptr< weld::Builder > m_xBuilder
void InitControlBase(weld::Widget *pWidget)
void set_entry_text(const OUString &rStr)
void connect_entry_activate(const Link< weld::ComboBox &, bool > &rLink)
void connect_changed(const Link< weld::ComboBox &, void > &rLink)
void append_text(const OUString &rStr)
static OUString ParseSmart(const OUString &aText, const OUString &aBaseURL)
void set_sensitive(bool bSensitive)
std::unique_ptr< SvtURLBox > m_xWidget
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)
virtual void dispose() override
URLBoxItemWindow(vcl::Window *pParent)
virtual ~URLBoxItemWindow() override
tools::Rectangle GetDesktopRectPixel() const
virtual void SetSizePixel(const Size &rNewSize)
void Enable(bool bEnable=true, bool bChild=true)
Reference< XDispatch > xDispatch
IMPL_STATIC_LINK(SfxURLToolBoxControl_Impl, ExecuteHdl_Impl, void *, p, void)
IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, OpenHdl, weld::ComboBox &, bool)
IMPL_LINK(URLBoxItemWindow, KeyInputHdl, const KeyEvent &, rKEvt, bool)
#define LINK(Instance, Class, Member)
std::vector< HistoryItem > GetList(EHistoryType eHistory)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
Reference< XFrame > xFrame
#define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass)