• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kpilot

HHDataProxy Class Reference

#include <hhdataproxy.h>

Inheritance diagram for HHDataProxy:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 42 of file hhdataproxy.h.


Public Member Functions

void addCategory (Record *, const QString &)
bool addGlobalCategory (const QString &category)
QString bestMatchCategory (const QStringList &pcCategories, const QString &category) const
void clearCategory (HHRecord *rec)
bool containsCategory (const QString &category) const
 HHDataProxy (PilotDatabase *db)
virtual bool isOpen () const
void loadAllRecords ()
void setCategory (Record *rec, const QString &category)
virtual void syncFinished ()

Protected Member Functions

virtual bool _commit ()
virtual bool _rollback ()
virtual bool commitCreate (Record *rec)
virtual bool commitDelete (Record *rec)
virtual bool commitUpdate (Record *rec)
virtual HHRecord * createHHRecord (PilotRecord *rec)=0
virtual QString generateUniqueId ()
virtual PilotAppInfoBase * readAppInfo ()=0

Protected Attributes

QMap< uint, QString > fAddedCategories
PilotAppInfoBase * fAppInfo
PilotDatabase * fDatabase
recordid_t fLastUsedUniqueId
QList< recordid_t > fResettedRecords

Constructor & Destructor Documentation

HHDataProxy::HHDataProxy ( PilotDatabase *  db  ) 

Definition at line 40 of file hhdataproxy.cc.


Member Function Documentation

bool HHDataProxy::_commit (  )  [protected, virtual]

Commits the changes of global added categories to the database.

Reimplemented from DataProxy.

Definition at line 202 of file hhdataproxy.cc.

bool HHDataProxy::_rollback (  )  [protected, virtual]

Undo the changes of global added categories to the database.

Reimplemented from DataProxy.

Definition at line 214 of file hhdataproxy.cc.

void HHDataProxy::addCategory ( Record *  ,
const QString &   
) [inline, virtual]

Does nothing because handheld records only can have only one category.

Implements DataProxy.

Definition at line 106 of file hhdataproxy.h.

bool HHDataProxy::addGlobalCategory ( const QString &  category  ) 

Adds the category to the pilot database.

If the category app info block is full and doesn't contain the category it returns false. True otherwhise.

Definition at line 106 of file hhdataproxy.cc.

QString HHDataProxy::bestMatchCategory ( const QStringList &  pcCategories,
const QString &  category 
) const

Given a list of category names from the PC side pcCategories, look for the category best matching the category category in the appinfo block.

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 Unfiled if none match.

Returns:
Category that best matches.

Unfiled if no best match.

Definition at line 56 of file hhdataproxy.cc.

void HHDataProxy::clearCategory ( HHRecord *  rec  ) 

Sets the category of.

Parameters:
rec to "Unfiled" or whatever is appropriate for the conduit to say that the record has no category.

Definition at line 88 of file hhdataproxy.cc.

bool HHDataProxy::commitCreate ( Record *  rec  )  [protected, virtual]

Commits created record rec to the datastore.

Implements DataProxy.

Definition at line 235 of file hhdataproxy.cc.

bool HHDataProxy::commitDelete ( Record *  rec  )  [protected, virtual]

Undo the commit of created record rec to the datastore.

Implements DataProxy.

Definition at line 280 of file hhdataproxy.cc.

bool HHDataProxy::commitUpdate ( Record *  rec  )  [protected, virtual]

Commits updated record rec to the datastore.

Implements DataProxy.

Definition at line 259 of file hhdataproxy.cc.

bool HHDataProxy::containsCategory ( const QString &  category  )  const

Returns true if the the PilotDatabase contains the given category, false otherwhise.

Definition at line 95 of file hhdataproxy.cc.

virtual HHRecord* HHDataProxy::createHHRecord ( PilotRecord *  rec  )  [protected, pure virtual]

This function creates a (subclass of) HHRecord for rec.

Implemented in CalendarHHDataProxy, ContactsHHDataProxy, KeyringHHDataProxy, TodoHHDataProxy, and ContactsHHDataProxy.

QString HHDataProxy::generateUniqueId (  )  [protected, virtual]

Generates a unique id for a new record.

Implements DataProxy.

Definition at line 184 of file hhdataproxy.cc.

bool HHDataProxy::isOpen (  )  const [virtual]

Returns whether or not the pilot database is opened.

Implements DataProxy.

Definition at line 301 of file hhdataproxy.cc.

void HHDataProxy::loadAllRecords (  )  [virtual]

Reads all records from the database.

Implements DataProxy.

Definition at line 315 of file hhdataproxy.cc.

virtual PilotAppInfoBase* HHDataProxy::readAppInfo (  )  [protected, pure virtual]

These functions must be implemented by the subclassing conduit.

Implementing classes read the appinfo block and return a pointer so that category information can be read and altered.

Implemented in CalendarHHDataProxy, ContactsHHDataProxy, KeyringHHDataProxy, TodoHHDataProxy, and ContactsHHDataProxy.

void HHDataProxy::setCategory ( Record *  rec,
const QString &  category 
) [virtual]

Reads the right category id from app info and updates the record accordingly.

When the Category is not found, it tries to add the Category to the database. If there is no category id found and the Category could not be added to the database the category of the record remains unchanged.

Implements DataProxy.

Definition at line 152 of file hhdataproxy.cc.

void HHDataProxy::syncFinished (  )  [virtual]

Notifies the proxy that the synchronization is finished and that no modifications will be done after this.

Reimplemented from DataProxy.

Definition at line 45 of file hhdataproxy.cc.


Member Data Documentation

QMap<uint, QString> HHDataProxy::fAddedCategories [protected]

Definition at line 157 of file hhdataproxy.h.

PilotAppInfoBase* HHDataProxy::fAppInfo [protected]

Definition at line 156 of file hhdataproxy.h.

PilotDatabase* HHDataProxy::fDatabase [protected]

Definition at line 153 of file hhdataproxy.h.

recordid_t HHDataProxy::fLastUsedUniqueId [protected]

Definition at line 154 of file hhdataproxy.h.

QList<recordid_t> HHDataProxy::fResettedRecords [protected]

Definition at line 155 of file hhdataproxy.h.


The documentation for this class was generated from the following files:
  • hhdataproxy.h
  • hhdataproxy.cc

kpilot

Skip menu "kpilot"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal