2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-04 11:25:41 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-10-28 03:46:16 +01:00
|
|
|
#ifndef INCLUDED_CUI_SOURCE_INC_MACROPG_HXX
|
|
|
|
#define INCLUDED_CUI_SOURCE_INC_MACROPG_HXX
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
#include <sfx2/basedlgs.hxx>
|
|
|
|
#include <sfx2/tabdlg.hxx>
|
|
|
|
|
|
|
|
#include <com/sun/star/container/XNameReplace.hpp>
|
|
|
|
#include <com/sun/star/util/XModifiable.hpp>
|
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
|
2015-01-01 19:58:59 +00:00
|
|
|
#include <unordered_map>
|
2009-10-31 00:36:06 +01:00
|
|
|
#include <vector>
|
|
|
|
|
2017-10-19 17:18:17 +02:00
|
|
|
typedef std::unordered_map< OUString, std::pair< OUString, OUString > > EventsHash;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
struct EventDisplayName
|
|
|
|
{
|
|
|
|
const sal_Char* pAsciiEventName;
|
2017-06-11 20:56:30 +01:00
|
|
|
const char* pEventResourceID;
|
|
|
|
EventDisplayName(const sal_Char* pAsciiName, const char* pResId)
|
|
|
|
: pAsciiEventName(pAsciiName)
|
|
|
|
, pEventResourceID(pResId)
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
2017-02-15 23:55:18 +02:00
|
|
|
typedef std::vector< EventDisplayName > EventDisplayNames;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2016-04-22 10:13:56 +02:00
|
|
|
class SvxMacroTabPage_;
|
2009-10-31 00:36:06 +01:00
|
|
|
class SvTabListBox;
|
|
|
|
|
2016-04-22 10:13:56 +02:00
|
|
|
class SvxMacroTabPage_Impl;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
|
2016-04-22 10:13:56 +02:00
|
|
|
class SvxMacroTabPage_ : public SfxTabPage
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
2019-03-03 17:24:03 +00:00
|
|
|
DECL_LINK( SelectEvent_Impl, weld::TreeView&, void );
|
|
|
|
DECL_LINK( AssignDeleteHdl_Impl, weld::Button&, void );
|
2019-10-05 18:36:38 +01:00
|
|
|
DECL_LINK( DoubleClickHdl_Impl, weld::TreeView&, bool );
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2019-09-04 16:07:56 +02:00
|
|
|
static void GenericHandler_Impl( SvxMacroTabPage_* pThis, const weld::Button* pBtn );
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2018-05-10 11:46:20 +02:00
|
|
|
css::uno::Reference< css::container::XNameReplace > m_xAppEvents;
|
2009-10-31 00:36:06 +01:00
|
|
|
protected:
|
2018-06-20 15:44:16 +02:00
|
|
|
std::unique_ptr<SvxMacroTabPage_Impl> mpImpl;
|
2015-07-28 14:18:40 +02:00
|
|
|
css::uno::Reference< css::container::XNameReplace > m_xDocEvents;
|
|
|
|
css::uno::Reference< css::util::XModifiable > m_xModifiable;
|
2009-10-31 00:36:06 +01:00
|
|
|
EventsHash m_appEventsHash;
|
|
|
|
EventsHash m_docEventsHash;
|
2016-06-24 13:12:25 +02:00
|
|
|
bool bDocModified, bAppEvents, bInitialized;
|
2009-10-31 00:36:06 +01:00
|
|
|
EventDisplayNames aDisplayNames;
|
|
|
|
|
2019-09-24 14:10:48 +01:00
|
|
|
SvxMacroTabPage_(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet& rItemSet);
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2010-11-01 15:24:47 +01:00
|
|
|
void EnableButtons();
|
2015-07-28 14:18:40 +02:00
|
|
|
static css::uno::Any GetPropsByName( const OUString& eventName, EventsHash& eventsHash );
|
2017-02-15 23:55:18 +02:00
|
|
|
static std::pair< OUString, OUString > GetPairFromAny( const css::uno::Any& aAny );
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SvxMacroTabPage_() override;
|
2009-10-31 00:36:06 +01:00
|
|
|
void InitResources();
|
|
|
|
|
2016-04-12 11:02:36 +02:00
|
|
|
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 );
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool FillItemSet( SfxItemSet* rSet ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Reset( const SfxItemSet* ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
void DisplayAppEvents( bool appEvents);
|
2014-04-16 11:39:08 +02:00
|
|
|
void SetReadOnly( bool bSet );
|
2015-10-12 16:04:04 +02:00
|
|
|
bool IsReadOnly() const override;
|
2009-10-31 00:36:06 +01:00
|
|
|
};
|
|
|
|
|
2016-04-22 10:13:56 +02:00
|
|
|
class SvxMacroTabPage : public SvxMacroTabPage_
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
SvxMacroTabPage(
|
2019-09-24 14:10:48 +01:00
|
|
|
weld::Container* pPage, weld::DialogController* pController,
|
2015-07-28 14:18:40 +02:00
|
|
|
const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame,
|
2009-10-31 00:36:06 +01:00
|
|
|
const SfxItemSet& rSet,
|
2016-07-07 15:56:37 +02:00
|
|
|
css::uno::Reference< css::container::XNameReplace > const & xNameReplace,
|
2009-10-31 00:36:06 +01:00
|
|
|
sal_uInt16 nSelectedIndex
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
// class SvxMacroAssignDlg --------------------------------------------------
|
|
|
|
|
2014-04-27 17:01:10 +02:00
|
|
|
typedef const sal_uInt16* (*GetTabPageRanges)(); // gives international Which-values
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2019-03-03 17:24:03 +00:00
|
|
|
class SvxMacroAssignSingleTabDialog : public SfxSingleTabDialogController
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
|
|
|
public:
|
2019-03-03 17:24:03 +00:00
|
|
|
SvxMacroAssignSingleTabDialog(weld::Window* pParent, const SfxItemSet& rOptionsSet);
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
private:
|
2019-03-03 17:24:03 +00:00
|
|
|
DECL_LINK(OKHdl_Impl, weld::Button&, void);
|
2009-10-31 00:36:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class SvxMacroAssignDlg : public SvxMacroAssignSingleTabDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SvxMacroAssignDlg(
|
2019-03-03 17:24:03 +00:00
|
|
|
weld::Window* pParent,
|
2015-07-28 14:18:40 +02:00
|
|
|
const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame,
|
2009-10-31 00:36:06 +01:00
|
|
|
const SfxItemSet& rSet,
|
2015-07-28 14:18:40 +02:00
|
|
|
const css::uno::Reference< css::container::XNameReplace >& xNameReplace,
|
2009-10-31 00:36:06 +01:00
|
|
|
sal_uInt16 nSelectedIndex
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 12:45:03 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|