xref: /aoo41x/main/unoxml/source/events/uievent.cxx (revision e9cbe144)
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 <uievent.hxx>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir namespace DOM { namespace events
27cdf0e10cSrcweir {
CUIEvent()28cdf0e10cSrcweir     CUIEvent::CUIEvent()
29cdf0e10cSrcweir         : CUIEvent_Base()
30cdf0e10cSrcweir         , m_detail(0)
31cdf0e10cSrcweir     {
32cdf0e10cSrcweir     }
33cdf0e10cSrcweir 
34cdf0e10cSrcweir     Reference< XAbstractView > SAL_CALL
getView()35cdf0e10cSrcweir     CUIEvent::getView() throw(RuntimeException)
36cdf0e10cSrcweir     {
37cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
38cdf0e10cSrcweir         return m_view;
39cdf0e10cSrcweir     }
40cdf0e10cSrcweir 
getDetail()41cdf0e10cSrcweir     sal_Int32 SAL_CALL CUIEvent::getDetail() throw(RuntimeException)
42cdf0e10cSrcweir     {
43cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
44cdf0e10cSrcweir         return m_detail;
45cdf0e10cSrcweir     }
46cdf0e10cSrcweir 
initUIEvent(const OUString & typeArg,sal_Bool canBubbleArg,sal_Bool cancelableArg,const Reference<XAbstractView> & viewArg,sal_Int32 detailArg)47cdf0e10cSrcweir     void SAL_CALL CUIEvent::initUIEvent(const OUString& typeArg,
48cdf0e10cSrcweir                      sal_Bool canBubbleArg,
49cdf0e10cSrcweir                      sal_Bool cancelableArg,
50cdf0e10cSrcweir                      const Reference< XAbstractView >& viewArg,
51cdf0e10cSrcweir                      sal_Int32 detailArg) throw(RuntimeException)
52cdf0e10cSrcweir     {
53cdf0e10cSrcweir         ::osl::MutexGuard const g(m_Mutex);
54cdf0e10cSrcweir 
55cdf0e10cSrcweir         CEvent::initEvent(typeArg, canBubbleArg, cancelableArg);
56cdf0e10cSrcweir         m_view = viewArg;
57cdf0e10cSrcweir         m_detail = detailArg;
58cdf0e10cSrcweir     }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     // delegate to CEvent, since we are inheriting from CEvent and XEvent
getType()62cdf0e10cSrcweir     OUString SAL_CALL CUIEvent::getType() throw (RuntimeException)
63cdf0e10cSrcweir     {
64cdf0e10cSrcweir         return CEvent::getType();
65cdf0e10cSrcweir     }
66cdf0e10cSrcweir 
getTarget()67cdf0e10cSrcweir     Reference< XEventTarget > SAL_CALL CUIEvent::getTarget() throw (RuntimeException)
68cdf0e10cSrcweir     {
69cdf0e10cSrcweir         return CEvent::getTarget();
70cdf0e10cSrcweir     }
71cdf0e10cSrcweir 
getCurrentTarget()72cdf0e10cSrcweir     Reference< XEventTarget > SAL_CALL CUIEvent::getCurrentTarget() throw (RuntimeException)
73cdf0e10cSrcweir     {
74cdf0e10cSrcweir         return CEvent::getCurrentTarget();
75cdf0e10cSrcweir     }
76cdf0e10cSrcweir 
getEventPhase()77cdf0e10cSrcweir     PhaseType SAL_CALL CUIEvent::getEventPhase() throw (RuntimeException)
78cdf0e10cSrcweir     {
79cdf0e10cSrcweir         return CEvent::getEventPhase();
80cdf0e10cSrcweir     }
81cdf0e10cSrcweir 
getBubbles()82cdf0e10cSrcweir     sal_Bool SAL_CALL CUIEvent::getBubbles() throw (RuntimeException)
83cdf0e10cSrcweir     {
84cdf0e10cSrcweir         return CEvent::getBubbles();
85cdf0e10cSrcweir     }
86cdf0e10cSrcweir 
getCancelable()87cdf0e10cSrcweir     sal_Bool SAL_CALL CUIEvent::getCancelable() throw (RuntimeException)
88cdf0e10cSrcweir     {
89cdf0e10cSrcweir         // mutation events cannot be canceled
90cdf0e10cSrcweir         return sal_False;
91cdf0e10cSrcweir     }
92cdf0e10cSrcweir 
getTimeStamp()93cdf0e10cSrcweir     com::sun::star::util::Time SAL_CALL CUIEvent::getTimeStamp() throw (RuntimeException)
94cdf0e10cSrcweir     {
95cdf0e10cSrcweir         return CEvent::getTimeStamp();
96cdf0e10cSrcweir     }
97cdf0e10cSrcweir 
stopPropagation()98cdf0e10cSrcweir     void SAL_CALL CUIEvent::stopPropagation() throw (RuntimeException)
99cdf0e10cSrcweir     {
100cdf0e10cSrcweir         CEvent::stopPropagation();
101cdf0e10cSrcweir     }
preventDefault()102cdf0e10cSrcweir     void SAL_CALL CUIEvent::preventDefault() throw (RuntimeException)
103cdf0e10cSrcweir     {
104cdf0e10cSrcweir         CEvent::preventDefault();
105cdf0e10cSrcweir     }
106cdf0e10cSrcweir 
initEvent(const OUString & eventTypeArg,sal_Bool canBubbleArg,sal_Bool cancelableArg)107cdf0e10cSrcweir     void SAL_CALL CUIEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
108cdf0e10cSrcweir         sal_Bool cancelableArg) throw (RuntimeException)
109cdf0e10cSrcweir     {
110cdf0e10cSrcweir         // base initializer
111cdf0e10cSrcweir         CEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
112cdf0e10cSrcweir     }
113cdf0e10cSrcweir }}
114