xref: /trunk/main/unoxml/source/events/uievent.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #include <uievent.hxx>
29 
30 namespace DOM { namespace events
31 {
32     CUIEvent::CUIEvent()
33         : CUIEvent_Base()
34         , m_detail(0)
35     {
36     }
37 
38     Reference< XAbstractView > SAL_CALL
39     CUIEvent::getView() throw(RuntimeException)
40     {
41         ::osl::MutexGuard const g(m_Mutex);
42         return m_view;
43     }
44 
45     sal_Int32 SAL_CALL CUIEvent::getDetail() throw(RuntimeException)
46     {
47         ::osl::MutexGuard const g(m_Mutex);
48         return m_detail;
49     }
50 
51     void SAL_CALL CUIEvent::initUIEvent(const OUString& typeArg,
52                      sal_Bool canBubbleArg,
53                      sal_Bool cancelableArg,
54                      const Reference< XAbstractView >& viewArg,
55                      sal_Int32 detailArg) throw(RuntimeException)
56     {
57         ::osl::MutexGuard const g(m_Mutex);
58 
59         CEvent::initEvent(typeArg, canBubbleArg, cancelableArg);
60         m_view = viewArg;
61         m_detail = detailArg;
62     }
63 
64 
65     // delegate to CEvent, since we are inheriting from CEvent and XEvent
66     OUString SAL_CALL CUIEvent::getType() throw (RuntimeException)
67     {
68         return CEvent::getType();
69     }
70 
71     Reference< XEventTarget > SAL_CALL CUIEvent::getTarget() throw (RuntimeException)
72     {
73         return CEvent::getTarget();
74     }
75 
76     Reference< XEventTarget > SAL_CALL CUIEvent::getCurrentTarget() throw (RuntimeException)
77     {
78         return CEvent::getCurrentTarget();
79     }
80 
81     PhaseType SAL_CALL CUIEvent::getEventPhase() throw (RuntimeException)
82     {
83         return CEvent::getEventPhase();
84     }
85 
86     sal_Bool SAL_CALL CUIEvent::getBubbles() throw (RuntimeException)
87     {
88         return CEvent::getBubbles();
89     }
90 
91     sal_Bool SAL_CALL CUIEvent::getCancelable() throw (RuntimeException)
92     {
93         // mutation events cannot be canceled
94         return sal_False;
95     }
96 
97     com::sun::star::util::Time SAL_CALL CUIEvent::getTimeStamp() throw (RuntimeException)
98     {
99         return CEvent::getTimeStamp();
100     }
101 
102     void SAL_CALL CUIEvent::stopPropagation() throw (RuntimeException)
103     {
104         CEvent::stopPropagation();
105     }
106     void SAL_CALL CUIEvent::preventDefault() throw (RuntimeException)
107     {
108         CEvent::preventDefault();
109     }
110 
111     void SAL_CALL CUIEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
112         sal_Bool cancelableArg) throw (RuntimeException)
113     {
114         // base initializer
115         CEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
116     }
117 }}
118