WebAPI/LogAPI: Difference between revisions
< WebAPI
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
attribute maxEntriesPerDay; | attribute maxEntriesPerDay; | ||
attribute maxEntriesPerUser; | attribute maxEntriesPerUser; | ||
} | }; | ||
dictionary LogOptions { | |||
}; | |||
interface LogEntryProperties { | interface LogEntryProperties { | ||
Line 20: | Line 23: | ||
attribute DOMString title; | attribute DOMString title; | ||
attribute DOMString description; | attribute DOMString description; | ||
} | }; | ||
[Constructor(in LogEntryProperties properties)] | [Constructor(in LogEntryProperties properties)] | ||
Line 26: | Line 29: | ||
readonly attribute DOMString id; | readonly attribute DOMString id; | ||
readonly attribute Date timestamp; // When this happened | readonly attribute Date timestamp; // When this happened | ||
} | }; | ||
</pre> | </pre> |
Revision as of 12:14, 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.)
interface LogsManager { DOMRequest add(in LogEntry entry); DOMRequest remove(DOMString entryId); DOMRequest removeOld(DOMTimestamp to,optional DOMString contactId) DOMRequest getLast(unsigned long number,); attribute maxEntriesPerDay; attribute maxEntriesPerUser; }; dictionary LogOptions { }; 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'] attribute DOMString title; attribute DOMString description; }; [Constructor(in LogEntryProperties properties)] interface LogEntry : LogEntryProperties { readonly attribute DOMString id; readonly attribute Date timestamp; // When this happened };