1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef _SVX_TABBASE_HYPERLINK_HXX
20 #define _SVX_TABBASE_HYPERLINK_HXX
22 #include <sfx2/app.hxx>
23 #include <sfx2/tabdlg.hxx>
24 #include <vcl/group.hxx>
25 #include <vcl/button.hxx>
26 #include <vcl/fixed.hxx>
27 #include <vcl/combobox.hxx>
28 #include <vcl/edit.hxx>
29 #include <vcl/lstbox.hxx>
30 #include <svl/stritem.hxx>
31 #include <svl/eitem.hxx>
32 #include <svtools/transfer.hxx>
33 #include <sfx2/dispatch.hxx>
34 #include <vcl/msgbox.hxx>
35 #include <sfx2/fcontnr.hxx>
36 #include <svtools/inettbc.hxx>
37 #include <vcl/timer.hxx>
39 #include <dialmgr.hxx>
40 #include <sfx2/docfile.hxx>
42 #include <com/sun/star/frame/XFrame.hpp>
44 #include <svx/hlnkitem.hxx>
46 #include "hlmarkwn.hxx"
47 #include "iconcdlg.hxx"
49 /// ComboBox-Control, which is filled with all current framenames
50 class SvxFramesComboBox
: public ComboBox
53 SvxFramesComboBox (Window
* pParent
, const ResId
& rResId
, SfxDispatcher
* pDispatch
);
54 ~SvxFramesComboBox ();
57 /// ComboBox-Control for URL's with History and Autocompletion
58 class SvxHyperURLBox
: public SvtURLBox
, public DropTargetHelper
61 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
);
62 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
);
64 virtual long Notify( NotifyEvent
& rNEvt
);
65 virtual void Select();
66 virtual void Modify();
67 virtual long PreNotify( NotifyEvent
& rNEvt
);
70 SvxHyperURLBox( Window
* pParent
, INetProtocol eSmart
= INET_PROT_FILE
);
74 /// Tabpage : Basisclass
75 class SvxHyperlinkTabPageBase
: public IconChoicePage
80 SvxFramesComboBox
*mpCbbFrame
;
83 FixedText
*mpFtIndication
;
87 ImageButton
*mpBtScript
;
89 sal_Bool mbIsCloseDisabled
;
91 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>
97 sal_Bool mbStdControlsInit
;
103 SvxHlinkDlgMarkWnd
* mpMarkWnd
;
105 void InitStdControls ();
106 virtual void FillStandardDlgFields ( SvxHyperlinkItem
* pHyperlinkItem
);
107 virtual void FillDlgFields ( String
& aStrURL
) = 0;
108 virtual void GetCurentItemData ( String
& aStrURL
, String
& aStrName
,
109 String
& aStrIntName
, String
& aStrFrame
,
110 SvxLinkInsertMode
& eMode
) = 0;
111 virtual String
CreateUiNameFromURL( const String
& aStrURL
);
113 void GetDataFromCommonFields( String
& aStrName
,
114 String
& aStrIntName
, String
& aStrFrame
,
115 SvxLinkInsertMode
& eMode
);
117 DECL_LINK (ClickScriptHdl_Impl
, void * ); ///< Button : Script
121 static String
GetSchemeFromURL( String aStrURL
);
123 inline void DisableClose( sal_Bool _bDisable
) { mbIsCloseDisabled
= _bDisable
; }
126 SvxHyperlinkTabPageBase (
129 const SfxItemSet
& rItemSet
131 virtual ~SvxHyperlinkTabPageBase ();
133 void SetDocumentFrame(
134 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rxDocumentFrame
)
136 mxDocumentFrame
= rxDocumentFrame
;
139 virtual sal_Bool
AskApply ();
140 virtual void DoApply ();
141 virtual void SetOnlineMode( sal_Bool bEnable
);
142 virtual void SetInitFocus();
143 virtual void SetMarkStr ( String
& aStrMark
);
144 virtual void Reset( const SfxItemSet
& );
145 virtual sal_Bool
FillItemSet( SfxItemSet
& );
146 virtual void ActivatePage( const SfxItemSet
& rItemSet
);
147 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );
149 sal_Bool
IsMarkWndVisible () { return ((Window
*)mpMarkWnd
)->IsVisible(); }
150 Size
GetSizeExtraWnd () { return ( mpMarkWnd
->GetSizePixel() ); }
151 sal_Bool
MoveToExtraWnd ( Point aNewPos
, sal_Bool bDisConnectDlg
= sal_False
);
153 virtual void ActivatePage();
154 virtual void DeactivatePage();
155 virtual sal_Bool
QueryClose();
158 virtual sal_Bool
ShouldOpenMarkWnd();
159 virtual void SetMarkWndShouldOpen(sal_Bool bOpen
);
162 void HideMarkWnd () { ( ( Window
* ) mpMarkWnd
)->Hide(); }
163 void InvalidateMarkWnd () { ( ( Window
* ) mpMarkWnd
)->Invalidate(); }
165 SfxDispatcher
* GetDispatcher() const;
167 sal_uInt16
GetMacroEvents();
168 SvxMacroTableDtor
* GetMacroTable();
170 sal_Bool
IsHTMLDoc() const;
173 #endif // _SVX_TABBASE_HYPERLINK_HXX
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */