43 #include "nsServiceManagerUtils.h"
44 #include "nsIInterfaceRequestorUtils.h"
45 #include "imgILoader.h"
46 #include "imgIRequest.h"
47 #include "nsNetError.h"
49 #include "nsIDOMNode.h"
50 #include "nsIDOMDocumentEvent.h"
51 #include "nsIDOMDocument.h"
52 #include "nsStringGlue.h"
53 #include "nsIDOMDocumentView.h"
54 #include "nsIDOMMouseEvent.h"
55 #include "nsIDOMAbstractView.h"
64 imgIContainerObserver)
77 nsCOMPtr<imgILoader> imgloader =
78 do_GetService(
"@mozilla.org/image/loader;1", &rv);
79 NS_ENSURE_SUCCESS(rv, rv);
84 rv = imgloader->LoadImage(aURI, aURI, aURI, nsnull,
this, nsnull,
85 nsIRequest::LOAD_BACKGROUND, nsnull, nsnull,
87 NS_ENSURE_SUCCESS(rv, rv);
99 PRUint16 aButton, PRInt32 aDetail,
100 PRBool aCtrlKey, PRBool aAltKey,
101 PRBool aShiftKey, PRBool aMetaKey)
107 if (NS_FAILED(rv))
return;
109 nsCOMPtr<nsIDOMDocument>
doc;
110 rv = node->GetOwnerDocument(getter_AddRefs(doc));
111 if (NS_FAILED(rv))
return;
113 nsCOMPtr<nsIDOMDocumentEvent> docEvent(do_QueryInterface(doc, &rv));
114 if (NS_FAILED(rv))
return;
116 nsCOMPtr<nsIDOMEvent>
event;
117 rv = docEvent->CreateEvent(NS_LITERAL_STRING(
"mouseevent"),
118 getter_AddRefs(event));
119 if (NS_FAILED(rv))
return;
121 nsCOMPtr<nsIDOMMouseEvent> mouseEvent(do_QueryInterface(event, &rv));
122 if (NS_FAILED(rv))
return;
125 nsCOMPtr<nsIDOMDocumentView> documentView(do_QueryInterface(doc, &rv));
126 if (NS_FAILED(rv))
return;
128 nsCOMPtr<nsIDOMAbstractView> view;
129 rv = documentView->GetDefaultView(getter_AddRefs(view));
130 if (NS_FAILED(rv))
return;
137 rv = mouseEvent->InitMouseEvent(aType,
138 PR_FALSE, PR_TRUE, view, aDetail,
139 position.x, position.y, position.x, position.y,
140 aCtrlKey, aAltKey, aShiftKey, aMetaKey,
142 if (NS_FAILED(rv))
return;
151 NS_IMETHODIMP nsSystemTrayIconBase::OnStartRequest(imgIRequest *aRequest)
157 NS_IMETHODIMP nsSystemTrayIconBase::OnStartDecode(imgIRequest *aRequest)
163 NS_IMETHODIMP nsSystemTrayIconBase::OnStartContainer(imgIRequest *aRequest, imgIContainer *aContainer)
170 nsSystemTrayService::OnStartFrame(imgIRequest *aRequest,
179 nsSystemTrayService::OnDataAvailable(imgIRequest *aRequest,
180 PRBool aCurrentFrame,
181 const nsIntRect * aRect)
188 nsSystemTrayService::OnStopFrame(imgIRequest *aRequest,
191 return NS_ERROR_NOT_IMPLEMENTED;
195 NS_IMETHODIMP nsSystemTrayIconBase::OnStopContainer(imgIRequest *aRequest, imgIContainer *aContainer)
201 NS_IMETHODIMP nsSystemTrayIconBase::OnStopDecode(imgIRequest *aRequest, nsresult status,
const PRUnichar *statusArg)
207 NS_IMETHODIMP nsSystemTrayIconBase::OnStopRequest(imgIRequest *aRequest, PRBool aIsLastPart)
216 nsSystemTrayService::FrameChanged(imgIContainer *aContainer,
217 nsIntRect * aDirtyRect)
function doc() browser.contentDocument
NS_IMPL_ISUPPORTS2(nsSystemTrayIconBase, imgIDecoderObserver, imgIContainerObserver) nsSystemTrayIconBase
void DispatchEvent(const nsAString &aType, PRUint16 aButton, PRInt32 aDetail, PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey, PRBool aMetaKey)
nsCOMPtr< imgIRequest > mRequest
virtual nsPoint GetPopupPosition()=0
nsCOMPtr< nsIDOMEventTarget > mEventTarget
nsresult SetEventTarget(nsIDOMEventTarget *aEventTarget)
nsresult SetImageFromURI(nsIURI *aURI)