Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #ifndef _IMAPDLG_HXX_
22 : #define _IMAPDLG_HXX_
23 :
24 : #include <svtools/inettbc.hxx>
25 : #include <sfx2/childwin.hxx>
26 : #include <sfx2/ctrlitem.hxx>
27 : #include <sfx2/basedlgs.hxx>
28 :
29 : #include <vcl/fixed.hxx>
30 :
31 : #include <vcl/combobox.hxx>
32 :
33 : #include <vcl/edit.hxx>
34 :
35 : #include <vcl/toolbox.hxx>
36 :
37 : #include <vcl/status.hxx>
38 : #include "svx/svxdllapi.h"
39 : #include <vector>
40 :
41 :
42 : #ifndef _GOMISC_HXX
43 : class ImageMap;
44 : #endif
45 :
46 :
47 : /*************************************************************************
48 : |*
49 : |* Derivation from SfxChildWindow as "container" for float
50 : |*
51 : \************************************************************************/
52 :
53 : class Graphic;
54 : typedef ::std::vector< String* > TargetList;
55 :
56 : class SVX_DLLPUBLIC SvxIMapDlgChildWindow : public SfxChildWindow
57 : {
58 : public:
59 :
60 : SvxIMapDlgChildWindow( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
61 :
62 : SFX_DECL_CHILDWINDOW_WITHID( SvxIMapDlgChildWindow );
63 :
64 : static void UpdateIMapDlg( const Graphic& rGraphic, const ImageMap* pImageMap = NULL,
65 : const TargetList* pTargetList = NULL, void* pEditingObj = NULL );
66 : };
67 :
68 :
69 : #ifndef _REDUCED_IMAPDLG_HXX_
70 : #define _REDUCED_IMAPDLG_HXX_
71 :
72 : class SvxIMapDlg;
73 :
74 : class SvxIMapDlgItem : public SfxControllerItem
75 : {
76 : SvxIMapDlg& rIMap;
77 :
78 :
79 : protected:
80 :
81 : virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
82 : const SfxPoolItem* pState );
83 :
84 :
85 : public:
86 :
87 : SvxIMapDlgItem( sal_uInt16 nId, SvxIMapDlg& rIMapDlg, SfxBindings& rBindings );
88 : };
89 :
90 : class IMapOwnData;
91 : class IMapWindow;
92 :
93 : class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow
94 : {
95 : friend class IMapOwnData;
96 : friend class IMapWindow;
97 : using Window::Update;
98 :
99 : ToolBox aTbxIMapDlg1;
100 : FixedText aFtURL;
101 : SvtURLBox maURLBox;
102 : FixedText aFtText;
103 : Edit aEdtText;
104 : FixedText maFtTarget;
105 : ComboBox maCbbTarget;
106 : StatusBar aStbStatus;
107 : ImageList maImageList;
108 :
109 : Size aLastSize;
110 : IMapWindow* pIMapWnd;
111 : IMapOwnData* pOwnData;
112 : void* pCheckObj;
113 : SvxIMapDlgItem aIMapItem;
114 :
115 : virtual void Resize();
116 : virtual sal_Bool Close();
117 :
118 : #ifdef _IMAPDLG_PRIVATE
119 :
120 : DECL_LINK( TbxClickHdl, ToolBox* );
121 : DECL_LINK( InfoHdl, IMapWindow* );
122 : DECL_LINK( MousePosHdl, IMapWindow* );
123 : DECL_LINK( GraphSizeHdl, IMapWindow* );
124 : DECL_LINK( URLModifyHdl, void* );
125 : DECL_LINK( URLLoseFocusHdl, void* );
126 : DECL_LINK(UpdateHdl, void *);
127 : DECL_LINK( TbxUpdateHdl, Timer* );
128 : DECL_LINK( StateHdl, IMapWindow* );
129 : DECL_LINK( MiscHdl, void* );
130 :
131 : void DoOpen();
132 : sal_Bool DoSave();
133 :
134 : #endif
135 :
136 :
137 : public:
138 :
139 : SvxIMapDlg( SfxBindings *pBindings, SfxChildWindow *pCW,
140 : Window* pParent, const ResId& rResId );
141 : ~SvxIMapDlg();
142 :
143 : void SetExecState( sal_Bool bEnable );
144 :
145 : void SetGraphic( const Graphic& rGraphic );
146 :
147 : void SetEditingObject( void* pObj ) { pCheckObj = pObj; }
148 0 : const void* GetEditingObject() const { return pCheckObj; }
149 :
150 : void SetImageMap( const ImageMap& rImageMap );
151 : const ImageMap& GetImageMap() const;
152 :
153 : void SetTargetList( const TargetList& rTargetList );
154 :
155 : void Update( const Graphic& rGraphic, const ImageMap* pImageMap = NULL,
156 : const TargetList* pTargetList = NULL, void* pEditingObj = NULL );
157 :
158 : virtual void KeyInput( const KeyEvent& rKEvt );
159 :
160 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
161 : void ApplyImageList();
162 : };
163 :
164 :
165 : /*************************************************************************
166 : |*
167 : |* Defines
168 : |*
169 : \************************************************************************/
170 :
171 : #define SVXIMAPDLG() ( (SvxIMapDlg*) ( SfxViewFrame::Current()->GetChildWindow( \
172 : SvxIMapDlgChildWindow::GetChildWindowId() )-> \
173 : GetWindow() ) )
174 :
175 :
176 : #endif // _REDUCED_IMAPDLG_HXX_
177 : #endif // _IMAPDLG_HXX_
178 :
179 :
180 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|