Bump version to 6.4.7.2.M8
[LibreOffice.git] / cui / source / inc / hltpbase.hxx
blob278eab3dd8532364d2868a8c1449c3e3ea52d0e2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_CUI_SOURCE_INC_HLTPBASE_HXX
20 #define INCLUDED_CUI_SOURCE_INC_HLTPBASE_HXX
22 #include <sfx2/tabdlg.hxx>
23 #include <vcl/transfer.hxx>
24 #include <sfx2/dispatch.hxx>
25 #include <svtools/inettbc.hxx>
26 #include <vcl/timer.hxx>
27 #include <vcl/waitobj.hxx>
29 #include <com/sun/star/frame/XFrame.hpp>
30 #include <svx/hlnkitem.hxx>
32 #include "hlmarkwn.hxx"
33 #include "iconcdlg.hxx"
35 /// ComboBox-Control for URL's with History and Autocompletion
36 class SvxHyperURLBox : public URLBox, public DropTargetHelper
38 protected:
39 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
40 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
42 public:
43 SvxHyperURLBox(std::unique_ptr<weld::ComboBox> xWidget);
46 /// Tabpage : Basisclass
47 class SvxHyperlinkTabPageBase : public IconChoicePage
49 private:
50 std::unique_ptr<weld::ComboBox> mxCbbFrame;
51 std::unique_ptr<weld::ComboBox> mxLbForm;
52 std::unique_ptr<weld::Entry> mxEdIndication;
53 std::unique_ptr<weld::Entry> mxEdText;
54 std::unique_ptr<weld::Button> mxBtScript;
55 std::unique_ptr<weld::Label> mxFormLabel;
56 std::unique_ptr<weld::Label> mxFrameLabel;
58 bool mbIsCloseDisabled;
60 css::uno::Reference< css::frame::XFrame >
61 mxDocumentFrame;
63 protected:
64 SvxHpLinkDlg* mpDialog;
66 bool mbStdControlsInit;
68 OUString maStrInitURL;
70 Timer maTimer;
72 TopLevelWindowLocker maBusy;
74 std::shared_ptr<SvxHlinkDlgMarkWnd> mxMarkWnd;
76 void InitStdControls ();
77 void FillStandardDlgFields ( const SvxHyperlinkItem* pHyperlinkItem );
78 virtual void FillDlgFields(const OUString& rStrURL) = 0;
79 virtual void GetCurentItemData ( OUString& rStrURL, OUString& aStrName,
80 OUString& aStrIntName, OUString& aStrFrame,
81 SvxLinkInsertMode& eMode ) = 0;
83 void GetDataFromCommonFields( OUString& aStrName,
84 OUString& aStrIntName, OUString& aStrFrame,
85 SvxLinkInsertMode& eMode );
87 DECL_LINK (ClickScriptHdl_Impl, weld::Button&, void ); ///< Button : Script
89 static OUString GetSchemeFromURL( const OUString& rStrURL );
91 void DisableClose( bool _bDisable );
93 public:
94 SvxHyperlinkTabPageBase (
95 weld::Container* pParent,
96 SvxHpLinkDlg* pDlg,
97 const OUString& rUIXMLDescription,
98 const OString& rID,
99 const SfxItemSet* pItemSet
101 virtual ~SvxHyperlinkTabPageBase () override;
103 void SetDocumentFrame(
104 const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame )
106 mxDocumentFrame = rxDocumentFrame;
109 virtual bool AskApply ();
110 virtual void DoApply ();
111 virtual void SetInitFocus();
112 virtual void SetMarkStr ( const OUString& aStrMark );
113 virtual void Reset( const SfxItemSet& ) override;
114 virtual bool FillItemSet( SfxItemSet* ) override;
115 virtual void ActivatePage( const SfxItemSet& rItemSet ) override;
116 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
118 bool IsMarkWndVisible() const { return static_cast<bool>(mxMarkWnd); }
119 void MoveToExtraWnd ( Point aNewPos );
121 virtual bool QueryClose() override;
123 protected:
124 virtual bool ShouldOpenMarkWnd();
125 virtual void SetMarkWndShouldOpen(bool bOpen);
127 void ShowMarkWnd();
128 void HideMarkWnd();
130 SfxDispatcher* GetDispatcher() const;
132 HyperDialogEvent GetMacroEvents() const;
133 SvxMacroTableDtor* GetMacroTable();
136 #endif // INCLUDED_CUI_SOURCE_INC_HLTPBASE_HXX
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */