merge the formfield patch from ooo-build
[ooovba.git] / svx / source / dialog / hyprdlg.hxx
blobe526bd86a7e53361d7202686534805feca2f94af
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hyprdlg.hxx,v $
10 * $Revision: 1.8 $
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;
42 class SfxViewFrame;
44 /*--------------------------------------------------------------------
45 Beschreibung:
46 --------------------------------------------------------------------*/
48 class HyperCombo : public ComboBox
50 SvxHyperlinkDlg *pDlg;
51 long nMaxWidth;
52 long nMinWidth;
53 long nRatio;
55 virtual long Notify( NotifyEvent& rNEvt );
56 virtual long PreNotify( NotifyEvent& rNEvt );
58 public:
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;
72 public:
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;
87 private:
88 SfxStatusForwarder aForwarder;
89 SfxStatusForwarder aHyperlinkDlgForward;
90 HyperCombo aNameCB;
91 HyperFixedText aUrlFT;
92 HyperCombo aUrlCB;
94 SvxSearchConfig aSearchConfig;
96 String sAddress;
97 String sExplorer;
98 String sOldName;
99 String sSearchTitle;
100 PopupMenu aLinkPopup;
101 PopupMenu *pTargetMenu;
102 BOOL bNoDoc;
103 BOOL bSend;
104 BOOL bHasOldName;
105 long nMaxWidth;
106 long nMinWidth;
107 long nMaxHeight;
108 BOOL bHtmlMode;
110 SfxImageManager* mpManager;
112 virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
113 virtual void DataChanged( const DataChangedEvent& rDCEvt );
115 // DockingWindow
116 virtual void Resize();
117 virtual void Resizing(Size& rSize);
119 // Drag&Drop
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 );
132 void EnableLink();
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();
138 void SetImages();
139 public:
140 SvxHyperlinkDlg(SfxBindings *pBindings, Window* pWindow);
141 ~SvxHyperlinkDlg();
145 #endif // _SVX_DLG_HYPERDLG_HXX