xref: /aoo42x/main/unoxml/source/events/event.hxx (revision 7f654276)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef EVENT_EVENT_HXX
25 #define EVENT_EVENT_HXX
26 
27 #include <sal/types.h>
28 
29 #include <com/sun/star/uno/Reference.h>
30 #include <com/sun/star/xml/dom/events/XEvent.hpp>
31 #include <com/sun/star/xml/dom/events/XEventTarget.hpp>
32 #include <com/sun/star/util/Time.hpp>
33 
34 #include <cppuhelper/implbase1.hxx>
35 
36 #include "../dom/node.hxx"
37 
38 
39 using namespace com::sun::star::uno;
40 using namespace com::sun::star::xml::dom;
41 using namespace com::sun::star::xml::dom::events;
42 
43 
44 namespace DOM {namespace events
45 {
46 class CEvent : public cppu::WeakImplHelper1< XEvent >
47 {
48 friend class CEventDispatcher;
49 
50 protected:
51     ::osl::Mutex m_Mutex;
52     sal_Bool m_canceled;
53     OUString m_eventType;
54     Reference< XEventTarget > m_target;
55     Reference< XEventTarget > m_currentTarget;
56     PhaseType m_phase;
57     sal_Bool m_bubbles;
58     sal_Bool m_cancelable;
59     com::sun::star::util::Time m_time;
60 
61 public:
62 
63     explicit CEvent();
64 
65     virtual ~CEvent();
66     virtual OUString SAL_CALL getType() throw (RuntimeException);
67     virtual Reference< XEventTarget > SAL_CALL getTarget() throw (RuntimeException);
68     virtual Reference< XEventTarget > SAL_CALL getCurrentTarget() throw (RuntimeException);
69     virtual PhaseType SAL_CALL getEventPhase() throw (RuntimeException);
70     virtual sal_Bool SAL_CALL getBubbles() throw (RuntimeException);
71     virtual sal_Bool SAL_CALL getCancelable() throw (RuntimeException);
72     virtual com::sun::star::util::Time SAL_CALL getTimeStamp() throw (RuntimeException);
73     virtual void SAL_CALL stopPropagation() throw (RuntimeException);
74     virtual void SAL_CALL preventDefault() throw (RuntimeException);
75     virtual void SAL_CALL initEvent(
76         const OUString& eventTypeArg,
77         sal_Bool canBubbleArg,
78         sal_Bool cancelableArg)  throw (RuntimeException);
79 };
80 }}
81 #endif
82