LibreOffice Module cui (master) 1
cuihyperdlg.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <sal/config.h>
23
24#include <memory>
25#include <string_view>
26
27#include <svx/hlnkitem.hxx>
28#include <sfx2/childwin.hxx>
29#include <sfx2/ctrlitem.hxx>
30#include <sfx2/bindings.hxx>
31
32#include "iconcdlg.hxx"
33
34/*************************************************************************
35|*
36|* Hyperlink-Dialog
37|*
38\************************************************************************/
39
40class SvxHpLinkDlg;
42{
43private:
45
47
48public:
49 SvxHlinkCtrl( sal_uInt16 nId, SfxBindings & rBindings, SvxHpLinkDlg* pDlg);
50 virtual void dispose() override;
51
52 virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState eState,
53 const SfxPoolItem* pState ) override;
54};
55
56
57/*************************************************************************
58|*
59|* Hyperlink-Dialog
60|*
61\************************************************************************/
62
64{
65private:
66 friend class IconChoicePage;
67
68 std::vector< std::unique_ptr<IconChoicePageData> > maPageList;
69
71 // tdf#90496 - remember last used view in hyperlink dialog
72 static OUString msRememberedPageId;
73
75 std::unique_ptr<SfxItemSet> pOutSet;
76 std::unique_ptr<SfxItemSet> pExampleSet;
78
80 std::unique_ptr<SfxItemSet> mpItemSet;
81
82 bool mbGrabFocus : 1;
83 bool mbIsHTMLDoc : 1;
84
85 std::unique_ptr<weld::Notebook> m_xIconCtrl;
86 std::unique_ptr<weld::Button> m_xOKBtn;
87 std::unique_ptr<weld::Button> m_xApplyBtn;
88 std::unique_ptr<weld::Button> m_xCancelBtn;
89 std::unique_ptr<weld::Button> m_xHelpBtn;
90 std::unique_ptr<weld::Button> m_xResetBtn;
91
92 DECL_LINK( ChosePageHdl_Impl, const OUString&, void );
93
94 IconChoicePageData* GetPageData ( std::u16string_view rId );
95
96 void SwitchPage( const OUString& rId );
97
98 DECL_LINK( ResetHdl, weld::Button&, void) ;
99 DECL_LINK (ClickOkHdl_Impl, weld::Button&, void );
100 DECL_LINK (ClickApplyHdl_Impl, weld::Button&, void );
101
102 IconChoicePage* GetTabPage( std::u16string_view rPageId )
103 { return GetPageData(rPageId)->xPage.get(); }
104
105 void ActivatePageImpl ();
106 void DeActivatePageImpl ();
107 void ResetPageImpl ();
108
109 void Activate() override;
110 virtual void Close() override;
111 void Apply();
112
113public:
114 SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld::Window* pParent);
115 virtual ~SvxHpLinkDlg () override;
116
117 // interface
118 void AddTabPage(const OUString &rId, CreatePage pCreateFunc /* != NULL */);
119
120 void SetCurPageId( const OUString& rId ) { msCurrentPageId = rId; SwitchPage(rId ); }
121 const OUString& GetCurPageId() const { return msCurrentPageId; }
122 void ShowPage( const OUString& rId );
123
126 void SetInputSet( const SfxItemSet* pInSet );
127
128 void Start();
129 bool QueryClose();
130
131 void PageCreated(IconChoicePage& rPage);
132
133 void SetPage( SvxHyperlinkItem const * pItem );
134 void SetReadOnlyMode( bool bReadOnly );
135 bool IsHTMLDoc() const { return mbIsHTMLDoc; }
136
138};
139
140
141/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxDispatcher * GetDispatcher() const
SfxBindings & GetBindings() const
SfxStatusForwarder aRdOnlyForwarder
Definition: cuihyperdlg.hxx:46
SvxHlinkCtrl(sal_uInt16 nId, SfxBindings &rBindings, SvxHpLinkDlg *pDlg)
Definition: cuihyperdlg.cxx:47
virtual void dispose() override
Definition: cuihyperdlg.cxx:54
SvxHpLinkDlg * pParent
Definition: cuihyperdlg.hxx:44
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: cuihyperdlg.cxx:61
IconChoicePage * GetTabPage(std::u16string_view rPageId)
IconChoicePageData * GetPageData(std::u16string_view rId)
Definition: iconcdlg.cxx:286
OUString msCurrentPageId
Definition: cuihyperdlg.hxx:70
std::unique_ptr< weld::Button > m_xCancelBtn
Definition: cuihyperdlg.hxx:88
void Activate() override
void ResetPageImpl()
Definition: iconcdlg.cxx:217
void PageCreated(IconChoicePage &rPage)
WhichRangesContainer pRanges
Definition: cuihyperdlg.hxx:77
void ActivatePageImpl()
Definition: iconcdlg.cxx:135
DECL_LINK(ClickOkHdl_Impl, weld::Button &, void)
void SetPage(SvxHyperlinkItem const *pItem)
const OUString & GetCurPageId() const
DECL_LINK(ChosePageHdl_Impl, const OUString &, void)
std::unique_ptr< weld::Button > m_xApplyBtn
Definition: cuihyperdlg.hxx:87
void SetReadOnlyMode(bool bReadOnly)
std::unique_ptr< weld::Button > m_xHelpBtn
Definition: cuihyperdlg.hxx:89
SfxDispatcher * GetDispatcher() const
void Start()
Definition: iconcdlg.cxx:274
void SwitchPage(const OUString &rId)
Definition: iconcdlg.cxx:306
SvxHpLinkDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent)
Definition: cuihyperdlg.cxx:88
std::unique_ptr< weld::Button > m_xOKBtn
Definition: cuihyperdlg.hxx:86
std::vector< std::unique_ptr< IconChoicePageData > > maPageList
Definition: cuihyperdlg.hxx:68
virtual ~SvxHpLinkDlg() override
std::unique_ptr< SfxItemSet > pOutSet
Definition: cuihyperdlg.hxx:75
virtual void Close() override
DECL_LINK(ResetHdl, weld::Button &, void)
bool IsHTMLDoc() const
std::unique_ptr< SfxItemSet > pExampleSet
Definition: cuihyperdlg.hxx:76
void AddTabPage(const OUString &rId, CreatePage pCreateFunc)
Definition: iconcdlg.cxx:73
SvxHlinkCtrl maCtrl
Controller.
Definition: cuihyperdlg.hxx:79
static OUString msRememberedPageId
Definition: cuihyperdlg.hxx:72
std::unique_ptr< weld::Button > m_xResetBtn
Definition: cuihyperdlg.hxx:90
std::unique_ptr< weld::Notebook > m_xIconCtrl
Definition: cuihyperdlg.hxx:85
void SetInputSet(const SfxItemSet *pInSet)
Definition: iconcdlg.cxx:247
void SetCurPageId(const OUString &rId)
DECL_LINK(ClickApplyHdl_Impl, weld::Button &, void)
void ShowPage(const OUString &rId)
Definition: iconcdlg.cxx:86
WhichRangesContainer GetInputRanges(const SfxItemPool &)
gives via map converted local slots if applicable
Definition: iconcdlg.cxx:232
bool QueryClose()
Definition: iconcdlg.cxx:260
void DeActivatePageImpl()
Definition: iconcdlg.cxx:157
const SfxItemSet * pSet
Definition: cuihyperdlg.hxx:74
std::unique_ptr< SfxItemSet > mpItemSet
Definition: cuihyperdlg.hxx:80
std::unique_ptr< IconChoicePage >(* CreatePage)(weld::Container *pParent, SvxHpLinkDlg *pDlg, const SfxItemSet *pAttrSet)
Definition: iconcdlg.hxx:33
SfxItemState
Data-structure for pages in dialog.
Definition: iconcdlg.hxx:69
std::unique_ptr< IconChoicePage > xPage
the TabPage itself
Definition: iconcdlg.hxx:71