Public Member Functions | Public Attributes

nsIAbDirectory Interface Reference

import "nsIAbDirectory.idl";

Inheritance diagram for nsIAbDirectory:
Collaboration diagram for nsIAbDirectory:

List of all members.

Public Member Functions

void deleteDirectory (in nsIAbDirectory directory)
boolean hasCard (in nsIAbCard cards)
boolean hasDirectory (in nsIAbDirectory dir)
nsIAbCard addCard (in nsIAbCard card)
 Adds a card to the database.
void modifyCard (in nsIAbCard modifiedCard)
 Modifies a card in the database to match that supplied.
void deleteCards (in nsIArray aCards)
 Deletes the array of cards from the database.
void dropCard (in nsIAbCard card, in boolean needToCopyCard)
boolean useForAutocomplete (in ACString aIdentityKey)
 Whether or not the directory should be searched when doing autocomplete, (currently by using GetChildCards); LDAP does not support this in online mode, so that should return false; additionally any other directory types that also do not support GetChildCards should return false.
void addMailList (in nsIAbDirectory list)
 Creates a new mailing list in the directory.
void editMailListToDatabase (in nsIAbCard listCard)
 Edits an existing mailing list (specified as listCard) into its parent directory.
void copyMailList (in nsIAbDirectory srcList)
ACString createNewDirectory (in AString aDirName, in ACString aURI, in unsigned long aType, in ACString aPrefName)
 Only creates a top level address book which is stored in the preferences.
void createDirectoryByURI (in AString displayName, in ACString aURI)
getXXXValue

Helper functions to get different types of pref, but return a default value if a pref value was not obtained.

Parameters:
aName The name of the pref within the branch dirPrefId to get a value from.
aDefaultValue The default value to return if getting the pref fails or the pref is not present.
Returns:
The value of the pref or the default value.
Exceptions:
NS_ERROR_NOT_INITIALIZED if the pref branch couldn't be obtained (e.g. dirPrefId isn't set).
long getIntValue (in string aName, in long aDefaultValue)
boolean getBoolValue (in string aName, in boolean aDefaultValue)
ACString getStringValue (in string aName, in ACString aDefaultValue)
AUTF8String getLocalizedStringValue (in string aName, in AUTF8String aDefaultValue)
setXXXValue

Helper functions to set different types of pref values.

Parameters:
aName The name of the pref within the branch dirPrefId to get a value from.
aValue The value to set the pref to.
Exceptions:
NS_ERROR_NOT_INITIALIZED if the pref branch couldn't be obtained (e.g. dirPrefId isn't set).
void setIntValue (in string aName, in long aValue)
void setBoolValue (in string aName, in boolean aValue)
void setStringValue (in string aName, in ACString aValue)
void setLocalizedStringValue (in string aName, in AUTF8String aValue)

Public Attributes

readonly attribute ACString propertiesChromeURI
 The chrome URI to use for bringing up a dialog to edit this directory.
attribute AString dirName
 The description of the directory.
readonly attribute long dirType
readonly attribute ACString fileName
readonly attribute ACString URI
readonly attribute long position
attribute unsigned long lastModifiedDate
attribute PRBool isMailList
readonly attribute
nsISimpleEnumerator 
childNodes
readonly attribute
nsISimpleEnumerator 
childCards
 Get the cards associated with the directory.
readonly attribute boolean isQuery
 Returns true if this directory represents a query - i.e.
readonly attribute boolean supportsMailingLists
 Does this directory support mailing lists? Note that in the case this directory is a mailing list and nested mailing lists are not supported, this will return false rather than true which the parent directory might.
attribute nsIMutableArray addressLists
 This attribute serves two purposes 1.
attribute AString listNickName
 Nick Name of the mailing list.
attribute AString description
 Description of the mailing list.
attribute ACString dirPrefId
 The id of the directory used in prefs e.g.

Member Function Documentation

nsIAbCard nsIAbDirectory::addCard ( in nsIAbCard  card  ) 

Adds a card to the database.

This card does not need to be of the same type as the database, e.g., one can add an nsIAbLDAPCard to an nsIAbMDBDirectory.

Returns:
"Real" card (eg nsIAbLDAPCard) that can be used for some extra functions.
void nsIAbDirectory::addMailList ( in nsIAbDirectory  list  ) 

Creates a new mailing list in the directory.

Currently only supported for top-level directories.

Parameters:
list The new mailing list to add.
void nsIAbDirectory::copyMailList ( in nsIAbDirectory  srcList  ) 
void nsIAbDirectory::createDirectoryByURI ( in AString  displayName,
in ACString  aURI 
)
ACString nsIAbDirectory::createNewDirectory ( in AString  aDirName,
in ACString  aURI,
in unsigned long  aType,
in ACString  aPrefName 
)

Only creates a top level address book which is stored in the preferences.

Need to change to factory based approach to create new address books

This method should become redundant or be only associated with card folders

The parameters are the same as for nsIAbManager::newAddressBook

void nsIAbDirectory::deleteCards ( in nsIArray  aCards  ) 

Deletes the array of cards from the database.

Parameters:
aCards The cards to delete from the database.
void nsIAbDirectory::deleteDirectory ( in nsIAbDirectory  directory  ) 
void nsIAbDirectory::dropCard ( in nsIAbCard  card,
in boolean  needToCopyCard 
)
void nsIAbDirectory::editMailListToDatabase ( in nsIAbCard  listCard  ) 

Edits an existing mailing list (specified as listCard) into its parent directory.

You should call this function on the resource with the same uri as the listCard.

Parameters:
listCard A nsIAbCard version of the mailing list with the new values.
boolean nsIAbDirectory::getBoolValue ( in string  aName,
in boolean  aDefaultValue 
)
long nsIAbDirectory::getIntValue ( in string  aName,
in long  aDefaultValue 
)
AUTF8String nsIAbDirectory::getLocalizedStringValue ( in string  aName,
in AUTF8String  aDefaultValue 
)
ACString nsIAbDirectory::getStringValue ( in string  aName,
in ACString  aDefaultValue 
)
boolean nsIAbDirectory::hasCard ( in nsIAbCard  cards  ) 
boolean nsIAbDirectory::hasDirectory ( in nsIAbDirectory  dir  ) 
void nsIAbDirectory::modifyCard ( in nsIAbCard  modifiedCard  ) 

Modifies a card in the database to match that supplied.

void nsIAbDirectory::setBoolValue ( in string  aName,
in boolean  aValue 
)
void nsIAbDirectory::setIntValue ( in string  aName,
in long  aValue 
)
void nsIAbDirectory::setLocalizedStringValue ( in string  aName,
in AUTF8String  aValue 
)
void nsIAbDirectory::setStringValue ( in string  aName,
in ACString  aValue 
)
boolean nsIAbDirectory::useForAutocomplete ( in ACString  aIdentityKey  ) 

Whether or not the directory should be searched when doing autocomplete, (currently by using GetChildCards); LDAP does not support this in online mode, so that should return false; additionally any other directory types that also do not support GetChildCards should return false.

Parameters:
aIdentity An optional parameter detailing the identity key (see nsIMsgAccountManager) that this autocomplete is being run against.
Returns:
True if this directory should/can be used during local autocomplete.

Member Data Documentation

This attribute serves two purposes 1.

If this directory is not a mail list, directories are stored here 2. If it is a mail list card entries are stored here

Note:
This is a *live* array and not a static copy

Get the cards associated with the directory.

This will return the cards associated with the mailing lists too.

attribute AString nsIAbDirectory::description

Description of the mailing list.

This attribute is only really used when the nsIAbDirectory represents a mailing list.

attribute AString nsIAbDirectory::dirName

The description of the directory.

If this directory is not a mailing list, then setting this attribute will send round a "DirName" update via nsIAddrBookSession.

attribute ACString nsIAbDirectory::dirPrefId

The id of the directory used in prefs e.g.

"ldap_2.servers.pab" Setting this will cause directoryPrefs to be updated.

readonly attribute long nsIAbDirectory::dirType
readonly attribute ACString nsIAbDirectory::fileName
readonly attribute boolean nsIAbDirectory::isQuery

Returns true if this directory represents a query - i.e.

the rdf resource was something like moz-abmdbdirectory://abook.mab?....

attribute unsigned long nsIAbDirectory::lastModifiedDate
attribute AString nsIAbDirectory::listNickName

Nick Name of the mailing list.

This attribute is only really used when the nsIAbDirectory represents a mailing list.

readonly attribute long nsIAbDirectory::position
readonly attribute ACString nsIAbDirectory::propertiesChromeURI

The chrome URI to use for bringing up a dialog to edit this directory.

When opening the dialog, use a JS argument of {selectedDirectory: thisdir} where thisdir is this directory that you just got the chrome URI from.

Does this directory support mailing lists? Note that in the case this directory is a mailing list and nested mailing lists are not supported, this will return false rather than true which the parent directory might.

readonly attribute ACString nsIAbDirectory::URI

The documentation for this interface was generated from the following file: