Bondi logo

Bondi WebIDL - Version 1.1 Candidate Release

26 October 2009


WebIDL
module appconfig {
    interface AppConfigManager {
        DOMString get (in DOMString key)
            raises (SecurityError);
        void set (in DOMString key,
                in DOMString value)
            raises (SecurityError);
    };
    interface AppConfigManagerObject {
        readonly attribute AppConfigManager appConfigManager;
    };
    Bondi implements AppConfigManagerObject;
};

module applauncher {
    [Callback=FunctionOnly, NoInterfaceObject] interface AppLauncherSuccessCallback {
        void onSuccess (in StringArray obj);
    };
    interface AppLauncherManager {
        PendingOperation launchApplication (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in DOMString appURI,
                [Optional] in StringArray params)
            raises (SecurityError, DeviceAPIError);
        PendingOperation getInstalledApplications (in AppLauncherSuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (DeviceAPIError);
        DOMString getDefaultApplication (in DOMString mimeType)
            raises (DeviceAPIError);
    };
    interface AppLauncherManagerObject {
        readonly attribute AppLauncherManager appLauncherManager;
    };
    Bondi implements AppLauncherManagerObject;
};

module camera {
    typedef sequence<Camera> CameraArray;
    typedef sequence<CameraFeature> CameraFeatureArray;
    typedef sequence<FeatureValue> FeatureValueArray;
    [Callback=FunctionOnly, NoInterfaceObject] interface CameraSuccessCallback {
        void onSuccess (in DOMString file);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface CamerasRetrievedSuccessCallback {
        void onSuccess (in CameraArray cameras);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface CameraLifeVideoSuccessCallback {
        void onSuccess (in DOMString identifier);
    };
    interface CameraError : GenericError {
        const unsigned short CAMERA_ALREADY_IN_USE_ERROR = 0;
        const unsigned short CAMERA_CAPTURE_ERROR = 1;
        const unsigned short CAMERA_LIFEVIDEO_ERROR = 2;
    };
    interface CameraManager {
        PendingOperation getCameras (in CamerasRetrievedSuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (SecurityError, DeviceAPIError);
    };
    interface CaptureOptions {
        attribute unsigned short width;
        attribute unsigned short height;
        attribute unsigned short frameRate;
        attribute DOMString mimeType;
        attribute boolean audio;
        attribute unsigned long maximumBitrate;
    };
    interface FeatureValue {
        attribute long value;
        attribute DOMString description;
    };
    interface CameraFeature {
        const short FEATURETYPE_INTERVALL = 0;
        const short FEATURETYPE_BINARY = 1;
        const short FEATURETYPE_ENUMERATION = 2;
        attribute DOMString description;
        attribute long id;
        attribute unsigned short type;
        attribute FeatureValue value;
        attribute FeatureValue default;
        attribute FeatureValueArray possibleValues;
    };
    interface Camera {
        const unsigned short ZOOM = 0;
        const unsigned short ZOOM_NOZOOM = 1;
        const unsigned short CONTRAST = 2;
        const unsigned short BRIGHTNESS = 3;
        const unsigned short COLORTEMPERATURE = 4;
        const unsigned short NIGHTMODE = 5;
        const unsigned short NIGHTMODE_OFF = 0;
        const unsigned short NIGHTMODE_ON = 1;
        const unsigned short MANUALFOCUS = 6;
        const unsigned short MANUALFOCUS_ON = 1;
        const unsigned short MANUALFOCUS_OFF = 0;
        const unsigned short FOCUS = 7;
        const unsigned short LIGHT = 8;
        const unsigned short LIGHT_OFF = 0;
        const unsigned short LIGHT_ON = 1;
        const unsigned short FLASH = 9;
        const unsigned short FLASH_NO_FLASH = 0;
        const unsigned short FLASH_AUTOFLASH = 1;
        const unsigned short FLASH_FORCEDFLASH = 2;
        readonly attribute DOMString description;
        CameraFeatureArray getSupportedFeatures ();
        void setFeature (in unsigned short featureID,
                in unsigned short valueID)
            raises (DeviceAPIError);
        PendingOperation requestLifeVideo (in CameraLifeVideoSuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (SecurityError, DeviceAPIError);
        PendingOperation takePicture (in CameraSuccessCallback successCallback,
                in ErrorCallback errorCallback,
                [Optional] in CaptureOptions options)
            raises (SecurityError, DeviceAPIError, CameraError);
        PendingOperation startVideo (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                [Optional] in CaptureOptions options)
            raises (SecurityError, DeviceAPIError, CameraError);
        PendingOperation stopVideo (in CameraSuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (DeviceAPIError, CameraError);
    };
    interface CameraManagerObject {
        readonly attribute CameraManager cameraManager;
    };
    Bondi implements CameraManagerObject;
};

module commlog {
    typedef sequence<SMS> SMSArray;
    typedef sequence<MMS> MMSArray;
    typedef sequence<Email> EmailArray;
    typedef sequence<Call> CallArray;
    [Callback=FunctionOnly, NoInterfaceObject] interface CommLogSMSSuccessCallback {
        void onSuccess (in SMSArray obj);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface CommLogMMSSuccessCallback {
        void onSuccess (in MMSArray obj);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface CommLogEmailSuccessCallback {
        void onSuccess (in EmailArray obj);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface CommLogCallSuccessCallback {
        void onSuccess (in CallArray obj);
    };
    interface CommLogManager {
        const unsigned short INBOX_FOLDER = 0;
        const unsigned short OUTBOX_FOLDER = 1;
        const unsigned short SENT_FOLDER = 2;
        const unsigned short DRAFT_FOLDER = 3;
        const unsigned short MISSED_CALLS_FOLDER = 0;
        const unsigned short RECEIVED_CALLS_FOLDER = 1;
        const unsigned short INITIATED_CALLS_FOLDER = 2;
        const unsigned short MESSAGE_TYPE_SMS = 0;
        const unsigned short MESSAGE_TYPE_MMS = 1;
        const unsigned short MESSAGE_TYPE_EMAIL = 2;
        PendingOperation getSMSLog (in CommLogSMSSuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in ShortArray messageFolders,
                [Optional] in SMSFilter filter)
            raises (SecurityError, DeviceAPIError);
        PendingOperation getMMSLog (in CommLogMMSSuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in ShortArray messageFolders,
                [Optional] in MMSFilter filter)
            raises (SecurityError, DeviceAPIError);
        PendingOperation getEmailLog (in CommLogEmailSuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in ShortArray messageFolders,
                [Optional] in EmailFilter filter)
            raises (SecurityError, DeviceAPIError);
        PendingOperation getCallLog (in CommLogCallSuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in ShortArray callFolder,
                [Optional] in CallFilter filter)
            raises (SecurityError, DeviceAPIError);
        StringArray getSMSSupportedPropertyKeys ();
        StringArray getMMSSupportedPropertyKeys ();
        StringArray getEmailSupportedPropertyKeys ();
        StringArray getCallSupportedPropertyKeys ();
        unsigned long getNumberOfMessages (in unsigned short messageType,
                in ShortArray messageFolders,
                [Optional] in boolean unread)
            raises (DeviceAPIError);
        unsigned long getNumberOfCalls (in ShortArray callFolders)
            raises (DeviceAPIError);
        PendingOperation clearMessageLog (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in unsigned short messageType,
                in unsigned short messageFolder)
            raises (SecurityError, DeviceAPIError);
        PendingOperation clearCallLog (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in unsigned short callFolder)
            raises (SecurityError, DeviceAPIError);
    };
    [Callback] interface Call {
        readonly attribute DOMString phoneNumber;
        readonly attribute Date startTime;
        readonly attribute unsigned long duration;
        readonly attribute DOMString id;
        readonly attribute unsigned short folder;
    };
    [Callback, NoInterfaceObject] interface SMSFilter {
        attribute DOMString body;
        attribute DOMString recipient;
        attribute Date initialDate;
        attribute Date finalDate;
    };
    [Callback, NoInterfaceObject] interface MMSFilter {
        attribute DOMString body;
        attribute DOMString recipient;
        attribute Date initialDate;
        attribute Date finalDate;
    };
    [Callback, NoInterfaceObject] interface EmailFilter {
        attribute DOMString from;
        attribute DOMString to;
        attribute DOMString cc;
        attribute DOMString bcc;
        attribute DOMString subject;
        attribute DOMString body;
        attribute Date initialDate;
        attribute Date finalDate;
    };
    [Callback, NoInterfaceObject] interface CallFilter {
        attribute DOMString phoneNumber;
        attribute unsigned long minDuration;
    };
    interface CommLogManagerObject {
        readonly attribute CommLogManager commlogManager;
    };
    Bondi implements CommLogManagerObject;
};

module bondi {
    typedef sequence<DOMString> StringArray;
    typedef sequence<octet> ByteArray;
    typedef sequence<short> ShortArray;
    typedef sequence<long> LongArray;
    typedef sequence<float> FloatArray;
    typedef Object Map;
    [Callback=FunctionOnly, NoInterfaceObject] interface SuccessCallback {
        void onSuccess ();
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface RequestFeatureSuccessCallback {
        void onSuccess (in Object ob);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface ErrorCallback {
        void onError (in GenericError error);
    };
    interface GenericError {
        readonly attribute unsigned short code;
    };
    interface DeviceAPIError : GenericError {
        const unsigned short UNKNOWN_ERROR = 10000;
        const unsigned short INVALID_ARGUMENT_ERROR = 10001;
        const unsigned short NOT_FOUND_ERROR = 10002;
        const unsigned short PENDING_OPERATION_ERROR = 10003;
        const unsigned short IO_ERROR = 10004;
        const unsigned short NOT_SUPPORTED_ERROR = 10005;
    };
    interface SecurityError : GenericError {
        const unsigned short PERMISSION_DENIED_ERROR = 20000;
    };
    interface PendingOperation {
        boolean cancel ();
    };
    interface Bondi {
        PendingOperation requestFeature (in RequestFeatureSuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in DOMString name)
            raises (DeviceAPIError, SecurityError);
    };
    interface BondiObject {
        readonly attribute Bondi bondi;
    };
    Window implements BondiObject;
};

module devicestatus {
    [Callback=FunctionOnly, NoInterfaceObject] interface PropertyChangeSuccessCallback {
        void onPropertyChange (in PropertyRef property,
                in Object newValue);
    };
    interface DeviceStatusError : GenericError {
        const unsigned short READ_ONLY_PROPERTY_ERROR = 1;
    };
    interface DeviceStatusManager {
        StringArray listVocabularies ();
        void setDefaultVocabulary (in DOMString vocabulary)
            raises (DeviceAPIError);
        StringArray listAspects ();
        StringArray getComponents (in AspectName aspect)
            raises (DeviceAPIError);
        StringArray listProperties (in AspectName aspect)
            raises (DeviceAPIError);
        Object getPropertyValue (in PropertyRef prop)
            raises (SecurityError, DeviceAPIError);
        void setPropertyValue (in PropertyRef pref,
                in Object value)
            raises (SecurityError, DeviceAPIError, DeviceStatusError);
        unsigned long watchPropertyChange (in PropertyRef pref,
                in PropertyChangeSuccessCallback listener,
                in Map options)
            raises (SecurityError, DeviceAPIError);
        void clearPropertyChange (in unsigned long watchHandler)
            raises (DeviceAPIError);
    };
    interface AspectName {
        attribute DOMString aspect;
        attribute DOMString vocabulary;
    };
    interface PropertyRef {
        attribute DOMString vocabulary;
        attribute DOMString component;
        attribute DOMString aspect;
        attribute DOMString property;
    };
    interface DeviceStatusManagerObject {
        readonly attribute DeviceStatusManager deviceStatusManager;
    };
    Bondi implements DeviceStatusManagerObject;
};

module filesystem {
    typedef sequence<File> FileArray;
    [Callback=FunctionOnly, NoInterfaceObject] interface FileSystemSuccessCallback {
        void onSuccess (in File file);
    };
    interface FileSystemManager {
        readonly attribute unsigned long maxPathLength;
        DOMString getDefaultLocation (in DOMString specifier,
                in unsigned long minFreeSpace)
            raises (DeviceAPIError);
        StringArray getRootLocations ();
        File resolve (in DOMString location)
            raises (SecurityError, DeviceAPIError);
        void registerEventListener (in FileSystemListener listener)
            raises (DeviceAPIError);
        void unregisterEventListener (in FileSystemListener listener)
            raises (DeviceAPIError);
    };
    interface FileSystemListener {
        void mountEvent (in DOMString location);
        void unmountEvent (in DOMString location);
    };
    interface File {
        readonly attribute File parent;
        readonly attribute boolean readOnly;
        readonly attribute boolean isFile;
        readonly attribute boolean isDirectory;
        readonly attribute Date created;
        readonly attribute Date modified;
        readonly attribute DOMString path;
        readonly attribute DOMString name;
        readonly attribute DOMString absolutePath;
        readonly attribute unsigned long fileSize;
        readonly attribute Map metadata;
        FileArray listFiles ()
            raises (SecurityError, DeviceAPIError);
        FileStream open (in DOMString mode,
                in DOMString encoding)
            raises (SecurityError, DeviceAPIError);
        PendingOperation copyTo (in FileSystemSuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in DOMString filePath,
                in boolean overwrite)
            raises (SecurityError, DeviceAPIError);
        PendingOperation moveTo (in FileSystemSuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in DOMString filePath,
                in boolean overwrite)
            raises (SecurityError, DeviceAPIError);
        File createDirectory (in DOMString dirPath)
            raises (SecurityError, DeviceAPIError);
        File createFile (in DOMString filePath)
            raises (SecurityError, DeviceAPIError);
        File resolve (in DOMString filePath)
            raises (SecurityError, DeviceAPIError);
        boolean deleteDirectory (in boolean recursive)
            raises (SecurityError, DeviceAPIError);
        boolean deleteFile ()
            raises (SecurityError, DeviceAPIError);
    };
    interface FileStream {
        readonly attribute boolean eof;
        attribute unsigned long position

            setraises (DeviceAPIError);
        readonly attribute unsigned long bytesAvailable;
        void close ();
        DOMString read (in unsigned long charCount)
            raises (DeviceAPIError);
        ByteArray readBytes (in unsigned long byteCount)
            raises (DeviceAPIError);
        DOMString readBase64 (in unsigned long byteCount)
            raises (DeviceAPIError);
        void write (in DOMString stringData)
            raises (DeviceAPIError);
        void writeBytes (in ByteArray byteData)
            raises (DeviceAPIError);
        void writeBase64 (in DOMString base64Data)
            raises (DeviceAPIError);
    };
    interface FileSystemManagerObject {
        readonly attribute FileSystemManager fileSystemManager;
    };
    Bondi implements FileSystemManagerObject;
};

module geolocation {
    [Callback=FunctionOnly, NoInterfaceObject] interface PositionSuccessCallback {
        void handleEvent (in Position position);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface PositionErrorCallback {
        void handleEvent (in PositionError error);
    };
    interface Geolocation {
        void getCurrentPosition (in PositionSuccessCallback successCallback,
                [Optional] in PositionErrorCallback errorCallback,
                [Optional] in PositionOptions options)
            raises (SecurityError, DeviceAPIError);
        long watchPosition (in PositionSuccessCallback successCallback,
                [Optional] in PositionErrorCallback errorCallback,
                [Optional] in PositionOptions options)
            raises (SecurityError, DeviceAPIError);
        void clearWatch (in long id);
    };
    interface Coordinates {
        readonly attribute double latitude;
        readonly attribute double longitude;
        readonly attribute double altitude;
        readonly attribute double accuracy;
        readonly attribute double altitudeAccuracy;
        readonly attribute double heading;
        readonly attribute double speed;
    };
    interface Position {
        readonly attribute long timestamp;
        readonly attribute Coordinates coords;
    };
    interface PositionError {
        const unsigned short UNKNOWN_ERROR = 0;
        const unsigned short POSITION_UNAVAILABLE_ERROR = 2;
        const unsigned short TIMEOUT_ERROR = 3;
        readonly attribute unsigned short code;
        readonly attribute DOMString message;
    };
    [Callback, NoInterfaceObject] interface PositionOptions {
        attribute long timeout;
        attribute long maximumAge;
        attribute boolean enableHighAccuracy;
    };
    interface GeolocationObject {
        readonly attribute Geolocation geolocation;
    };
    Bondi implements GeolocationObject;
};

module messaging {
    typedef sequence<MMSSlide> MMSSlideArray;
    [Callback=FunctionOnly, NoInterfaceObject] interface EmailAccountsSuccessCallback {
        void onSuccess (in StringArray obj);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface OnIncomingSMS {
        void onEvent (in SMS message);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface OnIncomingMMS {
        void onEvent (in MMS message);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface OnIncomingEmail {
        void onEvent (in Email message);
    };
    interface MessagingError : GenericError {
        const unsigned short OUT_OF_COVERAGE_ERROR = 1;
        const unsigned short MMS_VIDEO_SLIDE_ERROR = 2;
        const unsigned short MMS_MESSAGE_SIZE_EXCEEDED_ERROR = 3;
    };
    interface MessagingManager {
        const unsigned short INBOX_FOLDER = 0;
        const unsigned short OUTBOX_FOLDER = 1;
        const unsigned short SENT_FOLDER = 2;
        const unsigned short DRAFTS_FOLDER = 3;
        SMS createSMS ([Optional] in SMSOptions smsParams)
            raises (DeviceAPIError);
        MMS createMMS ([Optional] in MMSOptions mmsParams)
            raises (DeviceAPIError);
        Email createEmail ([Optional] in EmailOptions emailParams)
            raises (DeviceAPIError);
        PendingOperation sendSMS (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in SMS sms)
            raises (SecurityError, DeviceAPIError, MessagingError);
        PendingOperation sendMMS (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in MMS mms)
            raises (SecurityError, DeviceAPIError, MessagingError);
        PendingOperation sendEmail (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in Email email)
            raises (SecurityError, DeviceAPIError, MessagingError);
        BinaryMessage createBinaryMessage ([Optional] in BinaryMessageOptions binaryParams)
            raises (DeviceAPIError);
        PendingOperation sendBinaryMessage (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in BinaryMessage binary)
            raises (SecurityError, DeviceAPIError, MessagingError);
        PendingOperation getAvailableEmailAccounts (in EmailAccountsSuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (SecurityError, DeviceAPIError);
        unsigned long subscribeToSMS  (in OnIncomingSMS listener,
                in IncomingSMSEventFilter filter,
                in boolean exclusive)
            raises (SecurityError, DeviceAPIError);
        void unsubscribeFromSMS   (in unsigned long subscribeHandler)
            raises (SecurityError, DeviceAPIError);
        unsigned long subscribeToMMS  (in OnIncomingMMS listener,
                in IncomingMMSEventFilter filter,
                in boolean exclusive)
            raises (SecurityError, DeviceAPIError);
        void unsubscribeFromMMS   (in unsigned long subscribeHandler)
            raises (SecurityError, DeviceAPIError);
        unsigned long subscribeToEmail  (in OnIncomingEmail listener,
                in IncomingEmailEventFilter filter,
                in boolean exclusive)
            raises (SecurityError, DeviceAPIError);
        void unsubscribeFromEmail   (in unsigned long subscribeHandler)
            raises (SecurityError, DeviceAPIError);
    };
    interface SMS {
        readonly attribute DOMString id;
        readonly attribute Date datetime;
        attribute DOMString body

            setraises (DeviceAPIError);
        attribute boolean store
            setraises (DeviceAPIError);
        readonly attribute unsigned short folder;
        readonly attribute boolean read;
        Object getProperty (in DOMString propertyName)
            raises (DeviceAPIError);
        void setProperty (in DOMString propertyName,
                in DOMString propertyValue)
            raises (DeviceAPIError);
        StringArray getRecipients ();
        DOMString getRecipient (in unsigned short index)
            raises (DeviceAPIError);
        void appendRecipient (in DOMString phoneNumber)
            raises (DeviceAPIError);
        void clearRecipients ();
    };
    interface MMSSlide {
        attribute unsigned long duration;
        attribute DOMString image

            setraises (MessagingError);
        attribute unsigned long imageBegin;
        attribute unsigned long imageEnd;
        attribute DOMString audio
            setraises (MessagingError);
        attribute unsigned long audioBegin;
        attribute unsigned long audioEnd;
        attribute DOMString text

            setraises (MessagingError);
        attribute unsigned long textBegin;
        attribute unsigned long textEnd;
        attribute DOMString video
            setraises (MessagingError);
        attribute unsigned long videoBegin;
        attribute unsigned long videoEnd;
    };
    interface MMS {
        const unsigned short MULTIPART_MIXED = 0;
        const unsigned short MULTIPART_RELATED = 1;
        readonly attribute DOMString id;
        readonly attribute Date datetime;
        attribute DOMString multipartMixedBody

            setraises (DeviceAPIError);
        attribute boolean store
            setraises (DeviceAPIError);
        readonly attribute unsigned long folder;
        attribute DOMString subject
            setraises (DeviceAPIError);
        readonly attribute boolean read;
        attribute unsigned short messageType;
        attribute MMSSlideArray slides;
        Object getProperty (in DOMString propertyName)
            raises (DeviceAPIError);
        void setProperty (in DOMString propertyName,
                in Object propertyValue)
            raises (DeviceAPIError);
        StringArray getRecipients ();
        DOMString getRecipient (in unsigned long index)
            raises (DeviceAPIError);
        void appendRecipient (in DOMString phoneNumber)
            raises (DeviceAPIError);
        void clearRecipients ();
        StringArray getAttachments ();
        DOMString getAttachment (in unsigned short index)
            raises (DeviceAPIError);
        void appendAttachment (in DOMString myAttachment)
            raises (SecurityError, DeviceAPIError);
        void clearAttachments ()
            raises (DeviceAPIError);
    };
    interface Email {
        readonly attribute DOMString id;
        readonly attribute Date datetime;
        attribute DOMString from

            setraises (DeviceAPIError);
        attribute DOMString body
            setraises (DeviceAPIError);
        attribute boolean store
            setraises (DeviceAPIError);
        readonly attribute unsigned short folder;
        attribute DOMString subject

            setraises (DeviceAPIError);
        readonly attribute boolean read;
        DOMString getProperty (in DOMString propertyName)
            raises (DeviceAPIError);
        void setProperty (in DOMString propertyName,
                in DOMString propertyValue)
            raises (DeviceAPIError);
        StringArray getToList ();
        StringArray getCCList ();
        StringArray getBCCList ();
        void appendTo (in DOMString emailAddress)
            raises (DeviceAPIError);
        void clearTo ();
        void appendCC (in DOMString emailAddress)
            raises (DeviceAPIError);
        void clearCC ();
        void appendBCC (in DOMString emailAddress)
            raises (DeviceAPIError);
        void clearBCC ();
        StringArray getAttachments ();
        DOMString getAttachment (in unsigned short index)
            raises (DeviceAPIError);
        void appendAttachment (in DOMString myAttachment)
            raises (SecurityError, DeviceAPIError);
        void clearAttachments ();
    };
    [Callback, NoInterfaceObject] interface SMSOptions {
        attribute DOMString body;
        attribute DOMString recipients;
        attribute boolean store;
    };
    [Callback, NoInterfaceObject] interface MMSOptions {
        attribute DOMString body;
        attribute DOMString recipients;
        attribute StringArray attachments;
        attribute boolean store;
    };
    [Callback, NoInterfaceObject] interface EmailOptions {
        attribute DOMString from;
        attribute DOMString to;
        attribute DOMString cc;
        attribute DOMString bcc;
        attribute DOMString subject;
        attribute DOMString body;
        attribute StringArray attachments;
        attribute boolean store;
    };
    [Callback, NoInterfaceObject] interface BinaryMessageOptions {
        attribute DOMString recipients;
        attribute unsigned short port;
        attribute ByteArray payload;
    };
    interface BinaryMessage {
        attribute ByteArray payload

            setraises (DeviceAPIError);
        readonly attribute unsigned short port;
        Object getProperty (in DOMString propertyName)
            raises (DeviceAPIError);
        void setProperty (in DOMString propertyName,
                in DOMString propertyValue)
            raises (DeviceAPIError);
        StringArray getRecipients ();
        DOMString getRecipient (in unsigned short index)
            raises (DeviceAPIError);
        void appendRecipient (in DOMString phoneNumber)
            raises (DeviceAPIError);
        void clearRecipients ();
    };
    [Callback, NoInterfaceObject] interface IncomingSMSEventFilter {
        attribute unsigned long port;
        attribute DOMString sender;
    };
    [Callback, NoInterfaceObject] interface IncomingMMSEventFilter {
        attribute DOMString sender;
        attribute DOMString body;
    };
    [Callback, NoInterfaceObject] interface IncomingEmailEventFilter {
        attribute DOMString sender;
        attribute DOMString subject;
    };
    interface MessagingManagerObject {
        readonly attribute MessagingManager messagingManager;
    };
    Bondi implements MessagingManagerObject;
};

module gallery {
    typedef sequence<Gallery> GalleryArray;
    typedef sequence<MediaItem> MediaItemArray;
    interface GalleryError : GenericError {
        const unsigned short GALLERY_OPEN_ERROR = 1;
        const unsigned short GALLERY_NOT_OPEN_ERROR = 2;
    };
    interface GalleryManager {
        GalleryArray getGalleries ();
    };
    interface Gallery {
        const unsigned short MEDIA_ITEM_TYPE_UNDEFINED = 0;
        const unsigned short MEDIA_ITEM_TYPE_AUDIO = 1;
        const unsigned short MEDIA_ITEM_TYPE_VIDEO = 2;
        const unsigned short MEDIA_ITEM_TYPE_IMAGE = 3;
        const unsigned short MEDIA_SORT_NONE = 0;
        const unsigned short MEDIA_SORT_BY_FILENAME = 1;
        const unsigned short MEDIA_SORT_BY_FILEDATE = 2;
        const unsigned short MEDIA_SORT_BY_TYPE = 3;
        const unsigned short MEDIA_SORT_BY_TITLE = 20;
        const unsigned short MEDIA_SORT_BY_AUTHOR = 21;
        const unsigned short MEDIA_SORT_BY_ALBUM = 22;
        const unsigned short MEDIA_SORT_BY_DATE = 23;
        const unsigned short MEDIA_SORT_ASCENDING = 0;
        const unsigned short MEDIA_SORT_DESCENDING = 1;
        readonly attribute Map info;
        unsigned long getNumberOfMediaItems ()
            raises (SecurityError, GalleryError);
        PendingOperation open (in SuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (SecurityError, DeviceAPIError, GalleryError);
        PendingOperation refresh (in SuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (SecurityError, DeviceAPIError, GalleryError);
        void close ()
            raises (DeviceAPIError, GalleryError);
        PendingOperation changeView (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in ViewFilter viewOptions)
            raises (SecurityError, DeviceAPIError, GalleryError);
        MediaItemArray getMediaItems ()
            raises (SecurityError, DeviceAPIError, GalleryError);
        MediaItem getMediaItemById (in unsigned long itemId)
            raises (SecurityError, DeviceAPIError, GalleryError);
    };
    interface MediaItem {
        readonly attribute unsigned long id;
        readonly attribute long type;
        readonly attribute DOMString mimeType;
        readonly attribute DOMString fileName;
        readonly attribute Map metadata;
    };
    [Callback, NoInterfaceObject] interface ViewFilter {
        attribute short primarySortOrder;
        attribute short secondarySortOrder;
        attribute Date startDate;
        attribute Date endDate;
        attribute DOMString metaTag;
    };
    interface GalleryManagerObject {
        readonly attribute GalleryManager galleryManager;
    };
    Bondi implements GalleryManagerObject;
};

module contact {
    typedef sequence<AddressBook> AddressBookArray;
    typedef sequence<Contact> ContactArray;
    typedef sequence<PhoneNumber> PhoneNumberArray;
    [Callback=FunctionOnly, NoInterfaceObject] interface ContactArraySuccessCallback {
        void onSuccess (in ContactArray contacts);
    };
    interface ContactManager {
        const unsigned short MOBILE_NUMBER = 0;
        const unsigned short LANDLINE_NUMBER = 1;
        const unsigned short FAX_NUMBER = 2;
        const unsigned short WORK_NUMBER = 3;
        const unsigned short HOME_NUMBER = 4;
        AddressBookArray getAddressBooks ()
            raises (SecurityError);
    };
    interface AddressBook {
        Contact createContact ([Optional] in ContactOptions options)
            raises (SecurityError, DeviceAPIError);
        PendingOperation addContact (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in Contact contact)
            raises (SecurityError, DeviceAPIError);
        PendingOperation updateContact (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in Contact contact)
            raises (SecurityError, DeviceAPIError);
        PendingOperation deleteContact (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in Contact contact)
            raises (SecurityError, DeviceAPIError);
        PendingOperation deleteAllContacts (in SuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (SecurityError, DeviceAPIError);
        PendingOperation findContacts (in ContactArraySuccessCallback successCallback,
                in ErrorCallback errorCallback,
                in ContactFilter filter)
            raises (SecurityError, DeviceAPIError);
    };
    interface Contact {
        attribute DOMString id;
        attribute DOMString name;
        attribute DOMString nickname;
        attribute Address address;
        attribute DOMString photo;
        attribute PhoneNumberArray phoneNumbers;
        attribute DOMString email;
        Object getProperty (in DOMString propertyName)
            raises (DeviceAPIError);
        StringArray getSupportedPropertyKeys ();
        void setProperty (in DOMString propertyName,
                in Object propertyValue)
            raises (DeviceAPIError);
    };
    interface Address {
        attribute DOMString country;
        attribute DOMString region;
        attribute DOMString county;
        attribute DOMString city;
        attribute DOMString street;
        attribute DOMString streetNumber;
        attribute DOMString premises;
        attribute DOMString additionalInformation;
        attribute DOMString postalCode;
    };
    interface PhoneNumber {
        attribute DOMString number;
        attribute unsigned short type;
        attribute unsigned short subType;
    };
    [Callback, NoInterfaceObject] interface ContactOptions {
        attribute DOMString name;
        attribute DOMString nickName;
        attribute Address address;
        attribute DOMString picture;
        attribute PhoneNumberArray phoneNumbers;
        attribute DOMString email;
    };
    [Callback, NoInterfaceObject] interface ContactFilter {
        attribute DOMString name;
        attribute DOMString nickName;
        attribute Address address;
        attribute DOMString telephone;
        attribute DOMString email;
    };
    interface ContactManagerObject {
        readonly attribute ContactManager contactManager;
    };
    Bondi implements ContactManagerObject;
};

module task {
    typedef sequence<TaskList> TaskListArray;
    typedef sequence<Task> TaskArray;
    [Callback=FunctionOnly, NoInterfaceObject] interface TaskArraySuccessCallback {
        void onSuccess (in TaskArray tasks);
    };
    interface TaskManager {
        const unsigned short HIGH_PRIORITY = 0;
        const unsigned short MEDIUM_PRIORITY = 1;
        const unsigned short LOW_PRIORITY = 2;
        const unsigned short STATUS_DONE = 0;
        const unsigned short STATUS_PENDING = 1;
        const unsigned short STATUS_ONGOING = 2;
        TaskListArray getTaskLists ()
            raises (SecurityError);
    };
    interface TaskList {
        Task createTask ([Optional] in TaskOptions options)
            raises (SecurityError, DeviceAPIError);
        void addTask (in Task task)
            raises (SecurityError, DeviceAPIError);
        void updateTask (in Task task)
            raises (SecurityError, DeviceAPIError);
        void deleteTask (in Task task)
            raises (SecurityError, DeviceAPIError);
        PendingOperation clearTasks (in SuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (SecurityError, DeviceAPIError);
        PendingOperation findTasks (in TaskArraySuccessCallback successCallback,
                in ErrorCallback errorCallback,
                [Optional] in TaskFilter filter)
            raises (SecurityError, DeviceAPIError);
    };
    interface Task {
        attribute DOMString id;
        attribute unsigned short priority;
        attribute DOMString note;
        attribute DOMString summary;
        attribute Date due;
        attribute unsigned short status;
        Object getProperty (in DOMString propertyName)
            raises (DeviceAPIError);
        StringArray getSupportedPropertyKeys ();
        void setProperty (in DOMString propertyName,
                in Object propertyValue)
            raises (DeviceAPIError);
    };
    [Callback, NoInterfaceObject] interface TaskOptions {
        attribute short priority;
        attribute DOMString summary;
        attribute DOMString note;
        attribute Date due;
        attribute short status;
    };
    [Callback, NoInterfaceObject] interface TaskFilter {
        attribute short priority;
        attribute DOMString summary;
        attribute DOMString note;
        attribute Date initialDueDate;
        attribute Date finalDueDate;
        attribute short status;
    };
    interface TaskManagerObject {
        readonly attribute TaskManager taskManager;
    };
    Bondi implements TaskManagerObject;
};

module calendar {
    typedef sequence<Event> EventsArray;
    typedef sequence<Calendar> CalendarArray;
    [Callback=FunctionOnly, NoInterfaceObject] interface EventsArraySuccessCallback {
        void onSuccess (in EventsArray obj);
    };
    interface CalendarManager {
        const unsigned short NO_RECURRENCE = 0;
        const unsigned short DAILY_RECURRENCE = 1;
        const unsigned short WEEKLY_RECURRENCE = 2;
        const unsigned short MONTHLY_RECURRENCE = 3;
        const unsigned short YEARLY_RECURRENCE = 4;
        const unsigned short TENTATIVE_STATUS = 0;
        const unsigned short CONFIRMED_STATUS = 1;
        const unsigned short CANCELLED_STATUS = 2;
        const unsigned short NO_ALARM = 0;
        const unsigned short SILENT_ALARM = 1;
        const unsigned short SOUND_ALARM = 2;
        CalendarArray getCalendars ()
            raises (SecurityError);
    };
    interface Calendar {
        Event createEvent ([Optional] in EventOptions options)
            raises (SecurityError, DeviceAPIError);
        void addEvent (in Event event)
            raises (SecurityError, DeviceAPIError);
        void updateEvent (in Event event)
            raises (SecurityError, DeviceAPIError);
        void deleteEvent (in Event event)
            raises (SecurityError, DeviceAPIError);
        PendingOperation clearEvents (in SuccessCallback successCallback,
                in ErrorCallback errorCallback)
            raises (SecurityError, DeviceAPIError);
        PendingOperation findEvents (in SuccessCallback successCallback,
                in ErrorCallback errorCallback,
                [Optional] in EventFilter filter)
            raises (SecurityError, DeviceAPIError);
    };
    interface Event {
        attribute DOMString id;
        attribute DOMString description;
        attribute DOMString summary;
        attribute Date startTime;
        attribute Date endTime;
        attribute DOMString location;
        attribute unsigned short recurrence;
        attribute DOMString status;
        attribute Date alarmDate;
        attribute unsigned long alarmType;
        Object getProperty (in DOMString propertyName)
            raises (DeviceAPIError);
        StringArray getSupportedPropertyKeys ();
        void setProperty (in DOMString propertyName,
                in Object propertyValue)
            raises (DeviceAPIError);
    };
    [Callback, NoInterfaceObject] interface EventOptions {
        attribute DOMString summary;
        attribute DOMString description;
        attribute DOMString location;
        attribute Date startTime;
        attribute Date endTime;
        attribute short recurrence;
        attribute unsigned short status;
        attribute Date alarmDate;
        attribute unsigned short alarmType;
    };
    [Callback, NoInterfaceObject] interface EventFilter {
        attribute DOMString summary;
        attribute DOMString description;
        attribute DOMString location;
        attribute Date initialStartTime;
        attribute Date finalStartTime;
        attribute Date initialEndTime;
        attribute Date finalEndTime;
        attribute short recurrence;
        attribute unsigned short status;
        attribute Date initialAlarmDate;
        attribute Date finalAlarmDate;
        attribute unsigned short alarmType;
    };
    interface CalendarManagerObject {
        readonly attribute CalendarManager calendarManager;
    };
    Bondi implements CalendarManagerObject;
};

module ui {
    typedef sequence<MenuItem> Menu;
    [Callback=FunctionOnly, NoInterfaceObject] interface WidgetActivateCallback {
        void onActivate ();
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface WidgetDeactivateCallback {
        void onDeactivate ();
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface WidgetKeyPressCallback {
        void onKeyPress (in unsigned short keyCode);
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface WidgetOrientationChangeCallback {
        void onOrientationChange ();
    };
    [Callback=FunctionOnly, NoInterfaceObject] interface WidgetMenuSelectCallback {
        void onSelect ();
    };
    interface UIManager {
        const unsigned short LEFT_SOFT_KEY = 0;
        const unsigned short RIGHT_SOFT_KEY = 1;
        const unsigned short NAVIGATION_CURSOR = 0;
        const unsigned short NAVIGATION_TABBED = 1;
        const unsigned short INFINITE_DURATION = 0;
        const unsigned short ORIENTATION_0 = 0;
        const unsigned short ORIENTATION_90 = 90;
        const unsigned short ORIENTATION_180 = 180;
        const unsigned short ORIENTATION_270 = 270;
        readonly attribute Preferences preferences;
        attribute boolean isActive

            setraises (DeviceAPIError);
        attribute unsigned short navigationMode
            setraises (DeviceAPIError);
        readonly attribute boolean isRotationSupported;
        attribute unsigned short displayOrientation;
        attribute boolean softKeysVisible

            setraises (DeviceAPIError);
        attribute boolean statusBarVisible
            setraises (DeviceAPIError);
        MenuItem getSoftKey (in unsigned short id)
            raises (DeviceAPIError);
        void setOnActivate (in WidgetActivateCallback handler)
            raises (DeviceAPIError);
        void setOnDeactivate (in WidgetDeactivateCallback handler)
            raises (DeviceAPIError);
        void setOnKeyPress (in WidgetKeyPressCallback handler)
            raises (DeviceAPIError);
        void beep (in unsigned long duration,
                in unsigned short frequency);
        void startVibrate (in unsigned long duration,
                in unsigned short intensity);
        void stopVibrate ();
        void setOnOrientationChange (in WidgetOrientationChangeCallback handler)
            raises (DeviceAPIError);
        void lightOn (in unsigned long duration,
                in unsigned short intensity,
                in boolean fadeIn);
        void lightOff (in boolean fadeOut);
        Preferences getPreferences ();
    };
    interface MenuItem {
        readonly attribute unsigned long id;
        attribute DOMString text;
        readonly attribute Menu menuItems;
        void setOnSelect (in WidgetMenuSelectCallback handler)
            raises (DeviceAPIError);
        MenuItem getMenuItemById (in unsigned long id);
        MenuItem appendMenuItem (in unsigned long id,
                in DOMString text,
                in WidgetMenuSelectCallback onSelect)
            raises (DeviceAPIError);
        void removeMenuItem (in unsigned long id)
            raises (DeviceAPIError);
        void removeAllMenuItems ();
    };
    interface Preferences {
        attribute unsigned long callRingtoneVolume;
        attribute unsigned long messageRingtoneVolume;
        attribute boolean isVibrationActive;
        void setWallpaper (in DOMString wallpaper)
            raises (DeviceAPIError);
        void setCallRingtone (in DOMString ringtone)
            raises (DeviceAPIError);
        void setMessageRingtone (in DOMString ringtone)
            raises (DeviceAPIError);
    };
    interface UIManagerObject {
        readonly attribute UIManager uiManager;
    };
    Bondi implements UIManagerObject;
};

module pim {
    interface Pim {
    };
    interface PimObject {
        readonly attribute Pim pim;
    };
    Pim implements ContactManagerObject;
    Pim implements EventManagerObject;
    Pim implements TaskManagerObject;
    Bondi implements PimObject;
};