home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / abapi.h next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  12.0 KB  |  334 lines

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2.  
  3. Copyright (c) 1997 - 1998 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     abDLL.h
  8.  
  9. Abstract:
  10.  
  11.     prototypes for using exported functions from abDLL.dll
  12.  
  13.     NOTE - this represents work in progress and may dramatically
  14.             change before the AutoPC ships
  15.  
  16. -------------------------------------------------------------------*/
  17.  
  18. #ifndef _ABAPI_H
  19. #define _ABAPI_H
  20.  
  21.  
  22. #include <windbase.h>        // WinCE DB stuff
  23. #include <addrmapi.h>        // list of props in address book DB
  24.  
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif //__cplusplus
  29.  
  30.  
  31. // Auto PC internal fields - do not modify these directly
  32. #define HHPR_PHONEORDER                         PROP_TAG(PT_UNICODE, 0x4998)  // BUGBUG: need to propogate this to oak\inc\addrmapi.h
  33. #define HHPR_VOICETAG                           PROP_TAG(PT_UNICODE, 0x4999)  // BUGBUG: need to propogate this to oak\inc\addrmapi.h
  34.  
  35.  
  36. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  37.  
  38. Here is the field list that this API uses and displays to the user.
  39. This is an example array that you can pass to abRead().
  40.  
  41. const CEPROPID kFullProp[] =
  42. {
  43.     HHPR_SURNAME,                   // offset 0 - Names
  44.     HHPR_GIVEN_NAME,
  45.     HHPR_MIDDLE_NAME,
  46.  
  47.     HHPR_OFFICE_TELEPHONE_NUMBER,   // offset 3 - Phone Numbers
  48.     HHPR_OFFICE2_TELEPHONE_NUMBER,
  49.     HHPR_HOME_TELEPHONE_NUMBER,
  50.     HHPR_HOME2_TELEPHONE_NUMBER,
  51.     HHPR_PAGER_NUMBER,
  52.     HHPR_MOBILE_TELEPHONE_NUMBER,
  53.     HHPR_CAR_TELEPHONE_NUMBER,
  54.     HHPR_ASSISTANT_TELEPHONE_NUMBER,
  55.     HHPR_PHONEORDER,                // the preferred order for phone dialing - note this is not displayed it is used though
  56.  
  57.     HHPR_OFFICE_ADDRESS_STREET,     // offset 12 - Work address
  58.     HHPR_OFFICE_ADDRESS_CITY,
  59.     HHPR_OFFICE_ADDRESS_STATE,
  60.     HHPR_OFFICE_ADDRESS_POSTAL_CODE,
  61.     HHPR_OFFICE_ADDRESS_COUNTRY,
  62.  
  63.     HHPR_HOME_ADDRESS_STREET,       // offfset 17 - Home address
  64.     HHPR_HOME_ADDRESS_CITY,
  65.     HHPR_HOME_ADDRESS_STATE,
  66.     HHPR_HOME_ADDRESS_POSTAL_CODE,
  67.     HHPR_HOME_ADDRESS_COUNTRY,
  68.  
  69.     HHPR_BUSINESS_FAX_NUMBER,       // offset 22 - Fax Numbers
  70.     HHPR_HOME_FAX_NUMBER,
  71.  
  72.     HHPR_EMAIL1_EMAIL_ADDRESS,      // offset 24 - Email Addresses
  73.     HHPR_EMAIL2_EMAIL_ADDRESS,
  74.     HHPR_EMAIL3_EMAIL_ADDRESS,
  75.  
  76.     HHPR_NOTES,                     // offset 27 - free form notes - not currently displayed
  77.  
  78.     HHPR_BIRTHDAY,                  // offset 28 - Dates
  79.     HHPR_ANNIVERSARY,
  80.  
  81.     HHPR_WEB_PAGE,                  // offset 30 - Common work and home fields not already included above
  82.     HHPR_CATEGORY,
  83.     HHPR_SPOUSE_NAME,
  84.     HHPR_CHILDREN_NAME,
  85.  
  86.     HHPR_COMPANY_NAME,              // offset 34 - Work fields not already included above
  87.     HHPR_DEPARTMENT_NAME,
  88.     HHPR_OFFICE_LOCATION,
  89.     HHPR_TITLE,
  90.     HHPR_ASSISTANT_NAME,
  91.  
  92.     HHPR_VOICETAG,                  // offset 39 - voice tag field - note not displayed - it holds the voice tag ID
  93.  
  94.     HHPR_FILEAS                     // offset 40 - the sort order of the db  last first middle - not currently displayed directly
  95. };
  96.  
  97. -------------------------------------------------------------------*/
  98.  
  99.  
  100. /*---------------------------------------------
  101.   wInitView flags for filling the ABINFO struct
  102.   
  103.   defines the initial view displayed
  104.   ---------------------------------------------*/
  105.  
  106. #define ABV_MAINVIEW    1       // main contacts list with tabber index - focus set to 'ceoid'
  107. #define ABV_LOCATE    2       // same as ABV_MAINVIEW except as if user already said "locate"
  108. #define ABV_CARDPHONE    3       // card view, phone tab
  109. #define ABV_CARDHOME    4       // card view, home info tab
  110. #define ABV_CARDWORK    5       // card view, work info tab
  111. #define ABV_CARDNOTES    6       // card view, notes tab (currently not implemented)
  112. #define ABV_DIAL    7       // asks user "dial preferred #?", if no then ABV_CARDPHONE shown
  113. #define ABV_RECEIVE    8       // receive form, AutoPC waiting for Infrared connection
  114. #define ABV_SEND    9       // send form, AutoPC attempts to send 'dwParam' contacts staring at 'ceoid' via Infrared
  115. #define ABV_NEW     10           // New entry wizard form
  116.  
  117.  
  118. /*-------------------------------------------------
  119.   dwEnabled flags for filling the ABINFO struct
  120.   
  121.   defines which features are accessible to the user
  122.   -------------------------------------------------*/
  123.  
  124. #define ABE_BACK        0x0001   // after drilling down into i.e. card, allow to backup to main
  125. #define ABE_CARDPHONE   0x0002   // allow display of Phone card
  126. #define ABE_CARDHOME    0x0004   // allow display of Home card
  127. #define ABE_CARDWORK    0x0008   // allow display of Work card
  128. #define ABE_CARDNOTES   0x0010   // allow display of Notes card (Not Impl)
  129. #define ABE_DELETE      0x0020   // allow Delete Command
  130. #define ABE_DIAL        0x0040   // allow Dial Command
  131. #define ABE_EDIT        0x0080   // allow Edit Command
  132. #define ABE_NEW         0x0100   // allow New Command
  133. #define ABE_RECEIVE     0x0200   // allow Recieve Command
  134. #define ABE_SENDONE     0x0400   // allow Send One Command
  135. #define ABE_SENDALL     0x0800   // allow Send All Command
  136.  
  137. #define ABE_OPTIONMENU  0x1000    // allows the forms to setup the forms manager menu
  138. #define ABE_VOICEMENU   0x2000    // allows the user to interact with the address book with their voice
  139. #define ABE_EXITMAIN    0x4000    // allows the user to exit the main view
  140. #define ABE_TTS         0x8000    // makes the UI behave like it was invoked with speech commands instead of keyboard
  141.  
  142. #define ABE_MAINVIEW   0x10000    // reserved
  143. #define ABE_DBEMPTY    0x20000    // reserved
  144. #define ABE_VTMAKE     0x40000    // reserved
  145. #define ABE_VTDEL      0x80000    // reserved
  146. #define ABE_LOGINFAIL        0x100000    // returned in the enabled flags of the structure if the AB exited due to login failure
  147. #define ABE_PRESERVEAPPFOCUS 0x200000    // passed in, forces ABAPI to leave app in forground and exit AB upon login failure
  148.  
  149. // common combinations of ABE_ flags
  150.  
  151. #define ABE_ALL         0x3fff      // enable everything
  152. #define ABE_CARDALL     0x001e      // card view phone, home, work and notes tabs
  153. #define ABE_EDITALL     0x01a0      // delete, edit, new
  154. #define ABE_IRALL       0x0e00      // receive, sendone, sendall
  155.  
  156. // abapi notification flags returned in dwParam
  157. #define ABN_RECORDS_ADDED     0x0001  // records have been added since entering abapi
  158. #define ABN_RECORDS_DELETED   0x0002  // records have been deleted since entering abapi
  159. #define ABN_EXIT_USING_VOICE  0x0004  // user exited abapi using voice
  160. #define ABN_RESORT_DB         0x0008  // user change db fields affecting sort sequence
  161.  
  162. #ifdef INTERFACE
  163. #undef INTERFACE
  164. #endif
  165.  
  166. #define INTERFACE
  167.  
  168. //
  169. // The IVerifyContactSink
  170. //
  171. DECLARE_INTERFACE_(IVerifyContactSink, IUnknown)
  172. {
  173.     STDMETHOD(IsContactValid)(THIS_ CEOID ceoidContact, PROPID propidAddress, BSTR* pbstrExplanation) PURE;
  174. };
  175. //  IsValidContact - returns S_OK if contact is ok, S_FALSE if not
  176. //  ceoidContact - CE OID of the contact to validate
  177. //  propidAddress - HHPR_OFFICE_ADDRESS_STREET or HHPR_HOME_ADDRESS_STREET
  178. //                 Use to determine which address fields to validate
  179.  
  180. #undef  INTERFACE
  181.  
  182.  
  183. /*------------------
  184.   abDialog structure
  185.   ------------------*/
  186.  
  187. typedef struct
  188. {
  189.     CEOID   ceoid;      // contact ID - read/write
  190.     DWORD   dwEnabled;  // feature enable mask - combination of ABE_ constants - read
  191.     DWORD   dwParam;    // depends on wInitView - should be zero if unused
  192.     WORD    wInitView;  // initial/final view - one of ABV_ constants - read/write
  193.     WORD   wFieldOrd;  // field ordinal - read/write 
  194.     WORD    wCard;      // default/final card view - one of ABV_ constants - read/write
  195.     BSTR    bstrHelpIndexFile;  // help index file, if NULL  && topic NULL use AddrBook help
  196.     BSTR    bstrHelpTopicFile;  // initial help topic file, NULL == start at index 
  197.     BSTR    bstrMainFormCaption; // Use if ABV_MAINVIEW is shown
  198.     BSTR    bstrCardFormCaption; // Use if ABV_CARD* is shown
  199.     BSTR    bstrParam1;
  200.     BSTR    bstrParam2; 
  201.     IVerifyContactSink *pVerifyListSink;        // Reserved
  202.     IVerifyContactSink *pVerifySelectionSink;   // if specified, called before selection accepted
  203. } ABDIALOGINFO, *LPDIALOGINFO;
  204.  
  205. /*
  206. wInitView 
  207. ABV_MAINVIEW
  208. in:
  209.     dwParam - ABNotify
  210.     wCard - Def Card    
  211. out:
  212.     wCard - Last Card    
  213.     
  214. ABV_LOCATE
  215.  
  216. ABV_CARDPHONE
  217. in:
  218.     dwParam - ABNotify
  219.     wCard - ABV_CARDPHONE    
  220. out:
  221.     wCard - Last Card    
  222.     
  223. ABV_CARDHOME
  224. in:
  225.     wCard - ABV_CARDHOME    
  226. out:
  227.     dwParam - ABNotify
  228.     wCard - Last Card    
  229.     
  230. ABV_CARDWORK
  231. in:
  232.     wCard - ABV_CARDWORK    
  233. out:
  234.     dwParam - ABNotify
  235.     wCard - Last Card    
  236.     
  237. ABV_CARDNOTES
  238. in:
  239.     wCard - ABV_CARDNOTES    
  240. out:
  241.     dwParam - ABNotify
  242.     wCard - Last Card    
  243.     
  244. ABV_DIAL
  245. in:
  246.     dwParam - NULL or lpwsPhnNum or field id to dial      
  247.     wFieldOrd - if dwparam == NULL, field search order to use
  248.     bstrParam1 - record name (person name)
  249.     bstrParam2 - Field Name (Home Phone)
  250.     
  251. ABV_RECEIVE
  252. ABV_SEND
  253.     dwParam - # to send
  254. */
  255.  
  256. #define DIAL_PREF_WORK    0
  257. #define DIAL_PREF_HOME    1
  258. #define DIAL_PREF_MOBILE  2
  259. #define DIAL_PREF_PAGER   3
  260. #define DIAL_PREF_USEDEFAULT   0xffff
  261.  
  262.  
  263. /*---------------------
  264.   abDialog return codes
  265.   ---------------------*/
  266.  
  267. #define S_NO_PHONE_NUMS     0x01000001      // ABV_DIAL - contact has no valid phone numbers
  268. #define S_USER_NO_TO_DIAL   0x01000002      // ABV_DIAL - user answered NO to dial specified phone number
  269. #define S_USER_ABORTED      0x01000003      // ABV_DIAL - call aborted by user
  270. #define S_PHONE_ABORTED     0x01000004      // ABV_DIAL - call aborted due to hardware problem
  271. #define S_CARD_DELETED      0x01000005      // ABV_CARD - contact was deleted by user
  272.  
  273.  
  274.  
  275. /*-----------------------------------------
  276.   initialize Address Book - call this first
  277.   -----------------------------------------*/
  278.  
  279. HRESULT abOpen(
  280.     IfmManage   *pFrmMgr);       // pointer to caller's Form Manager Interface - read
  281.  
  282.  
  283. /*---------------------------------------
  284.   shut down Address Book - call this last
  285.   ---------------------------------------*/
  286.  
  287. HRESULT abClose();
  288.  
  289.  
  290. /*-------------------------------------------------------------------------------
  291.   launch the Address Book view specified in ABINFO with specific features enabled
  292.   -------------------------------------------------------------------------------*/
  293.  
  294. HRESULT abDialog(
  295.     LPDIALOGINFO    lpABInfo);  // pointer to ABDIALOGINFO struct - read (see struct def)
  296.  
  297.  
  298. /*----------------------------------------------------
  299.   Seek to a record in the DB - See CeSeekDatabase docs
  300.   ----------------------------------------------------*/
  301.  
  302. HRESULT abSeek(
  303.     DWORD   dwSeekType,         // one of CEDB_SEEK_* constants from windbase.h
  304.     DWORD   dwValue,            // depends on dwSeekType
  305.     PCEOID  pCEOid,             // pointer to CEOID to receive record ID
  306.     LPDWORD lpdwIndex);         // pointer to DWORD to receive ordinal from start of DB
  307.  
  308.  
  309. /*--------------------------------------------------
  310.   read several fields of current or specified record
  311.   --------------------------------------------------*/
  312.  
  313. HRESULT abRead(
  314.     CEOID       ceoid,          // record id or NULL for current - read
  315.     LPWORD      lpwNumProp,     // how many fields requested/read - read/write
  316.     CEPROPID    *rgPropID,      // array of HHPR_* ids indicating fields to retrieve (see addrmapi.h) - read
  317.     PCEPROPVAL  *prgCEPropVal); // pointer to PCEPROPVAL that receives data
  318.  
  319.  
  320. /*----------------------------------------------
  321.   write several fields of new or existing record
  322.   ----------------------------------------------*/
  323.  
  324. HRESULT abWrite(
  325.     CEOID *poid,                // *poid = NULL for new record, = existing CEOID to modify record - read/write
  326.     WORD wNumProp,              // how many fields to be written - read
  327.     PCEPROPVAL rgCEPropVal);    // CEPROPVAL array containing field data - read
  328.  
  329. #ifdef __cplusplus
  330. }
  331. #endif //__cplusplus
  332.  
  333. #endif //_ABAPI_H
  334.