libopie PIM API Documentation

ODateBookAccessBackend_SQL Class Reference

This is the default SQL implementation for DateBoook SQL storage It fully implements the interface. More...

#include <odatebookaccessbackend_sql.h>

Inheritance diagram for ODateBookAccessBackend_SQL:

Inheritance graph
[legend]
Collaboration diagram for ODateBookAccessBackend_SQL:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ODateBookAccessBackend_SQL (const QString &appName, const QString &fileName=QString::null)
 ~ODateBookAccessBackend_SQL ()
bool load ()
 load the resource

bool reload ()
 reload the resource

bool save ()
 save the resource and all it's changes

QArray< intallRecords () const
 return an array of all available uids

QArray< intmatchRegexp (const QRegExp &r) const
 return a List of records that match the regex

QArray< intqueryByExample (const OEvent &, int, const QDateTime &d=QDateTime())
 queryByExample for T with the given Settings

OEvent find (int uid) const
 find the OPimRecord with uid

void clear ()
 clear the back end

bool add (const OEvent &ev)
 add T

bool remove (int uid)
 remove

bool replace (const OEvent &ev)
 replace a record with T.uid()

QArray< UIDrawEvents () const
 This method should return a list of UIDs containing all events.

QArray< UIDrawRepeats () const
 This method should return a list of UIDs containing all repeating events.

QArray< UIDnonRepeats () const
 This mthod should return a list of UIDs containing all non repeating events.

OEvent::ValueList directNonRepeats ()
 If you do not want to implement the effectiveEvents methods below you need to supply it with directNonRepeats.

OEvent::ValueList directRawRepeats ()
 Same as above but return raw repeats!


Detailed Description

This is the default SQL implementation for DateBoook SQL storage It fully implements the interface.

See also:
ODateBookAccessBackend

OPimAccessBackend

Definition at line 17 of file odatebookaccessbackend_sql.h.


Constructor & Destructor Documentation

ODateBookAccessBackend_SQL::ODateBookAccessBackend_SQL const QString appName,
const QString fileName = QString::null
 

Definition at line 55 of file odatebookaccessbackend_sql.cpp.

References Global::applicationFileName(), QString::isEmpty(), and load().

ODateBookAccessBackend_SQL::~ODateBookAccessBackend_SQL  ) 
 

Definition at line 71 of file odatebookaccessbackend_sql.cpp.


Member Function Documentation

bool ODateBookAccessBackend_SQL::load  )  [virtual]
 

load the resource

Implements OPimAccessBackend< OEvent >.

Definition at line 111 of file odatebookaccessbackend_sql.cpp.

References QString::arg(), QMap< int, QString >::begin(), QMap< int, QString >::end(), and QString::latin1().

Referenced by ODateBookAccessBackend_SQL(), and reload().

bool ODateBookAccessBackend_SQL::reload  )  [virtual]
 

reload the resource

Implements OPimAccessBackend< OEvent >.

Definition at line 156 of file odatebookaccessbackend_sql.cpp.

References load().

Referenced by clear().

bool ODateBookAccessBackend_SQL::save  )  [virtual]
 

save the resource and all it's changes

Implements OPimAccessBackend< OEvent >.

Definition at line 161 of file odatebookaccessbackend_sql.cpp.

QArray< int > ODateBookAccessBackend_SQL::allRecords  )  const [virtual]
 

return an array of all available uids

Implements OPimAccessBackend< OEvent >.

Definition at line 166 of file odatebookaccessbackend_sql.cpp.

QArray< int > ODateBookAccessBackend_SQL::matchRegexp const QRegExp r  )  const [virtual]
 

return a List of records that match the regex

Implements OPimAccessBackend< OEvent >.

Definition at line 340 of file odatebookaccessbackend_sql.cpp.

QArray< int > ODateBookAccessBackend_SQL::queryByExample const OEvent ,
int  ,
const QDateTime d = QDateTime()
[virtual]
 

queryByExample for T with the given Settings

Implements OPimAccessBackend< OEvent >.

Definition at line 171 of file odatebookaccessbackend_sql.cpp.

OEvent ODateBookAccessBackend_SQL::find int  uid  )  const [virtual]
 

find the OPimRecord with uid

Parameters:
uid returns T and T.isEmpty() if nothing was found

Implements OPimAccessBackend< OEvent >.

Definition at line 187 of file odatebookaccessbackend_sql.cpp.

References QMap< int, QString >::begin(), QMapConstIterator::data(), QMap< int, QString >::end(), QMap::insert(), and QString::number().

Referenced by directNonRepeats(), and directRawRepeats().

void ODateBookAccessBackend_SQL::clear  )  [virtual]
 

clear the back end

Implements OPimAccessBackend< OEvent >.

Definition at line 175 of file odatebookaccessbackend_sql.cpp.

References reload().

bool ODateBookAccessBackend_SQL::add const OEvent ev  )  [virtual]
 

add T

Implements OPimAccessBackend< OEvent >.

Definition at line 213 of file odatebookaccessbackend_sql.cpp.

References QString::arg(), QMap::begin(), QMap< int, QString >::begin(), QMap::end(), QMap< int, QString >::end(), QMap::isEmpty(), QString::latin1(), QString::number(), OPimRecord::toExtraMap(), OEvent::toMap(), and Qtopia::Record::uid().

Referenced by replace().

bool ODateBookAccessBackend_SQL::remove int  uid  )  [virtual]
 

remove

Implements OPimAccessBackend< OEvent >.

Definition at line 259 of file odatebookaccessbackend_sql.cpp.

References QString::number().

Referenced by replace().

bool ODateBookAccessBackend_SQL::replace const OEvent ev  )  [virtual]
 

replace a record with T.uid()

Implements OPimAccessBackend< OEvent >.

Definition at line 278 of file odatebookaccessbackend_sql.cpp.

References add(), remove(), and Qtopia::Record::uid().

QArray< int > ODateBookAccessBackend_SQL::rawEvents  )  const [virtual]
 

This method should return a list of UIDs containing all events.

No filter should be applied

Returns:
list of events

Implements ODateBookAccessBackend.

Definition at line 284 of file odatebookaccessbackend_sql.cpp.

QArray< int > ODateBookAccessBackend_SQL::rawRepeats  )  const [virtual]
 

This method should return a list of UIDs containing all repeating events.

No filter should be applied

Returns:
list of repeating events

Implements ODateBookAccessBackend.

Definition at line 289 of file odatebookaccessbackend_sql.cpp.

Referenced by directRawRepeats().

QArray< int > ODateBookAccessBackend_SQL::nonRepeats  )  const [virtual]
 

This mthod should return a list of UIDs containing all non repeating events.

No filter should be applied

Returns:
list of nonrepeating events

Implements ODateBookAccessBackend.

Definition at line 302 of file odatebookaccessbackend_sql.cpp.

Referenced by directNonRepeats().

OEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats  )  [virtual]
 

If you do not want to implement the effectiveEvents methods below you need to supply it with directNonRepeats.

This method can return empty lists if effectiveEvents is implememted

Implements ODateBookAccessBackend.

Definition at line 315 of file odatebookaccessbackend_sql.cpp.

References QValueList::append(), QArray::count(), find(), nonRepeats(), and OEvent::ValueList.

OEvent::ValueList ODateBookAccessBackend_SQL::directRawRepeats  )  [virtual]
 

Same as above but return raw repeats!

Implements ODateBookAccessBackend.

Definition at line 327 of file odatebookaccessbackend_sql.cpp.

References QValueList::append(), QArray::count(), find(), rawRepeats(), and OEvent::ValueList.


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:17 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001