a_vcard.android.syncml.pim.vcard
Class ContactStruct

java.lang.Object
  extended by a_vcard.android.syncml.pim.vcard.ContactStruct

public class ContactStruct
extends java.lang.Object

The parameter class of VCardComposer. This class standy by the person-contact in Android system, we must use this class instance as parameter to transmit to VCardComposer so that create vCard string.


Nested Class Summary
static class ContactStruct.ContactMethod
           
static class ContactStruct.OrganizationData
           
static class ContactStruct.PhoneData
           
 
Field Summary
 java.lang.String company
          Deprecated. 
 java.util.List<ContactStruct.ContactMethod> contactmethodList
          Only for GET.
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> extensionMap
          Only for GET.
 java.lang.String name
          MUST exist
static int NAME_ORDER_TYPE_ENGLISH
           
static int NAME_ORDER_TYPE_JAPANESE
           
 java.util.List<java.lang.String> notes
          maybe folding
 java.util.List<ContactStruct.OrganizationData> organizationList
          Only for GET.
 java.util.List<ContactStruct.PhoneData> phoneList
          Only for GET.
 java.lang.String phoneticName
           
 byte[] photoBytes
          binary bytes of pic.
 java.lang.String photoType
          The type of Photo (e.g.
 java.lang.String title
          maybe folding
 
Constructor Summary
ContactStruct()
           
 
Method Summary
 void addContactmethod(int kind, int type, java.lang.String data, java.lang.String label, boolean isPrimary)
          Add a contactmethod info to contactmethodList.
 void addExtension(PropertyNode propertyNode)
           
 void addOrganization(int type, java.lang.String companyName, java.lang.String positionName, boolean isPrimary)
          Add a Organization info to organizationList.
 void addPhone(int type, java.lang.String data, java.lang.String label, boolean isPrimary)
          Add a phone info to phoneList.
static ContactStruct constructContactFromVNode(VNode node, int nameOrderType)
           
 java.lang.String displayString()
           
 boolean isIgnorable()
           
 void setPosition(java.lang.String positionValue)
          Set "position" value to the appropriate data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_ORDER_TYPE_ENGLISH

public static final int NAME_ORDER_TYPE_ENGLISH
See Also:
Constant Field Values

NAME_ORDER_TYPE_JAPANESE

public static final int NAME_ORDER_TYPE_JAPANESE
See Also:
Constant Field Values

name

public java.lang.String name
MUST exist


phoneticName

public java.lang.String phoneticName

notes

public java.util.List<java.lang.String> notes
maybe folding


title

public java.lang.String title
maybe folding


photoBytes

public byte[] photoBytes
binary bytes of pic.


photoType

public java.lang.String photoType
The type of Photo (e.g. JPEG, BMP, etc.)


phoneList

public java.util.List<ContactStruct.PhoneData> phoneList
Only for GET. Use addPhoneList() to PUT.


contactmethodList

public java.util.List<ContactStruct.ContactMethod> contactmethodList
Only for GET. Use addContactmethodList() to PUT.


organizationList

public java.util.List<ContactStruct.OrganizationData> organizationList
Only for GET. Use addOrgList() to PUT.


extensionMap

public java.util.Map<java.lang.String,java.util.List<java.lang.String>> extensionMap
Only for GET. Use addExtension() to PUT


company

@Deprecated
public java.lang.String company
Deprecated. 
Constructor Detail

ContactStruct

public ContactStruct()
Method Detail

addPhone

public void addPhone(int type,
                     java.lang.String data,
                     java.lang.String label,
                     boolean isPrimary)
Add a phone info to phoneList.

Parameters:
data - phone number
type - type col of content://contacts/phones
label - lable col of content://contacts/phones

addContactmethod

public void addContactmethod(int kind,
                             int type,
                             java.lang.String data,
                             java.lang.String label,
                             boolean isPrimary)
Add a contactmethod info to contactmethodList.

Parameters:
kind - integer value defined in Contacts.java (e.g. Contacts.KIND_EMAIL)
type - type col of content://contacts/contact_methods
data - contact data
label - extra string used only when kind is Contacts.KIND_CUSTOM.

addOrganization

public void addOrganization(int type,
                            java.lang.String companyName,
                            java.lang.String positionName,
                            boolean isPrimary)
Add a Organization info to organizationList.


setPosition

public void setPosition(java.lang.String positionValue)
Set "position" value to the appropriate data. If there's more than one OrganizationData objects, the value is set to the last one. If there's no OrganizationData object, a new OrganizationData is created, whose company name is empty. TODO: incomplete logic. fix this: e.g. This assumes ORG comes earlier, but TITLE may come earlier like this, though we do not know how to handle it in general cases... ---- TITLE:Software Engineer ORG:Google ----


addExtension

public void addExtension(PropertyNode propertyNode)

constructContactFromVNode

public static ContactStruct constructContactFromVNode(VNode node,
                                                      int nameOrderType)

displayString

public java.lang.String displayString()

isIgnorable

public boolean isIgnorable()