Unit:
AXPBook
Description:
The TApxPhonebook component provides a convenient way to store and retrieve information about connections. The information contains a name for the connection, phone number, and other information that defines the connection.
This component provides methods to select, add, and delete phone book entries, as well as dialogs to display and modify the entries.
The TApxPhoneBook uses a TMemIniFile to store and manipulate the phone book database. The connection information is stored in a TAxPBookRecord structure. TAxPBookRecord is defined as follows:
TAxPBookRecord = record
EntryName : string[100]; { unique name of the entry }
EntryType : TAxPBEntryType; { the type of connection }
Address : string[100]; { the address (phone number) }
Settings : TAxPBSettings; { DataBits, Parity, StopBits }
Emulation : TAxPBEmulation; { Default emulation }
Protocol : TAxPBProtocol; { Default protocol }
Custom1 : string[100]; { space for custom strings }
Custom2 : string[100];
Custom3 : string[100];
Custom4 : string[100];
end;
The EntryName field can be used to distinguish this connection from other connections in the database. This entry must be unique among all of the other entries.
The EntryType field is a TAxPBEntryType, which is defined as:
TAxPBEntryType = (pbtSerial, pbtModem);
pbtSerial is for direct connections through the serial port (null-modem or connections without an intermediate device). pbtModem is for connections through a modem or other intermediate device.
The Address field is the destination of the connection, usually the phone number.
The Settings field is a TAxPBSettings structure that defines the session parameters for the call. TAxPBSettings is defined as follows:
TAxPBSettings = record
DataBits : TAxDatabits;
Parity : TAxParity;
StopBits : TAxStopBits;
end;
The Emulation field is a TAxPBEmulation that can contain the terminal emulation used for this connection. TAxPBEmulation can be pbeNone for no emulation, pbeTTY for TTY emulation or pbeVT100 for VT100 emulation.
The Protocol field is a TAxPBProtocol that describes the default file transfer protocol for the connection. The following protocols are supported by APRO CLX:
TAxPBProtocol = (
ptNoProtocol,
ptXmodem,
ptXmodemCRC,
ptXmodem1K,
ptXmodem1KG,
ptYmodem,
ptYmodemG,
ptZmodem,
ptKermit,
ptAscii);
The Custom1, Custom2, Custom3 and Custom4 fields are provided for extended connection parameters and can be used to contain strings describing connection parameters not covered by the other fields. If these fields are used for authentication information (user name or password to access the connection), you are cautioned to encrypt the information.
The TApxPhoneBook component provides an add or edit dialog, and an entry selection dialog. To add a new entry, use the TApxPhoneBook.ShowNewEntryDialog method. To edit an existing entry, use the TApxPhoneBook.ShowEditDialog method.
The entry selection dialog allows editing existing entries and adding new entries.
The TApxPhoneBook component only contains connection information. This component does not configure the port, terminal, protocols, etc. Once an entry is selected, you change the appropriate TApxComPort, TApxTerminal and TApxProtocol properties to reflect the entry's parameters.