For more information on the Callhistory features, see Call History Guide.
Since: 2.0
Interface | Method |
---|---|
CallHistoryObject | |
RemoteParty | |
CallHistoryEntry | |
CallHistory | void find (CallHistoryEntryArraySuccessCallback successCallback, optional ErrorCallback? errorCallback, optional AbstractFilter? filter, optional SortMode? sortMode, optional unsigned long? limit, optional unsigned long? offset) void remove (CallHistoryEntry entry) void removeBatch (CallHistoryEntry[] entries, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) void removeAll (optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) long addChangeListener (CallHistoryChangeCallback observer) void removeChangeListener (long handle) |
CallHistoryEntryArraySuccessCallback | void onsuccess (CallHistoryEntry[] entries) |
CallHistoryChangeCallback | void onadded (CallHistoryEntry[] newItems) void onchanged (CallHistoryEntry[] changedItems) void onremoved (DOMString[] removedItems) |
[NoInterfaceObject] interface CallHistoryObject { readonly attribute CallHistory callhistory; };
Tizen implements CallHistoryObject;
Since: 2.0
[NoInterfaceObject] interface RemoteParty { readonly attribute DOMString? remoteParty; readonly attribute PersonId? personId; };
Since: 2.0
Since: 2.0
If the contact cannot be resolved, the value is null. See Contact API for more information.
Since: 2.0
[NoInterfaceObject] interface CallHistoryEntry { readonly attribute DOMString uid; readonly attribute DOMString type; readonly attribute DOMString[]? features; readonly attribute RemoteParty[] remoteParties; readonly attribute Date startTime; readonly attribute unsigned long duration; attribute DOMString direction; readonly attribute DOMString? callingParty; };
Since: 2.0
Since: 2.0
The following values are supported:
Since: 2.0
Since: 2.0
Since: 2.0
Since: 2.0
Since: 2.0
Since: 2.0
It is the device's local phone number - the number assigned to the SIM card (see SystemInfoSIM). If there is more than one SIM card in the device, this attribute can be used to recognize which SIM card was used to make/receive the call.
Since: 2.3
Remark : A null value means that the phone number of the device cannot be retrieved because the device user might not allow this functionality.
[NoInterfaceObject] interface CallHistory { void find(CallHistoryEntryArraySuccessCallback successCallback, optional ErrorCallback? errorCallback, optional AbstractFilter? filter, optional SortMode? sortMode, optional unsigned long? limit, optional unsigned long? offset) raises(WebAPIException); void remove(CallHistoryEntry entry) raises(WebAPIException); void removeBatch(CallHistoryEntry[] entries, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); void removeAll(optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); long addChangeListener(CallHistoryChangeCallback observer) raises(WebAPIException); void removeChangeListener(long handle) raises(WebAPIException); };
Since: 2.0
find
void find(CallHistoryEntryArraySuccessCallback successCallback, optional ErrorCallback? errorCallback, optional AbstractFilter? filter, optional SortMode? sortMode, optional unsigned long? limit, optional unsigned long? offset);
Since: 2.0
The errorCallback() is launched with these error types:
Privilege level: public
Privilege: http://tizen.org/privilege/callhistory.read
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if this functionality is not allowed.
with error type NotSupportedError, if the feature is not supported.
Code example:
// Defines success callback function onSuccess(results) { console.log(results.length + " call history item(s) found!"); for (var i=0; i<results.length; i++) { console.log(i + ". " + results[i].toString()); // process the CallHistoryEntry } } // Defines error callback function onError(error) { console.log("Query failed" + error.name); } // Defines filter: list CS calls, most recent first var filter = new tizen.AttributeFilter("type", "EXACTLY", "TEL"); // Defines sort mode: descending on call start time. var sortMode = new tizen.SortMode("startTime", "DESC"); // Makes the query and wires up the callbacks tizen.callhistory.find(onSuccess, onError, filter, sortMode); var numberfilter = new tizen.AttributeFilter( "remoteParties.remoteParty", "EXACTLY", "123456789"); // Creates a composite filter for time constraints var y2009Filter = new tizen.AttributeRangeFilter( "startTime", new Date(2009, 0, 1), new Date(2010, 0, 1)); var y2011Filter = new tizen.AttributeRangeFilter( "startTime", new Date(2011, 0, 1), new Date(2012, 0, 1)); var datefilter = new tizen.CompositeFilter("UNION", [y2009Filter, y2011Filter]); // Creates a filter to find all video calls (including cellular, skype, etc) // The filter matches any features from the "features" array exactly var tfilter = new tizen.AttributeFilter("features", "EXACTLY", "VIDEOCALL"); // Creates a composite filter var ifilter = new tizen.CompositeFilter("INTERSECTION", [numberFilter, dateFilter, tfilter]); // Makes the query and wires up the callbacks; reuse sortMode tizen.callhistory.find(onSuccess, onError, ifilter, sortMode);
remove
void remove(CallHistoryEntry entry);
Since: 2.0
Privilege level: public
Privilege: http://tizen.org/privilege/callhistory.write
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any input parameter contains invalid values.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
// Defines success callback function onSuccess(results) { if (results.length > 0) tizen.callhistory.remove(results[0]); } // Defines error callback function onError(error) { console.log("Query failed" + error.name); } // Makes the query and wires up the callbacks tizen.callhistory.find(onSuccess, onError);
removeBatch
void removeBatch(CallHistoryEntry[] entries, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
Since: 2.0
The errorCallback() is launched with these error types:
Privilege level: public
Privilege: http://tizen.org/privilege/callhistory.write
Parameters:
Exceptions:
with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if this feature is not supported.
Code example:
// Defines success callback function onSuccess(results) { tizen.callhistory.removeBatch(results); } // Defines error callback function onError(error) { console.log("Query failed" + error.name); } // Makes the query and wires up the callbacks tizen.callhistory.find(onSuccess, onError);
removeAll
void removeAll(optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
Since: 2.0
The errorCallback() is launched with these error types:
Privilege level: public
Privilege: http://tizen.org/privilege/callhistory.write
Parameters:
Exceptions:
with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if this functionality is not allowed.
with error type NotSupportedError, if this feature is not supported.
addChangeListener
long addChangeListener(CallHistoryChangeCallback observer);
Since: 2.0
Privilege level: public
Privilege: http://tizen.org/privilege/callhistory.read
Parameters:
Return value:
long A handle which can be used for unregistering.Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any input parameter contains invalid values.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError, if any other error occurs.
Code example:
var onListenerCB = { onadded: function(newItems) { console.log("New Item added"); for (var i in newItems) { console.log("Item " + i + " startTime: " + newItems[i].startTime); } }, onchanged: function(changedItems) { console.log("Items changed"); for (var i in changedItems) { console.log("Item " + i + " direction: " + changedItems[i].direction); } }, onremoved: function(removedItems) { console.log("Items removed"); for(var i in removedItems) { console.log("Item " + i + " : " + removedItems[i]); } }}; try { // Registers a call history callback var handle = tizen.callhistory.addChangeListener(onListenerCB); // Unregisters a previously registered listener tizen.callhistory.removeChangeListener(handle); } catch (error) { console.log("Exception - code: " + error.name + " message: " + error.message); }
removeChangeListener
void removeChangeListener(long handle);
Since: 2.0
Privilege level: public
Privilege: http://tizen.org/privilege/callhistory.read
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type InvalidValuesError, if any input parameter contains invalid values.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotSupportedError, if the feature is not supported.
with error type UnknownError, if any other error occurs.
[Callback=FunctionOnly, NoInterfaceObject] interface CallHistoryEntryArraySuccessCallback { void onsuccess(CallHistoryEntry[] entries); };
Since: 2.0
onsuccess
void onsuccess(CallHistoryEntry[] entries);
Since: 2.0
Parameters:
[Callback, NoInterfaceObject] interface CallHistoryChangeCallback { void onadded(CallHistoryEntry[] newItems); void onchanged(CallHistoryEntry[] changedItems); void onremoved(DOMString[] removedItems); };
Since: 2.0
onadded
void onadded(CallHistoryEntry[] newItems);
Since: 2.0
Parameters:
onchanged
void onchanged(CallHistoryEntry[] changedItems);
Since: 2.0
Parameters:
onremoved
void onremoved(DOMString[] removedItems);
Since: 2.0
Parameters:
To guarantee that the call log application runs on a device with the telephony feature, declare the following feature requirements in the config file:
module Callhistory { [NoInterfaceObject] interface CallHistoryObject { readonly attribute CallHistory callhistory; }; Tizen implements CallHistoryObject; [NoInterfaceObject] interface RemoteParty { readonly attribute DOMString? remoteParty; readonly attribute PersonId? personId; }; [NoInterfaceObject] interface CallHistoryEntry { readonly attribute DOMString uid; readonly attribute DOMString type; readonly attribute DOMString[]? features; readonly attribute RemoteParty[] remoteParties; readonly attribute Date startTime; readonly attribute unsigned long duration; attribute DOMString direction; readonly attribute DOMString? callingParty; }; [NoInterfaceObject] interface CallHistory { void find(CallHistoryEntryArraySuccessCallback successCallback, optional ErrorCallback? errorCallback, optional AbstractFilter? filter, optional SortMode? sortMode, optional unsigned long? limit, optional unsigned long? offset) raises(WebAPIException); void remove(CallHistoryEntry entry) raises(WebAPIException); void removeBatch(CallHistoryEntry[] entries, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); void removeAll(optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException); long addChangeListener(CallHistoryChangeCallback observer) raises(WebAPIException); void removeChangeListener(long handle) raises(WebAPIException); }; [Callback=FunctionOnly, NoInterfaceObject] interface CallHistoryEntryArraySuccessCallback { void onsuccess(CallHistoryEntry[] entries); }; [Callback, NoInterfaceObject] interface CallHistoryChangeCallback { void onadded(CallHistoryEntry[] newItems); void onchanged(CallHistoryEntry[] changedItems); void onremoved(DOMString[] removedItems); }; };