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