sbILibrary.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-2008 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 
33 #include "sbIMediaList.idl"
34 
35 interface nsIArray;
36 interface nsIChannel;
37 interface nsIPropertyBag2;
38 interface nsIStringEnumerator;
39 interface nsIURI;
40 interface sbIDevice;
41 interface sbILibraryFactory;
42 interface sbIMediaItem;
43 interface sbIMediaListFactory;
44 
49 [scriptable, uuid(923514f0-0845-431f-86d4-3a073c6a0a98)]
51 {
58  void onProgress(in unsigned long aIndex);
59 
67  void onComplete(in nsIArray aMediaItems,
68  in unsigned long aResult);
69 };
70 
81 [scriptable, uuid(cf0b3ffd-bdc6-4319-a13a-1ad82560230a)]
83 {
87  readonly attribute sbIDevice device;
88 
92  readonly attribute boolean supportsForeignMediaItems;
93 
97  readonly attribute nsIPropertyBag2 creationParameters;
98 
102  readonly attribute sbILibraryFactory factory;
103 
118  boolean containsItemWithSameIdentity(in sbIMediaItem aMediaItem);
119 
134  nsIArray getItemsWithSameIdentity(in sbIMediaItem aMediaItem);
135 
142  nsIChannel resolve(in nsIURI aUri);
143 
157  sbIMediaItem createMediaItem(in nsIURI aContentUri,
158  [optional] in sbIPropertyArray aProperties,
159  [optional] in boolean aAllowDuplicates);
160 
167  boolean createMediaItemIfNotExist(in nsIURI aContentUri,
168  [optional] in sbIPropertyArray aProperties,
169  [optional] out sbIMediaItem aResultItem);
170 
179  sbIMediaList createMediaList(in AString aType,
180  [optional] in sbIPropertyArray aProperties);
181 
191  sbIMediaList copyMediaList(in AString aType,
192  in sbIMediaList aSource,
193  in boolean aDontCopyContent);
194 
200  sbIMediaItem getMediaItem(in AString aGuid);
201 
209  sbIMediaItem getDuplicate(in sbIMediaItem aMediaItem);
210 
216  void clearItems();
217 
221  void clearItemsByType(in AString aContentType);
222 
227 
234 
238 /*
239  AString getPreferedAudioMimeType();
240  AString getPreferedVideoMimeType();
241 */
242 
250  void optimize([optional] in boolean aAnalyzeOnly);
251 
255  void flush();
256 
270  nsIArray batchCreateMediaItems(in nsIArray aURIArray,
271  [optional] in nsIArray aPropertyArrayArray,
272  [optional] in boolean aAllowDuplicates);
273 
287  (in nsIArray aURIArray,
288  [optional] in nsIArray aPropertyArrayArray,
289  [optional] out nsIArray aResultItemArray);
290 
304  in nsIArray aURIArray,
305  [optional] in nsIArray aPropertyArrayArray,
306  [optional] in boolean aAllowDuplicates);
307 };
readonly attribute nsIStringEnumerator mediaListTypes
A list of available media list types.
Definition: sbILibrary.idl:226
void clearItemsByType(in AString aContentType)
Clear items of a certain CONTENT_TYPE (see sbStandardProperties.h).
readonly attribute sbIDevice device
Reference to the device that this library is stored on.
Definition: sbILibrary.idl:87
void optimize([optional] in boolean aAnalyzeOnly)
Called when the library should remove unsupported media list types, unknown property types...
Definition of the sbIMediaList interface.
Factory for new library instances.
Factory for new media list instances.
sbIMediaItem getMediaItem(in AString aGuid)
Get a media item.
readonly attribute nsIPropertyBag2 creationParameters
Holds the parameters with which this library was created.
Definition: sbILibrary.idl:97
var uuid
A brief description of the contents of this interface.
nsIChannel resolve(in nsIURI aUri)
Resolves a songbird schemed URL to a channel. Throws an exception if the item referenced in the URL i...
void registerMediaListFactory(in sbIMediaListFactory aFactory)
Register a new media list type at run time.
nsIArray batchCreateMediaItems(in nsIArray aURIArray, [optional] in nsIArray aPropertyArrayArray, [optional] in boolean aAllowDuplicates)
Create many media items from a list of URIs, and notify their addition.
nsIArray getItemsWithSameIdentity(in sbIMediaItem aMediaItem)
Find mediaitems in the library that have the same identity as aMediaItem. Returns an empty array if n...
const nsIChannel
boolean createMediaItemIfNotExist(in nsIURI aContentUri, [optional] in sbIPropertyArray aProperties, [optional] out sbIMediaItem aResultItem)
Create a new media item, disallowing duplicates, and return if it did.
void onProgress(in unsigned long aIndex)
Called periodically to provide progress updates for the batch operation.
void batchCreateMediaItemsAsync(in sbIBatchCreateMediaItemsListener aListener, in nsIArray aURIArray, [optional] in nsIArray aPropertyArrayArray, [optional] in boolean aAllowDuplicates)
Asychronously create many media items from a list of URIs.
Media library abstraction.
Definition: sbILibrary.idl:82
void flush()
Called when the library should save any cached data to disk.
sbIMediaItem getDuplicate(in sbIMediaItem aMediaItem)
Search for and return a duplicate of the media item specified by aMediaItem.
Callback for batch media create items.
Definition: sbILibrary.idl:50
readonly attribute boolean supportsForeignMediaItems
Declares if this library will host foreign media items.
Definition: sbILibrary.idl:92
void onComplete(in nsIArray aMediaItems, in unsigned long aResult)
Called when batch operation is complete.
boolean containsItemWithSameIdentity(in sbIMediaItem aMediaItem)
Checks if another mediaitem with the same identity as aMediaItem is already present in the library...
void clearItems()
Clear all media items (excluding medialists) from the library.
Interface that defines a single item of media in the system.
sbIMediaItem createMediaItem(in nsIURI aContentUri, [optional] in sbIPropertyArray aProperties, [optional] in boolean aAllowDuplicates)
Creates a new media item aContentUri The URI pointing to the content of the new media item...
nsIArray batchCreateMediaItemsIfNotExist(in nsIArray aURIArray, [optional] in nsIArray aPropertyArrayArray, [optional] out nsIArray aResultItemArray)
Create many media items from a list of URIs, disallowing duplicates, and return which items were crea...
An interface to carry around arrays of nsIProperty instances. Users of this interface should only QI ...
readonly attribute sbILibraryFactory factory
Holds the factory that created this library.
Definition: sbILibrary.idl:102
sbIMediaList copyMediaList(in AString aType, in sbIMediaList aSource, in boolean aDontCopyContent)
Creates a new media list.
sbIMediaList createMediaList(in AString aType, [optional] in sbIPropertyArray aProperties)
Creates a new media list.