xref: /AOO41X/main/svx/inc/svx/imapdlg.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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 
28*cdf0e10cSrcweir 
29*cdf0e10cSrcweir #ifndef _IMAPDLG_HXX_
30*cdf0e10cSrcweir #define _IMAPDLG_HXX_
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include <svtools/inettbc.hxx>
33*cdf0e10cSrcweir #include <sfx2/childwin.hxx>
34*cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx>
35*cdf0e10cSrcweir #include <sfx2/basedlgs.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
38*cdf0e10cSrcweir #include <vcl/fixed.hxx>
39*cdf0e10cSrcweir #endif
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #ifndef _COMBOBOX_HXX //autogen
42*cdf0e10cSrcweir #include <vcl/combobox.hxx>
43*cdf0e10cSrcweir #endif
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir #ifndef _EDIT_HXX //autogen
46*cdf0e10cSrcweir #include <vcl/edit.hxx>
47*cdf0e10cSrcweir #endif
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir #ifndef _TOOLBOX_HXX //autogen
50*cdf0e10cSrcweir #include <vcl/toolbox.hxx>
51*cdf0e10cSrcweir #endif
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir #ifndef _STATUS_HXX //autogen
54*cdf0e10cSrcweir #include <vcl/status.hxx>
55*cdf0e10cSrcweir #endif
56*cdf0e10cSrcweir #include "svx/svxdllapi.h"
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir #ifndef _GOMISC_HXX
60*cdf0e10cSrcweir class ImageMap;
61*cdf0e10cSrcweir #endif
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir /*************************************************************************
65*cdf0e10cSrcweir |*
66*cdf0e10cSrcweir |* Ableitung vom SfxChildWindow als "Behaelter" fuer Float
67*cdf0e10cSrcweir |*
68*cdf0e10cSrcweir \************************************************************************/
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir class Graphic;
71*cdf0e10cSrcweir class TargetList;
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir class SVX_DLLPUBLIC SvxIMapDlgChildWindow : public SfxChildWindow
74*cdf0e10cSrcweir {
75*cdf0e10cSrcweir  public:
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir 	SvxIMapDlgChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir 	SFX_DECL_CHILDWINDOW( SvxIMapDlgChildWindow );
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir 	static void UpdateIMapDlg( const Graphic& rGraphic, const ImageMap* pImageMap = NULL,
82*cdf0e10cSrcweir 							   const TargetList* pTargetList = NULL, void* pEditingObj = NULL );
83*cdf0e10cSrcweir };
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir #ifndef _REDUCED_IMAPDLG_HXX_
87*cdf0e10cSrcweir #define _REDUCED_IMAPDLG_HXX_
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir /*************************************************************************
90*cdf0e10cSrcweir |*
91*cdf0e10cSrcweir |*
92*cdf0e10cSrcweir |*
93*cdf0e10cSrcweir \************************************************************************/
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir class SvxIMapDlg;
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir class SvxIMapDlgItem : public SfxControllerItem
98*cdf0e10cSrcweir {
99*cdf0e10cSrcweir 	SvxIMapDlg&	rIMap;
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir protected:
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 	virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
105*cdf0e10cSrcweir 							   const SfxPoolItem* pState );
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir public:
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir 	SvxIMapDlgItem( sal_uInt16 nId, SvxIMapDlg& rIMapDlg, SfxBindings& rBindings );
111*cdf0e10cSrcweir };
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir /*************************************************************************
115*cdf0e10cSrcweir |*
116*cdf0e10cSrcweir |*
117*cdf0e10cSrcweir |*
118*cdf0e10cSrcweir \************************************************************************/
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir class IMapOwnData;
121*cdf0e10cSrcweir class IMapWindow;
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow
124*cdf0e10cSrcweir {
125*cdf0e10cSrcweir 	friend class IMapOwnData;
126*cdf0e10cSrcweir 	friend class IMapWindow;
127*cdf0e10cSrcweir 	using Window::Update;
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 	ToolBox				aTbxIMapDlg1;
130*cdf0e10cSrcweir 	FixedText			aFtURL;
131*cdf0e10cSrcweir 	SvtURLBox			maURLBox;
132*cdf0e10cSrcweir 	FixedText			aFtText;
133*cdf0e10cSrcweir 	Edit				aEdtText;
134*cdf0e10cSrcweir 	FixedText			maFtTarget;
135*cdf0e10cSrcweir 	ComboBox			maCbbTarget;
136*cdf0e10cSrcweir 	StatusBar			aStbStatus;
137*cdf0e10cSrcweir 	ImageList			maImageList;
138*cdf0e10cSrcweir 	ImageList			maImageListH;
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir 	Size				aLastSize;
141*cdf0e10cSrcweir 	IMapWindow*			pIMapWnd;
142*cdf0e10cSrcweir 	IMapOwnData*		pOwnData;
143*cdf0e10cSrcweir 	void*				pCheckObj;
144*cdf0e10cSrcweir 	SvxIMapDlgItem		aIMapItem;
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir 	virtual	void		Resize();
147*cdf0e10cSrcweir 	virtual sal_Bool 		Close();
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir #ifdef _IMAPDLG_PRIVATE
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir 						DECL_LINK( TbxClickHdl, ToolBox* );
152*cdf0e10cSrcweir 						DECL_LINK( InfoHdl, IMapWindow* );
153*cdf0e10cSrcweir 						DECL_LINK( MousePosHdl, IMapWindow* );
154*cdf0e10cSrcweir 						DECL_LINK( GraphSizeHdl, IMapWindow* );
155*cdf0e10cSrcweir 						DECL_LINK( URLModifyHdl, void* );
156*cdf0e10cSrcweir 						DECL_LINK( URLLoseFocusHdl, void* );
157*cdf0e10cSrcweir 						DECL_LINK( UpdateHdl, Timer* );
158*cdf0e10cSrcweir 						DECL_LINK( TbxUpdateHdl, Timer* );
159*cdf0e10cSrcweir 						DECL_LINK( StateHdl, IMapWindow* );
160*cdf0e10cSrcweir 						DECL_LINK( MiscHdl, void* );
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir 	void				DoOpen();
163*cdf0e10cSrcweir 	sal_Bool				DoSave();
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir #endif
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir public:
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir 						SvxIMapDlg( SfxBindings *pBindings, SfxChildWindow *pCW,
171*cdf0e10cSrcweir 									Window* pParent, const ResId& rResId );
172*cdf0e10cSrcweir 						~SvxIMapDlg();
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir 	void				SetExecState( sal_Bool bEnable );
175*cdf0e10cSrcweir 
176*cdf0e10cSrcweir 	void				SetGraphic( const Graphic& rGraphic );
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir 	void				SetEditingObject( void* pObj ) { pCheckObj = pObj; }
179*cdf0e10cSrcweir 	const void*			GetEditingObject() const { return pCheckObj; }
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir 	void				SetImageMap( const ImageMap& rImageMap );
182*cdf0e10cSrcweir 	const ImageMap&		GetImageMap() const;
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir 	void				SetTargetList( const TargetList& rTargetList );
185*cdf0e10cSrcweir 	const TargetList&	GetTargetList() const;
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir 	void				Update( const Graphic& rGraphic, const ImageMap* pImageMap = NULL,
188*cdf0e10cSrcweir 								const TargetList* pTargetList = NULL, void* pEditingObj = NULL );
189*cdf0e10cSrcweir 
190*cdf0e10cSrcweir 	virtual void		KeyInput( const KeyEvent& rKEvt );
191*cdf0e10cSrcweir 
192*cdf0e10cSrcweir 	virtual void DataChanged( const DataChangedEvent& rDCEvt );
193*cdf0e10cSrcweir 	void ApplyImageList();
194*cdf0e10cSrcweir };
195*cdf0e10cSrcweir 
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir /*************************************************************************
198*cdf0e10cSrcweir |*
199*cdf0e10cSrcweir |* Defines
200*cdf0e10cSrcweir |*
201*cdf0e10cSrcweir \************************************************************************/
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir #define SVXIMAPDLG() ( (SvxIMapDlg*) ( SfxViewFrame::Current()->GetChildWindow( 		\
204*cdf0e10cSrcweir 						SvxIMapDlgChildWindow::GetChildWindowId() )-> 	\
205*cdf0e10cSrcweir 						GetWindow() ) )
206*cdf0e10cSrcweir 
207*cdf0e10cSrcweir 
208*cdf0e10cSrcweir #endif // _REDUCED_IMAPDLG_HXX_
209*cdf0e10cSrcweir #endif // _IMAPDLG_HXX_
210*cdf0e10cSrcweir 
211*cdf0e10cSrcweir 
212