Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::ODateBookAccessBackend_XML Class Reference

#include </home/clem/local/src/opie/libopie2/opiepim/backend/odatebookaccessbackend_xml.h>

Inheritance diagram for Opie::ODateBookAccessBackend_XML:

Inheritance graph
[legend]
Collaboration diagram for Opie::ODateBookAccessBackend_XML:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ODateBookAccessBackend_XML (const QString &appName, const QString &fileName=QString::null)
 ~ODateBookAccessBackend_XML ()
bool load ()
bool reload ()
bool save ()
QArray< int > allRecords () const
QArray< int > matchRegexp (const QRegExp &r) const
QArray< int > queryByExample (const OPimEvent &, int, const QDateTime &d=QDateTime())
OPimEvent find (int uid) const
void clear ()
bool add (const OPimEvent &ev)
bool remove (int uid)
bool replace (const OPimEvent &ev)
QArray< UIDrawEvents () const
QArray< UIDrawRepeats () const
QArray< UIDnonRepeats () const
OPimEvent::ValueList directNonRepeats () const
OPimEvent::ValueList directRawRepeats () const

Private Member Functions

bool loadFile ()
void finalizeRecord (OPimEvent &ev)
void setField (OPimEvent &, int field, const QString &val)

Private Attributes

bool m_changed:1
bool m_noTimeZone: 1
QString m_name
QMap< int, OPimEventm_raw
QMap< int, OPimEventm_rep
Datadata
Private * d

Detailed Description

This is the default XML implementation for DateBoook XML storage It fully implements the interface
See also:
ODateBookAccessBackend

OPimAccessBackend

Definition at line 43 of file odatebookaccessbackend_xml.h.


Constructor & Destructor Documentation

Opie::ODateBookAccessBackend_XML::ODateBookAccessBackend_XML const QString appName,
const QString fileName = QString::null
 

Definition at line 214 of file odatebookaccessbackend_xml.cpp.

References Global::applicationFileName(), QString::isEmpty(), m_changed, and m_name.

Opie::ODateBookAccessBackend_XML::~ODateBookAccessBackend_XML  ) 
 

Definition at line 220 of file odatebookaccessbackend_xml.cpp.


Member Function Documentation

bool Opie::ODateBookAccessBackend_XML::add const OPimEvent ev  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimEvent >.

Definition at line 308 of file odatebookaccessbackend_xml.cpp.

References QMap< Key, T >::insert(), m_changed, m_raw, and m_rep.

Referenced by replace().

QArray< int > Opie::ODateBookAccessBackend_XML::allRecords  )  const [virtual]
 

Implements Opie::OPimAccessBackend< OPimEvent >.

Definition at line 278 of file odatebookaccessbackend_xml.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::count(), QMap< Key, T >::end(), i, m_raw, and m_rep.

void Opie::ODateBookAccessBackend_XML::clear  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimEvent >.

Definition at line 297 of file odatebookaccessbackend_xml.cpp.

References QMap< Key, T >::clear(), m_changed, m_raw, and m_rep.

Referenced by reload().

OPimEvent::ValueList Opie::ODateBookAccessBackend_XML::directNonRepeats  )  const [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 Opie::ODateBookAccessBackend.

Definition at line 353 of file odatebookaccessbackend_xml.cpp.

References QValueList< T >::append(), QMap< Key, T >::begin(), QMap< Key, T >::end(), list, and m_raw.

OPimEvent::ValueList Opie::ODateBookAccessBackend_XML::directRawRepeats  )  const [virtual]
 

Same as above but return raw repeats!

Implements Opie::ODateBookAccessBackend.

Definition at line 361 of file odatebookaccessbackend_xml.cpp.

References QValueList< T >::append(), QMap< Key, T >::begin(), QMap< Key, T >::end(), list, and m_rep.

void Opie::ODateBookAccessBackend_XML::finalizeRecord OPimEvent ev  )  [inline, private]
 

Definition at line 501 of file odatebookaccessbackend_xml.cpp.

References alarmTime, QMap< Key, T >::contains(), created, Opie::OPimTimeZone::current(), Opie::OPimRecurrence::doesRecur(), end, Opie::OPimEvent::hasRecurrence(), QMap< Key, T >::insert(), Opie::OPimEvent::isAllDay(), m_noTimeZone, m_raw, m_rep, Opie::OPimEvent::notifiers(), rec, rp_end, Opie::OPimRecurrence::setCreatedDateTime(), Opie::OPimRecurrence::setEndDate(), Opie::OPimEvent::setEndDateTime(), Opie::OPimEvent::setRecurrence(), Opie::OPimRecurrence::setStart(), Opie::OPimEvent::setStartDateTime(), Opie::OPimEvent::setTimeZone(), Opie::OPimRecord::setUid(), snd, start, Opie::OPimEvent::startDateTime(), Opie::OPimEvent::timeZone(), Opie::OPimTimeZone::toDateTime(), Qtopia::Record::uid(), and Opie::OPimTimeZone::utc().

Referenced by loadFile().

OPimEvent Opie::ODateBookAccessBackend_XML::find int  uid  )  const
 

Definition at line 302 of file odatebookaccessbackend_xml.cpp.

References QMap< Key, T >::contains(), m_raw, and m_rep.

Referenced by loadFile().

bool Opie::ODateBookAccessBackend_XML::load  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimEvent >.

Definition at line 222 of file odatebookaccessbackend_xml.cpp.

References loadFile().

Referenced by reload().

bool Opie::ODateBookAccessBackend_XML::loadFile  )  [private]
 

Definition at line 371 of file odatebookaccessbackend_xml.cpp.

References alarmTime, QFile::encodeName(), FAlarm, FALSE, FCategories, FCreated, FDescription, FExceptions, finalizeRecord(), find(), FLocation, FNote, FRecChildren, FRecParent, FREnd, FREndDate, FRFreq, FRHasEndDate, QString::fromLatin1(), QString::fromUtf8(), FRPosition, FRStart, FRType, FRWeekdays, FSound, FTimeZone, FType, FUid, i, QAsciiDict< type >::insert(), len, m_changed, m_name, m_noTimeZone, NULL, Qtopia::plainString(), rec, QPtrCollection::setAutoDelete(), Qtopia::Record::setCustomField(), setField(), snd, str, strstrlen(), and TRUE.

Referenced by load().

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

Reimplemented from Opie::OPimAccessBackend< OPimEvent >.

Definition at line 645 of file odatebookaccessbackend_xml.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::count(), QMap< Key, T >::end(), m_raw, and m_rep.

QArray< int > Opie::ODateBookAccessBackend_XML::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 Opie::ODateBookAccessBackend.

Definition at line 341 of file odatebookaccessbackend_xml.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::count(), QMap< Key, T >::end(), i, and m_raw.

QArray< int > Opie::ODateBookAccessBackend_XML::queryByExample const OPimEvent ,
int  ,
const QDateTime d = QDateTime()
 

Definition at line 294 of file odatebookaccessbackend_xml.cpp.

QArray<UID> Opie::ODateBookAccessBackend_XML::rawEvents  )  const
 

QArray< int > Opie::ODateBookAccessBackend_XML::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 Opie::ODateBookAccessBackend.

Definition at line 329 of file odatebookaccessbackend_xml.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::count(), QMap< Key, T >::end(), i, and m_rep.

bool Opie::ODateBookAccessBackend_XML::reload  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimEvent >.

Definition at line 225 of file odatebookaccessbackend_xml.cpp.

References clear(), and load().

bool Opie::ODateBookAccessBackend_XML::remove int  uid  ) 
 

Definition at line 317 of file odatebookaccessbackend_xml.cpp.

References m_changed, m_raw, m_rep, and QMap< Key, T >::remove().

bool Opie::ODateBookAccessBackend_XML::replace const OPimEvent ev  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimEvent >.

Definition at line 324 of file odatebookaccessbackend_xml.cpp.

References add().

bool Opie::ODateBookAccessBackend_XML::save  )  [virtual]
 

Implements Opie::OPimAccessBackend< OPimEvent >.

Definition at line 229 of file odatebookaccessbackend_xml.cpp.

References buf, QFile::close(), f, IO_Raw, IO_WriteOnly, QCString::length(), m_changed, m_name, m_raw, m_rep, QFile::open(), QFile::remove(), saveEachEvent(), str, QString::utf8(), and QFile::writeBlock().

void Opie::ODateBookAccessBackend_XML::setField OPimEvent ,
int  field,
const QString val
[inline, private]
 

Definition at line 548 of file odatebookaccessbackend_xml.cpp.

References alarmTime, QValueList< T >::begin(), created, Opie::OPimRecurrence::Daily, QValueList< T >::end(), end, FAlarm, FCategories, FCreated, FDescription, FExceptions, FLocation, FNote, FRecChildren, FRecParent, FREnd, FREndDate, FRFreq, FRHasEndDate, FRPosition, FRStart, FRType, FRWeekdays, FSound, FTimeZone, FType, FUid, list, Opie::OPimAlarm::Loud, m_noTimeZone, Opie::OPimRecurrence::MonthlyDate, Opie::OPimRecurrence::MonthlyDay, Opie::OPimRecurrence::NoRepeat, recur(), rp_end, Opie::OPimAlarm::Silent, snd, QStringList::split(), start, Opie::OPimRecurrence::Weekly, and Opie::OPimRecurrence::Yearly.

Referenced by loadFile().


Member Data Documentation

Private* Opie::ODateBookAccessBackend_XML::d [private]
 

Reimplemented from Opie::ODateBookAccessBackend.

Definition at line 82 of file odatebookaccessbackend_xml.h.

Data* Opie::ODateBookAccessBackend_XML::data [private]
 

Definition at line 80 of file odatebookaccessbackend_xml.h.

bool Opie::ODateBookAccessBackend_XML::m_changed [private]
 

Definition at line 70 of file odatebookaccessbackend_xml.h.

Referenced by add(), clear(), loadFile(), ODateBookAccessBackend_XML(), remove(), and save().

QString Opie::ODateBookAccessBackend_XML::m_name [private]
 

Definition at line 76 of file odatebookaccessbackend_xml.h.

Referenced by loadFile(), ODateBookAccessBackend_XML(), and save().

bool Opie::ODateBookAccessBackend_XML::m_noTimeZone [private]
 

Definition at line 71 of file odatebookaccessbackend_xml.h.

Referenced by finalizeRecord(), loadFile(), and setField().

QMap<int, OPimEvent> Opie::ODateBookAccessBackend_XML::m_raw [private]
 

Definition at line 77 of file odatebookaccessbackend_xml.h.

Referenced by add(), allRecords(), clear(), directNonRepeats(), finalizeRecord(), find(), matchRegexp(), nonRepeats(), remove(), and save().

QMap<int, OPimEvent> Opie::ODateBookAccessBackend_XML::m_rep [private]
 

Definition at line 78 of file odatebookaccessbackend_xml.h.

Referenced by add(), allRecords(), clear(), directRawRepeats(), finalizeRecord(), find(), matchRegexp(), rawRepeats(), remove(), and save().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:59:24 2005 for OPIE by  doxygen 1.4.2