Back to index

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

#include <nsAbCardProperty.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS NS_DECL_NSIABCARD nsAbCardProperty (void)
virtual ~nsAbCardProperty (void)
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 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 GetAttributeName (PRUnichar **aName, nsString &value)
nsresult SetAttributeName (const PRUnichar *aName, nsString &attribute)

Protected Attributes

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

nsresult AppendData (const char *aAttrName, mozITXTToHTMLConv *aConv, nsString &aResult)
nsresult AppendSection (AppendItem *aArray, PRInt16 aCount, const nsAFlatString &aHeading, mozITXTToHTMLConv *aConv, nsString &aResult)
nsresult GetCardTypeFromString (const char *aCardTypeStr, PRBool aEmptyIsTrue, PRBool *aValue)

Detailed Description

Definition at line 58 of file nsAbCardProperty.h.


Constructor & Destructor Documentation

Definition at line 134 of file nsAbCardProperty.cpp.

{
}

Member Function Documentation

nsresult nsAbCardProperty::AppendData ( const char *  aAttrName,
mozITXTToHTMLConv aConv,
nsString aResult 
) [private]

Definition at line 1764 of file nsAbCardProperty.cpp.

{
  nsXPIDLString attrValue;
  nsresult rv = GetCardValue(aAttrName, getter_Copies(attrValue));
  NS_ENSURE_SUCCESS(rv,rv);

  if (attrValue.IsEmpty())
    return NS_OK;

  nsAutoString attrNameStr;
  attrNameStr.AssignWithConversion(aAttrName);
  
  aResult.Append(PRUnichar('<'));
  aResult.Append(attrNameStr);
  aResult.Append(PRUnichar('>'));
  
  // use ScanTXT to convert < > & to safe values.
  nsXPIDLString safeText;
  rv = aConv->ScanTXT(attrValue, mozITXTToHTMLConv::kEntities, getter_Copies(safeText));
  NS_ENSURE_SUCCESS(rv,rv);
  aResult.Append(safeText);

  aResult.AppendLiteral("</");
  aResult.Append(attrNameStr);
  aResult.Append(PRUnichar('>'));

  return NS_OK;
}

Here is the call graph for this function:

nsresult nsAbCardProperty::AppendSection ( AppendItem aArray,
PRInt16  aCount,
const nsAFlatString aHeading,
mozITXTToHTMLConv aConv,
nsString aResult 
) [private]

Definition at line 1793 of file nsAbCardProperty.cpp.

{
  nsresult rv;

  aResult.AppendLiteral("<section>");

  nsXPIDLString attrValue;
  PRBool sectionIsEmpty = PR_TRUE;

  PRInt16 i = 0;
  for (i=0;i<aCount;i++) {
    rv = GetCardValue(aArray[i].mColumn, getter_Copies(attrValue));
    NS_ENSURE_SUCCESS(rv,rv);
    sectionIsEmpty &= attrValue.IsEmpty();
  }

  if (!sectionIsEmpty && !aHeading.IsEmpty()) {
    nsCOMPtr<nsIStringBundle> bundle;

    nsCOMPtr<nsIStringBundleService> stringBundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); 
    NS_ENSURE_SUCCESS(rv,rv);

    rv = stringBundleService->CreateBundle(sAddrbookProperties, getter_AddRefs(bundle));
    NS_ENSURE_SUCCESS(rv,rv); 
  
    nsXPIDLString heading;
    rv = bundle->GetStringFromName(aHeading.get(), getter_Copies(heading));
    NS_ENSURE_SUCCESS(rv, rv);

    aResult.AppendLiteral("<sectiontitle>");
    aResult.Append(heading);
    aResult.AppendLiteral("</sectiontitle>");
  }

  for (i=0;i<aCount;i++) {
         rv = aArray[i].mCallback(this, &aArray[i], aConv, aResult);
    NS_ASSERTION(NS_SUCCEEDED(rv), "append callback failed");
  }

  aResult.AppendLiteral("</section>");

  return NS_OK;
}

Here is the call graph for this function:

wstring nsIAbCard::convertToXMLPrintData ( ) [inherited]
void nsIAbCard::copy ( in nsIAbCard  srcCard) [inherited]
boolean nsIAbCard::equals ( in nsIAbCard  card) [inherited]
nsresult nsAbCardProperty::GetAttributeName ( PRUnichar **  aName,
nsString value 
) [protected]

Definition at line 171 of file nsAbCardProperty.cpp.

Here is the call graph for this function:

nsresult nsAbCardProperty::GetCardTypeFromString ( const char *  aCardTypeStr,
PRBool  aEmptyIsTrue,
PRBool aValue 
) [private]

Definition at line 142 of file nsAbCardProperty.cpp.

{
  NS_ENSURE_ARG_POINTER(aCardTypeStr);
  NS_ENSURE_ARG_POINTER(aValue);

  *aValue = PR_FALSE;
  nsXPIDLString cardType;
  nsresult rv = GetCardType(getter_Copies(cardType));
  NS_ENSURE_SUCCESS(rv,rv);

  *aValue = ((aEmptyIsTrue && cardType.IsEmpty()) || cardType.Equals(NS_ConvertASCIItoUCS2(aCardTypeStr)));
  return NS_OK;
}

Here is the call graph for this function:

wstring nsIAbCard::getCardValue ( in string  name) [inherited]
nsresult nsAbCardProperty::SetAttributeName ( const PRUnichar aName,
nsString attribute 
) [protected]

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]

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 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.

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.

Definition at line 120 of file nsAbCardProperty.h.

Definition at line 119 of file nsAbCardProperty.h.

Definition at line 118 of file nsAbCardProperty.h.

Definition at line 82 of file nsAbCardProperty.h.

Definition at line 115 of file nsAbCardProperty.h.

Definition at line 87 of file nsAbCardProperty.h.

Definition at line 92 of file nsAbCardProperty.h.

Definition at line 107 of file nsAbCardProperty.h.

Definition at line 121 of file nsAbCardProperty.h.

Definition at line 122 of file nsAbCardProperty.h.

Definition at line 123 of file nsAbCardProperty.h.

Definition at line 124 of file nsAbCardProperty.h.

Definition at line 114 of file nsAbCardProperty.h.

Definition at line 81 of file nsAbCardProperty.h.

Definition at line 106 of file nsAbCardProperty.h.

Definition at line 77 of file nsAbCardProperty.h.

Definition at line 113 of file nsAbCardProperty.h.

Definition at line 85 of file nsAbCardProperty.h.

Definition at line 90 of file nsAbCardProperty.h.

Definition at line 75 of file nsAbCardProperty.h.

Definition at line 93 of file nsAbCardProperty.h.

Definition at line 94 of file nsAbCardProperty.h.

Definition at line 95 of file nsAbCardProperty.h.

Definition at line 98 of file nsAbCardProperty.h.

Definition at line 84 of file nsAbCardProperty.h.

Definition at line 89 of file nsAbCardProperty.h.

Definition at line 96 of file nsAbCardProperty.h.

Definition at line 97 of file nsAbCardProperty.h.

Definition at line 131 of file nsAbCardProperty.h.

Definition at line 105 of file nsAbCardProperty.h.

Definition at line 126 of file nsAbCardProperty.h.

Definition at line 76 of file nsAbCardProperty.h.

Definition at line 132 of file nsAbCardProperty.h.

Definition at line 78 of file nsAbCardProperty.h.

Definition at line 125 of file nsAbCardProperty.h.

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.

Definition at line 80 of file nsAbCardProperty.h.

Definition at line 112 of file nsAbCardProperty.h.

Definition at line 116 of file nsAbCardProperty.h.

Definition at line 117 of file nsAbCardProperty.h.

Definition at line 99 of file nsAbCardProperty.h.

Definition at line 100 of file nsAbCardProperty.h.

Definition at line 101 of file nsAbCardProperty.h.

Definition at line 104 of file nsAbCardProperty.h.

Definition at line 83 of file nsAbCardProperty.h.

Definition at line 88 of file nsAbCardProperty.h.

Definition at line 102 of file nsAbCardProperty.h.

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.

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: