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
73 std::unique_ptr<SfxItemSet> pOutSet;
74 std::unique_ptr<SfxItemSet> pExampleSet;
76
78 std::unique_ptr<SfxItemSet> mpItemSet;
79
80 bool mbGrabFocus : 1;
81 bool mbIsHTMLDoc : 1;
82
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;
89
90 DECL_LINK( ChosePageHdl_Impl, const OString&, void );
91
92 IconChoicePageData* GetPageData ( std::string_view rId );
93
94 void SwitchPage( const OString& rId );
95
96 DECL_LINK( ResetHdl, weld::Button&, void) ;
97 DECL_LINK (ClickOkHdl_Impl, weld::Button&, void );
98 DECL_LINK (ClickApplyHdl_Impl, weld::Button&, void );
99
100 IconChoicePage* GetTabPage( std::string_view rPageId )
101 { return GetPageData(rPageId)->xPage.get(); }
102
103 void ActivatePageImpl ();
104 void DeActivatePageImpl ();
105 void ResetPageImpl ();
106
107 void Activate() override;
108 virtual void Close() override;
109 void Apply();
110
111public:
112 SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld::Window* pParent);
113 virtual ~SvxHpLinkDlg () override;
114
115 // interface
116 void AddTabPage(const OString &rId, CreatePage pCreateFunc /* != NULL */);
117
118 void SetCurPageId( const OString& rId ) { msCurrentPageId = rId; SwitchPage(rId ); }
119 const OString & GetCurPageId() const { return msCurrentPageId; }
120 void ShowPage( const OString& rId );
121
124 void SetInputSet( const SfxItemSet* pInSet );
125
126 void Start();
127 bool QueryClose();
128
129 void PageCreated(IconChoicePage& rPage);
130
131 void SetPage( SvxHyperlinkItem const * pItem );
132 void SetReadOnlyMode( bool bReadOnly );
133 bool IsHTMLDoc() const { return mbIsHTMLDoc; }
134
136};
137
138
139/* 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
void AddTabPage(const OString &rId, CreatePage pCreateFunc)
Definition: iconcdlg.cxx:73
std::unique_ptr< weld::Button > m_xCancelBtn
Definition: cuihyperdlg.hxx:86
void Activate() override
void ResetPageImpl()
Definition: iconcdlg.cxx:214
void PageCreated(IconChoicePage &rPage)
WhichRangesContainer pRanges
Definition: cuihyperdlg.hxx:75
const OString & GetCurPageId() const
IconChoicePageData * GetPageData(std::string_view rId)
Definition: iconcdlg.cxx:283
void ActivatePageImpl()
Definition: iconcdlg.cxx:135
DECL_LINK(ClickOkHdl_Impl, weld::Button &, void)
OString msCurrentPageId
Definition: cuihyperdlg.hxx:70
void SetPage(SvxHyperlinkItem const *pItem)
std::unique_ptr< weld::Button > m_xApplyBtn
Definition: cuihyperdlg.hxx:85
void SetReadOnlyMode(bool bReadOnly)
DECL_LINK(ChosePageHdl_Impl, const OString &, void)
std::unique_ptr< weld::Button > m_xHelpBtn
Definition: cuihyperdlg.hxx:87
SfxDispatcher * GetDispatcher() const
void Start()
Definition: iconcdlg.cxx:271
void ShowPage(const OString &rId)
Definition: iconcdlg.cxx:86
SvxHpLinkDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent)
Definition: cuihyperdlg.cxx:85
IconChoicePage * GetTabPage(std::string_view rPageId)
std::unique_ptr< weld::Button > m_xOKBtn
Definition: cuihyperdlg.hxx:84
std::vector< std::unique_ptr< IconChoicePageData > > maPageList
Definition: cuihyperdlg.hxx:68
virtual ~SvxHpLinkDlg() override
std::unique_ptr< SfxItemSet > pOutSet
Definition: cuihyperdlg.hxx:73
virtual void Close() override
DECL_LINK(ResetHdl, weld::Button &, void)
bool IsHTMLDoc() const
std::unique_ptr< SfxItemSet > pExampleSet
Definition: cuihyperdlg.hxx:74
void SetCurPageId(const OString &rId)
SvxHlinkCtrl maCtrl
Controller.
Definition: cuihyperdlg.hxx:77
std::unique_ptr< weld::Button > m_xResetBtn
Definition: cuihyperdlg.hxx:88
std::unique_ptr< weld::Notebook > m_xIconCtrl
Definition: cuihyperdlg.hxx:83
void SetInputSet(const SfxItemSet *pInSet)
Definition: iconcdlg.cxx:244
DECL_LINK(ClickApplyHdl_Impl, weld::Button &, void)
WhichRangesContainer GetInputRanges(const SfxItemPool &)
gives via map converted local slots if applicable
Definition: iconcdlg.cxx:229
bool QueryClose()
Definition: iconcdlg.cxx:257
void DeActivatePageImpl()
Definition: iconcdlg.cxx:154
const SfxItemSet * pSet
Definition: cuihyperdlg.hxx:72
void SwitchPage(const OString &rId)
Definition: iconcdlg.cxx:303
std::unique_ptr< SfxItemSet > mpItemSet
Definition: cuihyperdlg.hxx:78
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