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_CUI_SOURCE_INC_CUIHYPERDLG_HXX
21 #define INCLUDED_CUI_SOURCE_INC_CUIHYPERDLG_HXX
23 #include <sal/config.h>
27 #include <svx/hlnkitem.hxx>
28 #include <sfx2/childwin.hxx>
29 #include <sfx2/ctrlitem.hxx>
30 #include <sfx2/bindings.hxx>
32 #include "iconcdlg.hxx"
34 /*************************************************************************
38 \************************************************************************/
41 class SvxHlinkCtrl
: public SfxControllerItem
44 SvxHpLinkDlg
* pParent
;
46 SfxStatusForwarder aRdOnlyForwarder
;
49 SvxHlinkCtrl( sal_uInt16 nId
, SfxBindings
& rBindings
, SvxHpLinkDlg
* pDlg
);
50 virtual void dispose() override
;
52 virtual void StateChanged( sal_uInt16 nSID
, SfxItemState eState
,
53 const SfxPoolItem
* pState
) override
;
57 /*************************************************************************
61 \************************************************************************/
63 class SvxHpLinkDlg
: public SfxModelessDialogController
66 friend class IconChoicePage
;
68 std::vector
< std::unique_ptr
<IconChoicePageData
> > maPageList
;
70 OString msCurrentPageId
;
72 const SfxItemSet
* pSet
;
73 std::unique_ptr
<SfxItemSet
> pOutSet
;
74 SfxItemSet
* pExampleSet
;
75 std::unique_ptr
<sal_uInt16
[]> pRanges
;
77 SvxHlinkCtrl maCtrl
; ///< Controller
78 std::unique_ptr
<SfxItemSet
> mpItemSet
;
83 std::unique_ptr
<weld::Notebook
> m_xIconCtrl
;
84 std::unique_ptr
<weld::Button
> m_xOKBtn
;
85 std::unique_ptr
<weld::Button
> m_xApplyBtn
;
86 std::unique_ptr
<weld::Button
> m_xCancelBtn
;
87 std::unique_ptr
<weld::Button
> m_xHelpBtn
;
88 std::unique_ptr
<weld::Button
> m_xResetBtn
;
90 DECL_LINK( ChosePageHdl_Impl
, const OString
&, void );
92 IconChoicePageData
* GetPageData ( const OString
& rId
);
95 void SwitchPage( const OString
& rId
);
97 DECL_LINK( ResetHdl
, weld::Button
&, void) ;
98 DECL_LINK (ClickOkHdl_Impl
, weld::Button
&, void );
99 DECL_LINK (ClickApplyHdl_Impl
, weld::Button
&, void );
101 IconChoicePage
* GetTabPage( const OString
& rPageId
)
102 { return GetPageData(rPageId
)->xPage
.get(); }
104 void ActivatePageImpl ();
105 void DeActivatePageImpl ();
106 void ResetPageImpl ();
108 virtual void Close() override
;
112 SvxHpLinkDlg(SfxBindings
* pBindings
, SfxChildWindow
* pChild
, weld::Window
* pParent
);
113 virtual ~SvxHpLinkDlg () override
;
116 void AddTabPage(const OString
&rId
, CreatePage pCreateFunc
/* != NULL */);
118 void SetCurPageId( const OString
& rId
) { msCurrentPageId
= rId
; SwitchPage(rId
); }
119 OString
GetCurPageId() const { return msCurrentPageId
; }
120 void ShowPage( const OString
& rId
);
122 /// gives via map converted local slots if applicable
123 const sal_uInt16
* GetInputRanges( const SfxItemPool
& );
124 void SetInputSet( const SfxItemSet
* pInSet
);
126 weld::Button
& GetOKButton() { return *m_xOKBtn
; }
131 void PageCreated(const OString
& rId
, IconChoicePage
& rPage
);
133 void SetPage( SvxHyperlinkItem
const * pItem
);
134 void SetReadOnlyMode( bool bReadOnly
);
135 bool IsHTMLDoc() const { return mbIsHTMLDoc
; }
137 SfxDispatcher
* GetDispatcher() const { return GetBindings().GetDispatcher(); }
141 #endif // INCLUDED_CUI_SOURCE_INC_CUIHYPERDLG_HXX
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */