Bug 417561, disable tagging of Talkback now we have prebuilt packages, r=rhelmer
[mozilla-1.9.git] / content / events / src / nsDOMMessageEvent.cpp
bloba9fb578b8c1fd7f08d3c00aa997cdc46fa32d653
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Mozilla Foundation.
19 * Portions created by the Initial Developer are Copyright (C) 2007
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Jeff Walden <jwalden+code@mit.edu> (original author)
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #include "nsDOMMessageEvent.h"
40 #include "nsContentUtils.h"
42 NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMMessageEvent)
44 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMMessageEvent, nsDOMEvent)
45 NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mSource)
46 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
48 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMMessageEvent, nsDOMEvent)
49 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mSource)
50 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
52 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMMessageEvent)
53 NS_INTERFACE_MAP_ENTRY(nsIDOMMessageEvent)
54 NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(MessageEvent)
55 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
57 NS_IMPL_ADDREF_INHERITED(nsDOMMessageEvent, nsDOMEvent)
58 NS_IMPL_RELEASE_INHERITED(nsDOMMessageEvent, nsDOMEvent)
60 NS_IMETHODIMP
61 nsDOMMessageEvent::GetData(nsAString& aData)
63 aData = mData;
64 return NS_OK;
67 NS_IMETHODIMP
68 nsDOMMessageEvent::GetOrigin(nsAString& aOrigin)
70 aOrigin = mOrigin;
71 return NS_OK;
74 NS_IMETHODIMP
75 nsDOMMessageEvent::GetSource(nsIDOMWindow** aSource)
77 NS_IF_ADDREF(*aSource = mSource);
78 return NS_OK;
81 NS_IMETHODIMP
82 nsDOMMessageEvent::InitMessageEvent(const nsAString& aType,
83 PRBool aCanBubble,
84 PRBool aCancelable,
85 const nsAString& aData,
86 const nsAString& aOrigin,
87 nsIDOMWindow* aSource)
89 nsresult rv = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable);
90 NS_ENSURE_SUCCESS(rv, rv);
92 mData = aData;
93 mOrigin = aOrigin;
94 mSource = aSource;
96 return NS_OK;
99 NS_IMETHODIMP
100 nsDOMMessageEvent::InitMessageEventNS(const nsAString& aNamespaceURI,
101 const nsAString& aType,
102 PRBool aCanBubble,
103 PRBool aCancelable,
104 const nsAString& aData,
105 const nsAString& aOrigin,
106 nsIDOMWindow* aSource)
108 return NS_ERROR_NOT_IMPLEMENTED;
111 nsresult
112 NS_NewDOMMessageEvent(nsIDOMEvent** aInstancePtrResult,
113 nsPresContext* aPresContext,
114 nsEvent* aEvent)
116 nsDOMMessageEvent* it = new nsDOMMessageEvent(aPresContext, aEvent);
117 if (nsnull == it)
118 return NS_ERROR_OUT_OF_MEMORY;
120 return CallQueryInterface(it, aInstancePtrResult);