sbICDDeviceService.idl
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2009 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #include "nsISupports.idl"
26 interface sbICDDevice;
27 interface nsISimpleEnumerator;
28 
29 
30 //------------------------------------------------------------------------------
31 //
32 // @interface sbICDListener
33 // @brief This interface is used to provide notification when media is
34 // inserted or removed from a system. This interface will also be
35 // informed when a device has been removed.
36 //
37 //------------------------------------------------------------------------------
38 
39 [scriptable, uuid(DAAB38B4-659D-4428-A30F-CE04B3541B56)]
41 {
42  //
43  // @brief Callback method when a CD device has been removed.
44  // @param aCDDevice The CD device that has been removed.
45  //
46  void onDeviceRemoved(in sbICDDevice aCDDevice);
47 
48  //
49  // @brief Callback method when media has been inserted into a CD drive.
50  // @param aCDDevice The CD device that had the media inserted.
51  //
52  void onMediaInserted(in sbICDDevice aCDDevice);
53 
54  //
55  // @brief Callback method when media has been ejected from a CD drive.
56  // @param aCDDevice The CD device that had the media removed.
57  //
58  void onMediaEjected(in sbICDDevice aCDDevice);
59 };
60 
61 //------------------------------------------------------------------------------
62 //
63 // @interface sbICD
64 // @brief This interface implements the CD devices enumeration functions.
65 //
66 //------------------------------------------------------------------------------
67 
68 [scriptable, uuid(f3d3e784-1dd1-11b2-bef7-820f9787ed4b)]
70 {
71  //
72  // @brief returns the voting weight of this CD device service
73  // @note higher weight = strong chance this device service will be selected
74  //
75  readonly attribute long weight;
76 
77  //
78  // @brief returns the number of CD devices present in the system
79  //
80  readonly attribute long nbDevices;
81 
82  //
83  // @brief returns a sbICDDevice object
84  // @note "deviceIndex" is 0-index based
85  //
86  sbICDDevice getDevice(in long deviceIndex);
87 
88  //
89  // @brief Get a device based on its identifier.
90  //
91  sbICDDevice getDeviceFromIdentifier(in ACString aDeviceIdentifier);
92 
93  //
94  // @brief Return an enumeration of all the cd devices.
95  //
97 
98  //
99  // @brief adds a listener to be notified when a device is added/removed
100  //
102 
103  //
104  // @brief removes a listener
105  //
107 };
108 
var D
void onMediaInserted(in sbICDDevice aCDDevice)
readonly attribute long weight
sbICDDevice getDeviceFromIdentifier(in ACString aDeviceIdentifier)
void registerListener(in sbICDDeviceListener listener)
var uuid
void removeListener(in sbICDDeviceListener listener)
nsISimpleEnumerator getCDDevices()
sbICDDevice getDevice(in long deviceIndex)
void onDeviceRemoved(in sbICDDevice aCDDevice)
readonly attribute long nbDevices
void onMediaEjected(in sbICDDevice aCDDevice)