tdf#147611: fix indices
[LibreOffice.git] / cui / source / inc / hltpbase.hxx
blob2ad0007c83cb020ae709b9a3f8aa768b98c52117
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 #pragma once
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
37 protected:
38 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
39 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
41 public:
42 SvxHyperURLBox(std::unique_ptr<weld::ComboBox> xWidget);
45 /// Tabpage : Basisclass
46 class SvxHyperlinkTabPageBase : public IconChoicePage
48 private:
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 >
60 mxDocumentFrame;
62 protected:
63 SvxHpLinkDlg* mpDialog;
65 bool mbStdControlsInit;
67 OUString maStrInitURL;
69 Timer maTimer;
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 GetCurentItemData ( 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 );
92 public:
93 SvxHyperlinkTabPageBase (
94 weld::Container* pParent,
95 SvxHpLinkDlg* pDlg,
96 const OUString& rUIXMLDescription,
97 const OString& rID,
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 bool AskApply ();
109 virtual void DoApply ();
110 virtual void SetInitFocus();
111 virtual void SetMarkStr ( const OUString& aStrMark );
112 virtual void Reset( const SfxItemSet& ) override;
113 virtual bool FillItemSet( SfxItemSet* ) override;
114 virtual void ActivatePage( const SfxItemSet& rItemSet ) override;
115 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
117 bool IsMarkWndVisible() const { return static_cast<bool>(mxMarkWnd); }
118 void MoveToExtraWnd ( Point aNewPos );
120 virtual bool QueryClose() override;
122 protected:
123 virtual bool ShouldOpenMarkWnd();
124 virtual void SetMarkWndShouldOpen(bool bOpen);
126 void ShowMarkWnd();
127 void HideMarkWnd();
129 SfxDispatcher* GetDispatcher() const;
131 HyperDialogEvent GetMacroEvents() const;
132 SvxMacroTableDtor* GetMacroTable();
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */