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 <sfx2/tabdlg.hxx>
22 #include <vcl/transfer.hxx>
23 #include <sfx2/dispatch.hxx>
24 #include <svtools/inettbc.hxx>
25 #include <vcl/timer.hxx>
26 #include <vcl/locktoplevels.hxx>
28 #include <com/sun/star/frame/XFrame.hpp>
29 #include <svx/hlnkitem.hxx>
31 #include "hlmarkwn.hxx"
32 #include "iconcdlg.hxx"
34 /// ComboBox-Control for URL's with History and Autocompletion
35 class SvxHyperURLBox
: public SvtURLBox
, public DropTargetHelper
38 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
) override
;
39 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
) override
;
42 SvxHyperURLBox(std::unique_ptr
<weld::ComboBox
> xWidget
);
45 /// Tabpage : Basisclass
46 class SvxHyperlinkTabPageBase
: public IconChoicePage
49 std::unique_ptr
<weld::ComboBox
> mxCbbFrame
;
50 std::unique_ptr
<weld::ComboBox
> mxLbForm
;
51 std::unique_ptr
<weld::Entry
> mxEdIndication
;
52 std::unique_ptr
<weld::Entry
> mxEdText
;
53 std::unique_ptr
<weld::Button
> mxBtScript
;
54 std::unique_ptr
<weld::Label
> mxFormLabel
;
55 std::unique_ptr
<weld::Label
> mxFrameLabel
;
57 bool mbIsCloseDisabled
;
59 css::uno::Reference
< css::frame::XFrame
>
63 SvxHpLinkDlg
* mpDialog
;
65 bool mbStdControlsInit
;
67 OUString maStrInitURL
;
71 TopLevelWindowLocker maBusy
;
73 std::shared_ptr
<SvxHlinkDlgMarkWnd
> mxMarkWnd
;
75 void InitStdControls ();
76 void FillStandardDlgFields ( const SvxHyperlinkItem
* pHyperlinkItem
);
77 virtual void FillDlgFields(const OUString
& rStrURL
) = 0;
78 virtual void GetCurrentItemData ( OUString
& rStrURL
, OUString
& aStrName
,
79 OUString
& aStrIntName
, OUString
& aStrFrame
,
80 SvxLinkInsertMode
& eMode
) = 0;
82 void GetDataFromCommonFields( OUString
& aStrName
,
83 OUString
& aStrIntName
, OUString
& aStrFrame
,
84 SvxLinkInsertMode
& eMode
);
86 DECL_LINK (ClickScriptHdl_Impl
, weld::Button
&, void ); ///< Button : Script
88 static OUString
GetSchemeFromURL( const OUString
& rStrURL
);
90 void DisableClose( bool _bDisable
);
93 SvxHyperlinkTabPageBase (
94 weld::Container
* pParent
,
96 const OUString
& rUIXMLDescription
,
98 const SfxItemSet
* pItemSet
100 virtual ~SvxHyperlinkTabPageBase () override
;
102 void SetDocumentFrame(
103 const css::uno::Reference
< css::frame::XFrame
>& rxDocumentFrame
)
105 mxDocumentFrame
= rxDocumentFrame
;
108 virtual void DoApply ();
109 virtual void SetInitFocus();
110 virtual void SetMarkStr ( const OUString
& aStrMark
);
111 virtual void Reset( const SfxItemSet
& ) override
;
112 virtual bool FillItemSet( SfxItemSet
* ) override
;
113 virtual void ActivatePage( const SfxItemSet
& rItemSet
) override
;
114 virtual DeactivateRC
DeactivatePage( SfxItemSet
* pSet
) override
;
116 bool IsMarkWndVisible() const { return static_cast<bool>(mxMarkWnd
); }
117 void MoveToExtraWnd ( Point aNewPos
);
119 virtual bool QueryClose() override
;
122 virtual bool ShouldOpenMarkWnd();
123 virtual void SetMarkWndShouldOpen(bool bOpen
);
128 SfxDispatcher
* GetDispatcher() const;
130 HyperDialogEvent
GetMacroEvents() const;
131 SvxMacroTableDtor
* GetMacroTable();
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */