WebAPI/LogAPI

From MozillaWiki
< WebAPI
Revision as of 12:07, 25 April 2012 by Jmcf (talk | contribs)
Jump to navigation Jump to search

Use Cases: To record the history of user activity with the phone, 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;
}

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;
   attribute Date timestamp;             // When this happened
}

interface LogEntry : LogEntryProperties {
}