kpilot/lib
PilotAddress Class Reference
#include <pilotAddress.h>
Inheritance diagram for PilotAddress:

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:
- fields: Work, Home, Fax, Other, Pager, Mobile, E-mail, Main
- slots: entryPhone1, entryPhone2, entryPhone3, entryPhone4, entryPhone5
Internally in the pilot-link library, the AddressAppInfo phone array stores the strings for the eight possible phone values. Their English string values are :
- phone[0] = Work
- phone[1] = Home
- phone[2] = Fax
- phone[3] = Other
- phone[4] = E-mail
- phone[5] = Main
- phone[6] = Pager
- phone[7] = Mobile
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.
Definition at line 80 of file pilotAddress.h.
Public Types | |
enum | EPhoneType { eWork = 0, eHome, eFax, eOther, eEmail, eMain, ePager, eMobile } |
Public Member Functions | |
PilotAddress (PilotAddressInfo *appinfo, PilotRecord *rec=0L) | |
PilotAddress (const PilotAddress ©From) | |
PilotAddress & | operator= (const PilotAddress &r) |
bool | operator== (const PilotAddress &r) |
virtual | ~PilotAddress () |
QString | getTextRepresentation (bool richText=false) const |
void | reset () |
void | setField (int field, const QString &text) |
QString | getField (int field) const |
QStringList | getEmails () const |
void | setEmails (QStringList emails) |
KABC::PhoneNumber::List | getPhoneNumbers () const |
void | setPhoneNumbers (KABC::PhoneNumber::List list) |
QString | getCategoryLabel () const |
bool | setCategory (const QString &label) |
QString | getPhoneField (EPhoneType type, bool checkCustom4=true) const |
int | setPhoneField (EPhoneType type, const QString &field, bool overflowCustom=true, bool overwriteExisting=true) |
int | getShownPhone () const |
void | setShownPhone (EPhoneType phoneType) |
int | getPhoneLabelIndex (int index) const |
PilotRecord * | pack () const |
const struct Address * | address () const |
Protected Member Functions | |
const char * | getFieldP (int field) const |
Member Function Documentation
|
Return list of all email addresses. This will search through our "phone" fields and will return only those which are e-mail addresses. Definition at line 257 of file pilotAddress.cc. |
|
Definition at line 554 of file pilotAddress.cc. |
|
Return list of all phone numbers. This will search through our "phone" fields and will return only those which are not e-mail addresses. Definition at line 281 of file pilotAddress.cc. |
|
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.
Definition at line 175 of file pilotAddress.h. |
|
Returns a text representation of the address. If richText is true, the text is allowed to contain Qt-HTML tags. Definition at line 136 of file pilotAddress.cc. |
|
Zeros the internal address info structure, in effect clearing out all prior set values.
Definition at line 103 of file pilotAddress.h. |
|
If the label already exists, uses the id; if not, adds the label to the category list.
Definition at line 139 of file pilotAddress.h. |
|
Definition at line 624 of file pilotAddress.cc. |
|
Definition at line 505 of file pilotAddress.cc. |
The documentation for this class was generated from the following files: