Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
nsAbIPCCard Class Reference

#include <nsAbIPCCard.h>

Inheritance diagram for nsAbIPCCard:
Inheritance graph
[legend]
Collaboration diagram for nsAbIPCCard:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD 
Equals (nsIAbCard *card, PRBool *_retval)
PRBool Equals (nsABCOMCardStruct *card, nsStringArray &differingAttrs)
PRBool EqualsAfterUnicodeConversion (nsABCOMCardStruct *card, nsStringArray &differingAttrs)
PRBool Same (nsABCOMCardStruct *card, PRBool isUnicode=PR_TRUE)
PRBool Same (nsIAbCard *card)
NS_IMETHOD Copy (nsIAbCard *srcCard)
nsresult Copy (nsABCOMCardStruct *srcCard)
nsresult ConvertToUnicodeAndCopy (nsABCOMCardStruct *srcCard)
nsresult GetABCOMCardStruct (PRBool isUnicode, nsABCOMCardStruct *card)
 nsAbIPCCard ()
 nsAbIPCCard (nsIAbCard *card)
 nsAbIPCCard (nsABCOMCardStruct *card, PRBool isUnicode=PR_TRUE)
virtual ~nsAbIPCCard ()
void SetStatus (PRUint32 status)
PRUint32 GetStatus ()
void SetRecordId (PRUint32 recID)
PRUint32 GetRecordId ()
void SetCategoryId (PRUint32 catID)
PRUint32 GetCategoryId ()
NS_IMETHOD EditCardToDatabase (const char *uri)
void setAbDatabase (in nsIAddrDatabase database)
void copyCard (in nsIAbMDBCard srcCardDB)
wstring getStringAttribute (in string name)
void setStringAttribute (in string name, in wstring value)
wstring getCardValue (in string name)
void setCardValue (in string attrname, in wstring value)
void copy (in nsIAbCard srcCard)
void editCardToDatabase (in string uri)
boolean equals (in nsIAbCard card)
string convertToBase64EncodedXML ()
wstring convertToXMLPrintData ()
string convertToEscapedVCard ()

Public Attributes

attribute unsigned long key
attribute unsigned long dbTableID
attribute unsigned long dbRowID
attribute wstring firstName
attribute wstring lastName
attribute wstring phoneticFirstName
attribute wstring phoneticLastName
attribute wstring displayName
attribute wstring nickName
attribute wstring primaryEmail
attribute wstring secondEmail
attribute wstring defaultEmail
attribute wstring cardType
attribute wstring workPhone
attribute wstring homePhone
attribute wstring faxNumber
attribute wstring pagerNumber
attribute wstring cellularNumber
attribute wstring workPhoneType
attribute wstring homePhoneType
attribute wstring faxNumberType
attribute wstring pagerNumberType
attribute wstring cellularNumberType
attribute wstring homeAddress
attribute wstring homeAddress2
attribute wstring homeCity
attribute wstring homeState
attribute wstring homeZipCode
attribute wstring homeCountry
attribute wstring workAddress
attribute wstring workAddress2
attribute wstring workCity
attribute wstring workState
attribute wstring workZipCode
attribute wstring workCountry
attribute wstring jobTitle
attribute wstring department
attribute wstring company
attribute wstring aimScreenName
attribute wstring anniversaryYear
attribute wstring anniversaryMonth
attribute wstring anniversaryDay
attribute wstring spouseName
attribute wstring familyName
attribute wstring defaultAddress
attribute wstring category
attribute wstring webPage1
 webPage1 is work web page
attribute wstring webPage2
 webPage2 is home web page
attribute wstring birthYear
attribute wstring birthMonth
attribute wstring birthDay
attribute wstring custom1
attribute wstring custom2
attribute wstring custom3
attribute wstring custom4
attribute wstring notes
attribute unsigned long lastModifiedDate
attribute unsigned long popularityIndex
attribute unsigned long preferMailFormat
attribute boolean isMailList
attribute string mailListURI
 If isMailList is true then mailListURI will contain the URI of the associated mail list.
attribute boolean allowRemoteContent
 allowRemoteContent to be displayed in HTML mail received from this contact.
readonly attribute boolean isANormalCard
 Card type helper attributes.
readonly attribute boolean isASpecialGroup
readonly attribute boolean isAnEmailAddress

Protected Member Functions

nsresult GetCardDatabase (const char *uri)
nsresult GetAttributeName (PRUnichar **aName, nsString &value)
nsresult SetAttributeName (const PRUnichar *aName, nsString &attribute)

Protected Attributes

PRUint32 m_key
PRUint32 m_dbTableID
PRUint32 m_dbRowID
nsCOMPtr< nsIAddrDatabasemCardDatabase
nsString m_PhoneticFirstName
nsString m_PhoneticLastName
nsString m_FirstName
nsString m_LastName
nsString m_DisplayName
nsString m_NickName
nsString m_PrimaryEmail
nsString m_SecondEmail
nsString m_DefaultEmail
nsString m_CardType
nsString m_WorkPhone
nsString m_HomePhone
nsString m_FaxNumber
nsString m_PagerNumber
nsString m_CellularNumber
nsString m_WorkPhoneType
nsString m_HomePhoneType
nsString m_FaxNumberType
nsString m_PagerNumberType
nsString m_CellularNumberType
nsString m_HomeAddress
nsString m_HomeAddress2
nsString m_HomeCity
nsString m_HomeState
nsString m_HomeZipCode
nsString m_HomeCountry
nsString m_WorkAddress
nsString m_WorkAddress2
nsString m_WorkCity
nsString m_WorkState
nsString m_WorkZipCode
nsString m_WorkCountry
nsString m_JobTitle
nsString m_Department
nsString m_Company
nsString m_AimScreenName
nsString m_AnniversaryYear
nsString m_AnniversaryMonth
nsString m_AnniversaryDay
nsString m_SpouseName
nsString m_FamilyName
nsString m_DefaultAddress
nsString m_Category
nsString m_WebPage1
nsString m_WebPage2
nsString m_BirthYear
nsString m_BirthMonth
nsString m_BirthDay
nsString m_Custom1
nsString m_Custom2
nsString m_Custom3
nsString m_Custom4
nsString m_Note
PRUint32 m_LastModDate
PRUint32 m_PreferMailFormat
PRUint32 m_PopularityIndex
PRBool m_AllowRemoteContent
PRBool m_IsMailList
nsCString m_MailListURI

Private Member Functions

void CopyValue (PRBool isUnicode, nsString &attribValue, LPTSTR *result)
PRBool CompareValue (PRBool isUnicode, LPTSTR cardValue, nsString &attribValue)
void SplitHomeAndWorkAddresses (nsABCOMCardStruct *card, PRBool isUnicode)
void SplitAddresses (PRBool isUnicode, LPTSTR homeAddress, LPTSTR workAddress)
void JoinHomeAndWorkAddresses (PRBool isUnicode, nsABCOMCardStruct *card)
void JoinAddress (PRBool isUnicode, LPTSTR *ptrAddress, nsString &address1, nsString &address2)

Private Attributes

PRUint32 mRecordId
PRUint32 mCategoryId
PRUint32 mStatus

Detailed Description

Definition at line 57 of file nsAbIPCCard.h.


Constructor & Destructor Documentation

Definition at line 59 of file nsAbIPCCard.cpp.

{
    mRecordId = 0;
    mCategoryId = -1;
    mStatus = -1;
    PR_LOG(PALMSYNC, PR_LOG_DEBUG, ("nsAbIPCCard::nsAbIPCCard \n"));
}

Definition at line 72 of file nsAbIPCCard.cpp.

{
    Copy(card);
}

Here is the call graph for this function:

Definition at line 77 of file nsAbIPCCard.cpp.

{
    if(isUnicode)
        Copy(card);
    else
        ConvertToUnicodeAndCopy(card);
}

Here is the call graph for this function:

Definition at line 67 of file nsAbIPCCard.cpp.

{
   
}

Member Function Documentation

PRBool nsAbIPCCard::CompareValue ( PRBool  isUnicode,
LPTSTR  cardValue,
nsString attribValue 
) [private]

Definition at line 731 of file nsAbIPCCard.cpp.

{
    if(cardValue) {
        if(isUnicode) {
            if (Compare(nsDependentString(cardValue), attribValue, nsCaseInsensitiveStringComparator()))
                return PR_FALSE;
        }
        else {
            nsAutoString str;
            CONVERT_ASSIGNTO_UNICODE(str, cardValue, PR_TRUE);
            if (Compare(str, attribValue, nsCaseInsensitiveStringComparator()))
                return PR_FALSE;
        }
    }

    return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 245 of file nsAbIPCCard.cpp.

{
    NS_ENSURE_ARG_POINTER(srcCard);

    mRecordId = srcCard->dwRecordId;
    mCategoryId = srcCard->dwCategoryId;
    mStatus = srcCard->dwStatus;

    nsAutoString str;

    // Each palm address field is allowed to have multiple lines
    // so replace CRLFs with spaces (since other than Notes field
    // moz only displays fields in a single line).
    CONVERT_ASSIGNTO_UNICODE(str, srcCard->firstName, PR_TRUE);
    SetFirstName(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->lastName, PR_TRUE);
    SetLastName(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->displayName, PR_TRUE);
    SetDisplayName(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->nickName, PR_TRUE);
    SetNickName(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->primaryEmail, PR_TRUE);
    SetPrimaryEmail(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->secondEmail, PR_TRUE);
    SetSecondEmail(str.get());

    SetPreferMailFormat(srcCard->preferMailFormat);

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workPhone, PR_TRUE);
    SetWorkPhone(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homePhone, PR_TRUE);
    SetHomePhone(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->faxNumber, PR_TRUE);
    SetFaxNumber(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->pagerNumber, PR_TRUE);
    SetPagerNumber(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->cellularNumber, PR_TRUE);
    SetCellularNumber(str.get());

    // See if home address contains multiple lines.
    SplitHomeAndWorkAddresses(srcCard, PR_FALSE);

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homeCity, PR_TRUE);
    SetHomeCity(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homeState, PR_TRUE);
    SetHomeState(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homeZipCode, PR_TRUE);
    SetHomeZipCode(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homeCountry, PR_TRUE);
    SetHomeCountry(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workCity, PR_TRUE);
    SetWorkCity(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workState, PR_TRUE);
    SetWorkState(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workZipCode, PR_TRUE);
    SetWorkZipCode(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workCountry, PR_TRUE);
    SetWorkCountry(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->jobTitle, PR_TRUE);
    SetJobTitle(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->department, PR_TRUE);
    SetDepartment(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->company, PR_TRUE);
    SetCompany(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->webPage1, PR_TRUE);
    SetWebPage1(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->webPage2, PR_TRUE);
    SetWebPage2(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->birthYear, PR_TRUE);
    SetBirthYear(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->birthMonth, PR_TRUE);
    SetBirthMonth(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->birthDay, PR_TRUE);
    SetBirthDay(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->custom1, PR_TRUE);
    SetCustom1(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->custom2, PR_TRUE);
    SetCustom2(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->custom3, PR_TRUE);
    SetCustom3(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->custom4, PR_TRUE);
    SetCustom4(str.get());

    CONVERT_ASSIGNTO_UNICODE(str, srcCard->notes, PR_FALSE);
    SetNotes(str.get());

    SetLastModifiedDate(srcCard->lastModifiedDate);
    SetIsMailList(srcCard->isMailList);
    SetMailListURI(srcCard->mailListURI);

    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

wstring nsIAbCard::convertToXMLPrintData ( ) [inherited]

Definition at line 85 of file nsAbIPCCard.cpp.

{
    NS_ENSURE_ARG_POINTER(srcCard);

    nsresult rv;
    nsCOMPtr<nsIAbMDBCard> dbCard;
    dbCard = do_QueryInterface(srcCard, &rv);
    if(NS_SUCCEEDED(rv) && dbCard) {
        nsXPIDLString palmIDStr;
        nsresult rv = dbCard->GetStringAttribute(CARD_ATTRIB_PALMID, getter_Copies(palmIDStr));
        if(NS_SUCCEEDED(rv) && palmIDStr.get()) {
            PRFloat64 f = PR_strtod(NS_LossyConvertUCS2toASCII(palmIDStr).get(), nsnull);
            PRInt64 l;
            LL_D2L(l, f);
            LL_L2UI(mRecordId, l);
        }
        else
            mRecordId = 0;
        // set tableID, RowID and Key for the card
        PRUint32 tableID=0;
        dbCard->GetDbTableID(&tableID);
        SetDbTableID(tableID);
        PRUint32 rowID=0;
        dbCard->GetDbRowID(&rowID);
        SetDbRowID(rowID);
        PRUint32 key;
        dbCard->GetKey(&key);
        SetKey(key);
    }
    PRUint32 lastModifiedDate = 0;
    srcCard->GetLastModifiedDate(&lastModifiedDate);
    mStatus = (lastModifiedDate) ? ATTR_MODIFIED : ATTR_NEW;

    rv = nsAbCardProperty::Copy(srcCard);
    // do we need to join the work and home addresses?
    // or split them?

    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 125 of file nsAbIPCCard.cpp.

{
    NS_ENSURE_ARG_POINTER(srcCard);

    mRecordId = srcCard->dwRecordId;
    mCategoryId = srcCard->dwCategoryId;
    mStatus = srcCard->dwStatus;
    srcCard->addressToUse = CPalmSyncImp::nsUseABHomeAddressForPalmAddress(); // 0 == work, 1 == home
    PR_LOG(PALMSYNC, PR_LOG_DEBUG, ("nsAbIPCCard::Copy using %d\n", srcCard->addressToUse));

    // Each palm address field is allowed to have multiple lines
    // so replace CRLFs with spaces (since other than Notes field
    // moz only displays fields in a single line).
    nsAutoString str;
    CONVERT_CRLF_TO_SPACE(str, srcCard->firstName);
    SetFirstName(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->lastName);
    SetLastName(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->displayName);
    SetDisplayName(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->nickName);
    SetNickName(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->primaryEmail);
    SetPrimaryEmail(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->secondEmail);
    SetSecondEmail(str.get());

    SetPreferMailFormat(srcCard->preferMailFormat);

    CONVERT_CRLF_TO_SPACE(str, srcCard->workPhone);
    SetWorkPhone(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->homePhone);
    SetHomePhone(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->faxNumber);
    SetFaxNumber(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->pagerNumber);
    SetPagerNumber(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->cellularNumber);
    SetCellularNumber(str.get());

    // See if home address contains multiple lines.
    SplitHomeAndWorkAddresses(srcCard, PR_TRUE);

    CONVERT_CRLF_TO_SPACE(str, srcCard->homeCity);
    SetHomeCity(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->homeState);
    SetHomeState(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->homeZipCode);
    SetHomeZipCode(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->homeCountry);
    SetHomeCountry(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->workCity);
    SetWorkCity(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->workState);
    SetWorkState(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->workZipCode);
    SetWorkZipCode(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->workCountry);
    SetWorkCountry(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->jobTitle);
    SetJobTitle(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->department);
    SetDepartment(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->company);
    SetCompany(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->webPage1);
    SetWebPage1(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->webPage2);
    SetWebPage2(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->birthYear);
    SetBirthYear(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->birthMonth);
    SetBirthMonth(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->birthDay);
    SetBirthDay(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->custom1);
    SetCustom1(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->custom2);
    SetCustom2(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->custom3);
    SetCustom3(str.get());

    CONVERT_CRLF_TO_SPACE(str, srcCard->custom4);
    SetCustom4(str.get());

    SetNotes(srcCard->notes);
    SetLastModifiedDate(srcCard->lastModifiedDate);
    SetIsMailList(srcCard->isMailList);
    SetMailListURI(srcCard->mailListURI);

    return NS_OK;
}

Here is the call graph for this function:

void nsIAbCard::copy ( in nsIAbCard  srcCard) [inherited]
void nsIAbMDBCard::copyCard ( in nsIAbMDBCard  srcCardDB) [inherited]
void nsAbIPCCard::CopyValue ( PRBool  isUnicode,
nsString attribValue,
LPTSTR result 
) [private]

Definition at line 808 of file nsAbIPCCard.cpp.

{
    *result = NULL;
    if(attribValue.Length() && attribValue.get()) {
        PRInt32 length;
        if(isUnicode) {                                 
            length = attribValue.Length()+1;
            PRUnichar * Str = (PRUnichar *) CoTaskMemAlloc(sizeof(PRUnichar) * length);
            wcsncpy(Str, attribValue.get(), length-1);
            Str[length-1] = '\0';
            *result = Str;
        } 
        else { 
            NS_LossyConvertUTF16toASCII cStr(attribValue);
            // These strings are defined as wide in the idl, so we need to add up to 3
            // bytes of 0 byte padding at the end (if the string is an odd number of 
            // bytes long, we need one null byte to pad out the last char to a wide char
            // and then  two more nulls as a wide null terminator.
            length = cStr.Length()+3;
            char * str = (char *) CoTaskMemAlloc(length);
            strncpy(str, cStr.get(), length-1);
            str[length-1] = '\0';
            *result = (LPTSTR) str;
        } 
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 268 of file nsAbMDBCardProperty.cpp.

Here is the call graph for this function:

NS_IMETHODIMP nsAbIPCCard::Equals ( nsIAbCard card,
PRBool _retval 
)

Reimplemented from nsAbMDBCardProperty.

Definition at line 568 of file nsAbIPCCard.cpp.

{
    NS_ENSURE_ARG_POINTER(card);
    NS_ENSURE_ARG_POINTER(_retval);

    nsXPIDLString str;
    *_retval = PR_FALSE;

    card->GetFirstName(getter_Copies(str));
    if (Compare(str, m_FirstName, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetLastName(getter_Copies(str));
    if (Compare(str, m_LastName, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetDisplayName(getter_Copies(str));
    if (Compare(str, m_DisplayName, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetNickName(getter_Copies(str));
    if (Compare(str, m_NickName, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetPrimaryEmail(getter_Copies(str));
    if (Compare(str, m_PrimaryEmail, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetSecondEmail(getter_Copies(str));
    if (Compare(str, m_SecondEmail, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetWorkPhone(getter_Copies(str));
    if (Compare(str, m_WorkPhone, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetHomePhone(getter_Copies(str));
    if (Compare(str, m_HomePhone, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetFaxNumber(getter_Copies(str));
    if (Compare(str, m_FaxNumber, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetPagerNumber(getter_Copies(str));
    if (Compare(str, m_PagerNumber, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetCellularNumber(getter_Copies(str));
    if (Compare(str, m_CellularNumber, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetHomeAddress(getter_Copies(str));
    if (Compare(str, m_HomeAddress, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetHomeAddress2(getter_Copies(str));
    if (Compare(str, m_HomeAddress2, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetHomeCity(getter_Copies(str));
    if (Compare(str, m_HomeCity, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetHomeState(getter_Copies(str));
    if (Compare(str, m_HomeState, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetHomeZipCode(getter_Copies(str));
    if (Compare(str, m_HomeZipCode, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetHomeCountry(getter_Copies(str));
    if (Compare(str, m_HomeCountry, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    // both card and this have their addresses split, which is correct
    card->GetWorkAddress(getter_Copies(str));
    if (Compare(str, m_WorkAddress, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetWorkAddress2(getter_Copies(str));
    if (Compare(str, m_WorkAddress2, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetWorkCity(getter_Copies(str));
    if (Compare(str, m_WorkCity, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetWorkState(getter_Copies(str));
    if (Compare(str, m_WorkState, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetWorkZipCode(getter_Copies(str));
    if (Compare(str, m_WorkZipCode, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetWorkCountry(getter_Copies(str));
    if (Compare(str, m_WorkCountry, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetJobTitle(getter_Copies(str));
    if (Compare(str, m_JobTitle, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetDepartment(getter_Copies(str));
    if (Compare(str, m_Department, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetCompany(getter_Copies(str));
    if (Compare(str, m_Company, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetWebPage1(getter_Copies(str));
    if (Compare(str, m_WebPage1, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetWebPage2(getter_Copies(str));
    if (Compare(str, m_WebPage2, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetBirthYear(getter_Copies(str));
    if (Compare(str, m_BirthYear, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetBirthMonth(getter_Copies(str));
    if (Compare(str, m_BirthMonth, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetBirthDay(getter_Copies(str));
    if (Compare(str, m_BirthDay, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetCustom1(getter_Copies(str));
    if (Compare(str, m_Custom1, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetCustom2(getter_Copies(str));
    if (Compare(str, m_Custom2, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetCustom3(getter_Copies(str));
    if (Compare(str, m_Custom3, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    card->GetCustom4(getter_Copies(str));
    if (Compare(str, m_Custom4, nsCaseInsensitiveStringComparator()))
        return NS_OK;

    PRBool isMailList=PR_FALSE;
    card->GetIsMailList(&isMailList);
    if (isMailList != m_IsMailList)
        return NS_OK;

    nsXPIDLCString str2;
    card->GetMailListURI(getter_Copies(str2));
    if (m_MailListURI.Equals(str2, nsCaseInsensitiveCStringComparator()))
        return NS_OK;

    *_retval = PR_TRUE;
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsAbIPCCard::Equals ( nsABCOMCardStruct card,
nsStringArray &  differingAttrs 
)

Definition at line 442 of file nsAbIPCCard.cpp.

{
    if(!card)
        return PR_FALSE;

    differingAttrs.Clear();

    if(card->firstName)
        if (Compare(nsDependentString(card->firstName), m_FirstName, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kFirstNameColumn));
    if(card->lastName)
        if (Compare(nsDependentString(card->lastName), m_LastName, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kLastNameColumn));
    if(card->displayName)
        if (Compare(nsDependentString(card->displayName), m_DisplayName, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kDisplayNameColumn));
    if(card->nickName)
        if (Compare(nsDependentString(card->nickName), m_NickName, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kNicknameColumn));
    if(card->primaryEmail)
        if (Compare(nsDependentString(card->primaryEmail), m_PrimaryEmail, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kPriEmailColumn));
    if(card->secondEmail)
        if (Compare(nsDependentString(card->secondEmail), m_SecondEmail, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(k2ndEmailColumn));
    if(card->workPhone)
        if (Compare(nsDependentString(card->workPhone), m_WorkPhone, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkPhoneColumn));
    if(card->homePhone)
        if (Compare(nsDependentString(card->homePhone), m_HomePhone, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kHomePhoneColumn));
    if(card->faxNumber)
        if (Compare(nsDependentString(card->faxNumber), m_FaxNumber, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kFaxColumn));
    if(card->pagerNumber)
        if (Compare(nsDependentString(card->pagerNumber), m_PagerNumber, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kPagerColumn));
    if(card->cellularNumber)
        if (Compare(nsDependentString(card->cellularNumber), m_CellularNumber, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kCellularColumn));
    // card  has home and work addresses joined, but "this" has them split
    if(card->homeAddress)
        if (Compare(nsDependentString(card->homeAddress), m_HomeAddress, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeAddressColumn));
    if(card->homeAddress2)
        if (Compare(nsDependentString(card->homeAddress2), m_HomeAddress2, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeAddress2Column));
    if(card->homeCity)
        if (Compare(nsDependentString(card->homeCity), m_HomeCity, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeCityColumn));
    if(card->homeState)
        if (Compare(nsDependentString(card->homeState), m_HomeState, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeStateColumn));
    if(card->homeZipCode)
        if (Compare(nsDependentString(card->homeZipCode), m_HomeZipCode, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeZipCodeColumn));
    if(card->homeCountry)
        if (Compare(nsDependentString(card->homeCountry), m_HomeCountry, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeCountryColumn));
    // card->workAddress is Joined, m_workAddress and m_workAddress2 are split
    if(card->workAddress)
        if (Compare(nsDependentString(card->workAddress), m_WorkAddress, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkAddressColumn));
    if(card->workAddress2)
        if (Compare(nsDependentString(card->workAddress2), m_WorkAddress2, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkAddress2Column));
    if(card->workCity)
        if (Compare(nsDependentString(card->workCity), m_WorkCity, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkCityColumn));
    if(card->workState)
        if (Compare(nsDependentString(card->workState), m_WorkState, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkStateColumn));
    if(card->workZipCode)
        if (Compare(nsDependentString(card->workZipCode), m_WorkZipCode, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkZipCodeColumn));
    if(card->workCountry)
        if (Compare(nsDependentString(card->workCountry), m_WorkCountry, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkCountryColumn));
    if(card->jobTitle)
        if (Compare(nsDependentString(card->jobTitle), m_JobTitle, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kJobTitleColumn));
    if(card->department)
        if (Compare(nsDependentString(card->department), m_Department, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kDepartmentColumn));
    if(card->company)
        if (Compare(nsDependentString(card->company), m_Company, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kCompanyColumn));
    if(card->webPage1)
        if (Compare(nsDependentString(card->webPage1), m_WebPage1, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kWebPage1Column));
    if(card->webPage2)
        if (Compare(nsDependentString(card->webPage2), m_WebPage2, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kWebPage2Column));
    if(card->birthYear)
        if (Compare(nsDependentString(card->birthYear), m_BirthYear, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kBirthYearColumn));
    if(card->birthMonth)
        if (Compare(nsDependentString(card->birthMonth), m_BirthMonth, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kBirthMonthColumn));
    if(card->birthDay)
        if (Compare(nsDependentString(card->birthDay), m_BirthDay, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kBirthDayColumn));
    if(card->custom1)
        if (Compare(nsDependentString(card->custom1), m_Custom1, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kCustom1Column));
    if(card->custom2)
        if (Compare(nsDependentString(card->custom2), m_Custom2, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kCustom2Column));
    if(card->custom3)
        if (Compare(nsDependentString(card->custom3), m_Custom3, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kCustom3Column));
    if(card->custom4)
        if (Compare(nsDependentString(card->custom4), m_Custom4, nsCaseInsensitiveStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kCustom4Column));
    if (card->isMailList != m_IsMailList)
        differingAttrs.AppendString(NS_LITERAL_STRING(kMailListName));
    if(card->mailListURI) {
        nsCAutoString str(card->mailListURI);
        if (str.Equals(m_MailListURI, nsCaseInsensitiveCStringComparator()))
            differingAttrs.AppendString(NS_LITERAL_STRING(kMailListDescription));
    }

    return (differingAttrs.Count() == 0);
}

Here is the call graph for this function:

boolean nsIAbCard::equals ( in nsIAbCard  card) [inherited]
PRBool nsAbIPCCard::EqualsAfterUnicodeConversion ( nsABCOMCardStruct card,
nsStringArray &  differingAttrs 
)

Definition at line 417 of file nsAbIPCCard.cpp.

{
    if(!card)
        return PR_FALSE;

    // convert to Unicode first
    nsAbIPCCard card1(card, PR_FALSE);
    card1.SplitAddresses(PR_FALSE, card->homeAddress, card->workAddress);
    nsABCOMCardStruct * newCard = new nsABCOMCardStruct;
    // get the unicode nsABCOMCardStruct and compare
    card1.GetABCOMCardStruct(PR_TRUE, newCard);
    // want to split newCard home and work address

    // I think this leaks...need to free up the original values
    card1.CopyValue(PR_TRUE, m_HomeAddress, &newCard->homeAddress);
    card1.CopyValue(PR_TRUE, m_HomeAddress2, &newCard->homeAddress2);
    card1.CopyValue(PR_TRUE, m_WorkAddress, &newCard->workAddress);
    card1.CopyValue(PR_TRUE, m_WorkAddress2, &newCard->workAddress2);
  
    PRBool ret = Equals(newCard, differingAttrs);
    delete newCard;
    return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 835 of file nsAbIPCCard.cpp.

{
    NS_ENSURE_ARG_POINTER(card);

    // If memset() call is missing, callers of MS COM nsSynchronizeAB() will
    // receive a different return code even if nsSynchronizeAB() return S_OK.
    memset(card, 0, sizeof(nsABCOMCardStruct));
    card->dwRecordId = mRecordId;
    card->dwCategoryId = mCategoryId;
    card->dwStatus = mStatus;
    card->addressToUse = CPalmSyncImp::nsUseABHomeAddressForPalmAddress(); // 0 == home, 1 == work
    PR_LOG(PALMSYNC, PR_LOG_DEBUG, ("nsAbIPCCard::GetABCOMCardStruct using %d\n", card->addressToUse));

    CopyValue(isUnicode, m_FirstName, &card->firstName);
    CopyValue(isUnicode, m_LastName, &card->lastName);
    CopyValue(isUnicode, m_DisplayName, &card->displayName);
    CopyValue(isUnicode, m_NickName, &card->nickName);
    CopyValue(isUnicode, m_PrimaryEmail, &card->primaryEmail);
    CopyValue(isUnicode, m_SecondEmail, &card->secondEmail);
    CopyValue(isUnicode, m_WorkPhone, &card->workPhone);
    CopyValue(isUnicode, m_HomePhone, &card->homePhone);
    CopyValue(isUnicode, m_FaxNumber, &card->faxNumber);
    CopyValue(isUnicode, m_PagerNumber, &card->pagerNumber);
    CopyValue(isUnicode, m_CellularNumber, &card->cellularNumber);
    // See if home address contains multiple lines.
    JoinHomeAndWorkAddresses(isUnicode, card);
    CopyValue(isUnicode, m_HomeCity, &card->homeCity);
    CopyValue(isUnicode, m_HomeState, &card->homeState);
    CopyValue(isUnicode, m_HomeZipCode, &card->homeZipCode);
    CopyValue(isUnicode, m_HomeCountry, &card->homeCountry);
    CopyValue(isUnicode, m_WorkCity, &card->workCity);
    CopyValue(isUnicode, m_WorkState, &card->workState);
    CopyValue(isUnicode, m_WorkZipCode, &card->workZipCode);
    CopyValue(isUnicode, m_WorkCountry, &card->workCountry);
    CopyValue(isUnicode, m_JobTitle, &card->jobTitle);
    CopyValue(isUnicode, m_Department, &card->department);
    CopyValue(isUnicode, m_Company, &card->company);
    CopyValue(isUnicode, m_WebPage1, &card->webPage1);
    CopyValue(isUnicode, m_WebPage2, &card->webPage2);
    CopyValue(isUnicode, m_BirthYear, &card->birthYear);
    CopyValue(isUnicode, m_BirthMonth, &card->birthMonth);
    CopyValue(isUnicode, m_BirthDay, &card->birthDay);
    CopyValue(isUnicode, m_Custom1, &card->custom1);
    CopyValue(isUnicode, m_Custom2, &card->custom2);
    CopyValue(isUnicode, m_Custom3, &card->custom3);
    CopyValue(isUnicode, m_Custom4, &card->custom4);
    CopyValue(isUnicode, m_Note, &card->notes);

    card->lastModifiedDate = m_LastModDate;
    card->preferMailFormat = m_PreferMailFormat;
    card->addressToUse = CPalmSyncImp::nsUseABHomeAddressForPalmAddress(); // 0 == home, 1 == work
    if (CPalmSyncImp::nsPreferABHomePhoneForPalmPhone())
      card->preferredPhoneNum = (m_HomePhone.IsEmpty()) ? (m_WorkPhone.IsEmpty() ? 4 : 1) : 2;
    else
      card->preferredPhoneNum = (m_WorkPhone.IsEmpty()) ? 2 : (m_WorkPhone.IsEmpty() ? 4 : 1);
    card->isMailList = m_IsMailList;
    // Can't use ToNewCString() call here becasue MSCOM will complaint about
    // memory deallocation (ie, NdrPointerFree()) use CoTaskMemAlloc() instead.
    if (m_MailListURI.IsEmpty())
      card->mailListURI = NULL;
    else
    {
      PRInt32 length = m_MailListURI.Length()+1;
      char * str = (char *) CoTaskMemAlloc(sizeof(char) * length);
      strncpy(str, m_MailListURI.get(), length-1);
      str[length-1] = '\0';
      card->mailListURI = str;
    }

    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsAbCardProperty::GetAttributeName ( PRUnichar **  aName,
nsString value 
) [protected, inherited]

Definition at line 171 of file nsAbCardProperty.cpp.

Here is the call graph for this function:

nsresult nsAbMDBCardProperty::GetCardDatabase ( const char *  uri) [protected, inherited]

Definition at line 285 of file nsAbMDBCardProperty.cpp.

{
       nsresult rv = NS_OK;

       nsCOMPtr<nsIAddrBookSession> abSession = 
                do_GetService(NS_ADDRBOOKSESSION_CONTRACTID, &rv); 
       if (NS_SUCCEEDED(rv))
       {
              nsCOMPtr<nsILocalFile> dbPath;
              rv = abSession->GetUserProfileDirectory(getter_AddRefs(dbPath));
              NS_ENSURE_SUCCESS(rv, rv);


              rv = dbPath->AppendNative(nsDependentCString(&(uri[kMDBDirectoryRootLen])));
              NS_ENSURE_SUCCESS(rv, rv);
              
              PRBool fileExists;
              rv = dbPath->Exists(&fileExists);
              if (NS_SUCCEEDED(rv) && fileExists)
              {
                     nsCOMPtr<nsIAddrDatabase> addrDBFactory = 
                              do_GetService(NS_ADDRDATABASE_CONTRACTID, &rv);

                     if (NS_SUCCEEDED(rv) && addrDBFactory)
                            rv = addrDBFactory->Open(dbPath, PR_TRUE, PR_TRUE, getter_AddRefs(mCardDatabase));
              }
              else
                     rv = NS_ERROR_FAILURE;
       }
       return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

wstring nsIAbCard::getCardValue ( in string  name) [inherited]

Definition at line 89 of file nsAbIPCCard.h.

{ return mCategoryId; }

Definition at line 87 of file nsAbIPCCard.h.

{ return mRecordId; }

Here is the caller graph for this function:

Definition at line 85 of file nsAbIPCCard.h.

{ return mStatus; }

Here is the caller graph for this function:

wstring nsIAbMDBCard::getStringAttribute ( in string  name) [inherited]
void nsAbIPCCard::JoinAddress ( PRBool  isUnicode,
LPTSTR ptrAddress,
nsString address1,
nsString address2 
) [private]

Definition at line 907 of file nsAbIPCCard.cpp.

{
  // If the two address lines in a moz card are not empty
  // then join the lines into a single line separated by
  // '\x0A'. This is the format expected by Palm.
  *ptrAddress = NULL;
  PRUint32 strLength= address1.Length() + address2.Length();
  if(!strLength)
    return;

  // Allocate space for 'strLength' plus three for nulls and one for "\x0A".
  // These strings are defined as wide in the idl, so we need to add up to 3
  // bytes of 0 byte padding at the end (if the string is an odd number of 
  // bytes long, we need one null byte to pad out the last char to a wide char
  // and then  two more nulls as a wide null terminator.
  strLength += 4;
  if(isUnicode)
  { 
    PRUnichar * uniStr = (PRUnichar *) CoTaskMemAlloc(sizeof(PRUnichar) * (strLength));
    if(address1.Length())
    {
      wcsncpy(uniStr, address1.get(), strLength-1);
      uniStr[strLength-1] = '\0';
      if(address2.Length())
      {
        wcsncat(uniStr, (const wchar_t *)"\x0A", strLength-1);
        wcsncat(uniStr, address2.get(), strLength-1);
        uniStr[strLength-1] = '\0';
      }
    }
    else
    {
      wcsncpy(uniStr, address2.get(), strLength-1);
      uniStr[strLength-1] = '\0';
    }

    *ptrAddress = uniStr;
  } 
  else
  { 
    char * str = (char *) CoTaskMemAlloc(strLength);
    if(address1.Length())
    {
      NS_LossyConvertUTF16toASCII cStr(address1);
      strncpy(str, cStr.get(), strLength-1);
      str[strLength-1] = '\0';
      if(address2.Length())
      {
        LossyCopyUTF16toASCII(address2, cStr);
        strncat(str, "\x0A", strLength-1);
        strncat(str, cStr.get(), strLength-1);
        str[strLength-1] = '\0';
      }
    }
    else
    {
      NS_LossyConvertUTF16toASCII cStr(address2);
      strncpy(str, cStr.get(), strLength-1);
      str[strLength-1] = '\0';
    }
    *ptrAddress = (LPTSTR) str;
  } 
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsAbIPCCard::JoinHomeAndWorkAddresses ( PRBool  isUnicode,
nsABCOMCardStruct card 
) [private]

Definition at line 970 of file nsAbIPCCard.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsAbIPCCard::Same ( nsABCOMCardStruct card,
PRBool  isUnicode = PR_TRUE 
)

Definition at line 749 of file nsAbIPCCard.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 767 of file nsAbIPCCard.cpp.

{
    if(!card)
        return PR_FALSE;

    nsresult rv;
    nsCOMPtr<nsIAbMDBCard> dbCard;
    dbCard = do_QueryInterface(card, &rv);
    if(NS_SUCCEEDED(rv)) {
        // first check the palmID for the cards if they exist
        nsXPIDLString palmIDStr;
        rv = dbCard->GetStringAttribute(CARD_ATTRIB_PALMID, getter_Copies(palmIDStr));
        if(NS_SUCCEEDED(rv) && palmIDStr.get()) {
            PRInt32 palmID=0;
            PRFloat64 f = PR_strtod(NS_LossyConvertUCS2toASCII(palmIDStr).get(), nsnull);
            PRInt64 l;
            LL_D2L(l, f);
            LL_L2UI(palmID, l);
            if(palmID && mRecordId)
                return mRecordId == palmID;
        }
    }

    nsXPIDLString str;
    card->GetFirstName(getter_Copies(str));
    if (Compare(str, m_FirstName, nsCaseInsensitiveStringComparator()))
        return PR_FALSE;
    card->GetLastName(getter_Copies(str));
    if (Compare(str, m_LastName, nsCaseInsensitiveStringComparator()))
        return PR_FALSE;
    card->GetDisplayName(getter_Copies(str));
    if (Compare(str, m_DisplayName, nsCaseInsensitiveStringComparator()))
        return PR_FALSE;
    card->GetNickName(getter_Copies(str));
    if (Compare(str, m_NickName, nsCaseInsensitiveStringComparator()))
        return PR_FALSE;

    return PR_TRUE;
}

Here is the call graph for this function:

nsresult nsAbCardProperty::SetAttributeName ( const PRUnichar aName,
nsString attribute 
) [protected, inherited]

Definition at line 178 of file nsAbCardProperty.cpp.

{
  if (aName)
    attribute = aName;
  return NS_OK;
}
void nsIAbCard::setCardValue ( in string  attrname,
in wstring  value 
) [inherited]

Definition at line 88 of file nsAbIPCCard.h.

{ mCategoryId = catID; }
void nsAbIPCCard::SetRecordId ( PRUint32  recID) [inline]

Definition at line 86 of file nsAbIPCCard.h.

{ mRecordId = recID; }

Here is the caller graph for this function:

void nsAbIPCCard::SetStatus ( PRUint32  status) [inline]

Definition at line 84 of file nsAbIPCCard.h.

{ mStatus = status; }

Here is the caller graph for this function:

void nsIAbMDBCard::setStringAttribute ( in string  name,
in wstring  value 
) [inherited]
void nsAbIPCCard::SplitAddresses ( PRBool  isUnicode,
LPTSTR  homeAddress,
LPTSTR  workAddress 
) [private]

Definition at line 366 of file nsAbIPCCard.cpp.

{
  PRInt32 idx;
  nsAutoString homeAddressStr;
  nsAutoString workAddressStr;
  if (isUnicode)
  {
    homeAddressStr.Assign(homeAddress);
    workAddressStr.Assign(workAddress);
  }
  else
  {
    CONVERT_ASSIGNTO_UNICODE(homeAddressStr, homeAddress, PR_FALSE);
    CONVERT_ASSIGNTO_UNICODE(workAddressStr, workAddress, PR_FALSE);
  }
  nsAutoString addr1, addr2;
  if ((idx = homeAddressStr.Find( "\x0D\x0A")) != kNotFound)
  {
    homeAddressStr.Left(addr1, idx);
    homeAddressStr.Right( addr2, homeAddressStr.Length() - idx - 2);  // need to minus string lenght of CRLF.
    addr2.ReplaceSubstring(NS_LITERAL_STRING("\x0D\x0A").get(),NS_LITERAL_STRING(", ").get());

    SetHomeAddress(addr1.get());
    SetHomeAddress2(addr2.get());
  }
  else
    SetHomeAddress(homeAddressStr.get());
  if ((idx = workAddressStr.Find( "\x0D\x0A")) != kNotFound)
  {
    workAddressStr.Left(addr1, idx);
    workAddressStr.Right( addr2, workAddressStr.Length() - idx - 2);  // need to minus string lenght of CRLF.
    addr2.ReplaceSubstring(NS_LITERAL_STRING("\x0D\x0A").get(),NS_LITERAL_STRING(", ").get());

    SetWorkAddress(addr1.get());
    SetWorkAddress2(addr2.get());
  }
  else
    SetWorkAddress(workAddressStr.get());
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 406 of file nsAbIPCCard.cpp.

{
  // If the address contains more than one line then split it into two 
  // (since moz only allows two address lines) and make sure all CRLFs
  // are converted to spaces in the 2nd address line. Lines are ended
  // with CRLF (done by moz conduit). So card->homeAddress2 
  // and card->workAddress2 are never used.
  SplitAddresses(isUnicode, card->homeAddress, card->workAddress);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

attribute wstring nsIAbCard::aimScreenName [inherited]

Definition at line 100 of file nsIAbCard.idl.

allowRemoteContent to be displayed in HTML mail received from this contact.

Definition at line 137 of file nsIAbCard.idl.

attribute wstring nsIAbCard::anniversaryDay [inherited]

Definition at line 103 of file nsIAbCard.idl.

Definition at line 102 of file nsIAbCard.idl.

Definition at line 101 of file nsIAbCard.idl.

attribute wstring nsIAbCard::birthDay [inherited]

Definition at line 118 of file nsIAbCard.idl.

attribute wstring nsIAbCard::birthMonth [inherited]

Definition at line 117 of file nsIAbCard.idl.

attribute wstring nsIAbCard::birthYear [inherited]

Definition at line 116 of file nsIAbCard.idl.

attribute wstring nsIAbCard::cardType [inherited]

Definition at line 74 of file nsIAbCard.idl.

attribute wstring nsIAbCard::category [inherited]

Definition at line 107 of file nsIAbCard.idl.

attribute wstring nsIAbCard::cellularNumber [inherited]

Definition at line 79 of file nsIAbCard.idl.

Definition at line 84 of file nsIAbCard.idl.

attribute wstring nsIAbCard::company [inherited]

Definition at line 99 of file nsIAbCard.idl.

attribute wstring nsIAbCard::custom1 [inherited]

Definition at line 119 of file nsIAbCard.idl.

attribute wstring nsIAbCard::custom2 [inherited]

Definition at line 120 of file nsIAbCard.idl.

attribute wstring nsIAbCard::custom3 [inherited]

Definition at line 121 of file nsIAbCard.idl.

attribute wstring nsIAbCard::custom4 [inherited]

Definition at line 122 of file nsIAbCard.idl.

attribute unsigned long nsIAbMDBCard::dbRowID [inherited]

Definition at line 51 of file nsIAbMDBCard.idl.

attribute unsigned long nsIAbMDBCard::dbTableID [inherited]

Definition at line 50 of file nsIAbMDBCard.idl.

attribute wstring nsIAbCard::defaultAddress [inherited]

Definition at line 106 of file nsIAbCard.idl.

attribute wstring nsIAbCard::defaultEmail [inherited]

Definition at line 73 of file nsIAbCard.idl.

attribute wstring nsIAbCard::department [inherited]

Definition at line 98 of file nsIAbCard.idl.

attribute wstring nsIAbCard::displayName [inherited]

Definition at line 69 of file nsIAbCard.idl.

attribute wstring nsIAbCard::familyName [inherited]

Definition at line 105 of file nsIAbCard.idl.

attribute wstring nsIAbCard::faxNumber [inherited]

Definition at line 77 of file nsIAbCard.idl.

attribute wstring nsIAbCard::faxNumberType [inherited]

Definition at line 82 of file nsIAbCard.idl.

attribute wstring nsIAbCard::firstName [inherited]

Definition at line 65 of file nsIAbCard.idl.

attribute wstring nsIAbCard::homeAddress [inherited]

Definition at line 85 of file nsIAbCard.idl.

attribute wstring nsIAbCard::homeAddress2 [inherited]

Definition at line 86 of file nsIAbCard.idl.

attribute wstring nsIAbCard::homeCity [inherited]

Definition at line 87 of file nsIAbCard.idl.

attribute wstring nsIAbCard::homeCountry [inherited]

Definition at line 90 of file nsIAbCard.idl.

attribute wstring nsIAbCard::homePhone [inherited]

Definition at line 76 of file nsIAbCard.idl.

attribute wstring nsIAbCard::homePhoneType [inherited]

Definition at line 81 of file nsIAbCard.idl.

attribute wstring nsIAbCard::homeState [inherited]

Definition at line 88 of file nsIAbCard.idl.

attribute wstring nsIAbCard::homeZipCode [inherited]

Definition at line 89 of file nsIAbCard.idl.

Definition at line 144 of file nsIAbCard.idl.

Card type helper attributes.

Definition at line 142 of file nsIAbCard.idl.

Definition at line 143 of file nsIAbCard.idl.

Definition at line 127 of file nsIAbCard.idl.

attribute wstring nsIAbCard::jobTitle [inherited]

Definition at line 97 of file nsIAbCard.idl.

attribute unsigned long nsIAbMDBCard::key [inherited]

Definition at line 47 of file nsIAbMDBCard.idl.

Definition at line 124 of file nsIAbCard.idl.

attribute wstring nsIAbCard::lastName [inherited]

Definition at line 66 of file nsIAbCard.idl.

Definition at line 108 of file nsAbCardProperty.h.

Definition at line 129 of file nsAbCardProperty.h.

Definition at line 111 of file nsAbCardProperty.h.

Definition at line 110 of file nsAbCardProperty.h.

Definition at line 109 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_BirthDay [protected, inherited]

Definition at line 120 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_BirthMonth [protected, inherited]

Definition at line 119 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_BirthYear [protected, inherited]

Definition at line 118 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_CardType [protected, inherited]

Definition at line 82 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_Category [protected, inherited]

Definition at line 115 of file nsAbCardProperty.h.

Definition at line 87 of file nsAbCardProperty.h.

Definition at line 92 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_Company [protected, inherited]

Definition at line 107 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_Custom1 [protected, inherited]

Definition at line 121 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_Custom2 [protected, inherited]

Definition at line 122 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_Custom3 [protected, inherited]

Definition at line 123 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_Custom4 [protected, inherited]

Definition at line 124 of file nsAbCardProperty.h.

PRUint32 nsAbMDBCardProperty::m_dbRowID [protected, inherited]

Definition at line 64 of file nsAbMDBCardProperty.h.

Definition at line 63 of file nsAbMDBCardProperty.h.

Definition at line 114 of file nsAbCardProperty.h.

Definition at line 81 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_Department [protected, inherited]

Definition at line 106 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_DisplayName [protected, inherited]

Definition at line 77 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_FamilyName [protected, inherited]

Definition at line 113 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_FaxNumber [protected, inherited]

Definition at line 85 of file nsAbCardProperty.h.

Definition at line 90 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_FirstName [protected, inherited]

Definition at line 75 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_HomeAddress [protected, inherited]

Definition at line 93 of file nsAbCardProperty.h.

Definition at line 94 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_HomeCity [protected, inherited]

Definition at line 95 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_HomeCountry [protected, inherited]

Definition at line 98 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_HomePhone [protected, inherited]

Definition at line 84 of file nsAbCardProperty.h.

Definition at line 89 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_HomeState [protected, inherited]

Definition at line 96 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_HomeZipCode [protected, inherited]

Definition at line 97 of file nsAbCardProperty.h.

PRBool nsAbCardProperty::m_IsMailList [protected, inherited]

Definition at line 131 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_JobTitle [protected, inherited]

Definition at line 105 of file nsAbCardProperty.h.

PRUint32 nsAbMDBCardProperty::m_key [protected, inherited]

Definition at line 62 of file nsAbMDBCardProperty.h.

PRUint32 nsAbCardProperty::m_LastModDate [protected, inherited]

Definition at line 126 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_LastName [protected, inherited]

Definition at line 76 of file nsAbCardProperty.h.

Definition at line 132 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_NickName [protected, inherited]

Definition at line 78 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_Note [protected, inherited]

Definition at line 125 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_PagerNumber [protected, inherited]

Definition at line 86 of file nsAbCardProperty.h.

Definition at line 91 of file nsAbCardProperty.h.

Definition at line 73 of file nsAbCardProperty.h.

Definition at line 74 of file nsAbCardProperty.h.

Definition at line 128 of file nsAbCardProperty.h.

Definition at line 127 of file nsAbCardProperty.h.

Definition at line 79 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_SecondEmail [protected, inherited]

Definition at line 80 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_SpouseName [protected, inherited]

Definition at line 112 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_WebPage1 [protected, inherited]

Definition at line 116 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_WebPage2 [protected, inherited]

Definition at line 117 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_WorkAddress [protected, inherited]

Definition at line 99 of file nsAbCardProperty.h.

Definition at line 100 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_WorkCity [protected, inherited]

Definition at line 101 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_WorkCountry [protected, inherited]

Definition at line 104 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_WorkPhone [protected, inherited]

Definition at line 83 of file nsAbCardProperty.h.

Definition at line 88 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_WorkState [protected, inherited]

Definition at line 102 of file nsAbCardProperty.h.

nsString nsAbCardProperty::m_WorkZipCode [protected, inherited]

Definition at line 103 of file nsAbCardProperty.h.

If isMailList is true then mailListURI will contain the URI of the associated mail list.

Definition at line 133 of file nsIAbCard.idl.

Definition at line 66 of file nsAbMDBCardProperty.h.

Definition at line 93 of file nsAbIPCCard.h.

Definition at line 92 of file nsAbIPCCard.h.

Definition at line 94 of file nsAbIPCCard.h.

attribute wstring nsIAbCard::nickName [inherited]

Definition at line 70 of file nsIAbCard.idl.

attribute wstring nsIAbCard::notes [inherited]

Definition at line 123 of file nsIAbCard.idl.

attribute wstring nsIAbCard::pagerNumber [inherited]

Definition at line 78 of file nsIAbCard.idl.

Definition at line 83 of file nsIAbCard.idl.

Definition at line 67 of file nsIAbCard.idl.

Definition at line 68 of file nsIAbCard.idl.

Definition at line 125 of file nsIAbCard.idl.

Definition at line 126 of file nsIAbCard.idl.

attribute wstring nsIAbCard::primaryEmail [inherited]

Definition at line 71 of file nsIAbCard.idl.

attribute wstring nsIAbCard::secondEmail [inherited]

Definition at line 72 of file nsIAbCard.idl.

attribute wstring nsIAbCard::spouseName [inherited]

Definition at line 104 of file nsIAbCard.idl.

attribute wstring nsIAbCard::webPage1 [inherited]

webPage1 is work web page

Definition at line 111 of file nsIAbCard.idl.

attribute wstring nsIAbCard::webPage2 [inherited]

webPage2 is home web page

Definition at line 115 of file nsIAbCard.idl.

attribute wstring nsIAbCard::workAddress [inherited]

Definition at line 91 of file nsIAbCard.idl.

attribute wstring nsIAbCard::workAddress2 [inherited]

Definition at line 92 of file nsIAbCard.idl.

attribute wstring nsIAbCard::workCity [inherited]

Definition at line 93 of file nsIAbCard.idl.

attribute wstring nsIAbCard::workCountry [inherited]

Definition at line 96 of file nsIAbCard.idl.

attribute wstring nsIAbCard::workPhone [inherited]

Definition at line 75 of file nsIAbCard.idl.

attribute wstring nsIAbCard::workPhoneType [inherited]

Definition at line 80 of file nsIAbCard.idl.

attribute wstring nsIAbCard::workState [inherited]

Definition at line 94 of file nsIAbCard.idl.

attribute wstring nsIAbCard::workZipCode [inherited]

Definition at line 95 of file nsIAbCard.idl.


The documentation for this class was generated from the following files: