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 #ifndef INCLUDED_CUI_SOURCE_INC_HLTPBASE_HXX
20 #define INCLUDED_CUI_SOURCE_INC_HLTPBASE_HXX
21 
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>
28 
29 #include <com/sun/star/frame/XFrame.hpp>
30 #include <svx/hlnkitem.hxx>
31 
32 #include "hlmarkwn.hxx"
33 #include "iconcdlg.hxx"
34 
36 class SvxHyperURLBox : public URLBox, public DropTargetHelper
37 {
38 protected:
39  virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
40  virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
41 
42 public:
43  SvxHyperURLBox(std::unique_ptr<weld::ComboBox> xWidget);
44 };
45 
48 {
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;
57 
59 
60  css::uno::Reference< css::frame::XFrame >
62 
63 protected:
65 
67 
68  OUString maStrInitURL;
69 
71 
73 
74  std::shared_ptr<SvxHlinkDlgMarkWnd> mxMarkWnd;
75 
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;
82 
83  void GetDataFromCommonFields( OUString& aStrName,
84  OUString& aStrIntName, OUString& aStrFrame,
85  SvxLinkInsertMode& eMode );
86 
87  DECL_LINK (ClickScriptHdl_Impl, weld::Button&, void );
88 
89  static OUString GetSchemeFromURL( const OUString& rStrURL );
90 
91  void DisableClose( bool _bDisable );
92 
93 public:
95  weld::Container* pParent,
96  SvxHpLinkDlg* pDlg,
97  const OUString& rUIXMLDescription,
98  const OString& rID,
99  const SfxItemSet* pItemSet
100  );
101  virtual ~SvxHyperlinkTabPageBase () override;
102 
104  const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame )
105  {
106  mxDocumentFrame = rxDocumentFrame;
107  }
108 
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;
117 
118  bool IsMarkWndVisible() const { return static_cast<bool>(mxMarkWnd); }
119  void MoveToExtraWnd ( Point aNewPos );
120 
121  virtual bool QueryClose() override;
122 
123 protected:
124  virtual bool ShouldOpenMarkWnd();
125  virtual void SetMarkWndShouldOpen(bool bOpen);
126 
127  void ShowMarkWnd();
128  void HideMarkWnd();
129 
130  SfxDispatcher* GetDispatcher() const;
131 
134 };
135 
136 #endif // INCLUDED_CUI_SOURCE_INC_HLTPBASE_HXX
137 
138 /* 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:529
std::unique_ptr< weld::ComboBox > mxCbbFrame
Definition: hltpbase.hxx:50
HyperDialogEvent
HyperDialogEvent GetMacroEvents()
Definition: hltpbase.cxx:373
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:466
virtual void SetInitFocus()
Definition: hltpbase.cxx:301
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
Definition: hltpbase.cxx:83
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: hltpbase.cxx:504
std::unique_ptr< weld::Label > mxFormLabel
Definition: hltpbase.hxx:55
virtual void SetMarkWndShouldOpen(bool bOpen)
Definition: hltpbase.cxx:534
void GetDataFromCommonFields(OUString &aStrName, OUString &aStrIntName, OUString &aStrFrame, SvxLinkInsertMode &eMode)
Definition: hltpbase.cxx:423
const SfxItemSet * pSet
Definition: iconcdlg.hxx:57
std::shared_ptr< SvxHlinkDlgMarkWnd > mxMarkWnd
Definition: hltpbase.hxx:74
std::unique_ptr< weld::Entry > mxEdText
Definition: hltpbase.hxx:53
std::unique_ptr< weld::Entry > mxEdIndication
Definition: hltpbase.hxx:52
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:72
void DisableClose(bool _bDisable)
Definition: hltpbase.cxx:312
SfxDispatcher * GetDispatcher() const
Definition: hltpbase.cxx:307
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:64
void FillStandardDlgFields(const SvxHyperlinkItem *pHyperlinkItem)
Definition: hltpbase.cxx:232
virtual void SetMarkStr(const OUString &aStrMark)
Definition: hltpbase.cxx:295
std::unique_ptr< weld::ComboBox > mxLbForm
Definition: hltpbase.hxx:51
void SetDocumentFrame(const css::uno::Reference< css::frame::XFrame > &rxDocumentFrame)
Definition: hltpbase.hxx:103
virtual void ActivatePage(const SfxItemSet &rItemSet) override
Definition: hltpbase.cxx:486
virtual ~SvxHyperlinkTabPageBase() override
Definition: hltpbase.cxx:125
DeactivateRC
ComboBox-Control for URL's with History and Autocompletion.
Definition: hltpbase.hxx:36
SvxMacroTableDtor * GetMacroTable()
Definition: hltpbase.cxx:381
virtual void Reset(const SfxItemSet &) override
Definition: hltpbase.cxx:443
virtual bool AskApply()
Definition: hltpbase.cxx:288
virtual void DoApply()
Definition: hltpbase.cxx:282
bool IsMarkWndVisible() const
Definition: hltpbase.hxx:118
std::unique_ptr< weld::Button > mxBtScript
Definition: hltpbase.hxx:54
std::unique_ptr< weld::Label > mxFrameLabel
Definition: hltpbase.hxx:56
Tabpage : Basisclass.
Definition: hltpbase.hxx:47
static OUString GetSchemeFromURL(const OUString &rStrURL)
Definition: hltpbase.cxx:390
virtual void FillDlgFields(const OUString &rStrURL)=0
css::uno::Reference< css::frame::XFrame > mxDocumentFrame
Definition: hltpbase.hxx:61