LibreOffice Module cui (master)  1
macropg.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 #ifndef INCLUDED_CUI_SOURCE_INC_MACROPG_HXX
20 #define INCLUDED_CUI_SOURCE_INC_MACROPG_HXX
21 
22 #include <sfx2/basedlgs.hxx>
23 #include <sfx2/tabdlg.hxx>
24 
25 #include <com/sun/star/container/XNameReplace.hpp>
26 #include <com/sun/star/util/XModifiable.hpp>
27 #include <com/sun/star/uno/Reference.hxx>
28 #include <rtl/ustring.hxx>
29 
30 #include <unordered_map>
31 #include <vector>
32 
33 typedef std::unordered_map< OUString, std::pair< OUString, OUString > > EventsHash;
34 
36 {
38  const char* pEventResourceID;
39  EventDisplayName(const sal_Char* pAsciiName, const char* pResId)
40  : pAsciiEventName(pAsciiName)
41  , pEventResourceID(pResId)
42  {
43  }
44 };
45 typedef std::vector< EventDisplayName > EventDisplayNames;
46 
47 class SvxMacroTabPage_;
48 class SvTabListBox;
49 
51 
52 
54 {
55  DECL_LINK( SelectEvent_Impl, weld::TreeView&, void );
56  DECL_LINK( AssignDeleteHdl_Impl, weld::Button&, void );
57  DECL_LINK( DoubleClickHdl_Impl, weld::TreeView&, bool );
58 
59  static void GenericHandler_Impl( SvxMacroTabPage_* pThis, const weld::Button* pBtn );
60 
61  css::uno::Reference< css::container::XNameReplace > m_xAppEvents;
62 protected:
63  std::unique_ptr<SvxMacroTabPage_Impl> mpImpl;
64  css::uno::Reference< css::container::XNameReplace > m_xDocEvents;
65  css::uno::Reference< css::util::XModifiable > m_xModifiable;
70 
71  SvxMacroTabPage_(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet& rItemSet);
72 
73  void EnableButtons();
74  static css::uno::Any GetPropsByName( const OUString& eventName, EventsHash& eventsHash );
75  static std::pair< OUString, OUString > GetPairFromAny( const css::uno::Any& aAny );
76 
77 public:
78 
79  virtual ~SvxMacroTabPage_() override;
80  void InitResources();
81 
82  void InitAndSetHandler( const css::uno::Reference< css::container::XNameReplace >& xAppEvents, const css::uno::Reference< css::container::XNameReplace >& xDocEvents, const css::uno::Reference< css::util::XModifiable >& xModifiable );
83  virtual bool FillItemSet( SfxItemSet* rSet ) override;
84 
85  virtual void Reset( const SfxItemSet* ) override;
86 
87  void DisplayAppEvents( bool appEvents);
88  void SetReadOnly( bool bSet );
89  bool IsReadOnly() const override;
90 };
91 
93 {
94 public:
96  weld::Container* pPage, weld::DialogController* pController,
97  const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame,
98  const SfxItemSet& rSet,
99  css::uno::Reference< css::container::XNameReplace > const & xNameReplace,
100  sal_uInt16 nSelectedIndex
101  );
102 };
103 
104 // class SvxMacroAssignDlg --------------------------------------------------
105 
106 typedef const sal_uInt16* (*GetTabPageRanges)(); // gives international Which-values
107 
109 {
110 public:
111  SvxMacroAssignSingleTabDialog(weld::Window* pParent, const SfxItemSet& rOptionsSet);
112 
113 private:
114  DECL_LINK(OKHdl_Impl, weld::Button&, void);
115 };
116 
118 {
119 public:
121  weld::Window* pParent,
122  const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame,
123  const SfxItemSet& rSet,
124  const css::uno::Reference< css::container::XNameReplace >& xNameReplace,
125  sal_uInt16 nSelectedIndex
126  );
127 };
128 
129 #endif
130 
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: macropg.cxx:174
SvxMacroAssignDlg(weld::Window *pParent, const css::uno::Reference< css::frame::XFrame > &_rxDocumentFrame, const SfxItemSet &rSet, const css::uno::Reference< css::container::XNameReplace > &xNameReplace, sal_uInt16 nSelectedIndex)
Definition: macropg.cxx:615
static void GenericHandler_Impl(SvxMacroTabPage_ *pThis, const weld::Button *pBtn)
Definition: macropg.cxx:395
void DisplayAppEvents(bool appEvents)
Definition: macropg.cxx:305
SvxMacroTabPage_(weld::Container *pPage, weld::DialogController *pController, const OUString &rUIXMLDescription, const OString &rID, const SfxItemSet &rItemSet)
Definition: macropg.cxx:75
DECL_LINK(OKHdl_Impl, weld::Button &, void)
SvxMacroAssignSingleTabDialog(weld::Window *pParent, const SfxItemSet &rOptionsSet)
Definition: macropg.cxx:661
EventDisplayName(const sal_Char *pAsciiName, const char *pResId)
Definition: macropg.hxx:39
const sal_Char * pAsciiEventName
Definition: macropg.hxx:37
css::uno::Reference< css::util::XModifiable > m_xModifiable
Definition: macropg.hxx:65
EventDisplayNames aDisplayNames
Definition: macropg.hxx:69
EventsHash m_docEventsHash
Definition: macropg.hxx:67
SvxMacroTabPage(weld::Container *pPage, weld::DialogController *pController, const css::uno::Reference< css::frame::XFrame > &_rxDocumentFrame, const SfxItemSet &rSet, css::uno::Reference< css::container::XNameReplace > const &xNameReplace, sal_uInt16 nSelectedIndex)
Definition: macropg.cxx:586
char sal_Char
std::unique_ptr< SvxMacroTabPage_Impl > mpImpl
Definition: macropg.hxx:63
std::vector< EventDisplayName > EventDisplayNames
Definition: macropg.hxx:45
std::unordered_map< OUString, std::pair< OUString, OUString > > EventsHash
Definition: macropg.hxx:33
void InitAndSetHandler(const css::uno::Reference< css::container::XNameReplace > &xAppEvents, const css::uno::Reference< css::container::XNameReplace > &xDocEvents, const css::uno::Reference< css::util::XModifiable > &xModifiable)
Definition: macropg.cxx:499
static css::uno::Any GetPropsByName(const OUString &eventName, EventsHash &eventsHash)
Definition: macropg.cxx:555
DECL_LINK(SelectEvent_Impl, weld::TreeView &, void)
css::uno::Reference< css::container::XNameReplace > m_xAppEvents
Definition: macropg.hxx:61
bool IsReadOnly() const override
Definition: macropg.cxx:268
static std::pair< OUString, OUString > GetPairFromAny(const css::uno::Any &aAny)
Definition: macropg.cxx:573
void EnableButtons()
Definition: macropg.cxx:63
void SetReadOnly(bool bSet)
Definition: macropg.cxx:263
virtual ~SvxMacroTabPage_() override
Definition: macropg.cxx:85
void InitResources()
Definition: macropg.cxx:90
css::uno::Reference< css::container::XNameReplace > m_xDocEvents
Definition: macropg.hxx:64
virtual void Reset(const SfxItemSet *) override
Definition: macropg.cxx:225
EventsHash m_appEventsHash
Definition: macropg.hxx:66
const char * pEventResourceID
Definition: macropg.hxx:38