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 : #include <event.hxx>
21 :
22 : namespace DOM { namespace events
23 : {
24 :
25 35146 : CEvent::CEvent()
26 : : m_canceled(sal_False)
27 : , m_phase(PhaseType_CAPTURING_PHASE)
28 : , m_bubbles(sal_False)
29 35146 : , m_cancelable(sal_True)
30 : {
31 35146 : }
32 :
33 35146 : CEvent::~CEvent()
34 : {
35 35146 : }
36 :
37 17573 : OUString SAL_CALL CEvent::getType() throw (RuntimeException)
38 : {
39 17573 : ::osl::MutexGuard const g(m_Mutex);
40 17573 : return m_eventType;
41 : }
42 :
43 : Reference< XEventTarget > SAL_CALL
44 0 : CEvent::getTarget() throw (RuntimeException)
45 : {
46 0 : ::osl::MutexGuard const g(m_Mutex);
47 0 : return m_target;
48 : }
49 :
50 : Reference< XEventTarget > SAL_CALL
51 17573 : CEvent::getCurrentTarget() throw (RuntimeException)
52 : {
53 17573 : ::osl::MutexGuard const g(m_Mutex);
54 17573 : return m_currentTarget;
55 : }
56 :
57 0 : PhaseType SAL_CALL CEvent::getEventPhase() throw (RuntimeException)
58 : {
59 0 : ::osl::MutexGuard const g(m_Mutex);
60 0 : return m_phase;
61 : }
62 :
63 35146 : sal_Bool SAL_CALL CEvent::getBubbles() throw (RuntimeException)
64 : {
65 35146 : ::osl::MutexGuard const g(m_Mutex);
66 35146 : return m_bubbles;
67 : }
68 :
69 17573 : sal_Bool SAL_CALL CEvent::getCancelable() throw (RuntimeException)
70 : {
71 17573 : ::osl::MutexGuard const g(m_Mutex);
72 17573 : return m_cancelable;
73 : }
74 :
75 : com::sun::star::util::Time SAL_CALL
76 17573 : CEvent::getTimeStamp() throw (RuntimeException)
77 : {
78 17573 : ::osl::MutexGuard const g(m_Mutex);
79 17573 : return m_time;
80 : }
81 :
82 0 : void SAL_CALL CEvent::stopPropagation() throw (RuntimeException)
83 : {
84 0 : ::osl::MutexGuard const g(m_Mutex);
85 0 : if (m_cancelable) { m_canceled = sal_True; }
86 0 : }
87 :
88 0 : void SAL_CALL CEvent::preventDefault() throw (RuntimeException)
89 : {
90 0 : }
91 :
92 : void SAL_CALL
93 35146 : CEvent::initEvent(OUString const& eventTypeArg, sal_Bool canBubbleArg,
94 : sal_Bool cancelableArg) throw (RuntimeException)
95 : {
96 35146 : ::osl::MutexGuard const g(m_Mutex);
97 :
98 35146 : m_eventType = eventTypeArg;
99 35146 : m_bubbles = canBubbleArg;
100 35146 : m_cancelable = cancelableArg;
101 35146 : }
102 :
103 : }}
104 :
105 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|