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_DLG_HYPERDLG_HXX 28*cdf0e10cSrcweir #define _SVX_DLG_HYPERDLG_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <vcl/combobox.hxx> 31*cdf0e10cSrcweir #include <vcl/toolbox.hxx> 32*cdf0e10cSrcweir #include <vcl/menu.hxx> 33*cdf0e10cSrcweir #include <svtools/stdctrl.hxx> 34*cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx> 35*cdf0e10cSrcweir #include <svl/srchcfg.hxx> 36*cdf0e10cSrcweir #include <sfx2/tbxctrl.hxx> 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir class SvxHyperlinkDlg; 39*cdf0e10cSrcweir class SfxViewFrame; 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir /*-------------------------------------------------------------------- 42*cdf0e10cSrcweir Beschreibung: 43*cdf0e10cSrcweir --------------------------------------------------------------------*/ 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir class HyperCombo : public ComboBox 46*cdf0e10cSrcweir { 47*cdf0e10cSrcweir SvxHyperlinkDlg *pDlg; 48*cdf0e10cSrcweir long nMaxWidth; 49*cdf0e10cSrcweir long nMinWidth; 50*cdf0e10cSrcweir long nRatio; 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir virtual long Notify( NotifyEvent& rNEvt ); 53*cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt ); 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir public: 56*cdf0e10cSrcweir HyperCombo( SvxHyperlinkDlg* pDialog, const ResId& rResId ); 57*cdf0e10cSrcweir 58*cdf0e10cSrcweir inline void SetRatio( long nR ) { nRatio = nR; } 59*cdf0e10cSrcweir inline long GetRatio() { return nRatio; } 60*cdf0e10cSrcweir long CalcResizeWidth( long nW ); 61*cdf0e10cSrcweir inline long GetResizeWidth() { return (nMaxWidth - nMinWidth); } 62*cdf0e10cSrcweir void DoResize( long nW ); 63*cdf0e10cSrcweir }; 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir class HyperFixedText : public FixedInfo 66*cdf0e10cSrcweir { 67*cdf0e10cSrcweir SvxHyperlinkDlg *pDlg; 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir public: 70*cdf0e10cSrcweir HyperFixedText( SvxHyperlinkDlg* pDialog, const ResId& rResId ); 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir }; 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir /*-------------------------------------------------------------------- 75*cdf0e10cSrcweir Beschreibung: Dialog zum Einf�gen/�ndern eines Hyperlink 76*cdf0e10cSrcweir --------------------------------------------------------------------*/ 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir class SvxHyperlinkDlg : public ToolBox, public SfxControllerItem 79*cdf0e10cSrcweir { 80*cdf0e10cSrcweir friend class HyperCombo; 81*cdf0e10cSrcweir friend class HyperFixedText; 82*cdf0e10cSrcweir using ToolBox::StateChanged; 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir private: 85*cdf0e10cSrcweir SfxStatusForwarder aForwarder; 86*cdf0e10cSrcweir SfxStatusForwarder aHyperlinkDlgForward; 87*cdf0e10cSrcweir HyperCombo aNameCB; 88*cdf0e10cSrcweir HyperFixedText aUrlFT; 89*cdf0e10cSrcweir HyperCombo aUrlCB; 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir SvxSearchConfig aSearchConfig; 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir String sAddress; 94*cdf0e10cSrcweir String sExplorer; 95*cdf0e10cSrcweir String sOldName; 96*cdf0e10cSrcweir String sSearchTitle; 97*cdf0e10cSrcweir PopupMenu aLinkPopup; 98*cdf0e10cSrcweir PopupMenu *pTargetMenu; 99*cdf0e10cSrcweir sal_Bool bNoDoc; 100*cdf0e10cSrcweir sal_Bool bSend; 101*cdf0e10cSrcweir sal_Bool bHasOldName; 102*cdf0e10cSrcweir long nMaxWidth; 103*cdf0e10cSrcweir long nMinWidth; 104*cdf0e10cSrcweir long nMaxHeight; 105*cdf0e10cSrcweir sal_Bool bHtmlMode; 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir SfxImageManager* mpManager; 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); 110*cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt ); 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir // DockingWindow 113*cdf0e10cSrcweir virtual void Resize(); 114*cdf0e10cSrcweir virtual void Resizing(Size& rSize); 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir // Drag&Drop 117*cdf0e10cSrcweir sal_Bool GetDragData(sal_uInt16 nItem, sal_uIntPtr nDDFormatId, String& rBuffer); 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir DECL_LINK(TBClickHdl, ToolBox *); 120*cdf0e10cSrcweir DECL_LINK(TBSelectHdl, ToolBox *); 121*cdf0e10cSrcweir DECL_LINK(DropdownClick, ToolBox * ); 122*cdf0e10cSrcweir DECL_LINK(LinkPopupSelectHdl, Menu *); 123*cdf0e10cSrcweir DECL_LINK(SearchPopupSelectHdl, Menu *); 124*cdf0e10cSrcweir DECL_LINK(ComboSelectHdl, ComboBox *); 125*cdf0e10cSrcweir DECL_LINK(ComboModifyHdl, ComboBox *); 126*cdf0e10cSrcweir DECL_LINK(BookmarkFoundHdl, String *); 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir void OpenDoc( const String& rURL, SfxViewFrame* pViewFrame ); 129*cdf0e10cSrcweir void EnableLink(); 130*cdf0e10cSrcweir void SendToApp(sal_uInt16 nType); 131*cdf0e10cSrcweir void AddToHistory(const String& rName, const String& rURL); 132*cdf0e10cSrcweir void TargetMenu(const String& rSelEntry, sal_Bool bExecute); 133*cdf0e10cSrcweir String GetSelTarget(); 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir void SetImages(); 136*cdf0e10cSrcweir public: 137*cdf0e10cSrcweir SvxHyperlinkDlg(SfxBindings *pBindings, Window* pWindow); 138*cdf0e10cSrcweir ~SvxHyperlinkDlg(); 139*cdf0e10cSrcweir }; 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir #endif // _SVX_DLG_HYPERDLG_HXX 143*cdf0e10cSrcweir 144