WebAPI/LogAPI: Difference between revisions
< WebAPI
Jump to navigation
Jump to search
(→WebIDL) |
(→WebIDL) |
||
Line 24: | Line 24: | ||
}; | }; | ||
interface LogIterator | interface LogIterator { | ||
{ | |||
DOMRequest next(optional unsigned short n); | DOMRequest next(optional unsigned short n); | ||
attribute unsigned long position; | attribute unsigned long position; | ||
}; | }; | ||
dictionary LogFindOptions { | |||
dictionary LogFindOptions | |||
{ | |||
attribute unsigned long maxRecords; | attribute unsigned long maxRecords; | ||
attribute DOMString contactId; | attribute DOMString contactId; | ||
Line 40: | Line 37: | ||
}; | }; | ||
interface LogEntryProperties | interface LogEntryProperties { | ||
{ | |||
attribute DOMString type; // possible values: ['incoming', 'outgoing''] | attribute DOMString type; // possible values: ['incoming', 'outgoing''] | ||
attribute DOMString status; // [missed, new] | attribute DOMString status; // [missed, new] | ||
Line 54: | Line 50: | ||
[Constructor(LogEntryProperties properties)] | [Constructor(LogEntryProperties properties)] | ||
interface LogEntry : LogEntryProperties | interface LogEntry : LogEntryProperties { | ||
{ | |||
readonly attribute DOMString id; | readonly attribute DOMString id; | ||
readonly attribute DOMTimestamp timestamp; // When this happened | readonly attribute DOMTimestamp timestamp; // When this happened | ||
}; | }; |
Revision as of 21:41, 25 April 2012
Use Cases
To record the history of user activity with the device, particularly with communication services (Phone Calls, Messages, Social Networks, etc.)
Consumers
- Comms Log Application (Global for the user and per-contact)
Producers
- Dialer, SMS, e-mail, Facebook, Twitter, ...
WebIDL
interface LogManager : EventTarget { DOMRequest put(LogEntry entry); DOMRequest delete(DOMString entryId); DOMRequest clear(LogClearOptions coptions); // Entries are always returned ordered by timestamp DOMRequest find(LogFindOptions options); attribute Function onentryadded; }; interface LogIterator { DOMRequest next(optional unsigned short n); attribute unsigned long position; }; dictionary LogFindOptions { attribute unsigned long maxRecords; attribute DOMString contactId; attribute Date from; attribute Date to; attribute DOMString service; }; interface LogEntryProperties { attribute DOMString type; // possible values: ['incoming', 'outgoing] attribute DOMString status; // [missed, new] attribute DOMString[] contactId; // ContactId attribute DOMString[] tel; // Tel number if not in contacts attribute DOMString objectId; // Object id (for example SMS message on the SMS database) attribute DOMString service; // oneOf ['SMS', 'Telephony', 'Facebook', 'Twitter'] attribute DOMString title; attribute DOMString description; attribute any extra; // Any extra data to be used by applications }; [Constructor(LogEntryProperties properties)] interface LogEntry : LogEntryProperties { readonly attribute DOMString id; readonly attribute DOMTimestamp timestamp; // When this happened };