1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hyprdlg.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_DLG_HYPERDLG_HXX
31 #define _SVX_DLG_HYPERDLG_HXX
33 #include <vcl/combobox.hxx>
34 #include <vcl/toolbox.hxx>
35 #include <vcl/menu.hxx>
36 #include <svtools/stdctrl.hxx>
37 #include <sfx2/ctrlitem.hxx>
38 #include "srchcfg.hxx"
39 #include <sfx2/tbxctrl.hxx>
41 class SvxHyperlinkDlg
;
44 /*--------------------------------------------------------------------
46 --------------------------------------------------------------------*/
48 class HyperCombo
: public ComboBox
50 SvxHyperlinkDlg
*pDlg
;
55 virtual long Notify( NotifyEvent
& rNEvt
);
56 virtual long PreNotify( NotifyEvent
& rNEvt
);
59 HyperCombo( SvxHyperlinkDlg
* pDialog
, const ResId
& rResId
);
61 inline void SetRatio( long nR
) { nRatio
= nR
; }
62 inline long GetRatio() { return nRatio
; }
63 long CalcResizeWidth( long nW
);
64 inline long GetResizeWidth() { return (nMaxWidth
- nMinWidth
); }
65 void DoResize( long nW
);
68 class HyperFixedText
: public FixedInfo
70 SvxHyperlinkDlg
*pDlg
;
73 HyperFixedText( SvxHyperlinkDlg
* pDialog
, const ResId
& rResId
);
77 /*--------------------------------------------------------------------
78 Beschreibung: Dialog zum Einf�gen/Žndern eines Hyperlink
79 --------------------------------------------------------------------*/
81 class SvxHyperlinkDlg
: public ToolBox
, public SfxControllerItem
83 friend class HyperCombo
;
84 friend class HyperFixedText
;
85 using ToolBox::StateChanged
;
88 SfxStatusForwarder aForwarder
;
89 SfxStatusForwarder aHyperlinkDlgForward
;
91 HyperFixedText aUrlFT
;
94 SvxSearchConfig aSearchConfig
;
100 PopupMenu aLinkPopup
;
101 PopupMenu
*pTargetMenu
;
110 SfxImageManager
* mpManager
;
112 virtual void StateChanged( USHORT nSID
, SfxItemState eState
, const SfxPoolItem
* pState
);
113 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
116 virtual void Resize();
117 virtual void Resizing(Size
& rSize
);
120 BOOL
GetDragData(USHORT nItem
, ULONG nDDFormatId
, String
& rBuffer
);
122 DECL_LINK(TBClickHdl
, ToolBox
*);
123 DECL_LINK(TBSelectHdl
, ToolBox
*);
124 DECL_LINK(DropdownClick
, ToolBox
* );
125 DECL_LINK(LinkPopupSelectHdl
, Menu
*);
126 DECL_LINK(SearchPopupSelectHdl
, Menu
*);
127 DECL_LINK(ComboSelectHdl
, ComboBox
*);
128 DECL_LINK(ComboModifyHdl
, ComboBox
*);
129 DECL_LINK(BookmarkFoundHdl
, String
*);
131 void OpenDoc( const String
& rURL
, SfxViewFrame
* pViewFrame
);
133 void SendToApp(USHORT nType
);
134 void AddToHistory(const String
& rName
, const String
& rURL
);
135 void TargetMenu(const String
& rSelEntry
, BOOL bExecute
);
136 String
GetSelTarget();
140 SvxHyperlinkDlg(SfxBindings
*pBindings
, Window
* pWindow
);
145 #endif // _SVX_DLG_HYPERDLG_HXX