>    My question is should I be able to access the Mozilla addressbook
>information from javascript via XPConnect? So far I can get some stuff
>working but for the most part I have no idea what needs to be done to
>make this work. Are there any examples of this somewhere?
>
>Any help would be great,
>

        Some bits are scriptable.
        
        In the source see:
        
http://lxr.mozilla.org/seamonkey/source/mailnews/addrbook/resources/content/
        
        for JavaScript GUI code.
        
        One problem is that the the nsIAbDirectory interface
        uses the nsIEnumerator interface. It is not possible
        to use this interface with XPConnect.
        
http://lxr.mozilla.org/seamonkey/source/xpcom/ds/nsIEnumerator.idl

        Thus it is not possible to obtain a list of sub-directories
        or child cards from the nsIAbDirectory interface unless
        you do one of two things. Use the corresponding 
        RDF data source, which i presume is not that easy or
        friendly to use from js; or write a wrapper interface which
        returns nsISimpleEnumerator for the appropriate methods.
        
        I think a bug should be logged if one is not already
        (if so anyone know the the number?).
        
        We are currently in the process of modifying address
        book code for multiple types of address book access
        and i think i could fix this fairly quickly to ensure
        address book functionality is fully scriptable.
        
Paul.


| ? + ? = To question
----------------\
   Paul Sandoz
        x19219
+353-1-8199219
 

Reply via email to