summaryrefslogtreecommitdiff
path: root/libopie/pim
authorzecke <zecke>2003-04-13 18:07:10 (UTC)
committer zecke <zecke>2003-04-13 18:07:10 (UTC)
commit6f610544d3db6198c90105b70fab1cc84f5a1fbd (patch) (side-by-side diff)
tree964d18f0a4cca7383a31810aa922876751c4a22c /libopie/pim
parent0b311079ff19798866291034663757103c6ba935 (diff)
downloadopie-6f610544d3db6198c90105b70fab1cc84f5a1fbd.zip
opie-6f610544d3db6198c90105b70fab1cc84f5a1fbd.tar.gz
opie-6f610544d3db6198c90105b70fab1cc84f5a1fbd.tar.bz2
More API doc
QString -> const QString& QString = 0l -> QString::null
Diffstat (limited to 'libopie/pim') (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/obackendfactory.h26
-rw-r--r--libopie/pim/ocontact.h7
-rw-r--r--libopie/pim/ocontactaccess.h14
-rw-r--r--libopie/pim/ocontactaccessbackend.h30
-rw-r--r--libopie/pim/ocontactaccessbackend_vcard.cpp7
-rw-r--r--libopie/pim/ocontactaccessbackend_vcard.h12
-rw-r--r--libopie/pim/ocontactaccessbackend_xml.cpp7
-rw-r--r--libopie/pim/ocontactaccessbackend_xml.h12
-rw-r--r--libopie/pim/odatebookaccess.cpp28
-rw-r--r--libopie/pim/odatebookaccess.h15
-rw-r--r--libopie/pim/odatebookaccessbackend.h45
-rw-r--r--libopie/pim/odatebookaccessbackend_xml.h6
-rw-r--r--libopie/pim/oevent.h17
13 files changed, 209 insertions, 17 deletions
diff --git a/libopie/pim/obackendfactory.h b/libopie/pim/obackendfactory.h
index 3a73210..ad6cf5a 100644
--- a/libopie/pim/obackendfactory.h
+++ b/libopie/pim/obackendfactory.h
@@ -15,8 +15,13 @@
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.6 2003/04/13 18:07:10 zecke
+ * More API doc
+ * QString -> const QString&
+ * QString = 0l -> QString::null
+ *
* Revision 1.5 2003/02/21 23:31:52 zecke
* Add XML datebookresource
* -clean up todoaccessxml header
* -implement some more stuff in the oeven tester
@@ -62,9 +67,23 @@
#ifdef __USE_SQL
#include "otodoaccesssql.h"
#endif
-
+/**
+ * This class is our factory. It will give us the default implementations
+ * of at least Todolist, Contacts and Datebook. In the future this class will
+ * allow users to switch the backend with ( XML->SQLite ) without the need
+ * to recompile.#
+ * This class as the whole PIM Api is making use of templates
+ *
+ * <pre>
+ * OTodoAccessBackend* backend = OBackEndFactory<OTodoAccessBackend>::Default("todo", QString::null );
+ * backend->load();
+ * </pre>
+ *
+ * @author Stefan Eilers
+ * @version 0.1
+ */
template<class T>
class OBackendFactory
{
public:
@@ -75,8 +94,13 @@ class OBackendFactory
CONTACT,
DATE
};
+ /**
+ * Returns a backend implementation for backendName
+ * @param backendName the type of the backend
+ * @param appName will be passed on to the backend
+ */
static T* Default( const QString backendName, const QString& appName ){
// __asm__("int3");
diff --git a/libopie/pim/ocontact.h b/libopie/pim/ocontact.h
index 1fd1c75..25fa0e7 100644
--- a/libopie/pim/ocontact.h
+++ b/libopie/pim/ocontact.h
@@ -35,8 +35,15 @@ QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>;
#endif
class ContactPrivate;
+/**
+ * OContact class represents a specialised PIM Record for contacts.
+ * It does store all kind of persopn related information.
+ *
+ * @short Contact Container
+ * @author TT, Stefan Eiler, Holger Freyther
+ */
class QPC_EXPORT OContact : public OPimRecord
{
friend class DataSet;
public:
diff --git a/libopie/pim/ocontactaccess.h b/libopie/pim/ocontactaccess.h
index 32b2dcb..d7ceaf2 100644
--- a/libopie/pim/ocontactaccess.h
+++ b/libopie/pim/ocontactaccess.h
@@ -16,8 +16,13 @@
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.7 2003/04/13 18:07:10 zecke
+ * More API doc
+ * QString -> const QString&
+ * QString = 0l -> QString::null
+ *
* Revision 1.6 2003/01/02 14:27:12 eilers
* Improved query by example: Search by date is possible.. First step
* for a today plugin for birthdays..
*
@@ -54,19 +59,24 @@
#include "ocontact.h"
#include "ocontactaccessbackend.h"
#include "opimaccesstemplate.h"
-/** Class to access the contacts database.
+/**
+ * Class to access the contacts database.
* This is just a frontend for the real database handling which is
* done by the backend.
+ * This class is used to access the Contacts on a system. This class as any OPIE PIM
+ * class is backend independent.
+
* @see OPimAccessTemplate
*/
class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
{
Q_OBJECT
public:
- /** Create Database with contacts (addressbook).
+ /**
+ * Create Database with contacts (addressbook).
* @param appname Name of application which wants access to the database
* (i.e. "todolist")
* @param filename The name of the database file. If not set, the default one
* is used.
diff --git a/libopie/pim/ocontactaccessbackend.h b/libopie/pim/ocontactaccessbackend.h
index 821f5bf..ebeb42d 100644
--- a/libopie/pim/ocontactaccessbackend.h
+++ b/libopie/pim/ocontactaccessbackend.h
@@ -18,8 +18,13 @@
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.5 2003/04/13 18:07:10 zecke
+ * More API doc
+ * QString -> const QString&
+ * QString = 0l -> QString::null
+ *
* Revision 1.4 2002/11/13 14:14:51 eilers
* Added sorted for Contacts..
*
* Revision 1.3 2002/11/01 15:10:42 eilers
@@ -43,17 +48,28 @@
#include "ocontact.h"
#include "opimaccessbackend.h"
-#include "qregexp.h"
+#include <qregexp.h>
+/**
+ * This class represents the interface of all Contact Backends.
+ * Derivates of this class will be used to access the contacts.
+ * As implementation currently XML and vCard exist. This class needs to be implemented
+ * if you want to provide your own storage.
+ * In all queries a list of uids is passed on instead of loading the actual record!
+ *
+ * @see OContactAccessBackend_VCard
+ * @see OContactAccessBackend_XML
+ */
class OContactAccessBackend: public OPimAccessBackend<OContact> {
public:
OContactAccessBackend() {}
virtual ~OContactAccessBackend() {}
- /** Return if database was changed externally.
+ /**
+ * 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.
@@ -67,19 +83,25 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> {
virtual bool wasChangedExternally() = 0;
virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0;
- /** Return all possible settings.
+ /**
+ * Return all possible settings.
* @return All settings provided by the current backend
* (i.e.: query_WildCards & query_IgnoreCase)
*/
virtual const uint querySettings() = 0;
- /** Check whether settings are correct.
+ /**
+ * Check whether settings are correct.
* @return <i>true</i> if the given settings are correct and possible.
*/
virtual bool hasQuerySettings (uint querySettings) const = 0;
+ /**
+ * FIXME!!!
+ * Returns a sorted list of records either ascendinf or descending for a giving criteria and category
+ */
virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0;
};
#endif
diff --git a/libopie/pim/ocontactaccessbackend_vcard.cpp b/libopie/pim/ocontactaccessbackend_vcard.cpp
index f24523f..270bef3 100644
--- a/libopie/pim/ocontactaccessbackend_vcard.cpp
+++ b/libopie/pim/ocontactaccessbackend_vcard.cpp
@@ -16,8 +16,13 @@
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.10 2003/04/13 18:07:10 zecke
+ * More API doc
+ * QString -> const QString&
+ * QString = 0l -> QString::null
+ *
* Revision 1.9 2003/03/21 10:33:09 eilers
* Merged speed optimized xml backend for contacts to main.
* Added QDateTime to querybyexample. For instance, it is now possible to get
* all Birthdays/Anniversaries between two dates. This should be used
@@ -75,9 +80,9 @@
#include <qpe/timeconversion.h>
#include <qfile.h>
-OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString filename ):
+OContactAccessBackend_VCard::OContactAccessBackend_VCard ( const QString& , const QString& filename ):
m_dirty( false ),
m_file( filename )
{
load();
diff --git a/libopie/pim/ocontactaccessbackend_vcard.h b/libopie/pim/ocontactaccessbackend_vcard.h
index 93e2da3..712d769 100644
--- a/libopie/pim/ocontactaccessbackend_vcard.h
+++ b/libopie/pim/ocontactaccessbackend_vcard.h
@@ -16,8 +16,13 @@
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.6 2003/04/13 18:07:10 zecke
+ * More API doc
+ * QString -> const QString&
+ * QString = 0l -> QString::null
+ *
* Revision 1.5 2003/03/21 10:33:09 eilers
* Merged speed optimized xml backend for contacts to main.
* Added QDateTime to querybyexample. For instance, it is now possible to get
* all Birthdays/Anniversaries between two dates. This should be used
@@ -46,11 +51,16 @@
#include "ocontactaccessbackend.h"
class VObject;
+/**
+ * This is the vCard 2.1 implementation of the Contact Storage
+ * @see OContactAccessBackend_XML
+ * @see OPimAccessBackend
+ */
class OContactAccessBackend_VCard : public OContactAccessBackend {
public:
- OContactAccessBackend_VCard ( QString appname, QString filename = 0l );
+ OContactAccessBackend_VCard ( const QString& appname, const QString& filename = QString::null );
bool load ();
bool reload();
bool save();
diff --git a/libopie/pim/ocontactaccessbackend_xml.cpp b/libopie/pim/ocontactaccessbackend_xml.cpp
index c5a7820..661cd51 100644
--- a/libopie/pim/ocontactaccessbackend_xml.cpp
+++ b/libopie/pim/ocontactaccessbackend_xml.cpp
@@ -16,8 +16,13 @@
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.5 2003/04/13 18:07:10 zecke
+ * More API doc
+ * QString -> const QString&
+ * QString = 0l -> QString::null
+ *
* Revision 1.4 2003/03/21 14:32:54 mickeyl
* g++ compliance fix: default arguments belong into the declaration, but not the definition
*
* Revision 1.3 2003/03/21 12:26:28 eilers
@@ -106,9 +111,9 @@
using namespace Opie;
-OContactAccessBackend_XML::OContactAccessBackend_XML ( QString appname, QString filename ):
+OContactAccessBackend_XML::OContactAccessBackend_XML ( const QString& appname, const QString& filename ):
m_changed( false )
{
// Just m_contactlist should call delete if an entry
// is removed.
diff --git a/libopie/pim/ocontactaccessbackend_xml.h b/libopie/pim/ocontactaccessbackend_xml.h
index 4d6a7ef..7b5365b 100644
--- a/libopie/pim/ocontactaccessbackend_xml.h
+++ b/libopie/pim/ocontactaccessbackend_xml.h
@@ -16,8 +16,13 @@
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.14 2003/04/13 18:07:10 zecke
+ * More API doc
+ * QString -> const QString&
+ * QString = 0l -> QString::null
+ *
* Revision 1.13 2003/03/21 10:33:09 eilers
* Merged speed optimized xml backend for contacts to main.
* Added QDateTime to querybyexample. For instance, it is now possible to get
* all Birthdays/Anniversaries between two dates. This should be used
@@ -83,11 +88,16 @@
#include <qlist.h>
#include <qdict.h>
/* the default xml implementation */
+/**
+ * This class is the XML implementation of a Contact backend
+ * it does implement everything available for OContact.
+ * @see OPimAccessBackend for more information of available methods
+ */
class OContactAccessBackend_XML : public OContactAccessBackend {
public:
- OContactAccessBackend_XML ( QString appname, QString filename = 0l );
+ OContactAccessBackend_XML ( const QString& appname, const QString& filename = QString::null );
bool save();
bool load ();
diff --git a/libopie/pim/odatebookaccess.cpp b/libopie/pim/odatebookaccess.cpp
index 08e61ff..a3661a3 100644
--- a/libopie/pim/odatebookaccess.cpp
+++ b/libopie/pim/odatebookaccess.cpp
@@ -1,7 +1,14 @@
#include "obackendfactory.h"
#include "odatebookaccess.h"
+/**
+ * Simple constructor
+ * It takes a ODateBookAccessBackend as parent. If it is 0 the default implementation
+ * will be used!
+ * @param back The backend to be used or 0 for the default backend
+ * @param ac What kind of access is intended
+ */
ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac )
: OPimAccessTemplate<OEvent>( back )
{
if (!back )
@@ -11,28 +18,49 @@ ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac )
setBackEnd( m_backEnd );
}
ODateBookAccess::~ODateBookAccess() {
}
+
+/**
+ * @return all events available
+ */
ODateBookAccess::List ODateBookAccess::rawEvents()const {
QArray<int> ints = m_backEnd->rawEvents();
List lis( ints, this );
return lis;
}
+
+/**
+ * @return all repeating events
+ */
ODateBookAccess::List ODateBookAccess::rawRepeats()const {
QArray<int> ints = m_backEnd->rawRepeats();
List lis( ints, this );
return lis;
}
+
+/**
+ * @return all non repeating events
+ */
ODateBookAccess::List ODateBookAccess::nonRepeats()const {
QArray<int> ints = m_backEnd->nonRepeats();
List lis( ints, this );
return lis;
}
+
+/**
+ * @return dates in the time span between from and to
+ * @param from Include all events from...
+ * @param to Include all events to...
+ */
OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) {
return m_backEnd->effecticeEvents( from, to );
}
+/**
+ * @return all events at a given datetime
+ */
OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) {
return m_backEnd->effecticeEvents( start );
}
diff --git a/libopie/pim/odatebookaccess.h b/libopie/pim/odatebookaccess.h
index 7047039..7c7a63f 100644
--- a/libopie/pim/odatebookaccess.h
+++ b/libopie/pim/odatebookaccess.h
@@ -5,20 +5,29 @@
#include "opimaccesstemplate.h"
#include "oevent.h"
+/**
+ * This is the object orientated datebook database. It'll use OBackendFactory
+ * to query for a backend.
+ * All access to the datebook should be done via this class.
+ * Make sure to load and save the datebook this is not part of
+ * destructing and creating the object
+ *
+ * @author Holger Freyther
+ */
class ODateBookAccess : public OPimAccessTemplate<OEvent> {
public:
ODateBookAccess( ODateBookAccessBackend* = 0l, enum Access acc = Random );
~ODateBookAccess();
- /** return all events */
+ /* return all events */
List rawEvents()const;
- /** return repeating events */
+ /* return repeating events */
List rawRepeats()const;
- /** return non repeating events */
+ /* return non repeating events */
List nonRepeats()const;
OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to );
OEffectiveEvent::ValueList effectiveEvents( const QDateTime& start );
diff --git a/libopie/pim/odatebookaccessbackend.h b/libopie/pim/odatebookaccessbackend.h
index eb6e8fb..86ff298 100644
--- a/libopie/pim/odatebookaccessbackend.h
+++ b/libopie/pim/odatebookaccessbackend.h
@@ -5,27 +5,68 @@
#include "opimaccessbackend.h"
#include "oevent.h"
+/**
+ * This class is the interface to the storage of Events.
+ * @see OPimAccessBackend
+ *
+ */
class ODateBookAccessBackend : public OPimAccessBackend<OEvent> {
public:
typedef int UID;
+
+ /**
+ * c'tor without parameter
+ */
ODateBookAccessBackend();
~ODateBookAccessBackend();
+ /**
+ * This method should return a list of UIDs containing
+ * all events. No filter should be applied
+ * @return list of events
+ */
virtual QArray<UID> rawEvents()const = 0;
+
+ /**
+ * This method should return a list of UIDs containing
+ * all repeating events. No filter should be applied
+ * @return list of repeating events
+ */
virtual QArray<UID> rawRepeats()const = 0;
+
+ /**
+ * This mthod should return a list of UIDs containing all non
+ * repeating events. No filter should be applied
+ * @return list of nonrepeating events
+ */
virtual QArray<UID> nonRepeats() const = 0;
/**
- * these two methods are used if you do not implement
- * effectiveEvents...
+ * 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
*/
virtual OEvent::ValueList directNonRepeats() = 0;
+
+ /**
+ * Same as above but return raw repeats!
+ */
virtual OEvent::ValueList directRawRepeats() = 0;
/* is implemented by default but you can reimplement it*/
+ /**
+ * Effective Events are special event occuring during a time frame. This method does calcualte
+ * EffectiveEvents bases on the directNonRepeats and directRawRepeats. You may implement this method
+ * yourself
+ */
virtual OEffectiveEvent::ValueList effecticeEvents( const QDate& from, const QDate& to );
+
+ /**
+ * this is an overloaded member function
+ * @see effecticeEvents
+ */
virtual OEffectiveEvent::ValueList effecticeEvents( const QDateTime& start );
};
diff --git a/libopie/pim/odatebookaccessbackend_xml.h b/libopie/pim/odatebookaccessbackend_xml.h
index 563c31f..7848f7c 100644
--- a/libopie/pim/odatebookaccessbackend_xml.h
+++ b/libopie/pim/odatebookaccessbackend_xml.h
@@ -4,8 +4,14 @@
#include <qmap.h>
#include "odatebookaccessbackend.h"
+/**
+ * This is the default XML implementation for DateBoook XML storage
+ * It fully implements the interface
+ * @see ODateBookAccessBackend
+ * @see OPimAccessBackend
+ */
class ODateBookAccessBackend_XML : public ODateBookAccessBackend {
public:
ODateBookAccessBackend_XML( const QString& appName,
const QString& fileName = QString::null);
diff --git a/libopie/pim/oevent.h b/libopie/pim/oevent.h
index 585515c..57d32d0 100644
--- a/libopie/pim/oevent.h
+++ b/libopie/pim/oevent.h
@@ -29,11 +29,20 @@ struct OCalendarHelper {
};
class OPimNotifyManager;
class ORecur;
+
+/**
+ * This is the container for all Events. It encapsules all
+ * available information for a single Event
+ * @short container for events.
+ */
class OEvent : public OPimRecord {
public:
typedef QValueList<OEvent> ValueList;
+ /**
+ * RecordFields contain possible attributes
+ */
enum RecordFields {
Uid = Qtopia::UID_ID,
Category = Qtopia::CATEGORY_ID,
Description,
@@ -48,9 +57,16 @@ public:
AllDay,
TimeZone
};
+ /**
+ * Start with an Empty OEvent. UID == 0 means that it is empty
+ */
OEvent(int uid = 0);
+
+ /**
+ * copy c'tor
+ */
OEvent( const OEvent& );
~OEvent();
OEvent &operator=( const OEvent& );
@@ -143,9 +159,8 @@ private:
/**
* AN Event can span through multiple days. We split up a multiday eve
*/
-
class OEffectiveEvent {
public:
typedef QValueList<OEffectiveEvent> ValueList;
enum Position { MidWay, Start, End, StartEnd };