home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / progect-src-0.20.tar.gz / progect-src-0.20.tar / progect-0.20 / Address.h next >
C/C++ Source or Header  |  2000-10-26  |  5KB  |  146 lines

  1. /******************************************************************************
  2.  *
  3.  * Copyright (c) 1997-1999 Palm Computing, Inc. or its subsidiaries.
  4.  * All rights reserved.
  5.  *
  6.  * File: Address.h
  7.  *
  8.  * Description:
  9.  *        Header for the Address Book.
  10.  *
  11.  * History:
  12.  *       4/24/97  roger - Created
  13.  *        2/2/99    meg    - added beepOnFail param
  14.  *
  15.  *****************************************************************************/
  16.  
  17. #include <IMCUtils.h>
  18. #include <ExgMgr.h>
  19.  
  20. #include "AddressDB.h"
  21.  
  22.  
  23.  
  24. /***********************************************************************
  25.  *
  26.  *   Internal Constants
  27.  *
  28.  ***********************************************************************/
  29.  
  30. #define addrVersionNum                    0x03
  31. #define addrPrefVersionNum                        0x03
  32. #define addrPrefID                        0x00
  33. #define addrDBName                        "AddressDB"
  34. #define addrDBType                        'DATA'
  35.  
  36. #define shortenedFieldString              "..."
  37. #define shortenedFieldLength              3
  38. #define fieldSeparatorString              ", "
  39. #define fieldSeparatorLength              2
  40. #define spaceBetweenNamesAndPhoneNumbers  6
  41.  
  42. // Address lookup table columns
  43. #define field1Column                      0
  44. #define field2Column                      1
  45.  
  46.  
  47.  
  48. /***********************************************************************
  49.  *
  50.  *   Internal Structures
  51.  *
  52.  ***********************************************************************/
  53.  
  54. // The Lookup command is called while another app is running.  Because of
  55. // of this the other app and not the Address Book has global variables.
  56. // All the variables the lookup command needs as globals are therefore
  57. // kept in this structure.
  58.  
  59. // 2/2/99 meg added the beepOnFail boolean because when a callng app sent in a 
  60. // multi char string and the string did not match, the lookup code would beep
  61. // then remove the last char. It would then repeat this process, beeping for
  62. // each char that was removed. I added this boolean that is initialized to true
  63. // so it beeps the first time, then when it beeps it sets the var to false. 
  64. // Entering a char turns it back on, so a user entering into the lookup field
  65. // will still get a beep per bad char, but it only will beep once for strings
  66. // passed in.
  67.  
  68. typedef struct 
  69.    {
  70.    AddrLookupParamsPtr params;
  71.    FormPtr frm;
  72.    DmOpenRef dbP;
  73.    Boolean hideSecretRecords;
  74.     UInt8 reserved1;
  75.    UInt16 currentRecord;
  76.    Int16 currentPhone;
  77.    UInt16 topVisibleRecord;
  78.    Int16 topVisibleRecordPhone;
  79.    Boolean sortByCompany;
  80.    Boolean ignoreEmptyLookupField;
  81.    AddressFields lookupFieldMap[addrLookupFieldCount];
  82.    Char phoneLabelLetters[numPhoneLabels];
  83.    Boolean beepOnFail;                
  84.     UInt8 reserved2;
  85.    } LookupVariablesType;
  86.  
  87. typedef LookupVariablesType *LookupVariablesPtr;
  88.  
  89.  
  90.  
  91.  
  92.  
  93. /************************************************************
  94.  * Global Variables
  95.  *************************************************************/
  96.  
  97. extern Boolean         SortByCompany;
  98.  
  99.  
  100. /************************************************************
  101.  * Function Prototypes
  102.  *************************************************************/
  103. #ifdef __cplusplus
  104. extern "C" {
  105. #endif
  106.  
  107.  
  108. // From Address.c
  109. extern Boolean DetermineRecordName (AddrDBRecordPtr recordP, 
  110.    Int16 *shortenedFieldWidth, Int16 *fieldSeparatorWidth, Boolean sortByCompany,
  111.    Char **name1, Int16 *name1Length, Int16 *name1Width, 
  112.    Char **name2, Int16 *name2Length, Int16 *name2Width, 
  113.    Char **unnamedRecordStringPtr, Int16 nameExtent);
  114.  
  115. extern void DrawRecordName (
  116.    Char *name1, Int16 name1Length, Int16 name1Width, 
  117.    Char *name2, Int16 name2Length, Int16 name2Width,
  118.    Int16 nameExtent, Int16 *x, Int16 y, Int16 shortenedFieldWidth, 
  119.    Int16 fieldSeparatorWidth, Boolean center, Boolean priorityIsName1,
  120.     Boolean inTitle);
  121.  
  122. extern void        InitPhoneLabelLetters(AddrAppInfoPtr appInfoPtr, Char *phoneLabelLetters);
  123. extern void *    GetObjectPtr (UInt16 objectID);
  124. extern void        SetDBAttrBits(DmOpenRef dbP, UInt16 attrBits);
  125.  
  126.  
  127. // From AddressLookup.c
  128. extern void Lookup (AddrLookupParamsType *params);
  129.  
  130.  
  131. // From AddressTransfer.c
  132. extern void AddrSendRecord (DmOpenRef dbP, Int16 recordNum);
  133. extern void AddrSendCategory (DmOpenRef dbP, UInt16 categoryNum);
  134. extern Err AddrReceiveData(DmOpenRef dbP, ExgSocketPtr obxSocketP);
  135. extern Boolean AddrImportVCard(DmOpenRef dbP, void *inputStream, GetCharF inputFunc,
  136.     Boolean obeyUniqueIDs, Boolean beginAlreadyRead);
  137. extern void AddrExportVCard(DmOpenRef dbP, Int16 index, AddrDBRecordType *recordP, 
  138.     void *outputStream, PutStringF outputFunc, Boolean writeUniqueIDs);
  139. extern void AddrRegisterData ();
  140.  
  141.  
  142. #ifdef __cplusplus 
  143. }
  144. #endif
  145.  
  146.