sbIWindowWatcher.idl
Go to the documentation of this file.
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 :miv */
3 /*
4 //
5 // BEGIN SONGBIRD GPL
6 //
7 // This file is part of the Songbird web player.
8 //
9 // Copyright(c) 2005-2008 POTI, Inc.
10 // http://songbirdnest.com
11 //
12 // This file may be licensed under the terms of of the
13 // GNU General Public License Version 2 (the "GPL").
14 //
15 // Software distributed under the License is distributed
16 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
17 // express or implied. See the GPL for the specific language
18 // governing rights and limitations.
19 //
20 // You should have received a copy of the GPL along with this
21 // program. If not, go to http://www.gnu.org/licenses/gpl.html
22 // or write to the Free Software Foundation, Inc.,
23 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 // END SONGBIRD GPL
26 //
27 */
28 
29 #include "nsISupports.idl"
30 
31 interface nsIDOMWindow;
32 
50 
51 [scriptable, uuid(93cf33df-770f-49ec-afb7-20db242dd366)]
53 {
59  readonly attribute boolean isShuttingDown;
60 
61 
73  /*XXXeps add cancel. */
74 
75  void callWithWindow(in AString aWindowType,
76  in sbICallWithWindowCallback aCallback,
77  [optional] in boolean aWait);
78 
79 
92  nsIDOMWindow getWindow(in AString aWindowType);
93 
94 
106  void waitForWindow(in AString aWindowType);
107 };
108 
109 
117 [scriptable, function, uuid(4052eb5e-fe52-4e31-abca-1263c2cfd009)]
119 {
126  void handleWindowCallback(in nsIDOMWindow aWindow);
127 };
128 
129 
130 //
131 // C++ defs.
132 //
133 
134 %{C++
135 #define SB_WINDOWWATCHER_CONTRACTID \
136  "@songbirdnest.com/Songbird/window-watcher;1"
137 %}C++
138 
A callback interface that is called with a window.
void waitForWindow(in AString aWindowType)
Wait until a window of the type specified by aWindowType is available or until shutdown. This method may not be called on the main thread. Since the available window can only be used on the main thread, the available window may become unavailable after waitForWindow returns but before processing continues on the main thread.
nsIDOMWindow getWindow(in AString aWindowType)
Get the top-most available window of the type specified by aWindowType. Return null if no matching wi...
var uuid
function C(H)
const nsIDOMWindow
void callWithWindow(in AString aWindowType, in sbICallWithWindowCallback aCallback, [optional] in boolean aWait)
Call callback specified by aCallback with a window of the type specified by aWindowType. Wait until a window of the specified type is available or until shutdown. Call callback with null window on shutdown. Call callback on main thread. If aWait is true, don't return until callback is called.
readonly attribute boolean isShuttingDown
True if the window watcher is shutting down and no more windows will become available.
void handleWindowCallback(in nsIDOMWindow aWindow)
Handle the callback with the window specified by aWindow.