Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #ifndef _IMAPDLG_HXX_
31 : : #define _IMAPDLG_HXX_
32 : :
33 : : #include <svtools/inettbc.hxx>
34 : : #include <sfx2/childwin.hxx>
35 : : #include <sfx2/ctrlitem.hxx>
36 : : #include <sfx2/basedlgs.hxx>
37 : :
38 : : #include <vcl/fixed.hxx>
39 : :
40 : : #include <vcl/combobox.hxx>
41 : :
42 : : #include <vcl/edit.hxx>
43 : :
44 : : #include <vcl/toolbox.hxx>
45 : :
46 : : #include <vcl/status.hxx>
47 : : #include "svx/svxdllapi.h"
48 : : #include <vector>
49 : :
50 : :
51 : : #ifndef _GOMISC_HXX
52 : : class ImageMap;
53 : : #endif
54 : :
55 : :
56 : : /*************************************************************************
57 : : |*
58 : : |* Derivation from SfxChildWindow as "container" for float
59 : : |*
60 : : \************************************************************************/
61 : :
62 : : class Graphic;
63 : : typedef ::std::vector< String* > TargetList;
64 : :
65 : : class SVX_DLLPUBLIC SvxIMapDlgChildWindow : public SfxChildWindow
66 : : {
67 : : public:
68 : :
69 : : SvxIMapDlgChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
70 : :
71 : : SFX_DECL_CHILDWINDOW_WITHID( SvxIMapDlgChildWindow );
72 : :
73 : : static void UpdateIMapDlg( const Graphic& rGraphic, const ImageMap* pImageMap = NULL,
74 : : const TargetList* pTargetList = NULL, void* pEditingObj = NULL );
75 : : };
76 : :
77 : :
78 : : #ifndef _REDUCED_IMAPDLG_HXX_
79 : : #define _REDUCED_IMAPDLG_HXX_
80 : :
81 : : class SvxIMapDlg;
82 : :
83 : : class SvxIMapDlgItem : public SfxControllerItem
84 : : {
85 : : SvxIMapDlg& rIMap;
86 : :
87 : :
88 : : protected:
89 : :
90 : : virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
91 : : const SfxPoolItem* pState );
92 : :
93 : :
94 : : public:
95 : :
96 : : SvxIMapDlgItem( sal_uInt16 nId, SvxIMapDlg& rIMapDlg, SfxBindings& rBindings );
97 : : };
98 : :
99 : : class IMapOwnData;
100 : : class IMapWindow;
101 : :
102 : : class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow
103 : : {
104 : : friend class IMapOwnData;
105 : : friend class IMapWindow;
106 : : using Window::Update;
107 : :
108 : : ToolBox aTbxIMapDlg1;
109 : : FixedText aFtURL;
110 : : SvtURLBox maURLBox;
111 : : FixedText aFtText;
112 : : Edit aEdtText;
113 : : FixedText maFtTarget;
114 : : ComboBox maCbbTarget;
115 : : StatusBar aStbStatus;
116 : : ImageList maImageList;
117 : :
118 : : Size aLastSize;
119 : : IMapWindow* pIMapWnd;
120 : : IMapOwnData* pOwnData;
121 : : void* pCheckObj;
122 : : SvxIMapDlgItem aIMapItem;
123 : :
124 : : virtual void Resize();
125 : : virtual sal_Bool Close();
126 : :
127 : : #ifdef _IMAPDLG_PRIVATE
128 : :
129 : : DECL_LINK( TbxClickHdl, ToolBox* );
130 : : DECL_LINK( InfoHdl, IMapWindow* );
131 : : DECL_LINK( MousePosHdl, IMapWindow* );
132 : : DECL_LINK( GraphSizeHdl, IMapWindow* );
133 : : DECL_LINK( URLModifyHdl, void* );
134 : : DECL_LINK( URLLoseFocusHdl, void* );
135 : : DECL_LINK(UpdateHdl, void *);
136 : : DECL_LINK( TbxUpdateHdl, Timer* );
137 : : DECL_LINK( StateHdl, IMapWindow* );
138 : : DECL_LINK( MiscHdl, void* );
139 : :
140 : : void DoOpen();
141 : : sal_Bool DoSave();
142 : :
143 : : #endif
144 : :
145 : :
146 : : public:
147 : :
148 : : SvxIMapDlg( SfxBindings *pBindings, SfxChildWindow *pCW,
149 : : Window* pParent, const ResId& rResId );
150 : : ~SvxIMapDlg();
151 : :
152 : : void SetExecState( sal_Bool bEnable );
153 : :
154 : : void SetGraphic( const Graphic& rGraphic );
155 : :
156 : : void SetEditingObject( void* pObj ) { pCheckObj = pObj; }
157 : 0 : const void* GetEditingObject() const { return pCheckObj; }
158 : :
159 : : void SetImageMap( const ImageMap& rImageMap );
160 : : const ImageMap& GetImageMap() const;
161 : :
162 : : void SetTargetList( const TargetList& rTargetList );
163 : :
164 : : void Update( const Graphic& rGraphic, const ImageMap* pImageMap = NULL,
165 : : const TargetList* pTargetList = NULL, void* pEditingObj = NULL );
166 : :
167 : : virtual void KeyInput( const KeyEvent& rKEvt );
168 : :
169 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
170 : : void ApplyImageList();
171 : : };
172 : :
173 : :
174 : : /*************************************************************************
175 : : |*
176 : : |* Defines
177 : : |*
178 : : \************************************************************************/
179 : :
180 : : #define SVXIMAPDLG() ( (SvxIMapDlg*) ( SfxViewFrame::Current()->GetChildWindow( \
181 : : SvxIMapDlgChildWindow::GetChildWindowId() )-> \
182 : : GetWindow() ) )
183 : :
184 : :
185 : : #endif // _REDUCED_IMAPDLG_HXX_
186 : : #endif // _IMAPDLG_HXX_
187 : :
188 : :
189 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|