WebAPI/LogAPI: Difference between revisions
< WebAPI
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
DOMRequest removeOld(DOMTimestamp to,optional DOMString contactId) | DOMRequest removeOld(DOMTimestamp to,optional DOMString contactId) | ||
DOMRequest getLast(LogOptions options); | DOMRequest getLast(LogOptions options); | ||
DOMRequest find(LogFindOptions options); | |||
attribute Function onentryadded; | attribute Function onentryadded; | ||
}; | }; | ||
Line 18: | Line 16: | ||
attribute unsigned long maxRecords; | attribute unsigned long maxRecords; | ||
attribute DOMString contactId; | attribute DOMString contactId; | ||
}; | |||
dictionary LogFindOptions : LogOptions { | |||
attribute Date from; | |||
attribute Date to; | |||
attribute DOMString service; | |||
}; | }; | ||
Revision as of 15:54, 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 of this API
interface LogManager : EventTarget { DOMRequest add(LogEntry entry); DOMRequest remove(DOMString entryId); DOMRequest removeOld(DOMTimestamp to,optional DOMString contactId) DOMRequest getLast(LogOptions options); DOMRequest find(LogFindOptions options); attribute Function onentryadded; }; dictionary LogOptions { attribute unsigned long maxRecords; attribute DOMString contactId; }; dictionary LogFindOptions : LogOptions { attribute Date from; attribute Date to; attribute DOMString service; }; interface LogEntryProperties { attribute DOMString type; // oneOf ['incoming', 'outgoing'] attribute DOMString[] contactId; // ContactId attribute DOMString[] tel; // Tel number if not already in contacts attribute DOMString objectId; // Object id (for example SMS message) attribute DOMString service; // oneOf ['SMS', 'Telephony', 'Facebook', 'Twitter'] attribute DOMString title; attribute DOMString description; attribute any extra; }; [Constructor(in LogEntryProperties properties)] interface LogEntry : LogEntryProperties { readonly attribute DOMString id; readonly attribute DOMTimestamp timestamp; // When this happened };