Platform SDK: MAPI |
The SContentRestriction structure describes a content restriction, which is used to limit a table view to only those rows that include a column with contents matching a search string.
Header file: | MAPIDEFS.H |
typedef struct _SContentRestriction { ULONG ulFuzzyLevel; ULONG ulPropTag; LPSPropValue lpProp; } SContentRestriction;
The lower 16 bits of the ulFuzzyLevel member apply to properties of type PT_BINARY and PT_STRING8 and must be set to one of the following values:
The upper 16 bits of the ulFuzzyLevel member apply only to properties of type PT_STRING8 and can be set to the following values in any combination:
There are two property tags in an SContentRestriction structure: one in the ulPropTag member and the other in the ulPropTag member of the SPropValue structure pointed to by lpProp. In both tags, MAPI requires only the property type field and ignores the property identifier field. However, the two property types must match, or else the error value MAPI_E_TOO_COMPLEX is returned when the restriction is used in a call to IMAPITable::Restrict or IMAPITable::FindRow.
The values FL_FULLSTRING, FL_PREFIX, and FL_SUBSTRING are mutually exclusive. Only one of them can be set, and one of them must be set. Their meanings are fixed, and the provider must implement them exactly as defined. The provider should return MAPI_E_TOO_COMPLEX if it is unable to support these values.
The values FL_IGNORECASE, FL_IGNORENONSPACE, and FL_LOOSE are independent. Anywhere from zero to all three of them can be set. Their definitions are provided as a guideline only, and the provider is free to implement its own specific meaning of each flag. The provider should not return any error indication if it has no implementation of a specified flag.
The result of a content restriction imposed against a property is undefined when the property does not exist. When a client requires well-defined behavior for such a restriction and is not sure whether the property exists — for example, it is not a required column of a table — it should create an AND restriction to join the content restriction with an exist restriction. Use an SExistRestriction structure to define the exist restriction and an SAndRestriction structure to define the AND restriction.
For more information on the SContentRestriction structure and restrictions in general, see About Restrictions.