KDE PIM / Developers / API Docs / kpilot / lib

PilotAddress Class Reference

A wrapper class around the Address struct provided by pi-address.h. More...

#include <pilotAddress.h>

Inherits PilotAppCategory.

List of all members.

Public Types

Public Member Functions

Static Public Attributes

Protected Member Functions


Detailed Description

A wrapper class around the Address struct provided by pi-address.h.

This class allows the user to set and get address field values. For everything but phone fields, the user can simply pass the the pi-address enum for the index for setField() and getField() such as entryLastname.

Phone fields are a bit trickier. The structure allows for 8 possible phone fields with 5 possible slots. That means there could be three fields that don't have available storage. The setPhoneField() method will attempt to store the extra fields in a custom field if there is an overflow.

There are eight possible fields for 5 view slots:

Internally in the pilot-link library, the AddressAppInfo phone array stores the strings for the eight possible phone values. Their English string values are :

Apparently, this order is kept for all languages, just with localized strings. The implementation of the internal methods will assume this order is kept. In other languages, main can replaced with Corporation.


Member Function Documentation

QString PilotAddress::getTextRepresentation bool  richText = false  )  [virtual]
 

Returns a text representation of the address.

If richText is true, the text is allowed to contain Qt-HTML tags.

void PilotAddress::reset  )  [inline]
 

Zeros the internal address info structure, in effect clearing out all prior set values.

void PilotAddress::setField int  field,
const QString &  text
 

Parameters:
text set the field value
field int values associated with the enum defined in pi-address.h. The copied possible enum's are: (copied from pi-address.h on 1/12/01) enum { entryLastname, entryFirstname, entryCompany, entryPhone1, entryPhone2, entryPhone3, entryPhone4, entryPhone5, entryAddress, entryCity, entryState, entryZip, entryCountry, entryTitle, entryCustom1, entryCustom2, entryCustom3, entryCustom4, entryNote };

bool PilotAddress::setCategory const QString &  label  )  [inline]
 

If the label already exists, uses the id; if not, adds the label to the category list.

Returns:
false if category labels are full

QString PilotAddress::getPhoneField EPhoneType  type,
bool  checkCustom4 = true
const
 

Parameters:
type is the type of phone
checkCustom4 flag if true, checks the entryCustom4 field for extra phone fields
Returns:
the field associated with the type

void PilotAddress::setPhoneField EPhoneType  type,
const QString &  field,
bool  overflowCustom = true
 

Parameters:
type is the type of phone
field is value to store
overflowCustom is true, and entryPhone1 to entryPhone5 is full it will use entryCustom4 field to store the field

int PilotAddress::getShownPhone  )  const [inline]
 

Returns the (adjusted) index of the phone number selected by the user to be shown in the overview of addresses.

Adjusted here means that it's actually an index into 3..8, the fields that store phone numbers, so 0 means field 3 is selected.

Returns:
# between 0 and 3, where 0 is entryPhone1 and 3 is entryPhone4

The documentation for this class was generated from the following files: