LibreOffice Module sfx2 (master) 1
evntconf.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_SFX2_EVNTCONF_HXX
20#define INCLUDED_SFX2_EVNTCONF_HXX
21
22#include <sal/config.h>
23#include <sfx2/dllapi.h>
24#include <sal/types.h>
25#include <sfx2/event.hxx>
26#include <svl/poolitem.hxx>
27#include <memory>
28#include <utility>
29#include <vector>
30
31class SfxObjectShell;
32class SvxMacro;
33
35{
37 OUString maEventName;
38 OUString maUIName;
39
41 OUString aEventName,
42 OUString aUIName )
43 : mnId( nId )
44 , maEventName(std::move( aEventName ))
45 , maUIName(std::move( aUIName )) {}
46};
47
49{
50private:
51 ::std::vector< SfxEventName > aEventNamesList;
52
53public:
55 SfxEventNamesList( const SfxEventNamesList &rCpy ) { *this = rCpy; }
58
59 size_t size() const { return aEventNamesList.size(); };
60
61 SfxEventName& at( size_t Index ) { return aEventNamesList[ Index ]; }
62 SfxEventName const & at( size_t Index ) const { return aEventNamesList[ Index ]; }
63
64 void push_back( SfxEventName Item ) { aEventNamesList.push_back( std::move(Item) ); }
65};
66
68{
70
71public:
72
73 SfxEventNamesItem ( const sal_uInt16 nId ) : SfxPoolItem( nId ) {}
74
75 virtual bool operator==( const SfxPoolItem& ) const override;
76 virtual bool GetPresentation( SfxItemPresentation ePres,
77 MapUnit eCoreMetric,
78 MapUnit ePresMetric,
79 OUString &rText,
80 const IntlWrapper& ) const override;
81 virtual SfxEventNamesItem* Clone( SfxItemPool *pPool = nullptr ) const override;
82
83 const SfxEventNamesList& GetEvents() const { return aEventsList;}
84 void AddEvent( const OUString&, const OUString&, SvMacroItemId );
85};
86
87
88inline constexpr OUStringLiteral PROP_EVENT_TYPE = u"EventType";
89inline constexpr OUStringLiteral PROP_LIBRARY = u"Library";
90inline constexpr OUStringLiteral PROP_SCRIPT = u"Script";
91inline constexpr OUStringLiteral PROP_MACRO_NAME = u"MacroName";
92#define STAR_BASIC "StarBasic"
93
95{
96public:
97 static void ConfigureEvent( const OUString& aName, const SvxMacro&, SfxObjectShell const * pObjSh);
98 static std::unique_ptr<SvxMacro> ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc );
99};
100
101#endif
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
SfxEventNamesList aEventsList
Definition: evntconf.hxx:69
SfxEventNamesItem(const sal_uInt16 nId)
Definition: evntconf.hxx:73
const SfxEventNamesList & GetEvents() const
Definition: evntconf.hxx:83
size_t size() const
Definition: evntconf.hxx:59
SfxEventNamesList & operator=(const SfxEventNamesList &rCpy)
void push_back(SfxEventName Item)
Definition: evntconf.hxx:64
SfxEventName const & at(size_t Index) const
Definition: evntconf.hxx:62
SfxEventNamesList(const SfxEventNamesList &rCpy)
Definition: evntconf.hxx:55
::std::vector< SfxEventName > aEventNamesList
Definition: evntconf.hxx:51
SfxEventName & at(size_t Index)
Definition: evntconf.hxx:61
sal_uInt16 mnId
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
float u
SvMacroItemId
these values get stored in streams in a 16-bit value
Definition: event.hxx:41
constexpr OUStringLiteral PROP_MACRO_NAME
Definition: evntconf.hxx:91
constexpr OUStringLiteral PROP_SCRIPT
Definition: evntconf.hxx:90
constexpr OUStringLiteral PROP_EVENT_TYPE
Definition: evntconf.hxx:88
constexpr OUStringLiteral PROP_LIBRARY
Definition: evntconf.hxx:89
OUString aUIName
OUString aName
MapUnit
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
sal_Int16 nId
SfxItemPresentation
OUString maUIName
Definition: evntconf.hxx:38
SfxEventName(SvMacroItemId nId, OUString aEventName, OUString aUIName)
Definition: evntconf.hxx:40
SvMacroItemId mnId
Definition: evntconf.hxx:36
OUString maEventName
Definition: evntconf.hxx:37
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)