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

ODateBookAccessBackend_XML Class Reference

#include </home/clem/local/src/opie/noncore/unsupported/libopie/pim/odatebookaccessbackend_xml.h>

Inheritance diagram for ODateBookAccessBackend_XML:

Inheritance graph
[legend]
Collaboration diagram for 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 OEvent &, int, const QDateTime &d=QDateTime())
OEvent find (int uid) const
void clear ()
bool add (const OEvent &ev)
bool remove (int uid)
bool replace (const OEvent &ev)
QArray< UIDrawEvents () const
QArray< UIDrawRepeats () const
QArray< UIDnonRepeats () const
OEvent::ValueList directNonRepeats ()
OEvent::ValueList directRawRepeats ()

Private Member Functions

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

Private Attributes

bool m_changed:1
QString m_name
QMap< int, OEventm_raw
QMap< int, OEventm_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 14 of file odatebookaccessbackend_xml.h.


Constructor & Destructor Documentation

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

Definition at line 169 of file odatebookaccessbackend_xml.cpp.

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

ODateBookAccessBackend_XML::~ODateBookAccessBackend_XML  ) 
 

Definition at line 175 of file odatebookaccessbackend_xml.cpp.


Member Function Documentation

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

add T

Implements OPimAccessBackend< OEvent >.

Definition at line 263 of file odatebookaccessbackend_xml.cpp.

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

Referenced by replace().

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

return an array of all available uids

Implements OPimAccessBackend< OEvent >.

Definition at line 233 of file odatebookaccessbackend_xml.cpp.

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

Referenced by rawEvents().

void ODateBookAccessBackend_XML::clear  )  [virtual]
 

clear the back end

Implements OPimAccessBackend< OEvent >.

Definition at line 252 of file odatebookaccessbackend_xml.cpp.

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

Referenced by reload().

OEvent::ValueList ODateBookAccessBackend_XML::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 310 of file odatebookaccessbackend_xml.cpp.

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

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

Same as above but return raw repeats!

Implements ODateBookAccessBackend.

Definition at line 318 of file odatebookaccessbackend_xml.cpp.

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

void ODateBookAccessBackend_XML::finalizeRecord OEvent ev  )  [inline, private]
 

Definition at line 453 of file odatebookaccessbackend_xml.cpp.

References alarmTime, QMap< Key, T >::contains(), created, OTimeZone::current(), OEvent::description(), end, OTimeZone::fromUTCDateTime(), OEvent::hasRecurrence(), QMap< Key, T >::insert(), OEvent::isAllDay(), m_raw, m_rep, OEvent::notifiers(), qWarning(), rec, rp_end, ORecur::setCreatedDateTime(), ORecur::setEndDate(), OEvent::setEndDateTime(), OEvent::setRecurrence(), ORecur::setStart(), OEvent::setStartDateTime(), OEvent::setTimeZone(), OPimRecord::setUid(), snd, start, OEvent::startDateTime(), OEvent::timeZone(), OTimeZone::toDateTime(), QDateTime::toString(), Qtopia::Record::uid(), and OTimeZone::utc().

Referenced by loadFile().

OEvent ODateBookAccessBackend_XML::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 257 of file odatebookaccessbackend_xml.cpp.

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

Referenced by loadFile().

bool ODateBookAccessBackend_XML::load  )  [virtual]
 

load the resource

Implements OPimAccessBackend< OEvent >.

Definition at line 177 of file odatebookaccessbackend_xml.cpp.

References loadFile().

Referenced by reload().

bool ODateBookAccessBackend_XML::loadFile  )  [private]
 

Definition at line 328 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, NULL, Qtopia::plainString(), rec, QPtrCollection::setAutoDelete(), Qtopia::Record::setCustomField(), setField(), snd, str, strstrlen(), and TRUE.

Referenced by load().

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

return a List of records that match the regex

Implements OPimAccessBackend< OEvent >.

Definition at line 595 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 > 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 ODateBookAccessBackend.

Definition at line 298 of file odatebookaccessbackend_xml.cpp.

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

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

queryByExample for T with the given Settings

Implements OPimAccessBackend< OEvent >.

Definition at line 249 of file odatebookaccessbackend_xml.cpp.

QArray< int > ODateBookAccessBackend_XML::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 283 of file odatebookaccessbackend_xml.cpp.

References allRecords().

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

Definition at line 286 of file odatebookaccessbackend_xml.cpp.

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

bool ODateBookAccessBackend_XML::reload  )  [virtual]
 

reload the resource

Implements OPimAccessBackend< OEvent >.

Definition at line 180 of file odatebookaccessbackend_xml.cpp.

References clear(), and load().

bool ODateBookAccessBackend_XML::remove int  uid  )  [virtual]
 

remove

Implements OPimAccessBackend< OEvent >.

Definition at line 272 of file odatebookaccessbackend_xml.cpp.

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

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

replace a record with T.uid()

Implements OPimAccessBackend< OEvent >.

Definition at line 279 of file odatebookaccessbackend_xml.cpp.

References add().

bool ODateBookAccessBackend_XML::save  )  [virtual]
 

save the resource and all it's changes

Implements OPimAccessBackend< OEvent >.

Definition at line 184 of file odatebookaccessbackend_xml.cpp.

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

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

Definition at line 496 of file odatebookaccessbackend_xml.cpp.

References OEvent::addChild(), alarmTime, QValueList< T >::begin(), created, ORecur::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, Qtopia::Record::idsFromString(), list, OPimAlarm::Loud, ORecur::MonthlyDate, ORecur::MonthlyDay, ORecur::NoRepeat, qWarning(), recur(), rp_end, OEvent::setAllDay(), Qtopia::Record::setCategories(), OEvent::setDescription(), OEvent::setLocation(), OEvent::setNote(), OEvent::setParent(), OEvent::setTimeZone(), OPimRecord::setUid(), OPimAlarm::Silent, snd, QStringList::split(), start, QDate::toString(), ORecur::Weekly, and ORecur::Yearly.

Referenced by loadFile().


Member Data Documentation

Private* ODateBookAccessBackend_XML::d [private]
 

Reimplemented from ODateBookAccessBackend.

Definition at line 51 of file odatebookaccessbackend_xml.h.

Data* ODateBookAccessBackend_XML::data [private]
 

Definition at line 49 of file odatebookaccessbackend_xml.h.

bool ODateBookAccessBackend_XML::m_changed [private]
 

Definition at line 41 of file odatebookaccessbackend_xml.h.

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

QString ODateBookAccessBackend_XML::m_name [private]
 

Definition at line 45 of file odatebookaccessbackend_xml.h.

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

QMap<int, OEvent> ODateBookAccessBackend_XML::m_raw [private]
 

Definition at line 46 of file odatebookaccessbackend_xml.h.

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

QMap<int, OEvent> ODateBookAccessBackend_XML::m_rep [private]
 

Definition at line 47 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:42:19 2005 for OPIE by  doxygen 1.4.2