kpilot/lib

PilotAddress Class Reference

Inheritance diagram for PilotAddress:

PilotAppCategory PilotRecordBase List of all members.

Detailed Description

Definition at line 81 of file pilotAddress.h.


Public Types

 eWork = 0
 eHome
 eFax
 eOther
 eEmail
 eMain
 ePager
 eMobile
enum  EPhoneType {
  eWork = 0, eHome, eFax, eOther,
  eEmail, eMain, ePager, eMobile
}

Public Member Functions

 PilotAddress (struct AddressAppInfo &appInfo) KDE_DEPRECATED
 PilotAddress (struct AddressAppInfo &appInfo, PilotRecord *rec) KDE_DEPRECATED
 PilotAddress (PilotAddressInfo *appinfo, PilotRecord *rec=0L)
 PilotAddress (const PilotAddress &copyFrom)
PilotAddressoperator= (const PilotAddress &r)
bool operator== (const PilotAddress &r)
 ~PilotAddress ()
virtual QString getTextRepresentation (bool richText=false)
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
virtual void * pack_ (void *, int *)
void unpack (const void *, int=0)
Address * address () const

Static Public Attributes

static const int APP_BUFFER_SIZE

Protected Member Functions

const char * getFieldP (int field) const

Member Function Documentation

QStringList PilotAddress::getEmails (  )  const

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 303 of file pilotAddress.cc.

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

Definition at line 613 of file pilotAddress.cc.

KABC::PhoneNumber::List PilotAddress::getPhoneNumbers (  )  const

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 329 of file pilotAddress.cc.

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

Definition at line 173 of file pilotAddress.h.

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.

Reimplemented from PilotAppCategory.

Definition at line 182 of file pilotAddress.cc.

void * PilotAddress::pack_ ( void *  ,
int *   
) [virtual]

Pack whatever data the interpreted record holds into the given buffer, of length size; return NULL to indicate failure, otherwise buf.

Set size to the actual size of data returned. (all of this is dictated by the pilot-link interfaces).

Subclasses must reimplement this to give a specific meaning to the binary blob.

Parameters:
buf Data buffer containing the blob.
size Size of the buffer (in bytes). As input, the maximum size of the buffer. As output, the number of bytes used.

Implements PilotAppCategory.

Definition at line 704 of file pilotAddress.cc.

void PilotAddress::reset (  )  [inline]

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

Definition at line 106 of file pilotAddress.h.

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

Definition at line 142 of file pilotAddress.h.

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 };

Definition at line 683 of file pilotAddress.cc.

int PilotAddress::setPhoneField ( EPhoneType  type,
const QString &  field,
bool  overflowCustom = true,
bool  overwriteExisting = 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
overwriteExisting is true, it will overwrite an existing record-type with the field, else it will always search for the first available slot
Returns:
index of the field that this information was set to

Definition at line 564 of file pilotAddress.cc.

void PilotAddress::unpack ( const void *  ,
int  = 0 
) [inline, virtual]

Unpack the binary blob buf of size size into some structure with meaning.

Implements PilotAppCategory.

Definition at line 179 of file pilotAddress.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys