Public Member Functions | Public Attributes

nsIAddrDatabase Interface Reference

import "nsIAddrDatabase.idl";

Inheritance diagram for nsIAddrDatabase:
Collaboration diagram for nsIAddrDatabase:

List of all members.

Public Member Functions

nsIAddrDatabase open (in nsIFile dbFile, in boolean create, in boolean upgrading)
void close (in boolean forceCommit)
void openMDB (in nsIFile dbName, in boolean create)
 Open the MDB database synchronously creating it if required.
void closeMDB (in boolean commit)
void commit (in unsigned long commitType)
void forceClosed ()
void createNewCardAndAddToDB (in nsIAbCard aNewCard, in boolean aNotify, in nsIAbDirectory aParent)
 Create a new card and add to the database.
void createNewListCardAndAddToDB (in nsIAbDirectory list, in unsigned long listRowID, in nsIAbCard newCard, in boolean aNotify)
void createMailListAndAddToDB (in nsIAbDirectory aNewList, in boolean aNotify, in nsIAbDirectory aParent)
 Create a new mailing list and add to the database.
nsISimpleEnumerator enumerateCards (in nsIAbDirectory directory)
 Enumerate the cards in the directory.
nsISimpleEnumerator enumerateListAddresses (in nsIAbDirectory directory)
 Enumerate the cards associated with the mailing lists in the directory.
void getMailingListsFromDB (in nsIAbDirectory parentDir)
void deleteCard (in nsIAbCard aCard, in boolean aNotify, in nsIAbDirectory aParent)
 Delete a card from the database.
void editCard (in nsIAbCard aCard, in boolean aNotify, in nsIAbDirectory aParent)
 Edit a card in the database.
boolean containsCard (in nsIAbCard card)
void deleteMailList (in nsIAbDirectory aMailList,[optional] in nsIAbDirectory aParent)
 Deletes a mailing list from the directory.
void editMailList (in nsIAbDirectory mailList, in nsIAbCard listCard, in boolean aNotify)
boolean containsMailList (in nsIAbDirectory mailList)
void deleteCardFromMailList (in nsIAbDirectory mailList, in nsIAbCard card, in boolean aNotify)
nsIAbCard getCardFromAttribute (in nsIAbDirectory aDirectory, in string aName, in AUTF8String aUTF8Value, in boolean aCaseInsensitive)
 Gets the first card which matches the attribute/value pair supplied.
nsISimpleEnumerator getCardsFromAttribute (in nsIAbDirectory aDirectory, in string aName, in AUTF8String uUTF8Value, in boolean aCaseInsensitive)
 Gets all cards which matches the attribute/value pair supplied.
PRBool findMailListbyUnicodeName (in wstring listName)
void getCardCount (out PRUint32 count)
void addCardRowToDB (in nsIMdbRow newRow)
void addLdifListMember (in nsIMdbRow row, in string value)
void addFirstName (in nsIMdbRow row, in string value)
void addLastName (in nsIMdbRow row, in string value)
void addPhoneticFirstName (in nsIMdbRow row, in string value)
void addPhoneticLastName (in nsIMdbRow row, in string value)
void addDisplayName (in nsIMdbRow row, in string value)
void addNickName (in nsIMdbRow row, in string value)
void addPrimaryEmail (in nsIMdbRow row, in string value)
void add2ndEmail (in nsIMdbRow row, in string value)
void addWorkPhone (in nsIMdbRow row, in string value)
void addHomePhone (in nsIMdbRow row, in string value)
void addFaxNumber (in nsIMdbRow row, in string value)
void addPagerNumber (in nsIMdbRow row, in string value)
void addCellularNumber (in nsIMdbRow row, in string value)
void addWorkPhoneType (in nsIMdbRow row, in string value)
void addHomePhoneType (in nsIMdbRow row, in string value)
void addFaxNumberType (in nsIMdbRow row, in string value)
void addPagerNumberType (in nsIMdbRow row, in string value)
void addCellularNumberType (in nsIMdbRow row, in string value)
void addHomeAddress (in nsIMdbRow row, in string value)
void addHomeAddress2 (in nsIMdbRow row, in string value)
void addHomeCity (in nsIMdbRow row, in string value)
void addHomeState (in nsIMdbRow row, in string value)
void addHomeZipCode (in nsIMdbRow row, in string value)
void addHomeCountry (in nsIMdbRow row, in string value)
void addWorkAddress (in nsIMdbRow row, in string value)
void addWorkAddress2 (in nsIMdbRow row, in string value)
void addWorkCity (in nsIMdbRow row, in string value)
void addWorkState (in nsIMdbRow row, in string value)
void addWorkZipCode (in nsIMdbRow row, in string value)
void addWorkCountry (in nsIMdbRow row, in string value)
void addJobTitle (in nsIMdbRow row, in string value)
void addDepartment (in nsIMdbRow row, in string value)
void addCompany (in nsIMdbRow row, in string value)
void addAimScreenName (in nsIMdbRow row, in string value)
void addAnniversaryYear (in nsIMdbRow row, in string value)
void addAnniversaryMonth (in nsIMdbRow row, in string value)
void addAnniversaryDay (in nsIMdbRow row, in string value)
void addSpouseName (in nsIMdbRow row, in string value)
void addFamilyName (in nsIMdbRow row, in string value)
void addDefaultAddress (in nsIMdbRow row, in string value)
void addCategory (in nsIMdbRow row, in string value)
void addWebPage1 (in nsIMdbRow row, in string value)
void addWebPage2 (in nsIMdbRow row, in string value)
void addBirthYear (in nsIMdbRow row, in string value)
void addBirthMonth (in nsIMdbRow row, in string value)
void addBirthDay (in nsIMdbRow row, in string value)
void addCustom1 (in nsIMdbRow row, in string value)
void addCustom2 (in nsIMdbRow row, in string value)
void addCustom3 (in nsIMdbRow row, in string value)
void addCustom4 (in nsIMdbRow row, in string value)
void addNotes (in nsIMdbRow row, in string value)
void addPreferMailFormat (in nsIMdbRow row, in unsigned long value)
void addPopularityIndex (in nsIMdbRow row, in unsigned long value)
void addAllowRemoteContent (in nsIMdbRow row, in boolean value)
void addListName (in nsIMdbRow row, in string value)
void addListNickName (in nsIMdbRow row, in string value)
void addListDescription (in nsIMdbRow row, in string value)
void addListDirNode (in nsIMdbRow listRow)
void setCardValue (in nsIAbCard card, in string name, in wstring value, in boolean notify)
 use for getting and setting generic string attributes like _AimScreenName
wstring getCardValue (in nsIAbCard card, in string name)
void AddListCardColumnsToRow (in nsIAbCard aPCard, in nsIMdbRow aPListRow, in unsigned long aPos, out nsIAbCard aPNewCard, in boolean aInMailingList, in nsIAbDirectory aParent, in nsIAbDirectory aRoot)
 Add the column representing the card to the mailing list row in the database.
void InitCardFromRow (in nsIAbCard aNewCard, in nsIMdbRow aCardRow)
void SetListAddressTotal (in nsIMdbRow aListRow, in PRUint32 aTotal)
nsIMdbRow FindRowByCard (in nsIAbCard aCard)

Public Attributes

attribute nsIFile dbPath
 Path to the address book database that this instance represents.
readonly attribute nsIMdbRow newRow
readonly attribute nsIMdbRow newListRow
readonly attribute nsIArray deletedCardList
 Returns an array of the deleted cards currently stored in the mork file.
readonly attribute unsigned long deletedCardCount
 Returns the count of the deleted card currently stored in the mork file.

Member Function Documentation

void nsIAddrDatabase::add2ndEmail ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addAimScreenName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addAllowRemoteContent ( in nsIMdbRow  row,
in boolean  value 
)
void nsIAddrDatabase::addAnniversaryDay ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addAnniversaryMonth ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addAnniversaryYear ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addBirthDay ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addBirthMonth ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addBirthYear ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addCardRowToDB ( in nsIMdbRow  newRow  ) 
void nsIAddrDatabase::addCategory ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addCellularNumber ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addCellularNumberType ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addCompany ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addCustom1 ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addCustom2 ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addCustom3 ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addCustom4 ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addDefaultAddress ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addDepartment ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addDisplayName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addFamilyName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addFaxNumber ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addFaxNumberType ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addFirstName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addHomeAddress ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addHomeAddress2 ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addHomeCity ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addHomeCountry ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addHomePhone ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addHomePhoneType ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addHomeState ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addHomeZipCode ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addJobTitle ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addLastName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addLdifListMember ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::AddListCardColumnsToRow ( in nsIAbCard  aPCard,
in nsIMdbRow  aPListRow,
in unsigned long  aPos,
out nsIAbCard  aPNewCard,
in boolean  aInMailingList,
in nsIAbDirectory  aParent,
in nsIAbDirectory  aRoot 
)

Add the column representing the card to the mailing list row in the database.

Parameters:
aPCard the card to be added.
aPListRow the row to which the column will be added.
aPos the position of the card in the mailing list.
aPNewCard a pointer to hold the new card added to the row.
aInMailingList If set to true, the card is already present in the mailing list
aParent parent mailing list to which the card is added. If set to null, listeners of the database will not be notified of card creation.
aRoot If the card is created while creating a new mailing list, its set to the parent addressbook. Set to null in other case.
void nsIAddrDatabase::addListDescription ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addListDirNode ( in nsIMdbRow  listRow  ) 
void nsIAddrDatabase::addListName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addListNickName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addNickName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addNotes ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addPagerNumber ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addPagerNumberType ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addPhoneticFirstName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addPhoneticLastName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addPopularityIndex ( in nsIMdbRow  row,
in unsigned long  value 
)
void nsIAddrDatabase::addPreferMailFormat ( in nsIMdbRow  row,
in unsigned long  value 
)
void nsIAddrDatabase::addPrimaryEmail ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addSpouseName ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWebPage1 ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWebPage2 ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWorkAddress ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWorkAddress2 ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWorkCity ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWorkCountry ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWorkPhone ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWorkPhoneType ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWorkState ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::addWorkZipCode ( in nsIMdbRow  row,
in string  value 
)
void nsIAddrDatabase::close ( in boolean  forceCommit  ) 
void nsIAddrDatabase::closeMDB ( in boolean  commit  ) 
void nsIAddrDatabase::commit ( in unsigned long  commitType  ) 
boolean nsIAddrDatabase::containsCard ( in nsIAbCard  card  ) 
boolean nsIAddrDatabase::containsMailList ( in nsIAbDirectory  mailList  ) 
void nsIAddrDatabase::createMailListAndAddToDB ( in nsIAbDirectory  aNewList,
in boolean  aNotify,
in nsIAbDirectory  aParent 
)

Create a new mailing list and add to the database.

Parameters:
aNewList the mailing list to be added.
aNotify if set to true, all the listeners of the database will be notified.
aParent parent directory to which the mailing list is added. If set to null, listeners of the database will not be notified of mailing list creation.
void nsIAddrDatabase::createNewCardAndAddToDB ( in nsIAbCard  aNewCard,
in boolean  aNotify,
in nsIAbDirectory  aParent 
)

Create a new card and add to the database.

Parameters:
aNewCard the card to be added
aNotify if set to true, all the listeners of the database will be notified.
aParent parent directory or mailing list to which the card is added. If set to null, listeners of the database will not be notified of card creation.
void nsIAddrDatabase::createNewListCardAndAddToDB ( in nsIAbDirectory  list,
in unsigned long  listRowID,
in nsIAbCard  newCard,
in boolean  aNotify 
)
void nsIAddrDatabase::deleteCard ( in nsIAbCard  aCard,
in boolean  aNotify,
in nsIAbDirectory  aParent 
)

Delete a card from the database.

Parameters:
aCard the card to be deleted.
aNotify if set to true, all the listeners of the database will be notified.
aParent parent directory from which the card is to be deleted. If set to null, listeners of the database will not be notified of card deletion.
void nsIAddrDatabase::deleteCardFromMailList ( in nsIAbDirectory  mailList,
in nsIAbCard  card,
in boolean  aNotify 
)
void nsIAddrDatabase::deleteMailList ( in nsIAbDirectory  aMailList,
[optional] in nsIAbDirectory  aParent 
)

Deletes a mailing list from the directory.

Parameters:
aMailList The nsIAbDirectory implementation of the mailing list that is to be deleted.
aParent The parent of the mailing list that is being deleted. If this is supplied, then a notification of card entry change in the database will be made.
void nsIAddrDatabase::editCard ( in nsIAbCard  aCard,
in boolean  aNotify,
in nsIAbDirectory  aParent 
)

Edit a card in the database.

Parameters:
aCard the card to be edited.
aNotify if set to true, all the listeners of the database will be notified.
aParent parent directory in which the card is to be edited. If set to null, listeners of the database will not be notified of card entry change.
void nsIAddrDatabase::editMailList ( in nsIAbDirectory  mailList,
in nsIAbCard  listCard,
in boolean  aNotify 
)
nsISimpleEnumerator nsIAddrDatabase::enumerateCards ( in nsIAbDirectory  directory  ) 

Enumerate the cards in the directory.

The enumerator will return the cards associated with mailing lists too.

Parameters:
directory the directory of which to enumerate the cards.
Returns:
an enumerator.
nsISimpleEnumerator nsIAddrDatabase::enumerateListAddresses ( in nsIAbDirectory  directory  ) 

Enumerate the cards associated with the mailing lists in the directory.

Parameters:
directory the directory of which to enumerate the cards.
Returns:
an enumerator.
PRBool nsIAddrDatabase::findMailListbyUnicodeName ( in wstring  listName  ) 
nsIMdbRow nsIAddrDatabase::FindRowByCard ( in nsIAbCard  aCard  ) 
void nsIAddrDatabase::forceClosed (  ) 
void nsIAddrDatabase::getCardCount ( out PRUint32  count  ) 
nsIAbCard nsIAddrDatabase::getCardFromAttribute ( in nsIAbDirectory  aDirectory,
in string  aName,
in AUTF8String  aUTF8Value,
in boolean  aCaseInsensitive 
)

Gets the first card which matches the attribute/value pair supplied.

Parameters:
aDirectory The current nsIAbDirectory associated with this instance of the database.
aName The attribute to look up the value in.
aUTF8Value The value to look up in UTF8 format.
aCaseInsensitive Set to true for case-insenstive matching.
Returns:
Returns an nsIAbCard if one is found, otherwise NULL.
nsISimpleEnumerator nsIAddrDatabase::getCardsFromAttribute ( in nsIAbDirectory  aDirectory,
in string  aName,
in AUTF8String  uUTF8Value,
in boolean  aCaseInsensitive 
)

Gets all cards which matches the attribute/value pair supplied.

Parameters:
aDirectory The current nsIAbDirectory associated with this instance of the database.
aName The attribute to look up the value in.
aUTF8Value The value to look up in UTF8 format.
aCaseInsensitive Set to true for case-insenstive matching.
Returns:
Returns an nsISimpleEnumerator of nsIAbCard instances.
wstring nsIAddrDatabase::getCardValue ( in nsIAbCard  card,
in string  name 
)
void nsIAddrDatabase::getMailingListsFromDB ( in nsIAbDirectory  parentDir  ) 
void nsIAddrDatabase::InitCardFromRow ( in nsIAbCard  aNewCard,
in nsIMdbRow  aCardRow 
)
nsIAddrDatabase nsIAddrDatabase::open ( in nsIFile  dbFile,
in boolean  create,
in boolean  upgrading 
)
void nsIAddrDatabase::openMDB ( in nsIFile  dbName,
in boolean  create 
)

Open the MDB database synchronously creating it if required.

If successful, this routine will set up the m_mdbStore and m_mdbEnv of the database object so other database calls can work.

Parameters:
dbName The location of the database file to open.
create If set to true, will create the database file if it does not already exist.
Exceptions:
NS_ERROR_FILE_NOT_FOUND The file was not found at the specified location (and create was false).
NS_ERROR_FILE_ACCESS_DENIED The file could not be opened as access was denied.
void nsIAddrDatabase::setCardValue ( in nsIAbCard  card,
in string  name,
in wstring  value,
in boolean  notify 
)

use for getting and setting generic string attributes like _AimScreenName

void nsIAddrDatabase::SetListAddressTotal ( in nsIMdbRow  aListRow,
in PRUint32  aTotal 
)

Member Data Documentation

Path to the address book database that this instance represents.

readonly attribute unsigned long nsIAddrDatabase::deletedCardCount

Returns the count of the deleted card currently stored in the mork file.

Returns an array of the deleted cards currently stored in the mork file.

readonly attribute nsIMdbRow nsIAddrDatabase::newRow

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