1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef _SVX_TABBASE_HYPERLINK_HXX 28*cdf0e10cSrcweir #define _SVX_TABBASE_HYPERLINK_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #define INET_TELNET_SCHEME "telnet://" 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #include <sfx2/app.hxx> 33*cdf0e10cSrcweir #include <sfx2/tabdlg.hxx> 34*cdf0e10cSrcweir #include <vcl/group.hxx> 35*cdf0e10cSrcweir #include <vcl/button.hxx> 36*cdf0e10cSrcweir #include <vcl/fixed.hxx> 37*cdf0e10cSrcweir #include <vcl/combobox.hxx> 38*cdf0e10cSrcweir #include <vcl/edit.hxx> 39*cdf0e10cSrcweir #include <vcl/lstbox.hxx> 40*cdf0e10cSrcweir #include <tools/urlobj.hxx> 41*cdf0e10cSrcweir #include <svl/stritem.hxx> 42*cdf0e10cSrcweir #include <svl/eitem.hxx> 43*cdf0e10cSrcweir #include <svtools/transfer.hxx> 44*cdf0e10cSrcweir #include <sfx2/dispatch.hxx> 45*cdf0e10cSrcweir #include <vcl/msgbox.hxx> 46*cdf0e10cSrcweir #include <sfx2/fcontnr.hxx> 47*cdf0e10cSrcweir #include <svtools/inettbc.hxx> 48*cdf0e10cSrcweir #include <vcl/timer.hxx> 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir #include <dialmgr.hxx> 51*cdf0e10cSrcweir #include <sfx2/docfile.hxx> 52*cdf0e10cSrcweir #include <cuires.hrc> 53*cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 54*cdf0e10cSrcweir #include "helpid.hrc" 55*cdf0e10cSrcweir #include <svx/hlnkitem.hxx> 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir #include "hlmarkwn.hxx" 58*cdf0e10cSrcweir #include "iconcdlg.hxx" 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir /************************************************************************* 62*cdf0e10cSrcweir |* 63*cdf0e10cSrcweir |* ComboBox-Control, wich is filled with all current framenames 64*cdf0e10cSrcweir |* 65*cdf0e10cSrcweir \************************************************************************/ 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir class SvxFramesComboBox : public ComboBox 68*cdf0e10cSrcweir { 69*cdf0e10cSrcweir public: 70*cdf0e10cSrcweir SvxFramesComboBox (Window* pParent, const ResId& rResId, SfxDispatcher* pDispatch); 71*cdf0e10cSrcweir ~SvxFramesComboBox (); 72*cdf0e10cSrcweir }; 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir /************************************************************************* 75*cdf0e10cSrcweir |* 76*cdf0e10cSrcweir |* ComboBox-Control for URL's with History and Autocompletion 77*cdf0e10cSrcweir |* 78*cdf0e10cSrcweir \************************************************************************/ 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir class SvxHyperURLBox : public SvtURLBox, public DropTargetHelper 81*cdf0e10cSrcweir { 82*cdf0e10cSrcweir private: 83*cdf0e10cSrcweir sal_Bool mbAccessAddress; 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir // String GetAllEmailNamesFromDragItem( sal_uInt16 nItem ); 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir protected: 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); 90*cdf0e10cSrcweir virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir virtual long Notify( NotifyEvent& rNEvt ); 93*cdf0e10cSrcweir virtual void Select(); 94*cdf0e10cSrcweir virtual void Modify(); 95*cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt ); 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir public: 98*cdf0e10cSrcweir SvxHyperURLBox( Window* pParent, INetProtocol eSmart = INET_PROT_FILE, sal_Bool bAddresses = sal_False ); 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir }; 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir /************************************************************************* 103*cdf0e10cSrcweir |* 104*cdf0e10cSrcweir |* Tabpage : Basisclass 105*cdf0e10cSrcweir |* 106*cdf0e10cSrcweir \************************************************************************/ 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir class SvxHyperlinkTabPageBase : public IconChoicePage 109*cdf0e10cSrcweir { 110*cdf0e10cSrcweir private: 111*cdf0e10cSrcweir FixedLine *mpGrpMore; 112*cdf0e10cSrcweir FixedText *mpFtFrame; 113*cdf0e10cSrcweir SvxFramesComboBox *mpCbbFrame; 114*cdf0e10cSrcweir FixedText *mpFtForm; 115*cdf0e10cSrcweir ListBox *mpLbForm; 116*cdf0e10cSrcweir FixedText *mpFtIndication; 117*cdf0e10cSrcweir Edit *mpEdIndication; 118*cdf0e10cSrcweir FixedText *mpFtText; 119*cdf0e10cSrcweir Edit *mpEdText; 120*cdf0e10cSrcweir ImageButton *mpBtScript; 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir sal_Bool mbIsCloseDisabled; 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > 125*cdf0e10cSrcweir mxDocumentFrame; 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir protected: 128*cdf0e10cSrcweir Window* mpDialog; 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir sal_Bool mbStdControlsInit; 131*cdf0e10cSrcweir 132*cdf0e10cSrcweir String maStrInitURL; 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir Timer maTimer; 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir SvxHlinkDlgMarkWnd* mpMarkWnd; 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir void InitStdControls (); 139*cdf0e10cSrcweir virtual void FillStandardDlgFields ( SvxHyperlinkItem* pHyperlinkItem ); 140*cdf0e10cSrcweir virtual void FillDlgFields ( String& aStrURL ) = 0; 141*cdf0e10cSrcweir virtual void GetCurentItemData ( String& aStrURL, String& aStrName, 142*cdf0e10cSrcweir String& aStrIntName, String& aStrFrame, 143*cdf0e10cSrcweir SvxLinkInsertMode& eMode ) = 0; 144*cdf0e10cSrcweir virtual String CreateUiNameFromURL( const String& aStrURL ); 145*cdf0e10cSrcweir 146*cdf0e10cSrcweir void GetDataFromCommonFields( String& aStrName, 147*cdf0e10cSrcweir String& aStrIntName, String& aStrFrame, 148*cdf0e10cSrcweir SvxLinkInsertMode& eMode ); 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir DECL_LINK (ClickScriptHdl_Impl, void * ); // Button : Script 151*cdf0e10cSrcweir 152*cdf0e10cSrcweir String aEmptyStr; 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir sal_Bool FileExists( const INetURLObject& rURL ); 155*cdf0e10cSrcweir static String GetSchemeFromURL( String aStrURL ); 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir inline void DisableClose( sal_Bool _bDisable ) { mbIsCloseDisabled = _bDisable; } 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir public: 160*cdf0e10cSrcweir SvxHyperlinkTabPageBase ( 161*cdf0e10cSrcweir Window *pParent, 162*cdf0e10cSrcweir const ResId &rResId, 163*cdf0e10cSrcweir const SfxItemSet& rItemSet 164*cdf0e10cSrcweir ); 165*cdf0e10cSrcweir virtual ~SvxHyperlinkTabPageBase (); 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir void SetDocumentFrame( 168*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame ) 169*cdf0e10cSrcweir { 170*cdf0e10cSrcweir mxDocumentFrame = rxDocumentFrame; 171*cdf0e10cSrcweir } 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir virtual sal_Bool AskApply (); 174*cdf0e10cSrcweir virtual void DoApply (); 175*cdf0e10cSrcweir virtual void SetOnlineMode( sal_Bool bEnable ); 176*cdf0e10cSrcweir virtual void SetInitFocus(); 177*cdf0e10cSrcweir virtual void SetMarkStr ( String& aStrMark ); 178*cdf0e10cSrcweir virtual void Reset( const SfxItemSet& ); 179*cdf0e10cSrcweir virtual sal_Bool FillItemSet( SfxItemSet& ); 180*cdf0e10cSrcweir virtual void ActivatePage( const SfxItemSet& rItemSet ); 181*cdf0e10cSrcweir virtual int DeactivatePage( SfxItemSet* pSet = 0 ); 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir sal_Bool IsMarkWndVisible () { return ((Window*)mpMarkWnd)->IsVisible(); } 184*cdf0e10cSrcweir Size GetSizeExtraWnd () { return ( mpMarkWnd->GetSizePixel() ); } 185*cdf0e10cSrcweir sal_Bool MoveToExtraWnd ( Point aNewPos, sal_Bool bDisConnectDlg = sal_False ); 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir virtual void ActivatePage(); 188*cdf0e10cSrcweir virtual void DeactivatePage(); 189*cdf0e10cSrcweir virtual sal_Bool QueryClose(); 190*cdf0e10cSrcweir 191*cdf0e10cSrcweir protected: 192*cdf0e10cSrcweir virtual sal_Bool ShouldOpenMarkWnd(); 193*cdf0e10cSrcweir virtual void SetMarkWndShouldOpen(sal_Bool bOpen); 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir void ShowMarkWnd (); 196*cdf0e10cSrcweir void HideMarkWnd () { ( ( Window* ) mpMarkWnd )->Hide(); } 197*cdf0e10cSrcweir void InvalidateMarkWnd () { ( ( Window* ) mpMarkWnd )->Invalidate(); } 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir SfxDispatcher* GetDispatcher() const; 200*cdf0e10cSrcweir 201*cdf0e10cSrcweir sal_uInt16 GetMacroEvents(); 202*cdf0e10cSrcweir SvxMacroTableDtor* GetMacroTable(); 203*cdf0e10cSrcweir 204*cdf0e10cSrcweir sal_Bool IsHTMLDoc() const; 205*cdf0e10cSrcweir }; 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir #endif // _SVX_TABBASE_HYPERLINK_HXX 208*cdf0e10cSrcweir 209