kpilot

KABCSync Namespace Reference


Classes

class  Settings

Enumerations

enum  MappingForCustomField { eCustomField = 0, eCustomBirthdate, eCustomURL, eCustomIM }
enum  MappingForOtherPhone {
  eOtherPhone = 0, eAssistant, eBusinessFax, eCarPhone,
  eEmail2, eHomeFax, eTelex, eTTYTTDPhone
}

Functions

unsigned int bestMatchedCategory (const QStringList &categorynames, const PilotAddressInfo &info, unsigned int category)
QString bestMatchedCategoryName (const QStringList &categorynames, const PilotAddressInfo &info, unsigned int category)
void copy (KABC::Addressee &toAbEntry, const PilotAddress &fromPiAddr, const PilotAddressInfo &appInfo, const Settings &syncSettings)
void copy (PilotAddress &toPilotAddr, const KABC::Addressee &fromAbEntry, const PilotAddressInfo &appInfo, const Settings &syncSettings)
KABC::Address getAddress (const KABC::Addressee &abEntry, const Settings &)
QString getFieldForHHCustom (unsigned int index, const KABC::Addressee &abEntry, const Settings &settings)
QString getFieldForHHOtherPhone (const KABC::Addressee &abEntry, const Settings &s)
KABC::PhoneNumber::List getPhoneNumbers (const PilotAddress &a)
bool isArchived (const KABC::Addressee &)
void makeArchived (KABC::Addressee &)
void setAddress (PilotAddress &toPilotAddr, const KABC::Address &abAddress)
void setCategory (KABC::Addressee &abEntry, const QString &cat)
void setFieldFromHHCustom (const unsigned int index, KABC::Addressee &abEntry, const QString &value, const Settings &settings)
void setFieldFromHHOtherPhone (KABC::Addressee &abEntry, const QString &nr, const Settings &s)
void setPhoneNumbers (const PilotAddressInfo &info, PilotAddress &a, const KABC::PhoneNumber::List &list)
void showAddressee (const KABC::Addressee &)

Variables

const QString appString = CSL1("KPILOT")
const QString flagString = CSL1("Flag")
const QString idString = CSL1("RecordID")

Enumeration Type Documentation

Enumerator:
eCustomField 
eCustomBirthdate 
eCustomURL 
eCustomIM 

Definition at line 63 of file kabcRecord.h.

Enumerator:
eOtherPhone 
eAssistant 
eBusinessFax 
eCarPhone 
eEmail2 
eHomeFax 
eTelex 
eTTYTTDPhone 

Definition at line 52 of file kabcRecord.h.


Function Documentation

unsigned int KABCSync::bestMatchedCategory ( const QStringList categorynames,
const PilotAddressInfo info,
unsigned int  category 
)

Given a list of category names from the KDE side (e.g.

attached to a PC-based Addressee) categorynames , look for the category best matching the category category in the appinfo block info . Here, best is defined as follows:

  • if the name of category category is in the list, use it
  • otherwise use the first category from the list that is a valid category on the handheld.
  • use Pilot::Unfiled if none match.

Returns:
Category index that best matches.

Pilot::Unfiled if no best match.

Definition at line 225 of file kabcRecord.cc.

QString KABCSync::bestMatchedCategoryName ( const QStringList categorynames,
const PilotAddressInfo info,
unsigned int  category 
) [inline]

As above, but return the name of the category.

Definition at line 173 of file kabcRecord.h.

void KABCSync::copy ( KABC::Addressee &  toAbEntry,
const PilotAddress fromPiAddr,
const PilotAddressInfo appInfo,
const Settings &  syncSettings 
)

Definition at line 570 of file kabcRecord.cc.

void KABCSync::copy ( PilotAddress toPilotAddr,
const KABC::Addressee &  fromAbEntry,
const PilotAddressInfo appInfo,
const Settings &  syncSettings 
)

Definition at line 512 of file kabcRecord.cc.

KABC::Address KABCSync::getAddress ( const KABC::Addressee &  abEntry,
const Settings &  s 
)

Returns the address portion of an addressee.

First search for a preferred address.

Since the HH can only store one address, we return the preferred address (if the Addressee abEntry has one) and then either home or business depending on preferHome and if that doesn't exist, the other one and if that doesn't exist, return the preferred home or work address if it exists.

If we don't have one, search for home or work as specified in the config dialog. If we don't have such one, either, search for the other type. If we still have no luck, return an address with preferred + home/work flag (from config dlg).

Definition at line 395 of file kabcRecord.cc.

QString KABCSync::getFieldForHHCustom ( unsigned int  index,
const KABC::Addressee &  abEntry,
const Settings &  settings 
)

Get the string value for HH custom field index (0.

.3) from the addressee abEntry . Which actual field this is depends on the mapping of custom HH fields to PC fields. This mapping is given by the customMapping which may be created from the conduit settings or by hand. Since one of the possible actual fields is "birthday," which needs formatting, use the date format string dateFormat. If this is empty, use the locale setting.

Returns:
String value for HH custom field index

Null QString on error (is also a valid return value)

Definition at line 270 of file kabcRecord.cc.

QString KABCSync::getFieldForHHOtherPhone ( const KABC::Addressee &  abEntry,
const Settings &  s 
)

The HH has a phone type "other" which may be mapped to any one of several PC side phone numbers.

Return the right one depending in the mapping.

Note:
mappingForOther should come from AbbrowserSettings::pilotOther()

Definition at line 419 of file kabcRecord.cc.

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

Return a list of all the phone numbers (max.

8) set in this handheld entry a . Email entries are ignored.

Definition at line 77 of file kabcRecord.cc.

bool KABCSync::isArchived ( const KABC::Addressee &  addr  ) 

Definition at line 497 of file kabcRecord.cc.

void KABCSync::makeArchived ( KABC::Addressee &  addr  ) 

Definition at line 502 of file kabcRecord.cc.

void KABCSync::setAddress ( PilotAddress toPilotAddr,
const KABC::Address &  abAddress 
)

Set the address fields of the HH record from the abAddress .

Definition at line 486 of file kabcRecord.cc.

void KABCSync::setCategory ( KABC::Addressee &  abEntry,
const QString cat 
)

Give the addressee abEntry the category cat (leaving existing category assignments intact).

Definition at line 261 of file kabcRecord.cc.

void KABCSync::setFieldFromHHCustom ( const unsigned int  index,
KABC::Addressee &  abEntry,
const QString value,
const Settings &  settings 
)

Set a field of the PC abEntry address from the custom HH field.

Use value value . The value comes from custom field index using the interpretation of custom fields customMapping . Because one of the interpretations includes the birthday, use the date format dateFormat ; if empty, use the local format when setting dates from the HH.

Definition at line 321 of file kabcRecord.cc.

void KABCSync::setFieldFromHHOtherPhone ( KABC::Addressee &  abEntry,
const QString nr,
const Settings &  s 
)

The HH has a phone type "other" which may be mapped to any one of several PC side phone numbers.

Store the number nr in the PC side phone field indicated by mappingForOther .

Note:
mappingForOther should come from AbbrowserSettings::pilotOther()

Definition at line 444 of file kabcRecord.cc.

void KABCSync::setPhoneNumbers ( const PilotAddressInfo info,
PilotAddress a,
const KABC::PhoneNumber::List &  list 
)

Set the phone numbers from list in the handheld entry a (with info block info providing the mapping of category names and some other fiddly stuff) as far as possible.

No overflow handling is done at all. If the desktop has more than 5 phone entries, the remainder are dropped.

Definition at line 134 of file kabcRecord.cc.

void KABCSync::showAddressee ( const KABC::Addressee &  abAddress  ) 

Definition at line 660 of file kabcRecord.cc.


Variable Documentation

const QString KABCSync::appString = CSL1("KPILOT")

Identifier for the application.

Definition at line 189 of file kabcRecord.h.

const QString KABCSync::flagString = CSL1("Flag")

Flags: synced or not.

Definition at line 190 of file kabcRecord.h.

const QString KABCSync::idString = CSL1("RecordID")

Record ID on HH for this addressee.

Definition at line 191 of file kabcRecord.h.