sbIPlaybackHistoryService Interface Reference

import"sbIPlaybackHistoryService.idl";

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

Public Member Functions

sbIPlaybackHistoryEntry createEntry (in sbIMediaItem aItem, in long long aTimestamp, in long long aDuration, in sbIPropertyArray aAnnotations)
 Create a playback history entry from a media item and a timestamp. More...
 
void addEntry (in sbIPlaybackHistoryEntry aEntry)
 Add an entry to the playback history service. More...
 
void addEntries (in nsIArray aEntries)
 Add entries to the playback history service. More...
 
sbIPlaybackHistoryEntry getEntryByIndex (in long long aIndex)
 Get an entry by index. Negative indexes wrap from the last entry. More...
 
nsIArray getEntriesByIndex (in long long aStartIndex, in unsigned long long aCount)
 Get entries from the playback history service using a start index. Negative indexes wrap from the last entry. More...
 
nsIArray getEntriesByTimestamp (in long long aStartTimestamp, in long long aEndTimestamp)
 Get entries between start timestamp and end timestamp. The range is inclusive. More...
 
void removeEntry (in sbIPlaybackHistoryEntry aEntry)
 Remove an entry from the playback history service. More...
 
void removeEntryByIndex (in long long aIndex)
 Remove an entry from the playback history service using the entry's index. Negative indexes wrap from the last entry. More...
 
void removeEntriesByIndex (in long long aStartIndex, in unsigned long long aCount)
 Remove entries from the playback history service using a start index. Negative indexes wrap from the last entry. More...
 
void removeEntries (in nsIArray aEntries)
 Remove entries from the playback history service. More...
 
nsIArray getEntriesByAnnotation (in AString aAnnotationId, in AString aAnnotationValue, [optional] in unsigned long aCount)
 Get entries by their annotation value. More...
 
nsIArray getEntriesByAnnotations (in sbIPropertyArray aAnnotations, [optional] in unsigned long aCount)
 
void clear ()
 Clear all entries from the playback history service. More...
 
void addListener (in sbIPlaybackHistoryListener aListener)
 Add a listener. More...
 
void removeListener (in sbIPlaybackHistoryListener aListener)
 Remove a listener. More...
 
nsresult addOrUpdateAnnotation (in long long aEntryId, in AString aAnnotationId, in AString aAnnotationValue)
 
nsresult removeAnnotation (in long long aEntryId, in AString aAnnotationId)
 

Public Attributes

readonly attribute
nsISimpleEnumerator 
entries
 Enumerator of all entries in the playback history service. More...
 
readonly attribute unsigned
long long 
entryCount
 Total number of entries in the playback history service. More...
 

Detailed Description

The playback history service stores all entries in reverse chronological order. This means that the most recent entry is always the first when using sbIPlaybackHistoryService::entries.

Getter methods assume that index 0 is the most recent entry.

Definition at line 47 of file sbIPlaybackHistoryService.idl.

Member Function Documentation

void sbIPlaybackHistoryService::addEntries ( in nsIArray  aEntries)

Add entries to the playback history service.

Parameters
aEntriesAn array of sbIPlaybackHistoryEntry objects.
Exceptions
NS_ERROR_INVALID_ARGwhen the array does not contain sbIPlaybackHistoryEntry objects.
void sbIPlaybackHistoryService::addEntry ( in sbIPlaybackHistoryEntry  aEntry)

Add an entry to the playback history service.

Parameters
aEntryThe playback history entry you wish to add.
void sbIPlaybackHistoryService::addListener ( in sbIPlaybackHistoryListener  aListener)

Add a listener.

nsresult sbIPlaybackHistoryService::addOrUpdateAnnotation ( in long long  aEntryId,
in AString  aAnnotationId,
in AString  aAnnotationValue 
)
void sbIPlaybackHistoryService::clear ( )

Clear all entries from the playback history service.

sbIPlaybackHistoryEntry sbIPlaybackHistoryService::createEntry ( in sbIMediaItem  aItem,
in long long  aTimestamp,
in long long  aDuration,
in sbIPropertyArray  aAnnotations 
)

Create a playback history entry from a media item and a timestamp.

Parameters
aItemThe media item for which you wish to create an entry.
aTimestampThe time at which the item was played in UNIX timestamp format.
aDurationThe duration of playback for the item for this entry.
aAnnotationsOptional annotations for the entry.
nsIArray sbIPlaybackHistoryService::getEntriesByAnnotation ( in AString  aAnnotationId,
in AString  aAnnotationValue,
[optional] in unsigned long  aCount 
)

Get entries by their annotation value.

Parameters
aAnnotationIdThe annotation id.
aAnnotationValueThe annotation value.
[optional]aCount The maximum number of entries to return.
Note
Results are ordered from newest to oldest.
nsIArray sbIPlaybackHistoryService::getEntriesByAnnotations ( in sbIPropertyArray  aAnnotations,
[optional] in unsigned long  aCount 
)
nsIArray sbIPlaybackHistoryService::getEntriesByIndex ( in long long  aStartIndex,
in unsigned long long  aCount 
)

Get entries from the playback history service using a start index. Negative indexes wrap from the last entry.

Parameters
aStartIndexThe start index.
aCountThe number of entries you wish to get.
Note
The array will contain sbIPlaybackHistoryEntry objects.
nsIArray sbIPlaybackHistoryService::getEntriesByTimestamp ( in long long  aStartTimestamp,
in long long  aEndTimestamp 
)

Get entries between start timestamp and end timestamp. The range is inclusive.

Parameters
aStartTimestampThe beginning of the range.
aEndTimestampThe end of the range.
Note
The timestamps are standard UNIX style timestamps.
If aStartTimestamp is greater than aEndTimestamp, the results are returned in descending order.
sbIPlaybackHistoryEntry sbIPlaybackHistoryService::getEntryByIndex ( in long long  aIndex)

Get an entry by index. Negative indexes wrap from the last entry.

Parameters
aIndex
nsresult sbIPlaybackHistoryService::removeAnnotation ( in long long  aEntryId,
in AString  aAnnotationId 
)
void sbIPlaybackHistoryService::removeEntries ( in nsIArray  aEntries)

Remove entries from the playback history service.

Parameters
aEntriesAn array of sbIPlaybackHistoryEntry objects to remove.
void sbIPlaybackHistoryService::removeEntriesByIndex ( in long long  aStartIndex,
in unsigned long long  aCount 
)

Remove entries from the playback history service using a start index. Negative indexes wrap from the last entry.

Parameters
aStartIndexThe start index.
aCountThe number of entries you wish to remove.
void sbIPlaybackHistoryService::removeEntry ( in sbIPlaybackHistoryEntry  aEntry)

Remove an entry from the playback history service.

Parameters
aEntryThe entry to remove.
void sbIPlaybackHistoryService::removeEntryByIndex ( in long long  aIndex)

Remove an entry from the playback history service using the entry's index. Negative indexes wrap from the last entry.

Parameters
aIndexThe index of the entry to remove.
void sbIPlaybackHistoryService::removeListener ( in sbIPlaybackHistoryListener  aListener)

Remove a listener.

Member Data Documentation

readonly attribute nsISimpleEnumerator sbIPlaybackHistoryService::entries

Enumerator of all entries in the playback history service.

Note
The enumerator will contain sbIPlaybackHistoryEntry objects.

Definition at line 53 of file sbIPlaybackHistoryService.idl.

readonly attribute unsigned long long sbIPlaybackHistoryService::entryCount

Total number of entries in the playback history service.

Definition at line 58 of file sbIPlaybackHistoryService.idl.


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