Bump version to 6.4.7.2.M8
[LibreOffice.git] / cui / source / inc / cuihyperdlg.hxx
blobb7f88ef013f5e7c9b0dc411cb3ce91fc255556a7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
25 #include <memory>
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 /*************************************************************************
36 |* Hyperlink-Dialog
38 \************************************************************************/
40 class SvxHpLinkDlg;
41 class SvxHlinkCtrl : public SfxControllerItem
43 private:
44 SvxHpLinkDlg* pParent;
46 SfxStatusForwarder aRdOnlyForwarder;
48 public:
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 /*************************************************************************
59 |* Hyperlink-Dialog
61 \************************************************************************/
63 class SvxHpLinkDlg : public SfxModelessDialogController
65 private:
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;
80 bool mbGrabFocus : 1;
81 bool mbIsHTMLDoc : 1;
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 );
93 void Start_Impl();
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;
109 void Apply();
111 public:
112 SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld::Window* pParent);
113 virtual ~SvxHpLinkDlg () override;
115 // interface
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; }
128 void Start();
129 bool QueryClose();
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: */