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

DateBookDB Class Reference

#include </home/clem/local/src/opie/library/datebookdb.h>

Inheritance diagram for DateBookDB:

Inheritance graph
[legend]
Collaboration diagram for DateBookDB:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DateBookDB ()
 ~DateBookDB ()
QValueList< EventgetEvents (const QDate &from, const QDate &to)
QValueList< EventgetEvents (const QDateTime &start)
QValueList< EffectiveEventgetEffectiveEvents (const QDate &from, const QDate &to)
QValueList< EffectiveEventgetEffectiveEvents (const QDateTime &start)
QValueList< EventgetRawRepeats () const
QValueList< EventgetNonRepeatingEvents (const QDate &from, const QDate &to) const
void addEvent (const Event &ev, bool doalarm=TRUE)
void removeEvent (const Event &ev)
void editEvent (const Event &old, Event &ev)
void addJFEvent (const Event &ev, bool doalarm=TRUE)
void removeJFEvent (const Event &ev)
bool save ()
void reload ()

Private Member Functions

bool origRepeat (const Event &ev, Event &orig) const
bool removeRepeat (const Event &ev)
void init ()
void loadFile (const QString &strFile)
void saveJournalEntry (const Event &ev, journal_action action)
bool saveJournalEntry (const Event &ev, journal_action action, int key, bool origHadRepeat=false)

Private Attributes

QValueList< EventeventList
QValueList< EventrepeatEvents
DateBookDBPrivated
QFile journalFile
int recordIdMax

Constructor & Destructor Documentation

DateBookDB::DateBookDB  ) 
 

Definition at line 383 of file datebookdb.cpp.

References init().

DateBookDB::~DateBookDB  ) 
 

Definition at line 388 of file datebookdb.cpp.

References QValueList< T >::clear(), d, eventList, repeatEvents, and save().


Member Function Documentation

void DateBookDB::addEvent const Event ev,
bool  doalarm = TRUE
 

Definition at line 591 of file datebookdb.cpp.

References ACTION_ADD, addJFEvent(), DateBookDBPrivate::clean, d, and saveJournalEntry().

Referenced by DateBook::duplicateEvent(), DateBook::insertEvent(), DateBook::setDocument(), and DateBook::slotNewEntry().

void DateBookDB::addJFEvent const Event ev,
bool  doalarm = TRUE
 

Definition at line 599 of file datebookdb.cpp.

References addEventAlarm(), QValueList< T >::append(), eventList, Event::hasAlarm(), Event::hasRepeat(), and repeatEvents.

Referenced by addEvent(), and loadFile().

void DateBookDB::editEvent const Event old,
Event ev
 

Definition at line 609 of file datebookdb.cpp.

References ACTION_REPLACE, addEventAlarm(), QValueList< T >::append(), DateBookDBPrivate::clean, d, delEventAlarm(), QValueList< T >::end(), eventList, QValueList< T >::find(), QValueList< T >::findIndex(), origRepeat(), QValueList< T >::remove(), removeRepeat(), repeatEvents, and saveJournalEntry().

Referenced by DateBook::editEvent().

QValueList< EffectiveEvent > DateBookDB::getEffectiveEvents const QDateTime start  ) 
 

Reimplemented in DateBookDBHoliday.

Definition at line 575 of file datebookdb.cpp.

References QValueList< T >::append(), QValueList< T >::begin(), QDateTime::date(), QValueList< T >::end(), getEffectiveEvents(), and QDateTime::secsTo().

QValueList< EffectiveEvent > DateBookDB::getEffectiveEvents const QDate from,
const QDate to
 

Reimplemented in DateBookDBHoliday.

Definition at line 454 of file datebookdb.cpp.

References QDate::addDays(), QDateTime::addDays(), Event::AllDay, QValueList< T >::append(), QValueList< T >::begin(), QDateTime::date(), QValueList< T >::end(), Event::RepeatPattern::endDate(), eventList, Event::RepeatPattern::hasEndDate, nextOccurance(), qHeapSort(), repeat(), repeatEvents, Event::repeatPattern(), EffectiveEvent::setDate(), EffectiveEvent::setEffectiveDates(), EffectiveEvent::setEnd(), Event::RepeatPattern::setEndDate(), EffectiveEvent::setEvent(), Event::setRepeat(), EffectiveEvent::setStart(), QDateTime::setTime(), QDateTime::time(), and TRUE.

Referenced by DateBookDay::findRealStart(), DatebookPluginWidget::getDates(), getEffectiveEvents(), DateBookDBHoliday::getEffectiveEvents(), DateBookDBHoliday::getEffectiveEventsNoHoliday(), and DateBookMonthTable::getEvents().

QValueList< Event > DateBookDB::getEvents const QDateTime start  ) 
 

Definition at line 437 of file datebookdb.cpp.

References QValueList< T >::append(), QValueList< T >::begin(), QDateTime::date(), QValueList< T >::end(), getEvents(), and TRUE.

QValueList< Event > DateBookDB::getEvents const QDate from,
const QDate to
 

Definition at line 401 of file datebookdb.cpp.

References QValueList< T >::append(), QValueList< T >::begin(), QDateTime::date(), QValueList< T >::end(), Event::RepeatPattern::endDate(), getNonRepeatingEvents(), Event::RepeatPattern::hasEndDate, nextOccurance(), qHeapSort(), repeatEvents, Event::repeatPattern(), Event::setEnd(), Event::RepeatPattern::setEndDate(), Event::setRepeat(), Event::setStart(), and TRUE.

Referenced by getEvents().

QValueList< Event > DateBookDB::getNonRepeatingEvents const QDate from,
const QDate to
const
 

Definition at line 1104 of file datebookdb.cpp.

References QDateTime::addDays(), QValueList< T >::append(), QValueList< T >::begin(), QDateTime::date(), QValueList< T >::end(), eventList, Event::setEnd(), Event::setStart(), QDateTime::setTime(), QDateTime::time(), and TRUE.

Referenced by DateBookDBHack::eventByUID(), getEvents(), and DateBook::slotDoFind().

QValueList< Event > DateBookDB::getRawRepeats  )  const
 

Definition at line 1099 of file datebookdb.cpp.

References repeatEvents.

Referenced by DateBookDBHack::eventByUID(), and DateBook::slotDoFind().

void DateBookDB::init  )  [private]
 

Definition at line 935 of file datebookdb.cpp.

References DateBookDBPrivate::clean, d, dateBookFilename(), dateBookJournalFile(), QFile::exists(), QString::isNull(), loadFile(), save(), str, tr, and warning().

Referenced by DateBookDB(), and reload().

void DateBookDB::loadFile const QString strFile  )  [private]
 

Definition at line 674 of file datebookdb.cpp.

References ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE, addJFEvent(), alarmTime, Event::AllDay, QValueList< T >::at(), QFile::close(), Event::RepeatPattern::createTime, Event::Daily, Event::day(), Event::RepeatPattern::days, Event::RepeatPattern::endDateUTC, eventList, f, FAlarm, FALSE, FCategories, FCreated, FDescription, FLocation, FNote, FREnd, FREndDate, Event::RepeatPattern::frequency, FRFreq, FRHasEndDate, QString::fromLatin1(), QString::fromUtf8(), FRPosition, FRStart, FRType, FRWeekdays, FSound, FType, FUid, Event::RepeatPattern::hasEndDate, i, Qtopia::Record::idsFromString(), QAsciiDict< type >::insert(), IO_ReadOnly, len, Event::Loud, Event::MonthlyDate, Event::MonthlyDay, Event::NoRepeat, Event::Normal, QFile::open(), Qtopia::plainString(), Event::RepeatPattern::position, qDebug(), QIODevice::readAll(), removeJFEvent(), repeatEvents, Event::setAlarm(), QPtrCollection::setAutoDelete(), Qtopia::Record::setCategories(), Qtopia::Record::setCustomField(), Event::setDescription(), Event::setEnd(), Event::setLocation(), Event::setNotes(), Event::setRepeat(), Event::setStart(), Event::setType(), Qtopia::Record::setUid(), Event::Silent, Event::start(), TRUE, Event::RepeatPattern::type, Event::Weekly, and Event::Yearly.

Referenced by init().

bool DateBookDB::origRepeat const Event ev,
Event orig
const [private]
 

Definition at line 1059 of file datebookdb.cpp.

References QValueList< T >::begin(), QValueList< T >::end(), FALSE, repeatEvents, and TRUE.

Referenced by editEvent().

void DateBookDB::reload  ) 
 

Definition at line 1031 of file datebookdb.cpp.

References QValueList< T >::begin(), QValueList< T >::clear(), delEventAlarm(), QValueList< T >::end(), eventList, init(), removeRepeat(), and repeatEvents.

Referenced by DateBook::reload().

void DateBookDB::removeEvent const Event ev  ) 
 

Definition at line 652 of file datebookdb.cpp.

References ACTION_REMOVE, DateBookDBPrivate::clean, d, removeJFEvent(), and saveJournalEntry().

Referenced by DateBook::removeEvent().

void DateBookDB::removeJFEvent const Event ev  ) 
 

Definition at line 660 of file datebookdb.cpp.

References delEventAlarm(), QValueList< T >::end(), eventList, QValueList< T >::find(), Event::hasAlarm(), Event::hasRepeat(), QValueList< T >::remove(), and removeRepeat().

Referenced by loadFile(), and removeEvent().

bool DateBookDB::removeRepeat const Event ev  )  [private]
 

Definition at line 1045 of file datebookdb.cpp.

References QValueList< T >::begin(), QValueList< T >::end(), FALSE, QValueList< T >::remove(), repeatEvents, Event::repeatPattern(), and TRUE.

Referenced by editEvent(), reload(), and removeJFEvent().

bool DateBookDB::save  ) 
 

Definition at line 960 of file datebookdb.cpp.

References QValueList< T >::begin(), buf, DateBookDBPrivate::clean, QFile::close(), d, dateBookFilename(), dateBookJournalFile(), QValueList< T >::end(), eventList, f, FALSE, IO_Raw, IO_WriteOnly, QString::latin1(), QCString::length(), QFile::open(), qWarning(), QFile::remove(), repeatEvents, str, QString::utf8(), and QFile::writeBlock().

Referenced by DateBook::closeEvent(), DateBook::flush(), init(), and ~DateBookDB().

bool DateBookDB::saveJournalEntry const Event ev,
journal_action  action,
int  key,
bool  origHadRepeat = false
[private]
 

Definition at line 1077 of file datebookdb.cpp.

References buf, QFile::close(), QString::data(), dateBookJournalFile(), f, IO_Append, IO_WriteOnly, QString::length(), QString::number(), QFile::open(), Event::save(), str, and QFile::writeBlock().

void DateBookDB::saveJournalEntry const Event ev,
journal_action  action
[private]
 

Definition at line 1072 of file datebookdb.cpp.

Referenced by addEvent(), editEvent(), and removeEvent().


Member Data Documentation

DateBookDBPrivate* DateBookDB::d [private]
 

Definition at line 79 of file datebookdb.h.

Referenced by addEvent(), editEvent(), init(), removeEvent(), save(), and ~DateBookDB().

QValueList<Event> DateBookDB::eventList [private]
 

Definition at line 77 of file datebookdb.h.

Referenced by addJFEvent(), editEvent(), getEffectiveEvents(), getNonRepeatingEvents(), loadFile(), reload(), removeJFEvent(), save(), and ~DateBookDB().

QFile DateBookDB::journalFile [private]
 

Definition at line 80 of file datebookdb.h.

int DateBookDB::recordIdMax [private]
 

Definition at line 82 of file datebookdb.h.

QValueList<Event> DateBookDB::repeatEvents [private]
 

Definition at line 78 of file datebookdb.h.

Referenced by addJFEvent(), editEvent(), getEffectiveEvents(), getEvents(), getRawRepeats(), loadFile(), origRepeat(), reload(), removeRepeat(), save(), and ~DateBookDB().


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