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 <tools/rtti.hxx>
26 #include <vcl/fixed.hxx>
27 #include <vcl/button.hxx>
28 #include <sfx2/event.hxx>
29 #include <sfx2/sfxsids.hrc>
30 #include <svl/macitem.hxx>
34 class SvxMacroTableDtor
;
36 struct SFX2_DLLPUBLIC SfxEventName
42 SfxEventName( sal_uInt16 nId
,
43 const OUString
& rEventName
,
44 const OUString
& rUIName
)
46 , maEventName( rEventName
)
47 , maUIName( rUIName
) {}
50 typedef ::std::vector
< SfxEventName
* > _SfxEventNamesList
;
52 class SFX2_DLLPUBLIC SfxEventNamesList
55 _SfxEventNamesList aEventNamesList
;
59 SfxEventNamesList() {}
60 SfxEventNamesList( const SfxEventNamesList
&rCpy
) { *this = rCpy
; }
61 ~SfxEventNamesList() { DelDtor(); }
62 SfxEventNamesList
& operator=( const SfxEventNamesList
&rCpy
);
64 size_t size() const { return aEventNamesList
.size(); };
66 SfxEventName
* at( size_t Index
) const
67 { return Index
< aEventNamesList
.size() ? aEventNamesList
[ Index
] : NULL
; }
69 void push_back( SfxEventName
* Item
) { aEventNamesList
.push_back( Item
); }
72 class SFX2_DLLPUBLIC SfxEventNamesItem
: public SfxPoolItem
74 SfxEventNamesList aEventsList
;
79 SfxEventNamesItem ( const sal_uInt16 nId
) : SfxPoolItem( nId
) {}
81 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
82 virtual bool GetPresentation( SfxItemPresentation ePres
,
83 SfxMapUnit eCoreMetric
,
84 SfxMapUnit ePresMetric
,
86 const IntlWrapper
* = 0 ) const SAL_OVERRIDE
;
87 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
88 virtual SfxPoolItem
* Create(SvStream
&, sal_uInt16
) const SAL_OVERRIDE
;
89 virtual SvStream
& Store(SvStream
&, sal_uInt16 nItemVersion
) const SAL_OVERRIDE
;
90 virtual sal_uInt16
GetVersion( sal_uInt16 nFileFormatVersion
) const SAL_OVERRIDE
;
92 const SfxEventNamesList
& GetEvents() const { return aEventsList
;}
93 void SetEvents( const SfxEventNamesList
& rList
) { aEventsList
= rList
; }
94 void AddEvent( const OUString
&, const OUString
&, sal_uInt16
);
99 #define PROP_EVENT_TYPE "EventType"
100 #define PROP_LIBRARY "Library"
101 #define PROP_SCRIPT "Script"
102 #define PROP_MACRO_NAME "MacroName"
103 #define STAR_BASIC "StarBasic"
105 class SFX2_DLLPUBLIC SfxEventConfiguration
108 static void ConfigureEvent( const OUString
& aName
, const SvxMacro
&, SfxObjectShell
* pObjSh
);
109 static SvxMacro
* ConvertToMacro( const com::sun::star::uno::Any
& rElement
, SfxObjectShell
* pDoc
, bool bBlowUp
);
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */