1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SFX2_EVNTCONF_HXX
20 #define INCLUDED_SFX2_EVNTCONF_HXX
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>
34 struct SFX2_DLLPUBLIC SfxEventName
40 SfxEventName( SvMacroItemId nId
,
44 , maEventName(std::move( aEventName
))
45 , maUIName(std::move( aUIName
)) {}
48 class SFX2_DLLPUBLIC SfxEventNamesList
51 ::std::vector
< SfxEventName
> aEventNamesList
;
54 SfxEventNamesList() {}
55 SfxEventNamesList( const SfxEventNamesList
&rCpy
) { *this = rCpy
; }
57 SfxEventNamesList
& operator=( const SfxEventNamesList
&rCpy
);
59 size_t size() const { return aEventNamesList
.size(); };
61 SfxEventName
& at( size_t Index
) { return aEventNamesList
[ Index
]; }
62 SfxEventName
const & at( size_t Index
) const { return aEventNamesList
[ Index
]; }
64 void push_back( SfxEventName Item
) { aEventNamesList
.push_back( std::move(Item
) ); }
67 class SFX2_DLLPUBLIC SfxEventNamesItem final
: public SfxPoolItem
69 SfxEventNamesList aEventsList
;
73 SfxEventNamesItem ( const sal_uInt16 nId
) : SfxPoolItem( nId
) {}
75 virtual bool operator==( const SfxPoolItem
& ) const override
;
76 virtual bool GetPresentation( SfxItemPresentation ePres
,
80 const IntlWrapper
& ) const override
;
81 virtual SfxEventNamesItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
83 const SfxEventNamesList
& GetEvents() const { return aEventsList
;}
84 void AddEvent( const OUString
&, const OUString
&, SvMacroItemId
);
88 inline constexpr OUStringLiteral PROP_EVENT_TYPE
= u
"EventType";
89 inline constexpr OUStringLiteral PROP_LIBRARY
= u
"Library";
90 inline constexpr OUStringLiteral PROP_SCRIPT
= u
"Script";
91 inline constexpr OUStringLiteral PROP_MACRO_NAME
= u
"MacroName";
92 #define STAR_BASIC "StarBasic"
94 class SFX2_DLLPUBLIC SfxEventConfiguration
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
);
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */