merge the formfield patch from ooo-build
[ooovba.git] / xmloff / source / forms / eventimport.hxx
blob2e58fa73e5448624334aff863e02a0043b4a57b8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: eventimport.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _XMLOFF_FORMS_EVENTIMPORT_HXX_
32 #define _XMLOFF_FORMS_EVENTIMPORT_HXX_
34 #include <xmloff/XMLEventsImportContext.hxx>
35 #include "callbacks.hxx"
36 #include "ifacecompare.hxx"
37 #include <com/sun/star/container/XIndexAccess.hpp>
39 class SvXMLImport;
40 //.........................................................................
41 namespace xmloff
43 //.........................................................................
45 //=====================================================================
46 //= OFormEventsImportContext
47 //=====================================================================
48 class OFormEventsImportContext : public XMLEventsImportContext
50 protected:
51 IEventAttacher& m_rEventAttacher;
53 public:
54 OFormEventsImportContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
55 IEventAttacher& _rEventAttacher);
57 protected:
58 virtual void EndElement();
61 //=====================================================================
62 //= ODefaultEventAttacherManager
63 //=====================================================================
64 class ODefaultEventAttacherManager : public IEventAttacherManager
66 protected:
67 DECLARE_STL_MAP(
68 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, // map from
69 ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >, // map to
70 OPropertySetCompare, // compare method
71 MapPropertySet2ScriptSequence); // class name
72 // usually an event attacher manager will need to collect all script events registered, 'cause
73 // the _real_ XEventAttacherManager handles it's events by index, but out indicies are not fixed
74 // until _all_ controls have been inserted.
76 MapPropertySet2ScriptSequence m_aEvents;
78 public:
79 // IEventAttacherManager
80 virtual void registerEvents(
81 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxElement,
82 const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
85 protected:
86 void setEvents(
87 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxContainer
90 virtual ~ODefaultEventAttacherManager();
93 //.........................................................................
94 } // namespace xmloff
95 //.........................................................................
97 #endif // _XMLOFF_FORMS_EVENTIMPORT_HXX_