Back to index

lightning-sunbird  0.9+nobinonly
IPalmSync.idl
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corp.
00018  * Portions created by the Initial Developer are Copyright (C) 2002
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s): Rajiv Dayal (rdayal@netscape.com)
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 
00037 // This idl will be compiled by MIDL.  MS-COM is used 
00038 // as brdige between MAPI clients and the Mozilla.
00039 
00040 import "unknwn.idl";
00041 
00042 // this is defined so that we can return an array of strings(i.e array of AB Description strings)
00043 typedef struct
00044 {
00045        LPTSTR lpszABName;
00046   LPTSTR lpszABUrl;
00047 }nsMozABDesc, *lpnsMozABDesc;
00048 
00049 const int kFirstTimeSyncDirFlag = 0x1;
00050 const int kIsPabDirFlag = 0x2;
00051 
00052 // This structure defines the data fields for MozAB based on "nsIAbCard.idl"
00053 // This structure is used for interaction with the other AddressBook Apps
00054 // nsIAbCard changes should be reflected here to take care of those changes
00055 // Take care when converting nsIAbCard to this struct
00056 typedef struct
00057 {
00058     unsigned long   dwRecordId; // remote record Id for this card
00059     unsigned long   dwCategoryId; // remote category Id for this card
00060        unsigned long   dwStatus; // change status for this card
00061 
00062        // standard AB fields for this card
00063     LPTSTR          firstName;
00064     LPTSTR          lastName;
00065     LPTSTR          displayName;
00066     LPTSTR          nickName;
00067     LPTSTR          primaryEmail;
00068     LPTSTR          secondEmail;
00069     LPTSTR          workPhone;
00070     LPTSTR          homePhone;
00071     LPTSTR          faxNumber;
00072     LPTSTR          pagerNumber;
00073     LPTSTR          cellularNumber;
00074     LPTSTR          homeAddress;
00075     LPTSTR          homeAddress2;
00076     LPTSTR          homeCity;
00077     LPTSTR          homeState;
00078     LPTSTR          homeZipCode;
00079     LPTSTR          homeCountry;
00080     LPTSTR          workAddress;
00081     LPTSTR          workAddress2;
00082     LPTSTR          workCity;
00083     LPTSTR          workState;
00084     LPTSTR          workZipCode;
00085     LPTSTR          workCountry;
00086     LPTSTR          jobTitle;
00087     LPTSTR          department;
00088     LPTSTR          company;
00092     LPTSTR          webPage1;
00096     LPTSTR          webPage2;
00097     LPTSTR          birthYear;
00098     LPTSTR          birthMonth;
00099     LPTSTR          birthDay;
00100     LPTSTR          custom1;
00101     LPTSTR          custom2;
00102     LPTSTR          custom3;
00103     LPTSTR          custom4;
00104     LPTSTR          notes;
00105     unsigned long   lastModifiedDate;
00106        unsigned long   addressToUse; // home, work, ... 
00107     unsigned long   preferredPhoneNum; // this is displayed in the contact list
00108     unsigned long   preferMailFormat;
00109     boolean         isMailList;
00115     LPSTR           mailListURI;
00116 }nsABCOMCardStruct, *lpnsABCOMCardStruct;
00117 
00118 [
00119     object,
00120     uuid(C8CE6FC1-CCF1-11d6-B8A5-000064657374),
00121     helpstring("nsIPalmSync Inteface"),
00122     pointer_default(unique)
00123 ]
00124 
00125 interface IPalmSync : IUnknown
00126 {
00127     HRESULT IsValid();
00128 
00129     // Get the list of Address Books for the currently logged in user profile
00130     HRESULT nsGetABList([in] BOOL aIsUnicode, [out] short * aABListCount,
00131                                           [out, size_is(, *aABListCount)] lpnsMozABDesc * aABList,
00132                                           [out, size_is(, *aABListCount)] long ** aABCatIndexList,
00133                                           [out, size_is(, *aABListCount)] BOOL ** aFirstTimeSyncList);
00134 
00135     // Synchronize the Address Book represented by the aCategoryIndex and the corresponding aABName in Mozilla
00136     // this will take care of ABs existing on both ends.
00137     HRESULT nsSynchronizeAB([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] long aCategoryId, [in] LPTSTR aABName,
00138                         [in] int aModRemoteRecCount, [in, size_is(aModRemoteRecCount)] lpnsABCOMCardStruct aModRemoteRecList,
00139                         [out] int * aModMozRecCount, [out, size_is(, *aModMozRecCount)] lpnsABCOMCardStruct * aModMozRecList);
00140 
00141     // All records from a AB represented by aCategoryIndex and aABName into a new or existing Mozilla AB
00142     HRESULT nsAddAllABRecords([in] BOOL aIsUnicode, [in] BOOL aReplaceExisting, [in] long aCategoryIndex, [in] LPTSTR aABName,
00143                                                  [in] int aRemoteRecCount, [in, size_is(aRemoteRecCount)] lpnsABCOMCardStruct aRemoteRecList);
00144 
00145     // Get All records from a Mozilla AB
00146     HRESULT nsGetAllABCards([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] LPTSTR aABName,
00147                         [out] int * aMozRecCount, [out, size_is(, *aMozRecCount)] lpnsABCOMCardStruct * aMozRecList);
00148 
00149     // Send an ack for done and update the palm rec id for new records added
00150     HRESULT nsAckSyncDone([in] BOOL aIsSuccess, [in] long aCatIndex, [in] int aNewRecCount, [in, size_is(aNewRecCount)] unsigned long * aNewPalmRecIDList);
00151 
00152     // Update the Address Book's category id and mod time.
00153     HRESULT nsUpdateABSyncInfo([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] LPTSTR aABName);
00154 
00155     // Delete an addressbook
00156     HRESULT nsDeleteAB([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] LPTSTR aABName, [in] LPTSTR aABUrl);
00157 
00158     // was this address book deleted in Mozilla?
00159     HRESULT nsGetABDeleted([in] LPTSTR aABName, [out] BOOL *abDeleted);
00160 
00161     // Rename an addressbook
00162     HRESULT nsRenameAB([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] LPTSTR aABName, [in] LPTSTR aABUrl);
00163 
00164     HRESULT nsUseABHomeAddressForPalmAddress ([out] BOOL *useHomeAddress);
00165 
00166     HRESULT nsPreferABHomePhoneForPalmPhone ([out] BOOL * preferHomePhone);
00167 };
00168