1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <sal/config.h>
23 #include <string_view>
25 #include "cuihyperdlg.hxx"
26 #include "hltpbase.hxx"
28 /*************************************************************************
30 |* Tabpage : Hyperlink - Internet
32 \************************************************************************/
34 class SvxHyperlinkInternetTp
: public SvxHyperlinkTabPageBase
37 OUString maStrOldUser
;
38 OUString maStrOldPassword
;
42 std::unique_ptr
<weld::RadioButton
> m_xRbtLinktypInternet
;
43 std::unique_ptr
<weld::RadioButton
> m_xRbtLinktypFTP
;
44 std::unique_ptr
<SvxHyperURLBox
> m_xCbbTarget
;
45 std::unique_ptr
<weld::Label
> m_xFtTarget
;
46 std::unique_ptr
<weld::Label
> m_xFtLogin
;
47 std::unique_ptr
<weld::Entry
> m_xEdLogin
;
48 std::unique_ptr
<weld::Label
> m_xFtPassword
;
49 std::unique_ptr
<weld::Entry
> m_xEdPassword
;
50 std::unique_ptr
<weld::CheckButton
> m_xCbAnonymous
;
52 DECL_LINK( Click_SmartProtocol_Impl
, weld::Toggleable
&, void ); ///< Radiobutton toggled: Type HTTP or FTP
53 DECL_LINK( ClickAnonymousHdl_Impl
, weld::Toggleable
&, void ); ///< Checkbox : Anonymous User
54 DECL_LINK( ModifiedLoginHdl_Impl
, weld::Entry
&, void ); ///< Contents of editfield "Login" modified
55 DECL_LINK( LostFocusTargetHdl_Impl
, weld::Widget
&, void ); ///< Combobox "Target" lost its focus
56 DECL_LINK( ModifiedTargetHdl_Impl
, weld::ComboBox
&, void ); ///< Contents of editfield "Target" modified
58 DECL_LINK( TimeoutHdl_Impl
, Timer
*, void); ///< Handler for timer -timeout
61 void SetScheme(std::u16string_view rScheme
);
62 void RemoveImproperProtocol(std::u16string_view rProperScheme
);
63 OUString
GetSchemeFromButtons() const;
64 INetProtocol
GetSmartProtocolFromButtons() const;
66 OUString
CreateAbsoluteURL() const;
68 void setAnonymousFTPUser();
69 void setFTPUser(const OUString
& rUser
, const OUString
& rPassword
);
70 void RefreshMarkWindow();
73 virtual void FillDlgFields(const OUString
& rStrURL
) override
;
74 virtual void GetCurrentItemData ( OUString
& rStrURL
, OUString
& aStrName
,
75 OUString
& aStrIntName
, OUString
& aStrFrame
,
76 SvxLinkInsertMode
& eMode
) override
;
77 virtual bool ShouldOpenMarkWnd () override
{return ( m_bMarkWndOpen
&& m_xRbtLinktypInternet
->get_active() );}
78 virtual void SetMarkWndShouldOpen (bool bOpen
) override
{m_bMarkWndOpen
=bOpen
;}
81 SvxHyperlinkInternetTp(weld::Container
* pParent
, SvxHpLinkDlg
* pDlg
, const SfxItemSet
* pItemSet
);
82 virtual ~SvxHyperlinkInternetTp() override
;
84 static std::unique_ptr
<IconChoicePage
> Create(weld::Container
* pWindow
, SvxHpLinkDlg
* pDlg
, const SfxItemSet
* pItemSet
);
86 virtual void SetMarkStr ( const OUString
& aStrMark
) override
;
88 virtual void SetInitFocus() override
;
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */