This chapter describes the private records API as declared in PrivateRecords.h
. It discusses the following topics:
Private Records Constants
Private Records Functions and Macros
Private Records Constants
privateRecordViewEnum Typedef
Purpose
Provides the available choices for displaying private records.
Declared In
PrivateRecords.h
Prototype
typedef Enum8 privateRecordViewEnum
Constants
-
showPrivateRecords = 0x00
- Display private records in the user interface.
-
maskPrivateRecords
- Show a shaded rectangle in place of a private record.
-
hidePrivateRecords
- Hide private records and provide no indication in the user interface that they exist.
Private Records Functions and Macros
SecSelectViewStatus Function
Purpose
Displays a form that allows the user to select whether to hide, show, or mask private records.
Declared In
PrivateRecords.h
Prototype
privateRecordViewEnum SecSelectViewStatus ( void )
Parameters
Returns
A privateRecordViewEnum
constant that indicates which option the user selected.
Comments
This function displays a dialog that allows users to change the preference prefShowPrivateRecords
, which controls how private records are displayed.
When the user taps the OK button in this dialog, SecVerifyPW()
is called to see if the user changed the preference setting and, if so, to prompt the user to enter the appropriate password.
After calling this function, your code should check the return value or the value of prefShowPrivateRecords
and mask, display, or hide the private records accordingly. See the description of TblSetRowMasked()
for a partial example.
SecVerifyPW Function
Purpose
Displays a password dialog, verify the password, and changes the private records preference.
Declared In
PrivateRecords.h
Prototype
Boolean SecVerifyPW (
privateRecordViewEnum newSecLevel
)
Parameters
-
→ newSecLevel
- The security level (display, hide, or mask) selected on the private records dialog. See
privateRecordViewEnum
.
Returns
true
if the prefShowPrivateRecords
preference was successfully changed, false
if not.
Comments
This function checks newSecLevel
against the current value for the preference. If the two values differ and newSecLevel
indicates a decrease in security, a dialog is displayed prompting the user to enter a password. (Hidden is considered the most secure, followed by masked. Showing private records is considered the least secure.) If the password is entered successfully, the preference is changed.
This function also displays an alert message if the security level has changed to either hidden or masked.