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() 43 { 44 ::osl::MutexGuard const g(m_Mutex); 45 return m_screenX; 46 } getScreenY()47 sal_Int32 SAL_CALL CMouseEvent::getScreenY() 48 { 49 ::osl::MutexGuard const g(m_Mutex); 50 return m_screenY; 51 } getClientX()52 sal_Int32 SAL_CALL CMouseEvent::getClientX() 53 { 54 ::osl::MutexGuard const g(m_Mutex); 55 return m_clientX; 56 } getClientY()57 sal_Int32 SAL_CALL CMouseEvent::getClientY() 58 { 59 ::osl::MutexGuard const g(m_Mutex); 60 return m_clientY; 61 } getCtrlKey()62 sal_Bool SAL_CALL CMouseEvent::getCtrlKey() 63 { 64 ::osl::MutexGuard const g(m_Mutex); 65 return m_ctrlKey; 66 } getShiftKey()67 sal_Bool SAL_CALL CMouseEvent::getShiftKey() 68 { 69 ::osl::MutexGuard const g(m_Mutex); 70 return m_shiftKey; 71 } getAltKey()72 sal_Bool SAL_CALL CMouseEvent::getAltKey() 73 { 74 ::osl::MutexGuard const g(m_Mutex); 75 return m_altKey; 76 } getMetaKey()77 sal_Bool SAL_CALL CMouseEvent::getMetaKey() 78 { 79 ::osl::MutexGuard const g(m_Mutex); 80 return m_metaKey; 81 } getButton()82 sal_Int16 SAL_CALL CMouseEvent::getButton() 83 { 84 ::osl::MutexGuard const g(m_Mutex); 85 return m_button; 86 } getRelatedTarget()87 Reference< XEventTarget > SAL_CALL CMouseEvent::getRelatedTarget() 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 { 110 ::osl::MutexGuard const g(m_Mutex); 111 112 CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg); 113 m_screenX = screenXArg; 114 m_screenY = screenYArg; 115 m_clientX = clientXArg; 116 m_clientY = clientYArg; 117 m_ctrlKey = ctrlKeyArg; 118 m_altKey = altKeyArg; 119 m_shiftKey = shiftKeyArg; 120 m_metaKey = metaKeyArg; 121 m_button = buttonArg; 122 } 123 124 // delegate to CUIEvent, since we are inheriting from CUIEvent and XUIEvent getView()125 Reference< XAbstractView > SAL_CALL CMouseEvent::getView() 126 { 127 return CUIEvent::getView(); 128 } 129 getDetail()130 sal_Int32 SAL_CALL CMouseEvent::getDetail() 131 { 132 return CUIEvent::getDetail(); 133 } 134 initUIEvent(const OUString & typeArg,sal_Bool canBubbleArg,sal_Bool cancelableArg,const Reference<XAbstractView> & viewArg,sal_Int32 detailArg)135 void SAL_CALL CMouseEvent::initUIEvent(const OUString& typeArg, 136 sal_Bool canBubbleArg, 137 sal_Bool cancelableArg, 138 const Reference< XAbstractView >& viewArg, 139 sal_Int32 detailArg) 140 { 141 CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg); 142 } 143 getType()144 OUString SAL_CALL CMouseEvent::getType() 145 { 146 return CUIEvent::getType(); 147 } 148 getTarget()149 Reference< XEventTarget > SAL_CALL CMouseEvent::getTarget() 150 { 151 return CUIEvent::getTarget(); 152 } 153 getCurrentTarget()154 Reference< XEventTarget > SAL_CALL CMouseEvent::getCurrentTarget() 155 { 156 return CUIEvent::getCurrentTarget(); 157 } 158 getEventPhase()159 PhaseType SAL_CALL CMouseEvent::getEventPhase() 160 { 161 return CUIEvent::getEventPhase(); 162 } 163 getBubbles()164 sal_Bool SAL_CALL CMouseEvent::getBubbles() 165 { 166 return CEvent::getBubbles(); 167 } 168 getCancelable()169 sal_Bool SAL_CALL CMouseEvent::getCancelable() 170 { 171 return CUIEvent::getCancelable(); 172 } 173 getTimeStamp()174 com::sun::star::util::Time SAL_CALL CMouseEvent::getTimeStamp() 175 { 176 return CUIEvent::getTimeStamp(); 177 } 178 stopPropagation()179 void SAL_CALL CMouseEvent::stopPropagation() 180 { 181 CUIEvent::stopPropagation(); 182 } 183 preventDefault()184 void SAL_CALL CMouseEvent::preventDefault() 185 { 186 CUIEvent::preventDefault(); 187 } 188 initEvent(const OUString & eventTypeArg,sal_Bool canBubbleArg,sal_Bool cancelableArg)189 void SAL_CALL CMouseEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg, 190 sal_Bool cancelableArg) 191 { 192 // base initializer 193 CUIEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg); 194 } 195 }} 196