sbIMetadataHandler Interface Reference

An object capable of manipulating the metadata tags for a media file. More...

import"sbIMetadataHandler.idl";

Inheritance diagram for sbIMetadataHandler:
[legend]
Collaboration diagram for sbIMetadataHandler:
[legend]

Public Member Functions

PRInt32 vote (in AString aUrl)
 Vote to be the handler returned for the given url. More...
 
PRInt32 read ()
 Start the read operation. More...
 
PRInt32 write ()
 Start the write operation. More...
 
void getImageData (in PRInt32 aType, out AUTF8String aMimeType, out unsigned long aDataLen, [array, retval, size_is(aDataLen)] out octet aData)
 
void setImageData (in PRInt32 aType, in AString aUrl)
 
void onChannelData (in nsISupports aChannel)
 Be thou informst that one's sbIMetadataChannel has just received data. More...
 
void close ()
 Close down the internals of the handler, stop any asynchronous operations, free any allocations. More...
 

Public Attributes

const PRUint32 METADATA_IMAGE_TYPE_OTHER = 0x00
 Constant for the type of image in the metadata, these are pulled from the taglib/attachedpictureframe.h. More...
 
const PRUint32 METADATA_IMAGE_TYPE_FILEICON = 0x01
 
const PRUint32 METADATA_IMAGE_TYPE_OTHERFILEICON = 0x02
 
const PRUint32 METADATA_IMAGE_TYPE_FRONTCOVER = 0x03
 
const PRUint32 METADATA_IMAGE_TYPE_BACKCOVER = 0x04
 
const PRUint32 METADATA_IMAGE_TYPE_LEAFLETPAGE = 0x05
 
const PRUint32 METADATA_IMAGE_TYPE_MEDIA = 0x06
 
const PRUint32 METADATA_IMAGE_TYPE_LEADARTIST = 0x07
 
const PRUint32 METADATA_IMAGE_TYPE_ARTIST = 0x08
 
const PRUint32 METADATA_IMAGE_TYPE_CONDUCTOR = 0x09
 
const PRUint32 METADATA_IMAGE_TYPE_BAND = 0x0A
 
const PRUint32 METADATA_IMAGE_TYPE_COMPOSER = 0x0B
 
const PRUint32 METADATA_IMAGE_TYPE_LYRICIST = 0x0C
 
const PRUint32 METADATA_IMAGE_TYPE_RECORDINGLOCATION = 0x0D
 
const PRUint32 METADATA_IMAGE_TYPE_DURINGRECORDING = 0x0E
 
const PRUint32 METADATA_IMAGE_TYPE_DURINGPERFORMANCE = 0x0F
 
const PRUint32 METADATA_IMAGE_TYPE_MOVIESCREENCAPTURE = 0x10
 
const PRUint32 METADATA_IMAGE_TYPE_COLOUREDFISH = 0x11
 
const PRUint32 METADATA_IMAGE_TYPE_ILLUSTRATION = 0x12
 
const PRUint32 METADATA_IMAGE_TYPE_BANDLOGO = 0x13
 
const PRUint32 METADATA_IMAGE_TYPE_PUBLISHERLOGO = 0x14
 
readonly attribute ACString contractID
 The Contract ID for the metadata handler. More...
 
attribute sbIMutablePropertyArray props
 An array of metadata properties. More...
 
readonly attribute PRBool completed
 Whether or not the object has completed its read/write operation. More...
 
readonly attribute PRBool requiresMainThread
 Whether or not this handler MUST be run on the main thread. More...
 
attribute nsIChannel channel
 The object's nsIChannel. More...
 

Detailed Description

An object capable of manipulating the metadata tags for a media file.

User code requests a handler by calling sbIMetadataManager::getHandlerForMediaURL that then returns one of these.

See Also
sbIMetadataManager

Definition at line 45 of file sbIMetadataHandler.idl.

Member Function Documentation

void sbIMetadataHandler::close ( )

Close down the internals of the handler, stop any asynchronous operations, free any allocations.

void sbIMetadataHandler::getImageData ( in PRInt32  aType,
out AUTF8String  aMimeType,
out unsigned long  aDataLen,
[array, retval, size_is(aDataLen)] out octet  aData 
)
void sbIMetadataHandler::onChannelData ( in nsISupports  aChannel)

Be thou informst that one's sbIMetadataChannel has just received data.

Every time the underlying nsIChannel dumps data on the sbIMetadataChannel, plus once more for when the nsIChannel reports a stop condition.

This is a chance for the handler code to attempt to parse the datastream.

Parameters
aChannelThe sbIMetadataChannel delivering data. You'll have to QI for it. consider removing. sbIMetadataChannel appears to be unused.
PRInt32 sbIMetadataHandler::read ( )

Start the read operation.

After getting a handler from the sbIMetadataManager, the user code usually calls read upon it, immediately. The implementor may choose to handle the request immediately or asynchronously.

Returns
-1 if operating asynchronously, otherwise the number of metadata values read (0 on failure)
void sbIMetadataHandler::setImageData ( in PRInt32  aType,
in AString  aUrl 
)
PRInt32 sbIMetadataHandler::vote ( in AString  aUrl)

Vote to be the handler returned for the given url.

The sbIMetadataManager will instantiate one of every sbIMetadataHandler subclass and ask it to vote on the given url. Whichever handler returns the highest vote will be used as the handler for the url.

Values less than zero cause that handler to be ignored.

At the moment, our handlers return -1, 0, or 1 (for "no," "maybe," and "yes").

Parameters
aUrlThe url upon which one should vote
Returns
The vote
See Also
sbIMetadataManager
PRInt32 sbIMetadataHandler::write ( )

Start the write operation.

After getting a handler from the sbIMetadataManager, the user code may set an sbIPropertyArray object into the handler and then call write to write the abstract metadata map into the specific metadata requirements of the file format supported by the handler.

Note that the number of items written may not always equal the number of items in the sbIPropertyArray object if the underlying file format does not support the given keys.

Returns
-1 if operating asynchronously, otherwise the number of metadata values written (0 on failure)

Member Data Documentation

attribute nsIChannel sbIMetadataHandler::channel

The object's nsIChannel.

The object is assigned an nsIChannel from the sbIMetadataManager after it has successfully voted for an url. In the Read call, the implementor may choose to pull the url from the channel and use that directly, or open the channel (either itself or using an sbIMetadataChannel as a helper) and stream the data to be parsed.

In general, for local files, it is faster to pull the url and handle the metadata read immediately rather than open the channel. For remote files, it's far easier to just use the channel infrastructure already setup.

Definition at line 120 of file sbIMetadataHandler.idl.

readonly attribute PRBool sbIMetadataHandler::completed

Whether or not the object has completed its read/write operation.

This value is false until the handler completes its read/write operation.

It is up to the implementor to determine if read/write calls should operate asynchronously or by blocking. The user of the handler should not attempt to get the sbIPropertyArray object before the operation is completed.

Definition at line 97 of file sbIMetadataHandler.idl.

readonly attribute ACString sbIMetadataHandler::contractID

The Contract ID for the metadata handler.

Definition at line 76 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_ARTIST = 0x08

Definition at line 59 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_BACKCOVER = 0x04

Definition at line 55 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_BAND = 0x0A

Definition at line 61 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_BANDLOGO = 0x13

Definition at line 70 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_COLOUREDFISH = 0x11

Definition at line 68 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_COMPOSER = 0x0B

Definition at line 62 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_CONDUCTOR = 0x09

Definition at line 60 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_DURINGPERFORMANCE = 0x0F

Definition at line 66 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_DURINGRECORDING = 0x0E

Definition at line 65 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_FILEICON = 0x01

Definition at line 52 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_FRONTCOVER = 0x03

Definition at line 54 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_ILLUSTRATION = 0x12

Definition at line 69 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_LEADARTIST = 0x07

Definition at line 58 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_LEAFLETPAGE = 0x05

Definition at line 56 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_LYRICIST = 0x0C

Definition at line 63 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_MEDIA = 0x06

Definition at line 57 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_MOVIESCREENCAPTURE = 0x10

Definition at line 67 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_OTHER = 0x00

Constant for the type of image in the metadata, these are pulled from the taglib/attachedpictureframe.h.

Definition at line 51 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_OTHERFILEICON = 0x02

Definition at line 53 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_PUBLISHERLOGO = 0x14

Definition at line 71 of file sbIMetadataHandler.idl.

const PRUint32 sbIMetadataHandler::METADATA_IMAGE_TYPE_RECORDINGLOCATION = 0x0D

Definition at line 64 of file sbIMetadataHandler.idl.

attribute sbIMutablePropertyArray sbIMetadataHandler::props

An array of metadata properties.

Metadata properties read from or to be written to the file.

When the handler has successfully completed its read() operation, the values attribute will be filled with the metadata from the url.

Definition at line 86 of file sbIMetadataHandler.idl.

readonly attribute PRBool sbIMetadataHandler::requiresMainThread

Whether or not this handler MUST be run on the main thread.

Since nsIChannel and other dependencies are not thread safe, some sbIMetadataHandler implementations can not be run on background threads.

Definition at line 105 of file sbIMetadataHandler.idl.


The documentation for this interface was generated from the following file: