Line data Source code
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 :
20 : #ifndef _XMLOFF_FORMS_EVENTIMPORT_HXX_
21 : #define _XMLOFF_FORMS_EVENTIMPORT_HXX_
22 :
23 : #include <xmloff/XMLEventsImportContext.hxx>
24 : #include "callbacks.hxx"
25 : #include "ifacecompare.hxx"
26 : #include <com/sun/star/container/XIndexAccess.hpp>
27 :
28 : class SvXMLImport;
29 : //.........................................................................
30 : namespace xmloff
31 : {
32 : //.........................................................................
33 :
34 : //=====================================================================
35 : //= OFormEventsImportContext
36 : //=====================================================================
37 0 : class OFormEventsImportContext : public XMLEventsImportContext
38 : {
39 : protected:
40 : IEventAttacher& m_rEventAttacher;
41 :
42 : public:
43 : OFormEventsImportContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName,
44 : IEventAttacher& _rEventAttacher);
45 :
46 : protected:
47 : virtual void EndElement();
48 : };
49 :
50 : //=====================================================================
51 : //= ODefaultEventAttacherManager
52 : //=====================================================================
53 82 : class ODefaultEventAttacherManager : public IEventAttacherManager
54 : {
55 : protected:
56 : DECLARE_STL_MAP(
57 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, // map from
58 : ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >, // map to
59 : OPropertySetCompare, // compare method
60 : MapPropertySet2ScriptSequence); // class name
61 : // usually an event attacher manager will need to collect all script events registered, 'cause
62 : // the _real_ XEventAttacherManager handles it's events by index, but out indicies are not fixed
63 : // until _all_ controls have been inserted.
64 :
65 : MapPropertySet2ScriptSequence m_aEvents;
66 :
67 : public:
68 : // IEventAttacherManager
69 : virtual void registerEvents(
70 : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxElement,
71 : const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
72 : );
73 :
74 : protected:
75 : void setEvents(
76 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxContainer
77 : );
78 :
79 : virtual ~ODefaultEventAttacherManager();
80 : };
81 :
82 : //.........................................................................
83 : } // namespace xmloff
84 : //.........................................................................
85 :
86 : #endif // _XMLOFF_FORMS_EVENTIMPORT_HXX_
87 :
88 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|