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 #ifndef INCLUDED_CUI_SOURCE_INC_CUIHYPERDLG_HXX
21 #define INCLUDED_CUI_SOURCE_INC_CUIHYPERDLG_HXX
22 
23 #include <sal/config.h>
24 
25 #include <memory>
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 
40 class SvxHpLinkDlg;
42 {
43 private:
45 
47 
48 public:
49  SvxHlinkCtrl( sal_uInt16 nId, SfxBindings & rBindings, SvxHpLinkDlg* pDlg);
50  virtual void dispose() override;
51 
52  virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
53  const SfxPoolItem* pState ) override;
54 };
55 
56 
57 /*************************************************************************
58 |*
59 |* Hyperlink-Dialog
60 |*
61 \************************************************************************/
62 
64 {
65 private:
66  friend class IconChoicePage;
67 
68  std::vector< std::unique_ptr<IconChoicePageData> > maPageList;
69 
70  OString msCurrentPageId;
71 
72  const SfxItemSet* pSet;
73  std::unique_ptr<SfxItemSet> pOutSet;
75  std::unique_ptr<sal_uInt16[]> pRanges;
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 ( const OString& rId );
93  void Start_Impl();
94 
95  void SwitchPage( const OString& rId );
96 
97  DECL_LINK( ResetHdl, weld::Button&, void) ;
98  DECL_LINK (ClickOkHdl_Impl, weld::Button&, void );
99  DECL_LINK (ClickApplyHdl_Impl, weld::Button&, void );
100 
101  IconChoicePage* GetTabPage( const OString& rPageId )
102  { return GetPageData(rPageId)->xPage.get(); }
103 
104  void ActivatePageImpl ();
105  void DeActivatePageImpl ();
106  void ResetPageImpl ();
107 
108  virtual void Close() override;
109  void Apply();
110 
111 public:
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  OString GetCurPageId() const { return msCurrentPageId; }
120  void ShowPage( const OString& rId );
121 
123  const sal_uInt16* GetInputRanges( const SfxItemPool& );
124  void SetInputSet( const SfxItemSet* pInSet );
125 
127 
128  void Start();
129  bool QueryClose();
130 
131  void PageCreated(const OString& rId, 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 #endif // INCLUDED_CUI_SOURCE_INC_CUIHYPERDLG_HXX
142 
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxHlinkCtrl maCtrl
Controller.
Definition: cuihyperdlg.hxx:77
void SetPage(SvxHyperlinkItem const *pItem)
std::unique_ptr< weld::Button > m_xHelpBtn
Definition: cuihyperdlg.hxx:87
void Start_Impl()
Definition: iconcdlg.cxx:280
void SetCurPageId(const OString &rId)
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: cuihyperdlg.cxx:61
virtual void dispose() override
Definition: cuihyperdlg.cxx:54
OString GetCurPageId() const
virtual void Close() override
std::unique_ptr< IconChoicePage >(* CreatePage)(weld::Container *pParent, SvxHpLinkDlg *pDlg, const SfxItemSet *pAttrSet)
Definition: iconcdlg.hxx:33
void Start()
Definition: iconcdlg.cxx:261
SfxItemSet * pExampleSet
Definition: cuihyperdlg.hxx:74
void ActivatePageImpl()
Definition: iconcdlg.cxx:134
IconChoicePage * GetTabPage(const OString &rPageId)
SfxStatusForwarder aRdOnlyForwarder
Definition: cuihyperdlg.hxx:46
bool QueryClose()
Definition: iconcdlg.cxx:266
DECL_LINK(ChosePageHdl_Impl, const OString &, void)
OString msCurrentPageId
Definition: cuihyperdlg.hxx:70
void PageCreated(const OString &rId, IconChoicePage &rPage)
std::unique_ptr< weld::Button > m_xOKBtn
Definition: cuihyperdlg.hxx:84
SvxHpLinkDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent)
Definition: cuihyperdlg.cxx:85
SvxHlinkCtrl(sal_uInt16 nId, SfxBindings &rBindings, SvxHpLinkDlg *pDlg)
Definition: cuihyperdlg.cxx:47
virtual ~SvxHpLinkDlg() override
std::unique_ptr< weld::Notebook > m_xIconCtrl
Definition: cuihyperdlg.hxx:83
std::vector< std::unique_ptr< IconChoicePageData > > maPageList
Definition: cuihyperdlg.hxx:68
const SfxItemSet * pSet
Definition: cuihyperdlg.hxx:72
std::unique_ptr< weld::Button > m_xCancelBtn
Definition: cuihyperdlg.hxx:86
std::unique_ptr< SfxItemSet > pOutSet
Definition: cuihyperdlg.hxx:73
weld::Button & GetOKButton()
IconChoicePageData * GetPageData(const OString &rId)
Definition: iconcdlg.cxx:292
std::unique_ptr< IconChoicePage > xPage
the TabPage itself
Definition: iconcdlg.hxx:39
void DeActivatePageImpl()
Definition: iconcdlg.cxx:155
SfxDispatcher * GetDispatcher() const
std::unique_ptr< sal_uInt16[]> pRanges
Definition: cuihyperdlg.hxx:75
SfxItemState
SfxBindings & GetBindings() const
std::unique_ptr< SfxItemSet > mpItemSet
Definition: cuihyperdlg.hxx:78
void ShowPage(const OString &rId)
Definition: iconcdlg.cxx:85
bool IsHTMLDoc() const
SfxDispatcher * GetDispatcher() const
void ResetPageImpl()
Definition: iconcdlg.cxx:215
const sal_uInt16 * GetInputRanges(const SfxItemPool &)
gives via map converted local slots if applicable
Definition: iconcdlg.cxx:230
SvxHpLinkDlg * pParent
Definition: cuihyperdlg.hxx:44
std::unique_ptr< weld::Button > m_xApplyBtn
Definition: cuihyperdlg.hxx:85
void SetInputSet(const SfxItemSet *pInSet)
Definition: iconcdlg.cxx:248
void AddTabPage(const OString &rId, CreatePage pCreateFunc)
Definition: iconcdlg.cxx:72
void SetReadOnlyMode(bool bReadOnly)
void SwitchPage(const OString &rId)
Definition: iconcdlg.cxx:312
Data-structure for pages in dialog.
Definition: iconcdlg.hxx:36
std::unique_ptr< weld::Button > m_xResetBtn
Definition: cuihyperdlg.hxx:88