xref: /aoo42x/main/svx/source/dialog/hyprdlg.hxx (revision 479f0c2e)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVX_DLG_HYPERDLG_HXX
24cdf0e10cSrcweir #define _SVX_DLG_HYPERDLG_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <vcl/combobox.hxx>
27cdf0e10cSrcweir #include <vcl/toolbox.hxx>
28cdf0e10cSrcweir #include <vcl/menu.hxx>
29cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
30cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx>
31cdf0e10cSrcweir #include <svl/srchcfg.hxx>
32cdf0e10cSrcweir #include <sfx2/tbxctrl.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir class SvxHyperlinkDlg;
35cdf0e10cSrcweir class SfxViewFrame;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir /*--------------------------------------------------------------------
38cdf0e10cSrcweir 	Beschreibung:
39cdf0e10cSrcweir  --------------------------------------------------------------------*/
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class HyperCombo : public ComboBox
42cdf0e10cSrcweir {
43cdf0e10cSrcweir 	SvxHyperlinkDlg *pDlg;
44cdf0e10cSrcweir 	long			nMaxWidth;
45cdf0e10cSrcweir 	long			nMinWidth;
46cdf0e10cSrcweir 	long			nRatio;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 	virtual long Notify( NotifyEvent& rNEvt );
49cdf0e10cSrcweir 	virtual long PreNotify( NotifyEvent& rNEvt );
50cdf0e10cSrcweir 
51cdf0e10cSrcweir public:
52cdf0e10cSrcweir 	HyperCombo( SvxHyperlinkDlg* pDialog, const ResId& rResId );
53cdf0e10cSrcweir 
SetRatio(long nR)54cdf0e10cSrcweir 	inline void	SetRatio( long nR ) { nRatio = nR; }
GetRatio()55cdf0e10cSrcweir 	inline long	GetRatio()			{ return nRatio; }
56cdf0e10cSrcweir 	long		CalcResizeWidth( long nW );
GetResizeWidth()57cdf0e10cSrcweir 	inline long	GetResizeWidth()	{ return (nMaxWidth - nMinWidth); }
58cdf0e10cSrcweir 	void		DoResize( long nW );
59cdf0e10cSrcweir };
60cdf0e10cSrcweir 
61cdf0e10cSrcweir class HyperFixedText : public FixedInfo
62cdf0e10cSrcweir {
63cdf0e10cSrcweir 	SvxHyperlinkDlg *pDlg;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir public:
66cdf0e10cSrcweir 	HyperFixedText( SvxHyperlinkDlg* pDialog, const ResId& rResId );
67cdf0e10cSrcweir 
68cdf0e10cSrcweir };
69cdf0e10cSrcweir 
70cdf0e10cSrcweir /*--------------------------------------------------------------------
71cdf0e10cSrcweir 	Beschreibung: Dialog zum Einf�gen/�ndern eines Hyperlink
72cdf0e10cSrcweir  --------------------------------------------------------------------*/
73cdf0e10cSrcweir 
74cdf0e10cSrcweir class SvxHyperlinkDlg : public ToolBox, public SfxControllerItem
75cdf0e10cSrcweir {
76cdf0e10cSrcweir 	friend class HyperCombo;
77cdf0e10cSrcweir 	friend class HyperFixedText;
78cdf0e10cSrcweir 	using ToolBox::StateChanged;
79cdf0e10cSrcweir 
80cdf0e10cSrcweir private:
81cdf0e10cSrcweir 	SfxStatusForwarder	aForwarder;
82cdf0e10cSrcweir 	SfxStatusForwarder	aHyperlinkDlgForward;
83cdf0e10cSrcweir 	HyperCombo			aNameCB;
84cdf0e10cSrcweir 	HyperFixedText		aUrlFT;
85cdf0e10cSrcweir 	HyperCombo			aUrlCB;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     SvxSearchConfig     aSearchConfig;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     String              sAddress;
90cdf0e10cSrcweir 	String				sExplorer;
91cdf0e10cSrcweir 	String				sOldName;
92cdf0e10cSrcweir 	String 				sSearchTitle;
93cdf0e10cSrcweir 	PopupMenu			aLinkPopup;
94cdf0e10cSrcweir 	PopupMenu			*pTargetMenu;
95cdf0e10cSrcweir 	sal_Bool				bNoDoc;
96cdf0e10cSrcweir 	sal_Bool				bHasOldName;
97cdf0e10cSrcweir 	long				nMaxWidth;
98cdf0e10cSrcweir 	long				nMinWidth;
99cdf0e10cSrcweir 	long				nMaxHeight;
100cdf0e10cSrcweir 	sal_Bool				bHtmlMode;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	SfxImageManager*	mpManager;
103cdf0e10cSrcweir 
104cdf0e10cSrcweir     virtual void    StateChanged( sal_uInt16 nSID, SfxItemState eState,	const SfxPoolItem* pState );
105cdf0e10cSrcweir 	virtual void DataChanged( const DataChangedEvent& rDCEvt );
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	// DockingWindow
108cdf0e10cSrcweir 	virtual void Resize();
109cdf0e10cSrcweir 	virtual void Resizing(Size& rSize);
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 	// Drag&Drop
112cdf0e10cSrcweir 	sal_Bool 		 GetDragData(sal_uInt16 nItem, sal_uIntPtr nDDFormatId, String& rBuffer);
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	DECL_LINK(TBClickHdl, ToolBox *);
115cdf0e10cSrcweir 	DECL_LINK(TBSelectHdl, ToolBox *);
116cdf0e10cSrcweir     DECL_LINK(DropdownClick, ToolBox * );
117cdf0e10cSrcweir 	DECL_LINK(LinkPopupSelectHdl, Menu *);
118cdf0e10cSrcweir 	DECL_LINK(SearchPopupSelectHdl, Menu *);
119cdf0e10cSrcweir 	DECL_LINK(ComboSelectHdl, ComboBox *);
120cdf0e10cSrcweir 	DECL_LINK(ComboModifyHdl, ComboBox *);
121cdf0e10cSrcweir 	DECL_LINK(BookmarkFoundHdl, String *);
122cdf0e10cSrcweir 
123cdf0e10cSrcweir     void    OpenDoc( const String& rURL, SfxViewFrame* pViewFrame );
124cdf0e10cSrcweir     void    EnableLink();
125cdf0e10cSrcweir 	void	SendToApp(sal_uInt16 nType);
126cdf0e10cSrcweir 	void	AddToHistory(const String& rName, const String& rURL);
127cdf0e10cSrcweir 	void	TargetMenu(const String& rSelEntry, sal_Bool bExecute);
128cdf0e10cSrcweir 	String	GetSelTarget();
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 	void	SetImages();
131cdf0e10cSrcweir public:
132cdf0e10cSrcweir 	SvxHyperlinkDlg(SfxBindings *pBindings, Window* pWindow);
133cdf0e10cSrcweir 	~SvxHyperlinkDlg();
134cdf0e10cSrcweir };
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 
137cdf0e10cSrcweir #endif // _SVX_DLG_HYPERDLG_HXX
138cdf0e10cSrcweir 
139