21#include <osl/file.hxx>
23#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
39 , m_xBtFileopen(xBuilder->weld_button(
"fileopen"))
40 , m_xEdTarget(xBuilder->weld_entry(
"target"))
41 , m_xFtFullURL(xBuilder->weld_label(
"url"))
42 , m_xBtBrowse(xBuilder->weld_button(
"browse"))
43 , m_bMarkWndOpen(false)
45 m_xCbbPath->SetSmartProtocol(INetProtocol::File);
78 m_xCbbPath->set_entry_text( rStrURL.copy( 0, (
nPos == -1 ? rStrURL.getLength() :
nPos ) ) );
82 if (
nPos != -1 &&
nPos < rStrURL.getLength()-1 )
83 aStrMark = rStrURL.copy(
nPos+1 );
86 ModifiedPathHdl_Impl(*
m_xCbbPath->getWidget());
98 OUString aStrPath(
m_xCbbPath->get_active_text() );
101 if ( !aStrPath.isEmpty() )
104 if (
aURL.GetProtocol() != INetProtocol::NotValid )
108 osl::FileBase::getFileURLFromSystemPath( aStrPath, aStrURL );
113 if( aStrURL.isEmpty() )
117 if( !aStrMark.isEmpty() )
119 aStrURL +=
sHash + aStrMark;
131 OUString& aStrIntName, OUString& aStrFrame,
150 return std::make_unique<SvxHyperlinkDocTp>(pWindow, pDlg, pItemSet);
170 DisableClose(
true );
173 css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE,
174 mpDialog->getDialog() );
175 OUString aOldURL( GetCurrentURL() );
179 osl::FileBase::getSystemPathFromFileURL(aOldURL, aPath);
184 DisableClose(
false );
192 osl::FileBase::getSystemPathFromFileURL(
aURL, aPath);
194 m_xCbbPath->SetBaseURL(
aURL );
195 m_xCbbPath->set_entry_text(aPath);
197 if ( aOldURL != GetCurrentURL() )
198 ModifiedPathHdl_Impl(*m_xCbbPath->getWidget());
210 if ( GetPathType ( maStrURL ) == EPathType::ExistsFile ||
211 maStrURL.isEmpty() ||
213 maStrURL.startsWith(
sHash ) )
220 mxMarkWnd->RefreshTree (
"" );
222 mxMarkWnd->RefreshTree ( maStrURL );
235 maStrURL = GetCurrentURL();
237 maTimer.SetTimeout( 2500 );
240 m_xFtFullURL->set_label( maStrURL );
250 if ( IsMarkWndVisible() && ( GetPathType( maStrURL )== EPathType::ExistsFile ||
251 maStrURL.isEmpty() ||
257 mxMarkWnd->RefreshTree (
"" );
259 mxMarkWnd->RefreshTree ( maStrURL );
270 maStrURL = GetCurrentURL();
272 if (IsMarkWndVisible())
273 mxMarkWnd->SelectEntry(m_xEdTarget->get_text());
275 m_xFtFullURL->set_label( maStrURL );
285 maStrURL = GetCurrentURL();
287 m_xFtFullURL->set_label( maStrURL );
311 if(
aURL.HasError() )
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
void SetExchangeSupport()
ComboBox-Control for URL's with History and Autocompletion.
std::unique_ptr< weld::Button > m_xBtBrowse
static EPathType GetPathType(std::u16string_view rStrPath)
virtual void SetInitFocus() override
virtual void SetMarkStr(const OUString &aStrMark) override
OUString GetCurrentURL() const
static std::unique_ptr< IconChoicePage > Create(weld::Container *pWindow, SvxHpLinkDlg *pDlg, const SfxItemSet *pItemSet)
void FillDlgFields(const OUString &rStrURL) override
std::unique_ptr< SvxHyperURLBox > m_xCbbPath
std::unique_ptr< weld::Button > m_xBtFileopen
std::unique_ptr< weld::Entry > m_xEdTarget
void GetCurrentItemData(OUString &rStrURL, OUString &aStrName, OUString &aStrIntName, OUString &aStrFrame, SvxLinkInsertMode &eMode) override
SvxHyperlinkDocTp(weld::Container *pParent, SvxHpLinkDlg *pDlg, const SfxItemSet *pItemSet)
virtual ~SvxHyperlinkDocTp() override
void GetDataFromCommonFields(OUString &aStrName, OUString &aStrIntName, OUString &aStrFrame, SvxLinkInsertMode &eMode)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
void SetDisplayFolder(const OUString &_rURL)
IMPL_LINK_NOARG(SvxHyperlinkDocTp, ClickFileopenHdl_Impl, weld::Button &, void)
#define LINK(Instance, Class, Member)
constexpr OUStringLiteral INET_FILE_SCHEME