LibreOffice Module cui (master) 1
hltpbase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
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>
27
28#include <com/sun/star/frame/XFrame.hpp>
29#include <svx/hlnkitem.hxx>
30
31#include "hlmarkwn.hxx"
32#include "iconcdlg.hxx"
33
35class SvxHyperURLBox : public SvtURLBox, public DropTargetHelper
36{
37protected:
38 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
39 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
40
41public:
42 SvxHyperURLBox(std::unique_ptr<weld::ComboBox> xWidget);
43};
44
47{
48private:
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;
56
58
59 css::uno::Reference< css::frame::XFrame >
61
62protected:
64
66
67 OUString maStrInitURL;
68
70
72
73 std::shared_ptr<SvxHlinkDlgMarkWnd> mxMarkWnd;
74
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;
81
82 void GetDataFromCommonFields( OUString& aStrName,
83 OUString& aStrIntName, OUString& aStrFrame,
84 SvxLinkInsertMode& eMode );
85
86 DECL_LINK (ClickScriptHdl_Impl, weld::Button&, void );
87
88 static OUString GetSchemeFromURL( const OUString& rStrURL );
89
90 void DisableClose( bool _bDisable );
91
92public:
94 weld::Container* pParent,
95 SvxHpLinkDlg* pDlg,
96 const OUString& rUIXMLDescription,
97 const OUString& rID,
98 const SfxItemSet* pItemSet
99 );
100 virtual ~SvxHyperlinkTabPageBase () override;
101
103 const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame )
104 {
105 mxDocumentFrame = rxDocumentFrame;
106 }
107
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;
115
116 bool IsMarkWndVisible() const { return static_cast<bool>(mxMarkWnd); }
117 void MoveToExtraWnd ( Point aNewPos );
118
119 virtual bool QueryClose() override;
120
121protected:
122 virtual bool ShouldOpenMarkWnd();
123 virtual void SetMarkWndShouldOpen(bool bOpen);
124
125 void ShowMarkWnd();
126 void HideMarkWnd();
127
129
132};
133
134/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SfxItemSet * pSet
Definition: iconcdlg.hxx:42
ComboBox-Control for URL's with History and Autocompletion.
Definition: hltpbase.hxx:36
SvxHyperURLBox(std::unique_ptr< weld::ComboBox > xWidget)
Definition: hltpbase.cxx:76
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
Definition: hltpbase.cxx:83
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
Definition: hltpbase.cxx:88
Tabpage : Basisclass.
Definition: hltpbase.hxx:47
DECL_LINK(ClickScriptHdl_Impl, weld::Button &, void)
Button : Script.
SfxDispatcher * GetDispatcher() const
Definition: hltpbase.cxx:308
static OUString GetSchemeFromURL(const OUString &rStrURL)
Definition: hltpbase.cxx:389
std::unique_ptr< weld::Button > mxBtScript
Definition: hltpbase.hxx:53
std::unique_ptr< weld::Label > mxFormLabel
Definition: hltpbase.hxx:54
virtual ~SvxHyperlinkTabPageBase() override
Definition: hltpbase.cxx:126
bool IsMarkWndVisible() const
Definition: hltpbase.hxx:116
void DisableClose(bool _bDisable)
Definition: hltpbase.cxx:313
void SetDocumentFrame(const css::uno::Reference< css::frame::XFrame > &rxDocumentFrame)
Definition: hltpbase.hxx:102
virtual void Reset(const SfxItemSet &) override
Definition: hltpbase.cxx:442
virtual void DoApply()
Definition: hltpbase.cxx:290
SvxHyperlinkTabPageBase(weld::Container *pParent, SvxHpLinkDlg *pDlg, const OUString &rUIXMLDescription, const OUString &rID, const SfxItemSet *pItemSet)
Definition: hltpbase.cxx:105
std::shared_ptr< SvxHlinkDlgMarkWnd > mxMarkWnd
Definition: hltpbase.hxx:73
std::unique_ptr< weld::Entry > mxEdText
Definition: hltpbase.hxx:52
std::unique_ptr< weld::Entry > mxEdIndication
Definition: hltpbase.hxx:51
std::unique_ptr< weld::Label > mxFrameLabel
Definition: hltpbase.hxx:55
std::unique_ptr< weld::ComboBox > mxLbForm
Definition: hltpbase.hxx:50
void MoveToExtraWnd(Point aNewPos)
Definition: hltpbase.cxx:169
void FillStandardDlgFields(const SvxHyperlinkItem *pHyperlinkItem)
Definition: hltpbase.cxx:233
virtual bool FillItemSet(SfxItemSet *) override
Definition: hltpbase.cxx:490
virtual bool ShouldOpenMarkWnd()
Definition: hltpbase.cxx:553
SvxHpLinkDlg * mpDialog
Definition: hltpbase.hxx:63
SvxMacroTableDtor * GetMacroTable()
Definition: hltpbase.cxx:380
virtual void ActivatePage(const SfxItemSet &rItemSet) override
Definition: hltpbase.cxx:510
virtual bool QueryClose() override
Definition: hltpbase.cxx:133
std::unique_ptr< weld::ComboBox > mxCbbFrame
Definition: hltpbase.hxx:49
virtual void SetMarkWndShouldOpen(bool bOpen)
Definition: hltpbase.cxx:558
virtual void FillDlgFields(const OUString &rStrURL)=0
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: hltpbase.cxx:528
TopLevelWindowLocker maBusy
Definition: hltpbase.hxx:71
void GetDataFromCommonFields(OUString &aStrName, OUString &aStrIntName, OUString &aStrFrame, SvxLinkInsertMode &eMode)
Definition: hltpbase.cxx:422
virtual void GetCurrentItemData(OUString &rStrURL, OUString &aStrName, OUString &aStrIntName, OUString &aStrFrame, SvxLinkInsertMode &eMode)=0
css::uno::Reference< css::frame::XFrame > mxDocumentFrame
Definition: hltpbase.hxx:60
HyperDialogEvent GetMacroEvents() const
Definition: hltpbase.cxx:372
virtual void SetMarkStr(const OUString &aStrMark)
Definition: hltpbase.cxx:296
virtual void SetInitFocus()
Definition: hltpbase.cxx:302
HyperDialogEvent
SvxLinkInsertMode
DeactivateRC
signed char sal_Int8