⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addrdefines.h

📁 palm os 上的中文伴侣源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
 * @return  The chat field label index corresponding to the given field.
 */
#define GetChatLabel(r, p) (((r)->options.chatBits >> (((p) - chat1) << 2)) & \
                            0xF)

/**
 * Set the chat field's label index.
 * The new chat label index should be an AddressChatLabels enum.
 *
 * @param r     Ptr to a record for which to set the label.
 * @param p     Index of the chat field to set.
 * @param pl    Index of the new chat label for the field.
 *
 * @return      Nothing.
 */
#define SetChatLabel(r, p, pl) ((r)->options.chatBits =                 \
                               ((r)->options.chatBits & ~((UInt32)      \
                               0x0000000F << (((p) - chat1) << 2))) |   \
                               ((UInt32) pl << (((p) - chat1) << 2)));

/**
 * Get the phone field's label string.
 * The given label number should be an AddressPhoneLabels enum.
 * e.g.: to retrieve the phone label for a given record's phone
 * field, use GetPhoneLabel() to get the label number to pass
 * to this macro.
 *
 * @param appInfoP  Ptr to the application info block containing
 *                      the field labels.
 * @param labelNum  Index of the phone field label to get.
 *
 * @return          A phone field label.
 */
#define GetPhoneLabelText(appInfoP, labelNum) \
        ((appInfoP)->fieldLabels[(((labelNum) < numPhoneLabelsStoredFirst) ? \
        (labelNum) + firstPhoneField : phoneLabelSecondStart)])

/**
 * Get the chat field's label string.
 * The given label number should be an AddressChatLabels enum.
 * e.g.: to retrieve the chat label for a given record's chat
 * field, use GetChatLabel() to get the label number to pass
 * to this macro.
 *
 * @param appInfoP  Ptr to the application info block containing
 *                      the field labels.
 * @param labelNum  Index of the chat field label to get.
 *
 * @return          A chat field label.
 */
#define GetChatLabelText(appInfoP, labelNum) \
        ((appInfoP)->fieldLabels[(((labelNum) < numChatLabels) ? \
        (labelNum) + chatLabelstart : chatLabelstart)])

/**
 * Get the address field's label string.
 * The given label number should be an AddressStreetAddressLabels enum.
 * e.g.: to retrieve the address label for a given record's address
 * field, use GetAddressLabel() to get the label number to pass
 * to this macro.
 *
 * @param appInfoP  Ptr to the application info block containing
 *                      the field labels.
 * @param labelNum  Index of the address field label to get.
 *
 * @return          An address field label.
 */
#define GetAddrLabelText(appInfoP, labelNum) \
        ((appInfoP)->fieldLabels[address + (labelNum * 5)])

/***********************************************************************
 *  Address field parts (or sub-field) macros.
 *  Note: For addresses, the address, city, state, zipCode, country, are
 *        accessed relative to a base address field index.
 ***********************************************************************/

/**
 * Get the index of the street sub-field of the address field.
 * The address base field index corresponds to one of the
 * address field indices in the AddressFields enum.  e.g.:
 * address2.
 *
 * @param b Address base field index.
 *
 * @return  The street field index.
 */
#define DeliveryAddressStreetField(b)           (b)

/**
 * Get the index of the city sub-field of the address field.
 * The address base field index corresponds to one of the
 * address field indices in the AddressFields enum.  e.g.:
 * address2.
 *
 * @param b Address base field index.
 *
 * @return  The city field index.
 */
#define DeliveryAddressCityField(b)             ((b) + 1)

/**
 * Get the index of the state sub-field of the address field.
 * The address base field index corresponds to one of the
 * address field indices in the AddressFields enum.  e.g.:
 * address2.
 *
 * @param b Address base field index.
 *
 * @return  The state field index.
 */
#define DeliveryAddressStateField(b)            ((b) + 2)

/**
 * Get the index of the zip code sub-field of the address field.
 * The address base field index corresponds to one of the
 * address field indices in the AddressFields enum.  e.g.:
 * address2.
 *
 * @param b Address base field index.
 *
 * @return  The zip code field index.
 */
#define DeliveryAddressZipCodeField(b)          ((b) + 3)

/**
 * Get the index of the country sub-field of the address field.
 * The address base field index corresponds to one of the
 * address field indices in the AddressFields enum.  e.g.:
 * address2.
 *
 * @param b Address base field index.
 *
 * @return  The country field index.
 */
#define DeliveryAddressCountryField(b)          ((b) + 4)

/***********************************************************************
 *  Field predicate macros.
 ***********************************************************************/

/**
 * Is the field a custom type field.
 * Note that "custom" here is in regard to the type of table
 * field, not to the custom/renameable record fields.
 *
 * @param fieldIndex    Index of the field to check.
 *
 * @return              True if a custom field.
 */
#define isCustomField(fieldIndex) (fieldIndex == birthdayDate ||    \
                                   fieldIndex == pictureInfo )

/**
 * Is the field a selector trigger type.
 *
 * @param fieldIndex    Index of the field to check.
 *
 * @return              True if a selector trigger type field.
 */
#define isSelectorTypeField(fieldIndex) (fieldIndex == birthdayDate)

/** Identifies picture fields */
#define isPictureField(fieldIndex) (fieldIndex == pictureInfo)

/**
 * Is the field a phone field.
 *
 * @param fieldIndex    Index of the field to check.
 *
 * @return              True if a phone field.
 */
#define isPhoneField(f) (f >= firstPhoneField && f <= lastPhoneField)

/**
 * Is the field an address field.
 *
 * @param fieldIndex    Index of the field to check.
 *
 * @return              True if an address field.
 */
#define isAddressField(fieldIndex) (fieldIndex == address || fieldIndex == address2 || fieldIndex == address3)

/**
 * Is the field a chat field.
 *
 * @param fieldIndex    Index of the field to check.
 *
 * @return              True if a chat field.
 */
#define isChatField(fieldIndex) (fieldIndex == chat1 || fieldIndex ==chat2)

/**
 * Does the field have a popup list of labels in Edit View.
 *
 * @param fieldIndex    Index of the field to check.
 *
 * @return              True if the field has a popup list of labels.
 */
#define isPopupTypeField(fieldIndex) (isPhoneField(fieldIndex)   || \
                                      isAddressField(fieldIndex) || \
                                      isChatField(fieldIndex))

/**
 * Is the label a chat field label.
 *
 * @param fieldIndex    Index of the field label to check.
 *
 * @return              True if a chat field label.
 */
#define isChatLabel(fieldIndex) (fieldIndex >= chatLabelstart && fieldIndex < \
                                 chatLabelstart + numChatLabels)

/***********************************************************************
 *  Miscellaneous macros.
 ***********************************************************************/

/**
 * Get the number of chat fields.
 *
 * @return The number of chat fields.
 */
#define chatFieldCount ((lastChatField - firstChatField) + 1)

/**
 * Get the number of custom/renameable fields.
 *
 * @return The number of custom/renameable fields.
 */
#define customFieldCount ((lastRenameableLabel - firstRenameableLabel) + 1)

/** Picture height and width in low res pixels */
/*@{*/
#define pictureHeight               48
#define pictureWidth                48
/*@}*/

/** Max picture size stroed in blob (in low res) */
/*@{*/
#define pictureMaxHeight            72
#define pictureMaxWidth             72
/*@}*/

#define ftrCreateDefaultDatabase    0
#define addrPrefVersionNum          0x01 //0x04
#define addrPrefID                  0x00

#endif  // ADDRDEFINES_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -