libopie PIM API Documentation

OContactAccess Class Reference

Class to access the contacts database. More...

#include <ocontactaccess.h>

Inheritance diagram for OContactAccess:

Inheritance graph
[legend]
Collaboration diagram for OContactAccess:

Collaboration graph
[legend]
List of all members.

Public Types

enum  QuerySettings {
  WildCards = 0x0001, IgnoreCase = 0x0002, RegExp = 0x0004, ExactMatch = 0x0008,
  MatchOne = 0x0010, DateDiff = 0x0020, DateYear = 0x0040, DateMonth = 0x0080,
  DateDay = 0x0100
}
 Constants for query. More...


Signals

void signalChanged (const OContactAccess *which)

Public Member Functions

 OContactAccess (const QString appname, const QString filename=0l, OContactAccessBackend *backend=0l, bool handlesync=true)
 Create Database with contacts (addressbook).

 ~OContactAccess ()
List sorted (bool ascending, int sortOrder, int sortFilter, int cat) const
 Return all Contacts in a sorted manner.

const uint querySettings ()
 Return all possible settings.

bool hasQuerySettings (int querySettings) const
 Check whether settings are correct.

bool wasChangedExternally () const
 if the resource was changed externally.

bool save ()
 Save contacts database.


Detailed Description

Class to access the contacts database.

This is just a frontend for the real database handling which is done by the backend. This class is used to access the Contacts on a system. This class as any OPIE PIM class is backend independent.

Author:
Stefan Eilers, Holger Freyther
See also:
OPimAccessTemplate

Definition at line 96 of file ocontactaccess.h.


Member Enumeration Documentation

enum OContactAccess::QuerySettings
 

Constants for query.

Use this constants to set the query parameters. Note: query_IgnoreCase just make sense with one of the other attributes !

See also:
queryByExample()
Enumeration values:
WildCards 
IgnoreCase 
RegExp 
ExactMatch 
MatchOne 
DateDiff 
DateYear 
DateMonth 
DateDay 

Definition at line 124 of file ocontactaccess.h.


Constructor & Destructor Documentation

OContactAccess::OContactAccess const QString  appname,
const QString  filename = 0l,
OContactAccessBackend backend = 0l,
bool  handlesync = true
 

Create Database with contacts (addressbook).

Parameters:
appname Name of application which wants access to the database (i.e. "todolist")
filename The name of the database file. If not set, the default one is used.
backend Pointer to an alternative Backend. If not set, we will use the default backend.
handlesync If true the database stores the current state automatically if it receives the signals flush() and reload() which are used before and after synchronisation. If the application wants to react itself, it should be disabled by setting it to false
See also:
OContactAccessBackend

Definition at line 76 of file ocontactaccess.cpp.

References QObject::connect(), OBackendFactory< T >::Default(), and OPimAccessTemplate< T >::setBackEnd().

OContactAccess::~OContactAccess  ) 
 

Definition at line 104 of file ocontactaccess.cpp.

References save().


Member Function Documentation

ORecordList< OContact > OContactAccess::sorted bool  ascending,
int  sortOrder,
int  sortFilter,
int  cat
const
 

Return all Contacts in a sorted manner.

Parameters:
ascending true: Sorted in acending order.
sortOrder Currently not implemented. Just defined to stay compatible to otodoaccess
sortFilter Currently not implemented. Just defined to stay compatible to otodoaccess
cat Currently not implemented. Just defined to stay compatible to otodoaccess

Definition at line 142 of file ocontactaccess.cpp.

const uint OContactAccess::querySettings  ) 
 

Return all possible settings.

Returns:
All settings provided by the current backend (i.e.: query_WildCards & query_IgnoreCase)

Definition at line 133 of file ocontactaccess.cpp.

References OContactAccessBackend::querySettings().

bool OContactAccess::hasQuerySettings int  querySettings  )  const
 

Check whether settings are correct.

Returns:
true if the given settings are correct and possible.

Definition at line 138 of file ocontactaccess.cpp.

References OContactAccessBackend::hasQuerySettings().

bool OContactAccess::wasChangedExternally  )  const
 

if the resource was changed externally.

You should use the signal instead of polling possible changes !

Reimplemented from OPimAccessTemplate< OContact >.

Definition at line 149 of file ocontactaccess.cpp.

bool OContactAccess::save  )  [virtual]
 

Save contacts database.

Save is more a "commit". After calling this function, all changes are public available.

Returns:
true if successful

Reimplemented from OPimAccessTemplate< OContact >.

Definition at line 114 of file ocontactaccess.cpp.

References OPimAccessTemplate< OContact >::reload(), OPimAccessTemplate< T >::save(), and OPimAccessTemplate< T >::wasChangedExternally().

Referenced by ~OContactAccess().

void OContactAccess::signalChanged const OContactAccess which  )  [signal]
 


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:26:04 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001