1*e9cbe144SAndrew Rist /**************************************************************
2*e9cbe144SAndrew Rist  *
3*e9cbe144SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*e9cbe144SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*e9cbe144SAndrew Rist  * distributed with this work for additional information
6*e9cbe144SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*e9cbe144SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*e9cbe144SAndrew Rist  * "License"); you may not use this file except in compliance
9*e9cbe144SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*e9cbe144SAndrew Rist  *
11*e9cbe144SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*e9cbe144SAndrew Rist  *
13*e9cbe144SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*e9cbe144SAndrew Rist  * software distributed under the License is distributed on an
15*e9cbe144SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*e9cbe144SAndrew Rist  * KIND, either express or implied.  See the License for the
17*e9cbe144SAndrew Rist  * specific language governing permissions and limitations
18*e9cbe144SAndrew Rist  * under the License.
19*e9cbe144SAndrew Rist  *
20*e9cbe144SAndrew Rist  *************************************************************/
21*e9cbe144SAndrew Rist 
22*e9cbe144SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include <mouseevent.hxx>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir namespace DOM { namespace events
27cdf0e10cSrcweir {
CMouseEvent()28cdf0e10cSrcweir     CMouseEvent::CMouseEvent()
29cdf0e10cSrcweir         : CMouseEvent_Base()
30cdf0e10cSrcweir         , m_screenX(0)
31cdf0e10cSrcweir         , m_screenY(0)
32cdf0e10cSrcweir         , m_clientX(0)
33cdf0e10cSrcweir         , m_clientY(0)
34cdf0e10cSrcweir         , m_ctrlKey(sal_False)
35cdf0e10cSrcweir         , m_shiftKey(sal_False)
36cdf0e10cSrcweir         , m_altKey(sal_False)
37cdf0e10cSrcweir         , m_metaKey(sal_False)
38cdf0e10cSrcweir         , m_button(0)
39cdf0e10cSrcweir     {
40cdf0e10cSrcweir     }
41cdf0e10cSrcweir 
getScreenX()42cdf0e10cSrcweir     sal_Int32 SAL_CALL CMouseEvent::getScreenX() throw (RuntimeException)
43cdf0e10cSrcweir     {
44cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
45cdf0e10cSrcweir         return m_screenX;
46cdf0e10cSrcweir     }
getScreenY()47cdf0e10cSrcweir     sal_Int32 SAL_CALL CMouseEvent::getScreenY() throw (RuntimeException)
48cdf0e10cSrcweir     {
49cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
50cdf0e10cSrcweir         return m_screenY;
51cdf0e10cSrcweir     }
getClientX()52cdf0e10cSrcweir     sal_Int32 SAL_CALL CMouseEvent::getClientX() throw (RuntimeException)
53cdf0e10cSrcweir     {
54cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
55cdf0e10cSrcweir         return m_clientX;
56cdf0e10cSrcweir     }
getClientY()57cdf0e10cSrcweir     sal_Int32 SAL_CALL CMouseEvent::getClientY() throw (RuntimeException)
58cdf0e10cSrcweir     {
59cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
60cdf0e10cSrcweir         return m_clientY;
61cdf0e10cSrcweir     }
getCtrlKey()62cdf0e10cSrcweir     sal_Bool SAL_CALL CMouseEvent::getCtrlKey() throw (RuntimeException)
63cdf0e10cSrcweir     {
64cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
65cdf0e10cSrcweir         return m_ctrlKey;
66cdf0e10cSrcweir     }
getShiftKey()67cdf0e10cSrcweir     sal_Bool SAL_CALL CMouseEvent::getShiftKey() throw (RuntimeException)
68cdf0e10cSrcweir     {
69cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
70cdf0e10cSrcweir         return m_shiftKey;
71cdf0e10cSrcweir     }
getAltKey()72cdf0e10cSrcweir     sal_Bool SAL_CALL CMouseEvent::getAltKey() throw (RuntimeException)
73cdf0e10cSrcweir     {
74cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
75cdf0e10cSrcweir         return m_altKey;
76cdf0e10cSrcweir     }
getMetaKey()77cdf0e10cSrcweir     sal_Bool SAL_CALL CMouseEvent::getMetaKey() throw (RuntimeException)
78cdf0e10cSrcweir     {
79cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
80cdf0e10cSrcweir         return m_metaKey;
81cdf0e10cSrcweir     }
getButton()82cdf0e10cSrcweir     sal_Int16 SAL_CALL CMouseEvent::getButton() throw (RuntimeException)
83cdf0e10cSrcweir     {
84cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
85cdf0e10cSrcweir         return m_button;
86cdf0e10cSrcweir     }
getRelatedTarget()87cdf0e10cSrcweir     Reference< XEventTarget > SAL_CALL CMouseEvent::getRelatedTarget()  throw(RuntimeException)
88cdf0e10cSrcweir     {
89cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
90cdf0e10cSrcweir         return m_relatedTarget;
91cdf0e10cSrcweir     }
92cdf0e10cSrcweir 
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> &)93cdf0e10cSrcweir     void SAL_CALL CMouseEvent::initMouseEvent(
94cdf0e10cSrcweir                         const OUString& typeArg,
95cdf0e10cSrcweir                         sal_Bool canBubbleArg,
96cdf0e10cSrcweir                         sal_Bool cancelableArg,
97cdf0e10cSrcweir                         const Reference< XAbstractView >& viewArg,
98cdf0e10cSrcweir                         sal_Int32 detailArg,
99cdf0e10cSrcweir                         sal_Int32 screenXArg,
100cdf0e10cSrcweir                         sal_Int32 screenYArg,
101cdf0e10cSrcweir                         sal_Int32 clientXArg,
102cdf0e10cSrcweir                         sal_Int32 clientYArg,
103cdf0e10cSrcweir                         sal_Bool ctrlKeyArg,
104cdf0e10cSrcweir                         sal_Bool altKeyArg,
105cdf0e10cSrcweir                         sal_Bool shiftKeyArg,
106cdf0e10cSrcweir                         sal_Bool metaKeyArg,
107cdf0e10cSrcweir                         sal_Int16 buttonArg,
108cdf0e10cSrcweir                         const Reference< XEventTarget >& /*relatedTargetArg*/)
109cdf0e10cSrcweir         throw(RuntimeException)
110cdf0e10cSrcweir     {
111cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
112cdf0e10cSrcweir 
113cdf0e10cSrcweir         CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
114cdf0e10cSrcweir         m_screenX = screenXArg;
115cdf0e10cSrcweir         m_screenY = screenYArg;
116cdf0e10cSrcweir         m_clientX = clientXArg;
117cdf0e10cSrcweir         m_clientY = clientYArg;
118cdf0e10cSrcweir         m_ctrlKey = ctrlKeyArg;
119cdf0e10cSrcweir         m_altKey = altKeyArg;
120cdf0e10cSrcweir         m_shiftKey = shiftKeyArg;
121cdf0e10cSrcweir         m_metaKey = metaKeyArg;
122cdf0e10cSrcweir         m_button = buttonArg;
123cdf0e10cSrcweir     }
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     // delegate to CUIEvent, since we are inheriting from CUIEvent and XUIEvent
getView()126cdf0e10cSrcweir     Reference< XAbstractView > SAL_CALL CMouseEvent::getView() throw(RuntimeException)
127cdf0e10cSrcweir     {
128cdf0e10cSrcweir         return CUIEvent::getView();
129cdf0e10cSrcweir     }
130cdf0e10cSrcweir 
getDetail()131cdf0e10cSrcweir     sal_Int32 SAL_CALL CMouseEvent::getDetail() throw(RuntimeException)
132cdf0e10cSrcweir     {
133cdf0e10cSrcweir         return CUIEvent::getDetail();
134cdf0e10cSrcweir     }
135cdf0e10cSrcweir 
initUIEvent(const OUString & typeArg,sal_Bool canBubbleArg,sal_Bool cancelableArg,const Reference<XAbstractView> & viewArg,sal_Int32 detailArg)136cdf0e10cSrcweir     void SAL_CALL CMouseEvent::initUIEvent(const OUString& typeArg,
137cdf0e10cSrcweir                      sal_Bool canBubbleArg,
138cdf0e10cSrcweir                      sal_Bool cancelableArg,
139cdf0e10cSrcweir                      const Reference< XAbstractView >& viewArg,
140cdf0e10cSrcweir                      sal_Int32 detailArg) throw(RuntimeException)
141cdf0e10cSrcweir     {
142cdf0e10cSrcweir         CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
143cdf0e10cSrcweir     }
144cdf0e10cSrcweir 
getType()145cdf0e10cSrcweir     OUString SAL_CALL CMouseEvent::getType() throw (RuntimeException)
146cdf0e10cSrcweir     {
147cdf0e10cSrcweir         return CUIEvent::getType();
148cdf0e10cSrcweir     }
149cdf0e10cSrcweir 
getTarget()150cdf0e10cSrcweir     Reference< XEventTarget > SAL_CALL CMouseEvent::getTarget() throw (RuntimeException)
151cdf0e10cSrcweir     {
152cdf0e10cSrcweir         return CUIEvent::getTarget();
153cdf0e10cSrcweir     }
154cdf0e10cSrcweir 
getCurrentTarget()155cdf0e10cSrcweir     Reference< XEventTarget > SAL_CALL CMouseEvent::getCurrentTarget() throw (RuntimeException)
156cdf0e10cSrcweir     {
157cdf0e10cSrcweir         return CUIEvent::getCurrentTarget();
158cdf0e10cSrcweir     }
159cdf0e10cSrcweir 
getEventPhase()160cdf0e10cSrcweir     PhaseType SAL_CALL CMouseEvent::getEventPhase() throw (RuntimeException)
161cdf0e10cSrcweir     {
162cdf0e10cSrcweir         return CUIEvent::getEventPhase();
163cdf0e10cSrcweir     }
164cdf0e10cSrcweir 
getBubbles()165cdf0e10cSrcweir     sal_Bool SAL_CALL CMouseEvent::getBubbles() throw (RuntimeException)
166cdf0e10cSrcweir     {
167cdf0e10cSrcweir         return CEvent::getBubbles();
168cdf0e10cSrcweir     }
169cdf0e10cSrcweir 
getCancelable()170cdf0e10cSrcweir     sal_Bool SAL_CALL CMouseEvent::getCancelable() throw (RuntimeException)
171cdf0e10cSrcweir     {
172cdf0e10cSrcweir         return CUIEvent::getCancelable();
173cdf0e10cSrcweir     }
174cdf0e10cSrcweir 
getTimeStamp()175cdf0e10cSrcweir     com::sun::star::util::Time SAL_CALL CMouseEvent::getTimeStamp() throw (RuntimeException)
176cdf0e10cSrcweir     {
177cdf0e10cSrcweir         return CUIEvent::getTimeStamp();
178cdf0e10cSrcweir     }
179cdf0e10cSrcweir 
stopPropagation()180cdf0e10cSrcweir     void SAL_CALL CMouseEvent::stopPropagation() throw (RuntimeException)
181cdf0e10cSrcweir     {
182cdf0e10cSrcweir         CUIEvent::stopPropagation();
183cdf0e10cSrcweir     }
184cdf0e10cSrcweir 
preventDefault()185cdf0e10cSrcweir     void SAL_CALL CMouseEvent::preventDefault() throw (RuntimeException)
186cdf0e10cSrcweir     {
187cdf0e10cSrcweir         CUIEvent::preventDefault();
188cdf0e10cSrcweir     }
189cdf0e10cSrcweir 
initEvent(const OUString & eventTypeArg,sal_Bool canBubbleArg,sal_Bool cancelableArg)190cdf0e10cSrcweir     void SAL_CALL CMouseEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
191cdf0e10cSrcweir         sal_Bool cancelableArg) throw (RuntimeException)
192cdf0e10cSrcweir     {
193cdf0e10cSrcweir         // base initializer
194cdf0e10cSrcweir         CUIEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
195cdf0e10cSrcweir     }
196cdf0e10cSrcweir }}
197cdf0e10cSrcweir 
198