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
)
74 : SfxPoolItem( nId
, SfxItemType::SfxEventNamesItemType
) {}
76 virtual bool operator==( const SfxPoolItem
& ) const override
;
77 virtual bool GetPresentation( SfxItemPresentation ePres
,
81 const IntlWrapper
& ) const override
;
82 virtual SfxEventNamesItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
84 const SfxEventNamesList
& GetEvents() const { return aEventsList
;}
85 void AddEvent( const OUString
&, const OUString
&, SvMacroItemId
);
89 inline constexpr OUString PROP_EVENT_TYPE
= u
"EventType"_ustr
;
90 inline constexpr OUString PROP_LIBRARY
= u
"Library"_ustr
;
91 inline constexpr OUString PROP_SCRIPT
= u
"Script"_ustr
;
92 inline constexpr OUString PROP_MACRO_NAME
= u
"MacroName"_ustr
;
93 #define STAR_BASIC "StarBasic"
95 class SFX2_DLLPUBLIC SfxEventConfiguration
98 static void ConfigureEvent( const OUString
& aName
, const SvxMacro
&, SfxObjectShell
const * pObjSh
);
99 static std::unique_ptr
<SvxMacro
> ConvertToMacro( const css::uno::Any
& rElement
, SfxObjectShell
* pDoc
);
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */