W3C home > Mailing lists > Public > public-device-apis@w3.org > December 2009

[contacts] PutForwards for complex contact attributes

From: <richard.tibbett@orange-ftgroup.com>
Date: Mon, 21 Dec 2009 18:11:13 +0100
Message-ID: <355A518BC0575547B2A3D6773AAF8EEF7764E9@ftrdmel1>
To: <public-device-apis@w3.org>
Hi,

Looking in to the WebIDL documentation I see some value in using
PutForwards [1] for Contacts API [2] 'complex' attributes.

The intention is to increase the simplicity for developers to work with
ContactField-based attributes (e.g. currently these are phones, emails,
impps attributes in the Contact interface):

The intention is for...

contact.phones.push({value:'+440000000001'}); // add a new value,
relying on the existing mechanism

...to become equivalent to:

contact.phones.push('+440000000001'); // ...add a new value, relying on
a PutForwards helper mechanism to set the resulting 'value' attribute to
'+440000000001'.


My question is a.) whether this is of interest for this API, and b.) how
it can be correctly defined in WebIDL based on the nature of the
attribute (an Array). 

Currently I have the following markup in mind:

interface ContactField {
    attribute DOMString[]? types;
    attribute DOMString    value;
};
interface ContactProperties {
    ...
    [PutForwards=value] readonly attribute ContactField[] phones;
    ...
};

Is this specified correctly???

This could require clarification via the WebIDL mailing list but
worthwhile getting feedback from DAP participants on the proposed helper
mechanism first...

Best Regards,

Richard

[1] http://dev.w3.org/2006/webapi/WebIDL/#PutForwards

[2] http://dev.w3.org/2009/dap/contacts/
Received on Monday, 21 December 2009 17:11:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:03 GMT