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/waitobj.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 
36 {
37 protected:
38  virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
39  virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
40 
41 public:
42  SvxHyperURLBox(std::unique_ptr<weld::ComboBox> xWidget);
43 };
44 
47 {
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;
56 
58 
59  css::uno::Reference< css::frame::XFrame >
61 
62 protected:
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 GetCurentItemData ( 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 
92 public:
94  weld::Container* pParent,
95  SvxHpLinkDlg* pDlg,
96  const OUString& rUIXMLDescription,
97  const OString& 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 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;
116 
117  bool IsMarkWndVisible() const { return static_cast<bool>(mxMarkWnd); }
118  void MoveToExtraWnd ( Point aNewPos );
119 
120  virtual bool QueryClose() override;
121 
122 protected:
123  virtual bool ShouldOpenMarkWnd();
124  virtual void SetMarkWndShouldOpen(bool bOpen);
125 
126  void ShowMarkWnd();
127  void HideMarkWnd();
128 
129  SfxDispatcher* GetDispatcher() const;
130 
133 };
134 
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void GetCurentItemData(OUString &rStrURL, OUString &aStrName, OUString &aStrIntName, OUString &aStrFrame, SvxLinkInsertMode &eMode)=0
virtual bool ShouldOpenMarkWnd()
Definition: hltpbase.cxx:536
std::unique_ptr< weld::ComboBox > mxCbbFrame
Definition: hltpbase.hxx:49
HyperDialogEvent
virtual bool QueryClose() override
Definition: hltpbase.cxx:132
DECL_LINK(ClickScriptHdl_Impl, weld::Button &, void)
Button : Script.
signed char sal_Int8
virtual bool FillItemSet(SfxItemSet *) override
Definition: hltpbase.cxx:473
virtual void SetInitFocus()
Definition: hltpbase.cxx:308
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
Definition: hltpbase.cxx:83
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: hltpbase.cxx:511
std::unique_ptr< weld::Label > mxFormLabel
Definition: hltpbase.hxx:54
virtual void SetMarkWndShouldOpen(bool bOpen)
Definition: hltpbase.cxx:541
void GetDataFromCommonFields(OUString &aStrName, OUString &aStrIntName, OUString &aStrFrame, SvxLinkInsertMode &eMode)
Definition: hltpbase.cxx:430
const SfxItemSet * pSet
Definition: iconcdlg.hxx:56
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
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
Definition: hltpbase.cxx:88
SvxHyperURLBox(std::unique_ptr< weld::ComboBox > xWidget)
Definition: hltpbase.cxx:76
TopLevelWindowLocker maBusy
Definition: hltpbase.hxx:71
void DisableClose(bool _bDisable)
Definition: hltpbase.cxx:319
SfxDispatcher * GetDispatcher() const
Definition: hltpbase.cxx:314
void MoveToExtraWnd(Point aNewPos)
Definition: hltpbase.cxx:168
SvxHyperlinkTabPageBase(weld::Container *pParent, SvxHpLinkDlg *pDlg, const OUString &rUIXMLDescription, const OString &rID, const SfxItemSet *pItemSet)
Definition: hltpbase.cxx:105
SvxLinkInsertMode
SvxHpLinkDlg * mpDialog
Definition: hltpbase.hxx:63
void FillStandardDlgFields(const SvxHyperlinkItem *pHyperlinkItem)
Definition: hltpbase.cxx:232
virtual void SetMarkStr(const OUString &aStrMark)
Definition: hltpbase.cxx:302
std::unique_ptr< weld::ComboBox > mxLbForm
Definition: hltpbase.hxx:50
void SetDocumentFrame(const css::uno::Reference< css::frame::XFrame > &rxDocumentFrame)
Definition: hltpbase.hxx:102
HyperDialogEvent GetMacroEvents() const
Definition: hltpbase.cxx:380
virtual void ActivatePage(const SfxItemSet &rItemSet) override
Definition: hltpbase.cxx:493
virtual ~SvxHyperlinkTabPageBase() override
Definition: hltpbase.cxx:125
DeactivateRC
ComboBox-Control for URL's with History and Autocompletion.
Definition: hltpbase.hxx:35
SvxMacroTableDtor * GetMacroTable()
Definition: hltpbase.cxx:388
virtual void Reset(const SfxItemSet &) override
Definition: hltpbase.cxx:450
virtual bool AskApply()
Definition: hltpbase.cxx:295
virtual void DoApply()
Definition: hltpbase.cxx:289
bool IsMarkWndVisible() const
Definition: hltpbase.hxx:117
std::unique_ptr< weld::Button > mxBtScript
Definition: hltpbase.hxx:53
std::unique_ptr< weld::Label > mxFrameLabel
Definition: hltpbase.hxx:55
Tabpage : Basisclass.
Definition: hltpbase.hxx:46
static OUString GetSchemeFromURL(const OUString &rStrURL)
Definition: hltpbase.cxx:397
virtual void FillDlgFields(const OUString &rStrURL)=0
css::uno::Reference< css::frame::XFrame > mxDocumentFrame
Definition: hltpbase.hxx:60