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