27 #ifndef __SB_WINDOWWATCHER_H__
28 #define __SB_WINDOWWATCHER_H__
36 #include <sbIWindowWatcher.h>
39 #include <nsClassHashtable.h>
40 #include <nsCOMArray.h>
41 #include <nsIDOMEventListener.h>
42 #include <nsIDOMEventTarget.h>
43 #include <nsIDOMWindowInternal.h>
44 #include <nsIObserver.h>
45 #include <nsIObserverService.h>
46 #include <nsIThreadManager.h>
47 #include <nsIWindowMediator.h>
48 #include <nsIWindowWatcher.h>
88 NS_DECL_SBIWINDOWWATCHER
141 nsCOMPtr<nsIWindowWatcher> mWindowWatcher;
142 nsCOMPtr<nsIWindowMediator> mWindowMediator;
143 nsCOMPtr<nsIObserverService> mObserverService;
144 nsCOMPtr<nsIThreadManager> mThreadManager;
145 PRBool mSentMainWinPresentedNotification;
147 PRBool mIsShuttingDown;
148 nsCOMArray<nsIDOMWindow> mWindowList;
153 WindowInfo() : isReady(PR_FALSE)
155 MOZ_COUNT_CTOR(WindowInfo);
159 MOZ_COUNT_DTOR(WindowInfo);
162 nsCOMPtr<nsIDOMWindow>
window;
164 nsRefPtr<sbWindowWatcherEventListener>
168 nsClassHashtable<nsISupportsHashKey, WindowInfo>
174 nsCOMPtr<sbICallWithWindowCallback>
callback;
175 } CallWithWindowInfo;
176 nsTArray<CallWithWindowInfo> mCallWithWindowList;
177 PRBool mServicingCallWithWindowList;
185 const PRUnichar*
aData);
188 const PRUnichar*
aData);
190 nsresult OnQuitApplicationGranted();
203 void RemoveAllWindows();
208 nsAString& aWindowType);
210 nsresult InvokeCallWithWindowCallbacks(
nsIDOMWindow* aWindow);
220 #define SB_WINDOWWATCHER_CLASSNAME "sbWindowWatcher"
221 #define SB_WINDOWWATCHER_CID \
227 { 0x8d, 0x5d, 0xd0, 0x88, 0x4d, 0x0c, 0xb7, 0x88 } \
258 NS_DECL_NSIDOMEVENTLISTENER
295 nsCOMPtr<nsIWeakReference> mWeakSBWindowWatcher;
297 nsCOMPtr<nsIDOMWindow> mWindow;
298 nsCOMPtr<nsIDOMEventTarget> mEventTarget;
299 nsTArray<nsString> mOutstandingEvents;
306 nsresult Initialize();
310 mSBWindowWatcher(aSBWindowWatcher),
345 NS_DECL_SBICALLWITHWINDOWCALLBACK
356 nsresult
Wait(
const nsAString& aWindowType);
380 nsCOMPtr<sbIWindowWatcher> mSBWindowWatcher;
381 PRMonitor* mReadyMonitor;
382 nsCOMPtr<nsIDOMWindow> mWindow;
389 nsresult Initialize();
395 #endif // __SB_WINDOWWATCHER_H__
A callback interface that is called with a window.
nsresult AddEventListener(const char *aEventName)
NS_DECL_ISUPPORTS static NS_DECL_SBICALLWITHWINDOWCALLBACK nsresult New(sbWindowWatcherWaitForWindow **aWaitForWindow)
virtual ~sbWindowWatcherWaitForWindow()
nsresult Wait(const nsAString &aWindowType)
Wait until a window of the type specified by aWindowType is available or until shutdown.
NS_DECL_ISUPPORTS NS_DECL_SBIWINDOWWATCHER NS_DECL_NSIOBSERVER sbWindowWatcher()
virtual ~sbWindowWatcher()
NS_DECL_ISUPPORTS static NS_DECL_NSIDOMEVENTLISTENER nsresult New(sbWindowWatcherEventListener **aListener, sbWindowWatcher *aSBWindowWatcher, nsIDOMWindow *aWindow)
nsresult ClearEventListeners()
_updateTextAndScrollDataForFrame aData