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 <mutationevent.hxx>
29 
30 namespace DOM { namespace events
31 {
32     CMutationEvent::CMutationEvent()
33         : CMutationEvent_Base()
34         , m_attrChangeType(AttrChangeType_MODIFICATION)
35     {
36     }
37 
38     CMutationEvent::~CMutationEvent()
39     {
40     }
41 
42     Reference< XNode > SAL_CALL CMutationEvent::getRelatedNode() throw (RuntimeException)
43     {
44         ::osl::MutexGuard const g(m_Mutex);
45         return m_relatedNode;
46     }
47 
48     OUString SAL_CALL CMutationEvent::getPrevValue() throw (RuntimeException)
49     {
50         ::osl::MutexGuard const g(m_Mutex);
51         return m_prevValue;
52     }
53 
54     OUString SAL_CALL CMutationEvent::getNewValue() throw (RuntimeException)
55     {
56         ::osl::MutexGuard const g(m_Mutex);
57         return m_newValue;
58     }
59 
60     OUString SAL_CALL CMutationEvent::getAttrName() throw (RuntimeException)
61     {
62         ::osl::MutexGuard const g(m_Mutex);
63         return m_attrName;
64     }
65 
66     AttrChangeType SAL_CALL CMutationEvent::getAttrChange() throw (RuntimeException)
67     {
68         ::osl::MutexGuard const g(m_Mutex);
69         return m_attrChangeType;
70     }
71 
72     void SAL_CALL CMutationEvent::initMutationEvent(const OUString& typeArg,
73         sal_Bool canBubbleArg, sal_Bool cancelableArg,
74         const Reference< XNode >& relatedNodeArg, const OUString& prevValueArg,
75         const OUString& newValueArg, const OUString& attrNameArg,
76         AttrChangeType attrChangeArg) throw (RuntimeException)
77     {
78         ::osl::MutexGuard const g(m_Mutex);
79 
80         CEvent::initEvent(typeArg, canBubbleArg, cancelableArg);
81         m_relatedNode = relatedNodeArg;
82         m_prevValue = prevValueArg;
83         m_newValue = newValueArg;
84         m_attrName = attrNameArg;
85         m_attrChangeType = attrChangeArg;
86     }
87 
88     // delegate to CEvent, since we are inheriting from CEvent and XEvent
89     OUString SAL_CALL CMutationEvent::getType() throw (RuntimeException)
90     {
91         return CEvent::getType();
92     }
93 
94     Reference< XEventTarget > SAL_CALL CMutationEvent::getTarget() throw (RuntimeException)
95     {
96         return CEvent::getTarget();
97     }
98 
99     Reference< XEventTarget > SAL_CALL CMutationEvent::getCurrentTarget() throw (RuntimeException)
100     {
101         return CEvent::getCurrentTarget();
102     }
103 
104     PhaseType SAL_CALL CMutationEvent::getEventPhase() throw (RuntimeException)
105     {
106         return CEvent::getEventPhase();
107     }
108 
109     sal_Bool SAL_CALL CMutationEvent::getBubbles() throw (RuntimeException)
110     {
111         return CEvent::getBubbles();
112     }
113 
114     sal_Bool SAL_CALL CMutationEvent::getCancelable() throw (RuntimeException)
115     {
116         return CEvent::getCancelable();
117     }
118 
119     com::sun::star::util::Time SAL_CALL CMutationEvent::getTimeStamp() throw (RuntimeException)
120     {
121         return CEvent::getTimeStamp();
122     }
123 
124     void SAL_CALL CMutationEvent::stopPropagation() throw (RuntimeException)
125     {
126         CEvent::stopPropagation();
127     }
128     void SAL_CALL CMutationEvent::preventDefault() throw (RuntimeException)
129     {
130         CEvent::preventDefault();
131     }
132 
133     void SAL_CALL CMutationEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
134         sal_Bool cancelableArg) throw (RuntimeException)
135     {
136         // base initializer
137         CEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
138     }
139 }}
140 
141