sbIDeviceLibrary.idl
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2011 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
27 #include "sbILibrary.idl"
28 #include "nsISupports.idl"
29 
30 interface nsIArray;
31 interface sbIMediaItem;
32 interface sbIMediaList;
33 interface sbIPropertyArray;
34 interface nsIURI;
35 interface nsIFile;
37 
45 [scriptable, uuid(b97b4384-b3c6-4418-5fd5-7553859aad22)]
47 {
58  void onBatchBegin(in sbIMediaList aMediaList);
59 
69  void onBatchEnd(in sbIMediaList aMediaList);
70 
83  boolean onItemAdded(in sbIMediaList aMediaList,
84  in sbIMediaItem aMediaItem,
85  in unsigned long aIndex);
86 
97  boolean onBeforeItemRemoved(in sbIMediaList aMediaList,
98  in sbIMediaItem aMediaItem,
99  in unsigned long aIndex);
100 
111  boolean onAfterItemRemoved(in sbIMediaList aMediaList,
112  in sbIMediaItem aMediaItem,
113  in unsigned long aIndex);
114 
124  boolean onBeforeListCleared(in sbIMediaList aMediaList,
125  in boolean aExcludeLists);
126 
136  boolean onListCleared(in sbIMediaList aMediaList,
137  in boolean aExcludeLists);
138 
149  boolean onItemUpdated(in sbIMediaList aMediaList,
150  in sbIMediaItem aMediaItem,
151  in sbIPropertyArray aProperties);
152 
162  boolean onItemMoved(in sbIMediaList aMediaList,
163  in unsigned long aFromIndex,
164  in unsigned long aToIndex);
165 
171  void onItemCopied(in sbIMediaItem aSourceItem,
172  in sbIMediaItem aDestItem);
173 
174 
184  boolean onBeforeCreateMediaItem(in nsIURI aContentUri,
185  [optional] in sbIPropertyArray aProperties,
186  [optional] in boolean aAllowDuplicates);
187 
192  boolean onBeforeCreateMediaList(in AString aType,
193  [optional] in sbIPropertyArray aProperties);
194 
199  boolean onBeforeAdd(in sbIMediaItem aMediaItem);
200 
205  boolean onBeforeAddAll(in sbIMediaList aMediaList);
206 
211  boolean onBeforeAddSome(in nsISimpleEnumerator aMediaItems);
212 
217  boolean onBeforeClear();
218 };
219 
224 [scriptable, uuid(e40c58fa-5adf-434c-79a4-27c153101c9e)]
226 {
231  void initialize(in AString aLibraryId);
232 
236  void finalize();
237 
242  const unsigned long MGMT_PREF_UNINITIALIZED = 0;
247  const unsigned long MEDIATYPE_UNKNOWN = 0x0A;
248 
249  const unsigned long MEDIATYPE_AUDIO = 0x00;
250 
251  const unsigned long MEDIATYPE_VIDEO = 0x01;
252 
253  const unsigned long MEDIATYPE_IMAGE = 0x02;
254 
255  const unsigned long MEDIATYPE_COUNT = 0x03;
256 
263 
264  /***************************************************************
265  * Following functions are convenience functions for the UI
266  * An alternative option would be to make this mainstream and
267  * have syncSettings return a live object and make it read-only
268  */
269 
278  nsIArray getSyncFolderListByType(in unsigned long aContentType);
279 
288  void setSyncFolderListByType(in unsigned long aContentType,
289  in nsIArray aFolderList);
290 
298  void sync();
299 
300 
306 
312 };
boolean onBeforeAdd(in sbIMediaItem aMediaItem)
Called before an item is added.
void onItemCopied(in sbIMediaItem aSourceItem, in sbIMediaItem aDestItem)
Called when a media item has been copied.
Definition of the sbILibrary interface.
boolean onListCleared(in sbIMediaList aMediaList, in boolean aExcludeLists)
boolean onBeforeAddAll(in sbIMediaList aMediaList)
Called before all item from a list are added.
void setSyncFolderListByType(in unsigned long aContentType, in nsIArray aFolderList)
Set the list of folders with content type aContentType the user wants to sync from his disk to the de...
const unsigned long MEDIATYPE_UNKNOWN
boolean onItemAdded(in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
Called when a media item is added to a list, through add or addAll.
var uuid
A brief description of the contents of this interface.
Interface used to listen to changes to a device library.
const unsigned long MEDIATYPE_AUDIO
void onBatchBegin(in sbIMediaList aMediaList)
Called when the library is about to perform multiple operations at once.
const unsigned long MGMT_PREF_UNINITIALIZED
const unsigned long MEDIATYPE_IMAGE
const unsigned long MEDIATYPE_VIDEO
boolean onBeforeCreateMediaItem(in nsIURI aContentUri, [optional] in sbIPropertyArray aProperties, [optional] in boolean aAllowDuplicates)
Called before a media item is going to be created.
boolean onAfterItemRemoved(in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
Called after a media item has been removed from a list, through remove, removeAll or removeByIndex...
void addDeviceLibraryListener(in sbIDeviceLibraryListener aListener)
Add a listener to this device library.
void sync()
Initiates a sync operation on this library.
void initialize(in AString aLibraryId)
Initialize the device library.
boolean onBeforeCreateMediaList(in AString aType, [optional] in sbIPropertyArray aProperties)
Called before a media list is going to be created.
nsIArray getSyncFolderListByType(in unsigned long aContentType)
Return the list of folders with content type aContentType the user wants to sync from his disk to the...
boolean onBeforeItemRemoved(in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in unsigned long aIndex)
Called before a media item is removed from a list, through remove, removeAll or removeByIndex.
boolean onItemMoved(in sbIMediaList aMediaList, in unsigned long aFromIndex, in unsigned long aToIndex)
Called when a media item is moved.
boolean onBeforeAddSome(in nsISimpleEnumerator aMediaItems)
Called before some items are added.
void onBatchEnd(in sbIMediaList aMediaList)
Called when the library has finished performing multiple operations at once.
Media library abstraction.
Definition: sbILibrary.idl:82
attribute sbIDeviceLibrarySyncSettings syncSettings
boolean onItemUpdated(in sbIMediaList aMediaList, in sbIMediaItem aMediaItem, in sbIPropertyArray aProperties)
Called when a media item is changed.
boolean onBeforeClear()
Called before the device is cleared.
boolean onBeforeListCleared(in sbIMediaList aMediaList, in boolean aExcludeLists)
void removeDeviceLibraryListener(in sbIDeviceLibraryListener aListener)
Remove a listener from this device library.
Interface that defines a single item of media in the system.
An interface to carry around arrays of nsIProperty instances. Users of this interface should only QI ...
const unsigned long MEDIATYPE_COUNT
void finalize()
Finalize the device library.