1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVX_IMAPDLG_HXX
21 #define INCLUDED_SVX_IMAPDLG_HXX
23 #include <sfx2/childwin.hxx>
24 #include <sfx2/ctrlitem.hxx>
25 #include <sfx2/basedlgs.hxx>
26 #include <svx/svxdllapi.h>
30 namespace vcl
{ class Window
; }
31 namespace weld
{ class Button
; }
32 namespace weld
{ class ComboBox
; }
33 namespace weld
{ class CustomWeld
; }
34 namespace weld
{ class Entry
; }
35 namespace weld
{ class Label
; }
36 namespace weld
{ class Toolbar
; }
37 namespace weld
{ class Widget
; }
38 namespace weld
{ class Window
; }
43 /*************************************************************************
45 |* Derivation from SfxChildWindow as "container" for float
47 \************************************************************************/
50 typedef ::std::vector
< OUString
> TargetList
;
52 class SVX_DLLPUBLIC SvxIMapDlgChildWindow final
: public SfxChildWindow
56 SvxIMapDlgChildWindow( vcl::Window
*, sal_uInt16
, SfxBindings
*, SfxChildWinInfo
const * );
58 SFX_DECL_CHILDWINDOW_WITHID( SvxIMapDlgChildWindow
);
60 static void UpdateIMapDlg( const Graphic
& rGraphic
, const ImageMap
* pImageMap
,
61 const TargetList
* pTargetList
, void* pEditingObj
);
67 class SvxIMapDlgItem final
: public SfxControllerItem
71 virtual void StateChanged( sal_uInt16 nSID
, SfxItemState eState
,
72 const SfxPoolItem
* pState
) override
;
77 SvxIMapDlgItem( SvxIMapDlg
& rIMapDlg
, SfxBindings
& rBindings
);
84 class SVX_DLLPUBLIC SvxIMapDlg
: public SfxModelessDialogController
86 friend class IMapOwnData
;
87 friend class IMapWindow
;
89 std::unique_ptr
<IMapOwnData
> pOwnData
;
91 SvxIMapDlgItem aIMapItem
;
93 std::unique_ptr
<IMapWindow
> m_xIMapWnd
;
94 std::unique_ptr
<weld::Toolbar
> m_xTbxIMapDlg1
;
95 std::unique_ptr
<weld::Label
> m_xFtURL
;
96 std::unique_ptr
<URLBox
> m_xURLBox
;
97 std::unique_ptr
<weld::Label
> m_xFtText
;
98 std::unique_ptr
<weld::Entry
> m_xEdtText
;
99 std::unique_ptr
<weld::Label
> m_xFtTarget
;
100 std::unique_ptr
<weld::ComboBox
> m_xCbbTarget
;
101 std::unique_ptr
<weld::Button
> m_xCancelBtn
;
102 std::unique_ptr
<weld::Label
> m_xStbStatus1
;
103 std::unique_ptr
<weld::Label
> m_xStbStatus2
;
104 std::unique_ptr
<weld::Label
> m_xStbStatus3
;
105 std::unique_ptr
<weld::CustomWeld
> m_xIMapWndWeld
;
107 DECL_LINK( TbxClickHdl
, const OString
&, void );
108 DECL_LINK( InfoHdl
, IMapWindow
&, void );
109 DECL_LINK( MousePosHdl
, GraphCtrl
*, void );
110 DECL_LINK( GraphSizeHdl
, GraphCtrl
*, void );
111 DECL_LINK( URLModifyHdl
, weld::ComboBox
&, void );
112 DECL_LINK( EntryModifyHdl
, weld::Entry
&, void );
113 DECL_LINK( URLModifyComboBoxHdl
, weld::ComboBox
&, void );
114 DECL_LINK( URLLoseFocusHdl
, weld::Widget
&, void );
115 DECL_LINK( UpdateHdl
, Timer
*, void );
116 DECL_LINK( StateHdl
, GraphCtrl
*, void );
117 DECL_LINK( CancelHdl
, weld::Button
&, void );
122 void SetActiveTool(const OString
& rId
);
126 SvxIMapDlg(SfxBindings
*pBindings
, SfxChildWindow
*pCW
,
127 weld::Window
* pParent
);
128 virtual ~SvxIMapDlg() override
;
130 void SetExecState( bool bEnable
);
132 const void* GetEditingObject() const { return pCheckObj
; }
134 const ImageMap
& GetImageMap() const;
136 void SetTargetList( const TargetList
& rTargetList
);
138 void UpdateLink( const Graphic
& rGraphic
, const ImageMap
* pImageMap
,
139 const TargetList
* pTargetList
, void* pEditingObj
);
142 SVX_DLLPUBLIC SvxIMapDlg
* GetIMapDlg();
144 #endif // INCLUDED_SVX_IMAPDLG_HXX
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */