@ -30,11 +30,11 @@ public class MsOutlookAddrBookContactQuery
private static final Logger logger
= Logger . getLogger ( MsOutlookAddrBookContactQuery . class ) ;
p rivate static final int dispidEmail1EmailAddress = 12 ;
p ublic static final int dispidEmail1EmailAddress = 12 ;
p rivate static final int dispidEmail2EmailAddress = 13 ;
p ublic static final int dispidEmail2EmailAddress = 13 ;
p rivate static final int dispidEmail3EmailAddress = 14 ;
p ublic static final int dispidEmail3EmailAddress = 14 ;
/ * *
* The object type of a < tt > SourceContact < / tt > in the Address Book of
@ -61,9 +61,9 @@ public class MsOutlookAddrBookContactQuery
0x3A1C /* PR_MOBILE_TELEPHONE_NUMBER */ ,
0x3A1F /* PR_OTHER_TELEPHONE_NUMBER */ ,
0x0FFE /* PR_OBJECT_TYPE */ ,
0x0000808 3 /* dispidEmail1EmailAddress */,
0x0000809 3 /* dispidEmail2EmailAddress */,
0x000080A 3 /* dispidEmail3EmailAddress */,
0x0000808 4 /* dispidEmail1OriginalDisplayName */,
0x0000809 4 /* dispidEmail2OriginalDisplayName */,
0x000080A 4 /* dispidEmail3OriginalDisplayName */,
0x3A16 /* PR_COMPANY_NAME */ ,
0x0FFF /* PR_ORIGINAL_ENTRYID */ ,
0x3A24 /* dispidFax1EmailAddress */ ,
@ -84,7 +84,9 @@ public class MsOutlookAddrBookContactQuery
0x3A5A , // PR_HOME_ADDRESS_COUNTRY
0x3A5B , // PR_HOME_ADDRESS_POSTAL_CODE
0x3A5C , // PR_HOME_ADDRESS_STATE_OR_PROVINCE
0x3A5D // PR_HOME_ADDRESS_STREET
0x3A5D , // PR_HOME_ADDRESS_STREET
0x0000801A , // dispidHomeAddress
0x0000801B // dispidWorkAddress
} ;
/ * *
@ -102,189 +104,199 @@ public class MsOutlookAddrBookContactQuery
/ * *
* The id of the < tt > PR_ATTACHMENT_CONTACTPHOTO < / tt > MAPI property .
* /
p rivate static final long PR_ATTACHMENT_CONTACTPHOTO = 0x7FFF ;
p ublic static final long PR_ATTACHMENT_CONTACTPHOTO = 0x7FFF ;
/ * *
* The index of the id of the < tt > PR_BUSINESS_TELEPHONE_NUMBER < / tt > property
* in { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_BUSINESS_TELEPHONE_NUMBER = 5 ;
p ublic static final int PR_BUSINESS_TELEPHONE_NUMBER = 5 ;
/ * *
* The index of the id of the < tt > PR_BUSINESS2_TELEPHONE_NUMBER < / tt >
* property in { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_BUSINESS2_TELEPHONE_NUMBER = 6 ;
p ublic static final int PR_BUSINESS2_TELEPHONE_NUMBER = 6 ;
p rivate static final int PR_COMPANY_NAME = 15 ;
p ublic static final int PR_COMPANY_NAME = 15 ;
/ * *
* The index of the id of the < tt > PR_DISPLAY_NAME < / tt > property in
* { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_DISPLAY_NAME = 0 ;
p ublic static final int PR_DISPLAY_NAME = 0 ;
/ * *
* The index of the id of the < tt > PR_EMAIL_ADDRESS < / tt > property in
* { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_EMAIL_ADDRESS = 1 ;
p ublic static final int PR_EMAIL_ADDRESS = 1 ;
/ * *
* The index of the id of the < tt > PR_GIVEN_NAME < / tt > property in
* { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_GIVEN_NAME = 2 ;
p ublic static final int PR_GIVEN_NAME = 2 ;
/ * *
* The index of the id of the < tt > PR_HOME_TELEPHONE_NUMBER < / tt > property in
* { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_HOME_TELEPHONE_NUMBER = 7 ;
p ublic static final int PR_HOME_TELEPHONE_NUMBER = 7 ;
/ * *
* The index of the id of the < tt > PR_HOME2_TELEPHONE_NUMBER < / tt > property in
* { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_HOME2_TELEPHONE_NUMBER = 8 ;
p ublic static final int PR_HOME2_TELEPHONE_NUMBER = 8 ;
/ * *
* The index of the id of the < tt > PR_MIDDLE_NAME < / tt > property in
* { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_MIDDLE_NAME = 3 ;
p ublic static final int PR_MIDDLE_NAME = 3 ;
/ * *
* The index of the id of the < tt > PR_MOBILE_TELEPHONE_NUMBER < / tt > property
* in { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_MOBILE_TELEPHONE_NUMBER = 9 ;
p ublic static final int PR_MOBILE_TELEPHONE_NUMBER = 9 ;
/ * *
* The index of the id of the < tt > PR_OTHER_TELEPHONE_NUMBER < / tt > property
* in { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_OTHER_TELEPHONE_NUMBER = 10 ;
p ublic static final int PR_OTHER_TELEPHONE_NUMBER = 10 ;
/ * *
* The index of the id of the < tt > PR_OBJECT_TYPE < / tt > property in
* { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_OBJECT_TYPE = 11 ;
p ublic static final int PR_OBJECT_TYPE = 11 ;
/ * *
* The index of the id of the < tt > PR_SURNAME < / tt > property in
* { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_SURNAME = 4 ;
p ublic static final int PR_SURNAME = 4 ;
/ * *
* The index of the id of the < tt > PR_ORIGINAL_ENTRYID < / tt > property
* in { @link # MAPI_MAILUSER_PROP_IDS } .
* /
p rivate static final int PR_ORIGINAL_ENTRYID = 16 ;
p ublic static final int PR_ORIGINAL_ENTRYID = 16 ;
/ * *
* The index of the 1 st fax telephone number ( business fax ) .
* /
p rivate static final int dispidFax1EmailAddress = 17 ;
p ublic static final int dispidFax1EmailAddress = 17 ;
/ * *
* The index of the 2 nd fax telephone number ( home fax ) .
* /
p rivate static final int dispidFax2EmailAddress = 18 ;
p ublic static final int dispidFax2EmailAddress = 18 ;
/ * *
* The index of the 3 rd fax telephone number ( other fax ) .
* /
p rivate static final int dispidFax3EmailAddress = 19 ;
p ublic static final int dispidFax3EmailAddress = 19 ;
/ * *
* The index of the nickname .
* /
p rivate static final int PR_NICKNAME = 20 ;
p ublic static final int PR_NICKNAME = 20 ;
/ * *
* The index of the name prefix .
* /
p rivate static final int PR_DISPLAY_NAME_PREFIX = 21 ;
p ublic static final int PR_DISPLAY_NAME_PREFIX = 21 ;
/ * *
* The index of the personnal home page
* /
p rivate static final int PR_PERSONAL_HOME_PAGE = 22 ;
p ublic static final int PR_PERSONAL_HOME_PAGE = 22 ;
/ * *
* The index of the business home page
* /
p rivate static final int PR_BUSINESS_HOME_PAGE = 23 ;
p ublic static final int PR_BUSINESS_HOME_PAGE = 23 ;
/ * *
* The index of the job title .
* /
p rivate static final int PR_TITLE = 24 ;
p ublic static final int PR_TITLE = 24 ;
/ * *
* The index of the instant messaging address .
* /
p rivate static final int dispidInstMsg = 25 ;
p ublic static final int dispidInstMsg = 25 ;
/ * *
* The index of the business city of the postal address .
* /
p rivate static final int PR_BUSINESS_ADDRESS_CITY = 26 ;
p ublic static final int PR_BUSINESS_ADDRESS_CITY = 26 ;
/ * *
* The index of the business country of the postal address .
* /
p rivate static final int PR_BUSINESS_ADDRESS_COUNTRY = 27 ;
p ublic static final int PR_BUSINESS_ADDRESS_COUNTRY = 27 ;
/ * *
* The index of the business postal code of the postal address .
* /
p rivate static final int PR_BUSINESS_ADDRESS_POSTAL_CODE = 28 ;
p ublic static final int PR_BUSINESS_ADDRESS_POSTAL_CODE = 28 ;
/ * *
* The index of the business state or province of the postal address .
* /
p rivate static final int PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE = 29 ;
p ublic static final int PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE = 29 ;
/ * *
* The index of the business street of the postal address .
* /
p rivate static final int PR_BUSINESS_ADDRESS_STREET = 30 ;
p ublic static final int PR_BUSINESS_ADDRESS_STREET = 30 ;
/ * *
* The index of the home city of the postal address .
* /
p rivate static final int PR_HOME_ADDRESS_CITY = 31 ;
p ublic static final int PR_HOME_ADDRESS_CITY = 31 ;
/ * *
* The index of the home country of the postal address .
* /
p rivate static final int PR_HOME_ADDRESS_COUNTRY = 32 ;
p ublic static final int PR_HOME_ADDRESS_COUNTRY = 32 ;
/ * *
* The index of the home postal code of the postal address .
* /
p rivate static final int PR_HOME_ADDRESS_POSTAL_CODE = 33 ;
p ublic static final int PR_HOME_ADDRESS_POSTAL_CODE = 33 ;
/ * *
* The index of the home state or province of the postal address .
* /
p rivate static final int PR_HOME_ADDRESS_STATE_OR_PROVINCE = 34 ;
p ublic static final int PR_HOME_ADDRESS_STATE_OR_PROVINCE = 34 ;
/ * *
* The index of the home street of the postal address .
* /
private static final int PR_HOME_ADDRESS_STREET = 35 ;
public static final int PR_HOME_ADDRESS_STREET = 35 ;
/ * *
* The index of the display for the home postal address .
* /
public static final int dispidHomeAddress = 36 ;
/ * *
* The index of the display for the work postal address .
* /
public static final int dispidWorkAddress = 37 ;
/ * *
* The indexes in { @link # MAPI_MAILUSER_PROP_IDS } of the property IDs which
* are to be represented in < tt > SourceContact < / tt > as
* < tt > ContactDetail < / tt > s .
* /
private static final int [ ] CONTACT_DETAIL_PROP_INDEXES
p ublic static final int [ ] CONTACT_DETAIL_PROP_INDEXES
= new int [ ]
{
PR_EMAIL_ADDRESS ,
@ -319,7 +331,9 @@ public class MsOutlookAddrBookContactQuery
PR_HOME_ADDRESS_COUNTRY ,
PR_HOME_ADDRESS_POSTAL_CODE ,
PR_HOME_ADDRESS_STATE_OR_PROVINCE ,
PR_HOME_ADDRESS_STREET
PR_HOME_ADDRESS_STREET ,
dispidHomeAddress ,
dispidWorkAddress
} ;
/ * *
@ -398,7 +412,7 @@ public static native void foreachMailUser(
String query ,
PtrOutlookContactCallback callback ) ;
p rivate static ContactDetail . Category getCategory ( int propIndex )
p ublic static ContactDetail . Category getCategory ( int propIndex )
{
switch ( propIndex )
{
@ -440,6 +454,8 @@ private static ContactDetail.Category getCategory(int propIndex)
case PR_HOME_ADDRESS_POSTAL_CODE :
case PR_HOME_ADDRESS_STATE_OR_PROVINCE :
case PR_HOME_ADDRESS_STREET :
case dispidHomeAddress :
case dispidWorkAddress :
return ContactDetail . Category . Address ;
default :
return null ;
@ -455,7 +471,7 @@ private static ContactDetail.Category getCategory(int propIndex)
* @return the set of < tt > ContactDetail < / tt > labels to be assigned to the
* property specified by its index in < tt > MAPI_MAILUSER_PROP_IDS < / tt >
* /
p rivate static ContactDetail . SubCategory [ ] getSubCategories ( int propIndex )
p ublic static ContactDetail . SubCategory [ ] getSubCategories ( int propIndex )
{
switch ( propIndex )
{
@ -596,6 +612,18 @@ private static ContactDetail.SubCategory[] getSubCategories(int propIndex)
ContactDetail . SubCategory . Home ,
ContactDetail . SubCategory . Street
} ;
case dispidHomeAddress :
return
new ContactDetail . SubCategory [ ]
{
ContactDetail . SubCategory . Home ,
} ;
case dispidWorkAddress :
return
new ContactDetail . SubCategory [ ]
{
ContactDetail . SubCategory . Work ,
} ;
default :
return null ;
}
@ -691,6 +719,10 @@ else if(subCategories.contains(
{
return MAPI_MAILUSER_PROP_IDS [ PR_BUSINESS_ADDRESS_STREET ] ;
}
else
{
return MAPI_MAILUSER_PROP_IDS [ dispidWorkAddress ] ;
}
}
else if ( subCategories . contains ( ContactDetail . SubCategory . Home ) )
{
@ -718,6 +750,10 @@ else if(subCategories.contains(
{
return MAPI_MAILUSER_PROP_IDS [ PR_HOME_ADDRESS_STREET ] ;
}
else
{
return MAPI_MAILUSER_PROP_IDS [ dispidHomeAddress ] ;
}
}
}
return - 1 ;