LibreOffice Module unoxml (master) 1
mouseevent.cxx
Go to the documentation of this file.
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 <mouseevent.hxx>
21
22using namespace css::uno;
23using namespace css::xml::dom::events;
24using namespace css::xml::dom::views;
25
26namespace DOM::events
27{
29 : m_screenX(0)
30 , m_screenY(0)
31 , m_clientX(0)
32 , m_clientY(0)
33 , m_ctrlKey(false)
34 , m_shiftKey(false)
35 , m_altKey(false)
36 , m_metaKey(false)
37 , m_button(0)
38 {
39 }
40
41 sal_Int32 SAL_CALL CMouseEvent::getScreenX()
42 {
43 std::unique_lock const g(m_Mutex);
44 return m_screenX;
45 }
46 sal_Int32 SAL_CALL CMouseEvent::getScreenY()
47 {
48 std::unique_lock const g(m_Mutex);
49 return m_screenY;
50 }
51 sal_Int32 SAL_CALL CMouseEvent::getClientX()
52 {
53 std::unique_lock const g(m_Mutex);
54 return m_clientX;
55 }
56 sal_Int32 SAL_CALL CMouseEvent::getClientY()
57 {
58 std::unique_lock const g(m_Mutex);
59 return m_clientY;
60 }
62 {
63 std::unique_lock const g(m_Mutex);
64 return m_ctrlKey;
65 }
67 {
68 std::unique_lock const g(m_Mutex);
69 return m_shiftKey;
70 }
72 {
73 std::unique_lock const g(m_Mutex);
74 return m_altKey;
75 }
77 {
78 std::unique_lock const g(m_Mutex);
79 return m_metaKey;
80 }
81 sal_Int16 SAL_CALL CMouseEvent::getButton()
82 {
83 std::unique_lock const g(m_Mutex);
84 return m_button;
85 }
86 Reference< XEventTarget > SAL_CALL CMouseEvent::getRelatedTarget()
87 {
88 return Reference< XEventTarget >();
89 }
90
92 const OUString& typeArg,
93 sal_Bool canBubbleArg,
94 sal_Bool cancelableArg,
95 const Reference< XAbstractView >& viewArg,
96 sal_Int32 detailArg,
97 sal_Int32 screenXArg,
98 sal_Int32 screenYArg,
99 sal_Int32 clientXArg,
100 sal_Int32 clientYArg,
101 sal_Bool ctrlKeyArg,
102 sal_Bool altKeyArg,
103 sal_Bool shiftKeyArg,
104 sal_Bool metaKeyArg,
105 sal_Int16 buttonArg,
106 const Reference< XEventTarget >& /*relatedTargetArg*/)
107 {
108 CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
109 std::unique_lock const g(m_Mutex);
110 m_screenX = screenXArg;
111 m_screenY = screenYArg;
112 m_clientX = clientXArg;
113 m_clientY = clientYArg;
114 m_ctrlKey = ctrlKeyArg;
115 m_altKey = altKeyArg;
116 m_shiftKey = shiftKeyArg;
117 m_metaKey = metaKeyArg;
118 m_button = buttonArg;
119 }
120
121 // delegate to CUIEvent, since we are inheriting from CUIEvent and XUIEvent
122 Reference< XAbstractView > SAL_CALL CMouseEvent::getView()
123 {
124 return CUIEvent::getView();
125 }
126
127 sal_Int32 SAL_CALL CMouseEvent::getDetail()
128 {
129 return CUIEvent::getDetail();
130 }
131
132 void SAL_CALL CMouseEvent::initUIEvent(const OUString& typeArg,
133 sal_Bool canBubbleArg,
134 sal_Bool cancelableArg,
135 const Reference< XAbstractView >& viewArg,
136 sal_Int32 detailArg)
137 {
138 CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
139 }
140
141 OUString SAL_CALL CMouseEvent::getType()
142 {
143 return CUIEvent::getType();
144 }
145
146 Reference< XEventTarget > SAL_CALL CMouseEvent::getTarget()
147 {
148 return CUIEvent::getTarget();
149 }
150
151 Reference< XEventTarget > SAL_CALL CMouseEvent::getCurrentTarget()
152 {
154 }
155
156 PhaseType SAL_CALL CMouseEvent::getEventPhase()
157 {
159 }
160
162 {
163 return CEvent::getBubbles();
164 }
165
167 {
169 }
170
171 css::util::Time SAL_CALL CMouseEvent::getTimeStamp()
172 {
173 return CUIEvent::getTimeStamp();
174 }
175
177 {
179 }
180
182 {
184 }
185
186 void SAL_CALL CMouseEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
187 sal_Bool cancelableArg)
188 {
189 // base initializer
190 CUIEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
191 }
192}
193
194/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Bool SAL_CALL getBubbles() override
Definition: event.cxx:66
virtual sal_Bool SAL_CALL getCtrlKey() override
Definition: mouseevent.cxx:61
virtual void SAL_CALL initMouseEvent(const OUString &typeArg, sal_Bool canBubbleArg, sal_Bool cancelableArg, const css::uno::Reference< css::xml::dom::views::XAbstractView > &viewArg, sal_Int32 detailArg, sal_Int32 screenXArg, sal_Int32 screenYArg, sal_Int32 clientXArg, sal_Int32 clientYArg, sal_Bool ctrlKeyArg, sal_Bool altKeyArg, sal_Bool shiftKeyArg, sal_Bool metaKeyArg, sal_Int16 buttonArg, const css::uno::Reference< css::xml::dom::events::XEventTarget > &relatedTargetArg) override
Definition: mouseevent.cxx:91
virtual css::uno::Reference< css::xml::dom::events::XEventTarget > SAL_CALL getRelatedTarget() override
Definition: mouseevent.cxx:86
virtual sal_Bool SAL_CALL getMetaKey() override
Definition: mouseevent.cxx:76
virtual sal_Bool SAL_CALL getCancelable() override
Definition: mouseevent.cxx:166
virtual sal_Int16 SAL_CALL getButton() override
Definition: mouseevent.cxx:81
virtual css::xml::dom::events::PhaseType SAL_CALL getEventPhase() override
Definition: mouseevent.cxx:156
virtual sal_Bool SAL_CALL getShiftKey() override
Definition: mouseevent.cxx:66
virtual css::uno::Reference< css::xml::dom::views::XAbstractView > SAL_CALL getView() override
Definition: mouseevent.cxx:122
virtual sal_Bool SAL_CALL getBubbles() override
Definition: mouseevent.cxx:161
virtual sal_Int32 SAL_CALL getScreenY() override
Definition: mouseevent.cxx:46
virtual sal_Int32 SAL_CALL getScreenX() override
Definition: mouseevent.cxx:41
virtual css::uno::Reference< css::xml::dom::events::XEventTarget > SAL_CALL getCurrentTarget() override
Definition: mouseevent.cxx:151
virtual void SAL_CALL preventDefault() override
Definition: mouseevent.cxx:181
virtual css::util::Time SAL_CALL getTimeStamp() override
Definition: mouseevent.cxx:171
virtual void SAL_CALL stopPropagation() override
Definition: mouseevent.cxx:176
virtual sal_Int32 SAL_CALL getDetail() override
Definition: mouseevent.cxx:127
virtual void SAL_CALL initUIEvent(const OUString &typeArg, sal_Bool canBubbleArg, sal_Bool cancelableArg, const css::uno::Reference< css::xml::dom::views::XAbstractView > &viewArg, sal_Int32 detailArg) override
Definition: mouseevent.cxx:132
virtual sal_Bool SAL_CALL getAltKey() override
Definition: mouseevent.cxx:71
virtual sal_Int32 SAL_CALL getClientX() override
Definition: mouseevent.cxx:51
virtual OUString SAL_CALL getType() override
Definition: mouseevent.cxx:141
virtual sal_Int32 SAL_CALL getClientY() override
Definition: mouseevent.cxx:56
virtual css::uno::Reference< css::xml::dom::events::XEventTarget > SAL_CALL getTarget() override
Definition: mouseevent.cxx:146
virtual void SAL_CALL initEvent(const OUString &eventTypeArg, sal_Bool canBubbleArg, sal_Bool cancelableArg) override
Definition: mouseevent.cxx:186
virtual void SAL_CALL initEvent(const OUString &eventTypeArg, sal_Bool canBubbleArg, sal_Bool cancelableArg) override
Definition: uievent.cxx:105
virtual sal_Int32 SAL_CALL getDetail() override
Definition: uievent.cxx:40
virtual css::xml::dom::events::PhaseType SAL_CALL getEventPhase() override
Definition: uievent.cxx:75
virtual css::uno::Reference< css::xml::dom::events::XEventTarget > SAL_CALL getTarget() override
Definition: uievent.cxx:65
virtual css::uno::Reference< css::xml::dom::events::XEventTarget > SAL_CALL getCurrentTarget() override
Definition: uievent.cxx:70
virtual void SAL_CALL preventDefault() override
Definition: uievent.cxx:100
virtual css::util::Time SAL_CALL getTimeStamp() override
Definition: uievent.cxx:91
virtual sal_Bool SAL_CALL getCancelable() override
Definition: uievent.cxx:85
virtual void SAL_CALL stopPropagation() override
Definition: uievent.cxx:96
virtual void SAL_CALL initUIEvent(const OUString &typeArg, sal_Bool canBubbleArg, sal_Bool cancelableArg, const css::uno::Reference< css::xml::dom::views::XAbstractView > &viewArg, sal_Int32 detailArg) override
Definition: uievent.cxx:46
virtual css::uno::Reference< css::xml::dom::views::XAbstractView > SAL_CALL getView() override
Definition: uievent.cxx:34
virtual OUString SAL_CALL getType() override
Definition: uievent.cxx:60
unsigned char sal_Bool