2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-04 11:25:41 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-10-28 03:46:16 +01:00
|
|
|
#ifndef INCLUDED_CUI_SOURCE_INC_HLTPBASE_HXX
|
|
|
|
#define INCLUDED_CUI_SOURCE_INC_HLTPBASE_HXX
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
#include <sfx2/tabdlg.hxx>
|
2018-10-08 09:02:25 +01:00
|
|
|
#include <vcl/transfer.hxx>
|
2009-10-31 00:36:06 +01:00
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <svtools/inettbc.hxx>
|
|
|
|
#include <vcl/timer.hxx>
|
2019-06-23 19:51:15 +01:00
|
|
|
#include <vcl/waitobj.hxx>
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
#include <com/sun/star/frame/XFrame.hpp>
|
|
|
|
#include <svx/hlnkitem.hxx>
|
|
|
|
|
|
|
|
#include "hlmarkwn.hxx"
|
|
|
|
#include "iconcdlg.hxx"
|
|
|
|
|
2012-08-06 10:51:21 +03:00
|
|
|
/// ComboBox-Control for URL's with History and Autocompletion
|
2019-06-23 19:51:15 +01:00
|
|
|
class SvxHyperURLBox : public URLBox, public DropTargetHelper
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
|
|
|
protected:
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
|
|
|
|
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
public:
|
2019-06-23 19:51:15 +01:00
|
|
|
SvxHyperURLBox(std::unique_ptr<weld::ComboBox> xWidget);
|
2009-10-31 00:36:06 +01:00
|
|
|
};
|
|
|
|
|
2012-08-06 10:51:21 +03:00
|
|
|
/// Tabpage : Basisclass
|
2009-10-31 00:36:06 +01:00
|
|
|
class SvxHyperlinkTabPageBase : public IconChoicePage
|
|
|
|
{
|
|
|
|
private:
|
2019-06-23 19:51:15 +01:00
|
|
|
std::unique_ptr<weld::ComboBox> mxCbbFrame;
|
|
|
|
std::unique_ptr<weld::ComboBox> mxLbForm;
|
|
|
|
std::unique_ptr<weld::Entry> mxEdIndication;
|
|
|
|
std::unique_ptr<weld::Entry> mxEdText;
|
|
|
|
std::unique_ptr<weld::Button> mxBtScript;
|
|
|
|
std::unique_ptr<weld::Label> mxFormLabel;
|
|
|
|
std::unique_ptr<weld::Label> mxFrameLabel;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-07-28 14:18:40 +02:00
|
|
|
bool mbIsCloseDisabled;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-07-28 14:18:40 +02:00
|
|
|
css::uno::Reference< css::frame::XFrame >
|
|
|
|
mxDocumentFrame;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
protected:
|
2019-06-23 19:51:15 +01:00
|
|
|
SvxHpLinkDlg* mpDialog;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2014-04-16 11:39:08 +02:00
|
|
|
bool mbStdControlsInit;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2013-09-26 08:30:52 +02:00
|
|
|
OUString maStrInitURL;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
Timer maTimer;
|
|
|
|
|
2019-06-23 19:51:15 +01:00
|
|
|
TopLevelWindowLocker maBusy;
|
|
|
|
|
2019-06-17 09:10:50 +01:00
|
|
|
std::shared_ptr<SvxHlinkDlgMarkWnd> mxMarkWnd;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
void InitStdControls ();
|
2015-01-20 12:38:10 +02:00
|
|
|
void FillStandardDlgFields ( const SvxHyperlinkItem* pHyperlinkItem );
|
2013-09-30 11:03:58 +01:00
|
|
|
virtual void FillDlgFields(const OUString& rStrURL) = 0;
|
2013-09-26 08:30:52 +02:00
|
|
|
virtual void GetCurentItemData ( OUString& rStrURL, OUString& aStrName,
|
|
|
|
OUString& aStrIntName, OUString& aStrFrame,
|
2009-10-31 00:36:06 +01:00
|
|
|
SvxLinkInsertMode& eMode ) = 0;
|
|
|
|
|
2013-09-26 08:30:52 +02:00
|
|
|
void GetDataFromCommonFields( OUString& aStrName,
|
|
|
|
OUString& aStrIntName, OUString& aStrFrame,
|
2009-10-31 00:36:06 +01:00
|
|
|
SvxLinkInsertMode& eMode );
|
|
|
|
|
2019-06-23 19:51:15 +01:00
|
|
|
DECL_LINK (ClickScriptHdl_Impl, weld::Button&, void ); ///< Button : Script
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2013-09-23 07:19:08 +01:00
|
|
|
static OUString GetSchemeFromURL( const OUString& rStrURL );
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2019-06-23 19:51:15 +01:00
|
|
|
void DisableClose( bool _bDisable );
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
SvxHyperlinkTabPageBase (
|
2019-06-23 19:51:15 +01:00
|
|
|
weld::Container* pParent,
|
2019-06-23 20:01:05 +01:00
|
|
|
SvxHpLinkDlg* pDlg,
|
2014-06-22 12:24:33 +02:00
|
|
|
const OUString& rUIXMLDescription,
|
2019-06-23 19:51:15 +01:00
|
|
|
const OString& rID,
|
2017-05-16 10:11:26 +02:00
|
|
|
const SfxItemSet* pItemSet
|
2009-10-31 00:36:06 +01:00
|
|
|
);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SvxHyperlinkTabPageBase () override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
void SetDocumentFrame(
|
2015-07-28 14:18:40 +02:00
|
|
|
const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame )
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
|
|
|
mxDocumentFrame = rxDocumentFrame;
|
|
|
|
}
|
|
|
|
|
2014-04-16 11:39:08 +02:00
|
|
|
virtual bool AskApply ();
|
2009-10-31 00:36:06 +01:00
|
|
|
virtual void DoApply ();
|
|
|
|
virtual void SetInitFocus();
|
2013-09-26 08:30:52 +02:00
|
|
|
virtual void SetMarkStr ( const OUString& aStrMark );
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Reset( const SfxItemSet& ) override;
|
|
|
|
virtual bool FillItemSet( SfxItemSet* ) override;
|
|
|
|
virtual void ActivatePage( const SfxItemSet& rItemSet ) override;
|
2016-07-22 14:35:27 +02:00
|
|
|
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2019-06-17 09:10:50 +01:00
|
|
|
bool IsMarkWndVisible() const { return static_cast<bool>(mxMarkWnd); }
|
|
|
|
void MoveToExtraWnd ( Point aNewPos );
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool QueryClose() override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
protected:
|
2014-04-16 11:39:08 +02:00
|
|
|
virtual bool ShouldOpenMarkWnd();
|
2014-09-12 15:47:25 +02:00
|
|
|
virtual void SetMarkWndShouldOpen(bool bOpen);
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2019-06-17 09:10:50 +01:00
|
|
|
void ShowMarkWnd();
|
|
|
|
void HideMarkWnd();
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
SfxDispatcher* GetDispatcher() const;
|
|
|
|
|
2019-09-04 16:07:56 +02:00
|
|
|
HyperDialogEvent GetMacroEvents() const;
|
2009-10-31 00:36:06 +01:00
|
|
|
SvxMacroTableDtor* GetMacroTable();
|
|
|
|
};
|
|
|
|
|
2013-10-28 03:46:16 +01:00
|
|
|
#endif // INCLUDED_CUI_SOURCE_INC_HLTPBASE_HXX
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2010-10-27 12:45:03 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|