OContactAccessBackend_XML Class Reference
This class is the XML implementation of a Contact backend it does implement everything available for OContact. More...
#include <ocontactaccessbackend_xml.h>
Inheritance diagram for OContactAccessBackend_XML:


Public Member Functions | |
| OContactAccessBackend_XML (const QString &appname, const QString &filename=QString::null) | |
| bool | save () |
| save the resource and all it's changes | |
| bool | load () |
| load the resource | |
| void | clear () |
| clear the back end | |
| bool | wasChangedExternally () |
| Return if database was changed externally. | |
| QArray< int > | allRecords () const |
| return an array of all available uids | |
| OContact | find (int uid) const |
| find the OPimRecord with uid | |
| QArray< int > | queryByExample (const OContact &query, int settings, const QDateTime &d=QDateTime()) |
| queryByExample for T with the given Settings | |
| QArray< int > | matchRegexp (const QRegExp &r) const |
| return a List of records that match the regex | |
| const uint | querySettings () |
| Return all possible settings. | |
| bool | hasQuerySettings (uint querySettings) const |
| Check whether settings are correct. | |
| QArray< int > | sorted (bool asc, int, int, int) |
| FIXME!!! Returns a sorted list of records either ascendinf or descending for a giving criteria and category. | |
| bool | add (const OContact &newcontact) |
| add T | |
| bool | replace (const OContact &contact) |
| replace a record with T.uid() | |
| bool | remove (int uid) |
| remove | |
| bool | reload () |
| reload the resource | |
Protected Attributes | |
| bool | m_changed |
| QString | m_journalName |
| QString | m_fileName |
| QString | m_appName |
| QList< OContact > | m_contactList |
| QDateTime | m_readtime |
| QDict< OContact > | m_uidToContact |
Detailed Description
This class is the XML implementation of a Contact backend it does implement everything available for OContact.
- See also:
- OPimAccessBackend for more information of available methods
Definition at line 103 of file ocontactaccessbackend_xml.h.
Constructor & Destructor Documentation
|
||||||||||||
|
Definition at line 127 of file ocontactaccessbackend_xml.cpp. References Global::applicationFileName(), load(), m_appName, m_contactList, m_fileName, m_journalName, and m_uidToContact. |
Member Function Documentation
|
|
save the resource and all it's changes
Implements OPimAccessBackend< OContact >. Definition at line 151 of file ocontactaccessbackend_xml.cpp. References QFile::close(), QListIterator::current(), QByteArray::data(), QString::latin1(), QCString::length(), m_changed, m_contactList, m_fileName, m_journalName, QFile::open(), QFile::remove(), QString::utf8(), and QIODevice::writeBlock(). |
|
|
load the resource
Implements OPimAccessBackend< OContact >. Definition at line 221 of file ocontactaccessbackend_xml.cpp. References QDict< OContact >::clear(), QList< OContact >::clear(), m_contactList, m_fileName, m_journalName, and m_uidToContact. Referenced by OContactAccessBackend_XML(), and reload(). |
|
|
clear the back end
Implements OPimAccessBackend< OContact >. Definition at line 240 of file ocontactaccessbackend_xml.cpp. References QDict< OContact >::clear(), QList< OContact >::clear(), m_changed, m_contactList, and m_uidToContact. |
|
|
Return if database was changed externally. This may just make sense on file based databases like a XML-File. It is used to prevent to overwrite the current database content if the file was already changed by something else ! If this happens, we have to reload before save our data. If we use real databases, this should be handled by the database management system themselve, therefore this function should always return false in this case. It is not our problem to handle this conflict ...
Implements OContactAccessBackend. Definition at line 248 of file ocontactaccessbackend_xml.cpp. References QFileInfo::lastModified(), m_fileName, and m_readtime. |
|
|
return an array of all available uids
Implements OPimAccessBackend< OContact >. Definition at line 257 of file ocontactaccessbackend_xml.cpp. References QList< OContact >::count(), QListIterator::current(), and m_contactList. |
|
|
find the OPimRecord with uid
Implements OPimAccessBackend< OContact >. Definition at line 270 of file ocontactaccessbackend_xml.cpp. References QDict< OContact >::find(), and m_uidToContact. |
|
||||||||||||||||
|
queryByExample for T with the given Settings
Implements OPimAccessBackend< OContact >. Definition at line 283 of file ocontactaccessbackend_xml.cpp. References OContact::anniversary(), OContact::birthday(), QList< OContact >::count(), QListIterator::current(), QDate::currentDate(), QDateTime::date(), QDate::day(), QDate::daysTo(), OContact::field(), QRegExp::find(), QString::isEmpty(), QDate::isValid(), m_contactList, QDate::month(), QArray::resize(), QDate::setYMD(), QDate::toString(), QString::upper(), and QDate::year(). |
|
|
return a List of records that match the regex
Implements OContactAccessBackend. Definition at line 424 of file ocontactaccessbackend_xml.cpp. References QList< OContact >::count(), QListIterator::current(), m_contactList, and QArray::resize(). |
|
|
Return all possible settings.
Implements OContactAccessBackend. Definition at line 442 of file ocontactaccessbackend_xml.cpp. |
|
|
Check whether settings are correct.
Implements OContactAccessBackend. Definition at line 455 of file ocontactaccessbackend_xml.cpp. |
|
||||||||||||||||||||
|
FIXME!!! Returns a sorted list of records either ascendinf or descending for a giving criteria and category.
Implements OContactAccessBackend. Definition at line 503 of file ocontactaccessbackend_xml.cpp. References QValueList::append(), QValueList::begin(), QList< OContact >::count(), QListIterator::current(), QValueList::end(), QMap::insert(), m_contactList, QString::number(), and QStringList::sort(). |
|
|
add T
Implements OPimAccessBackend< OContact >. Definition at line 531 of file ocontactaccessbackend_xml.cpp. References m_changed. |
|
|
replace a record with T.uid()
Implements OPimAccessBackend< OContact >. Definition at line 542 of file ocontactaccessbackend_xml.cpp. References QList< OContact >::append(), QDict< OContact >::find(), QDict< OContact >::insert(), m_changed, m_contactList, m_uidToContact, QDict< OContact >::remove(), QList< OContact >::removeRef(), and Qtopia::Record::uid(). |
|
|
remove
Implements OPimAccessBackend< OContact >. Definition at line 564 of file ocontactaccessbackend_xml.cpp. References QDict< OContact >::find(), m_changed, m_contactList, m_uidToContact, QDict< OContact >::remove(), and QList< OContact >::removeRef(). |
|
|
reload the resource
Implements OPimAccessBackend< OContact >. Definition at line 580 of file ocontactaccessbackend_xml.cpp. References load(). |
Member Data Documentation
|
|
Definition at line 150 of file ocontactaccessbackend_xml.h. Referenced by add(), clear(), remove(), replace(), and save(). |
|
|
Definition at line 151 of file ocontactaccessbackend_xml.h. Referenced by load(), OContactAccessBackend_XML(), and save(). |
|
|
Definition at line 152 of file ocontactaccessbackend_xml.h. Referenced by load(), OContactAccessBackend_XML(), save(), and wasChangedExternally(). |
|
|
Definition at line 153 of file ocontactaccessbackend_xml.h. Referenced by OContactAccessBackend_XML(). |
|
|
Definition at line 154 of file ocontactaccessbackend_xml.h. Referenced by allRecords(), clear(), load(), matchRegexp(), OContactAccessBackend_XML(), queryByExample(), remove(), replace(), save(), and sorted(). |
|
|
Definition at line 155 of file ocontactaccessbackend_xml.h. Referenced by wasChangedExternally(). |
|
|
Definition at line 157 of file ocontactaccessbackend_xml.h. Referenced by clear(), find(), load(), OContactAccessBackend_XML(), remove(), and replace(). |
The documentation for this class was generated from the following files:
