author | zecke <zecke> | 2003-04-13 18:07:10 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-04-13 18:07:10 (UTC) |
commit | 6f610544d3db6198c90105b70fab1cc84f5a1fbd (patch) (unidiff) | |
tree | 964d18f0a4cca7383a31810aa922876751c4a22c | |
parent | 0b311079ff19798866291034663757103c6ba935 (diff) | |
download | opie-6f610544d3db6198c90105b70fab1cc84f5a1fbd.zip opie-6f610544d3db6198c90105b70fab1cc84f5a1fbd.tar.gz opie-6f610544d3db6198c90105b70fab1cc84f5a1fbd.tar.bz2 |
More API doc
QString -> const QString&
QString = 0l -> QString::null
26 files changed, 418 insertions, 34 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 | |||
@@ -16,6 +16,11 @@ | |||
16 | * ===================================================================== | 16 | * ===================================================================== |
17 | * History: | 17 | * History: |
18 | * $Log$ | 18 | * $Log$ |
19 | * Revision 1.6 2003/04/13 18:07:10 zecke | ||
20 | * More API doc | ||
21 | * QString -> const QString& | ||
22 | * QString = 0l -> QString::null | ||
23 | * | ||
19 | * Revision 1.5 2003/02/21 23:31:52 zecke | 24 | * Revision 1.5 2003/02/21 23:31:52 zecke |
20 | * Add XML datebookresource | 25 | * Add XML datebookresource |
21 | * -clean up todoaccessxml header | 26 | * -clean up todoaccessxml header |
@@ -63,7 +68,21 @@ | |||
63 | #include "otodoaccesssql.h" | 68 | #include "otodoaccesssql.h" |
64 | #endif | 69 | #endif |
65 | 70 | ||
66 | 71 | /** | |
72 | * This class is our factory. It will give us the default implementations | ||
73 | * of at least Todolist, Contacts and Datebook. In the future this class will | ||
74 | * allow users to switch the backend with ( XML->SQLite ) without the need | ||
75 | * to recompile.# | ||
76 | * This class as the whole PIM Api is making use of templates | ||
77 | * | ||
78 | * <pre> | ||
79 | * OTodoAccessBackend* backend = OBackEndFactory<OTodoAccessBackend>::Default("todo", QString::null ); | ||
80 | * backend->load(); | ||
81 | * </pre> | ||
82 | * | ||
83 | * @author Stefan Eilers | ||
84 | * @version 0.1 | ||
85 | */ | ||
67 | template<class T> | 86 | template<class T> |
68 | class OBackendFactory | 87 | class OBackendFactory |
69 | { | 88 | { |
@@ -76,6 +95,11 @@ class OBackendFactory | |||
76 | DATE | 95 | DATE |
77 | }; | 96 | }; |
78 | 97 | ||
98 | /** | ||
99 | * Returns a backend implementation for backendName | ||
100 | * @param backendName the type of the backend | ||
101 | * @param appName will be passed on to the backend | ||
102 | */ | ||
79 | static T* Default( const QString backendName, const QString& appName ){ | 103 | static T* Default( const QString backendName, const QString& appName ){ |
80 | 104 | ||
81 | // __asm__("int3"); | 105 | // __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 | |||
@@ -36,6 +36,13 @@ QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>; | |||
36 | 36 | ||
37 | class ContactPrivate; | 37 | class ContactPrivate; |
38 | 38 | ||
39 | /** | ||
40 | * OContact class represents a specialised PIM Record for contacts. | ||
41 | * It does store all kind of persopn related information. | ||
42 | * | ||
43 | * @short Contact Container | ||
44 | * @author TT, Stefan Eiler, Holger Freyther | ||
45 | */ | ||
39 | class QPC_EXPORT OContact : public OPimRecord | 46 | class QPC_EXPORT OContact : public OPimRecord |
40 | { | 47 | { |
41 | friend class DataSet; | 48 | friend class DataSet; |
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 | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.7 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.6 2003/01/02 14:27:12 eilers | 25 | * Revision 1.6 2003/01/02 14:27:12 eilers |
21 | * Improved query by example: Search by date is possible.. First step | 26 | * Improved query by example: Search by date is possible.. First step |
22 | * for a today plugin for birthdays.. | 27 | * for a today plugin for birthdays.. |
@@ -55,9 +60,13 @@ | |||
55 | #include "ocontactaccessbackend.h" | 60 | #include "ocontactaccessbackend.h" |
56 | #include "opimaccesstemplate.h" | 61 | #include "opimaccesstemplate.h" |
57 | 62 | ||
58 | /** Class to access the contacts database. | 63 | /** |
64 | * Class to access the contacts database. | ||
59 | * This is just a frontend for the real database handling which is | 65 | * This is just a frontend for the real database handling which is |
60 | * done by the backend. | 66 | * done by the backend. |
67 | * This class is used to access the Contacts on a system. This class as any OPIE PIM | ||
68 | * class is backend independent. | ||
69 | |||
61 | * @see OPimAccessTemplate | 70 | * @see OPimAccessTemplate |
62 | */ | 71 | */ |
63 | class OContactAccess: public QObject, public OPimAccessTemplate<OContact> | 72 | class OContactAccess: public QObject, public OPimAccessTemplate<OContact> |
@@ -65,7 +74,8 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact> | |||
65 | Q_OBJECT | 74 | Q_OBJECT |
66 | 75 | ||
67 | public: | 76 | public: |
68 | /** Create Database with contacts (addressbook). | 77 | /** |
78 | * Create Database with contacts (addressbook). | ||
69 | * @param appname Name of application which wants access to the database | 79 | * @param appname Name of application which wants access to the database |
70 | * (i.e. "todolist") | 80 | * (i.e. "todolist") |
71 | * @param filename The name of the database file. If not set, the default one | 81 | * @param filename The name of the database file. If not set, the default one |
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 | |||
@@ -19,6 +19,11 @@ | |||
19 | * ===================================================================== | 19 | * ===================================================================== |
20 | * History: | 20 | * History: |
21 | * $Log$ | 21 | * $Log$ |
22 | * Revision 1.5 2003/04/13 18:07:10 zecke | ||
23 | * More API doc | ||
24 | * QString -> const QString& | ||
25 | * QString = 0l -> QString::null | ||
26 | * | ||
22 | * Revision 1.4 2002/11/13 14:14:51 eilers | 27 | * Revision 1.4 2002/11/13 14:14:51 eilers |
23 | * Added sorted for Contacts.. | 28 | * Added sorted for Contacts.. |
24 | * | 29 | * |
@@ -44,15 +49,26 @@ | |||
44 | #include "ocontact.h" | 49 | #include "ocontact.h" |
45 | #include "opimaccessbackend.h" | 50 | #include "opimaccessbackend.h" |
46 | 51 | ||
47 | #include "qregexp.h" | 52 | #include <qregexp.h> |
48 | 53 | ||
54 | /** | ||
55 | * This class represents the interface of all Contact Backends. | ||
56 | * Derivates of this class will be used to access the contacts. | ||
57 | * As implementation currently XML and vCard exist. This class needs to be implemented | ||
58 | * if you want to provide your own storage. | ||
59 | * In all queries a list of uids is passed on instead of loading the actual record! | ||
60 | * | ||
61 | * @see OContactAccessBackend_VCard | ||
62 | * @see OContactAccessBackend_XML | ||
63 | */ | ||
49 | class OContactAccessBackend: public OPimAccessBackend<OContact> { | 64 | class OContactAccessBackend: public OPimAccessBackend<OContact> { |
50 | public: | 65 | public: |
51 | OContactAccessBackend() {} | 66 | OContactAccessBackend() {} |
52 | virtual ~OContactAccessBackend() {} | 67 | virtual ~OContactAccessBackend() {} |
53 | 68 | ||
54 | 69 | ||
55 | /** Return if database was changed externally. | 70 | /** |
71 | * Return if database was changed externally. | ||
56 | * This may just make sense on file based databases like a XML-File. | 72 | * This may just make sense on file based databases like a XML-File. |
57 | * It is used to prevent to overwrite the current database content | 73 | * It is used to prevent to overwrite the current database content |
58 | * if the file was already changed by something else ! | 74 | * if the file was already changed by something else ! |
@@ -68,17 +84,23 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> { | |||
68 | 84 | ||
69 | virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; | 85 | virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; |
70 | 86 | ||
71 | /** Return all possible settings. | 87 | /** |
88 | * Return all possible settings. | ||
72 | * @return All settings provided by the current backend | 89 | * @return All settings provided by the current backend |
73 | * (i.e.: query_WildCards & query_IgnoreCase) | 90 | * (i.e.: query_WildCards & query_IgnoreCase) |
74 | */ | 91 | */ |
75 | virtual const uint querySettings() = 0; | 92 | virtual const uint querySettings() = 0; |
76 | 93 | ||
77 | /** Check whether settings are correct. | 94 | /** |
95 | * Check whether settings are correct. | ||
78 | * @return <i>true</i> if the given settings are correct and possible. | 96 | * @return <i>true</i> if the given settings are correct and possible. |
79 | */ | 97 | */ |
80 | virtual bool hasQuerySettings (uint querySettings) const = 0; | 98 | virtual bool hasQuerySettings (uint querySettings) const = 0; |
81 | 99 | ||
100 | /** | ||
101 | * FIXME!!! | ||
102 | * Returns a sorted list of records either ascendinf or descending for a giving criteria and category | ||
103 | */ | ||
82 | virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0; | 104 | virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0; |
83 | 105 | ||
84 | }; | 106 | }; |
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 | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.10 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.9 2003/03/21 10:33:09 eilers | 25 | * Revision 1.9 2003/03/21 10:33:09 eilers |
21 | * Merged speed optimized xml backend for contacts to main. | 26 | * Merged speed optimized xml backend for contacts to main. |
22 | * Added QDateTime to querybyexample. For instance, it is now possible to get | 27 | * Added QDateTime to querybyexample. For instance, it is now possible to get |
@@ -76,7 +81,7 @@ | |||
76 | 81 | ||
77 | #include <qfile.h> | 82 | #include <qfile.h> |
78 | 83 | ||
79 | OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString filename ): | 84 | OContactAccessBackend_VCard::OContactAccessBackend_VCard ( const QString& , const QString& filename ): |
80 | m_dirty( false ), | 85 | m_dirty( false ), |
81 | m_file( filename ) | 86 | m_file( filename ) |
82 | { | 87 | { |
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 | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.6 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.5 2003/03/21 10:33:09 eilers | 25 | * Revision 1.5 2003/03/21 10:33:09 eilers |
21 | * Merged speed optimized xml backend for contacts to main. | 26 | * Merged speed optimized xml backend for contacts to main. |
22 | * Added QDateTime to querybyexample. For instance, it is now possible to get | 27 | * Added QDateTime to querybyexample. For instance, it is now possible to get |
@@ -47,9 +52,14 @@ | |||
47 | 52 | ||
48 | class VObject; | 53 | class VObject; |
49 | 54 | ||
55 | /** | ||
56 | * This is the vCard 2.1 implementation of the Contact Storage | ||
57 | * @see OContactAccessBackend_XML | ||
58 | * @see OPimAccessBackend | ||
59 | */ | ||
50 | class OContactAccessBackend_VCard : public OContactAccessBackend { | 60 | class OContactAccessBackend_VCard : public OContactAccessBackend { |
51 | public: | 61 | public: |
52 | OContactAccessBackend_VCard ( QString appname, QString filename = 0l ); | 62 | OContactAccessBackend_VCard ( const QString& appname, const QString& filename = QString::null ); |
53 | 63 | ||
54 | bool load (); | 64 | bool load (); |
55 | bool reload(); | 65 | bool reload(); |
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 | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.5 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.4 2003/03/21 14:32:54 mickeyl | 25 | * Revision 1.4 2003/03/21 14:32:54 mickeyl |
21 | * g++ compliance fix: default arguments belong into the declaration, but not the definition | 26 | * g++ compliance fix: default arguments belong into the declaration, but not the definition |
22 | * | 27 | * |
@@ -107,7 +112,7 @@ | |||
107 | using namespace Opie; | 112 | using namespace Opie; |
108 | 113 | ||
109 | 114 | ||
110 | OContactAccessBackend_XML::OContactAccessBackend_XML ( QString appname, QString filename ): | 115 | OContactAccessBackend_XML::OContactAccessBackend_XML ( const QString& appname, const QString& filename ): |
111 | m_changed( false ) | 116 | m_changed( false ) |
112 | { | 117 | { |
113 | // Just m_contactlist should call delete if an entry | 118 | // Just m_contactlist should call delete if an entry |
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 | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.14 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.13 2003/03/21 10:33:09 eilers | 25 | * Revision 1.13 2003/03/21 10:33:09 eilers |
21 | * Merged speed optimized xml backend for contacts to main. | 26 | * Merged speed optimized xml backend for contacts to main. |
22 | * Added QDateTime to querybyexample. For instance, it is now possible to get | 27 | * Added QDateTime to querybyexample. For instance, it is now possible to get |
@@ -84,9 +89,14 @@ | |||
84 | #include <qdict.h> | 89 | #include <qdict.h> |
85 | 90 | ||
86 | /* the default xml implementation */ | 91 | /* the default xml implementation */ |
92 | /** | ||
93 | * This class is the XML implementation of a Contact backend | ||
94 | * it does implement everything available for OContact. | ||
95 | * @see OPimAccessBackend for more information of available methods | ||
96 | */ | ||
87 | class OContactAccessBackend_XML : public OContactAccessBackend { | 97 | class OContactAccessBackend_XML : public OContactAccessBackend { |
88 | public: | 98 | public: |
89 | OContactAccessBackend_XML ( QString appname, QString filename = 0l ); | 99 | OContactAccessBackend_XML ( const QString& appname, const QString& filename = QString::null ); |
90 | 100 | ||
91 | bool save(); | 101 | bool save(); |
92 | 102 | ||
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,6 +1,13 @@ | |||
1 | #include "obackendfactory.h" | 1 | #include "obackendfactory.h" |
2 | #include "odatebookaccess.h" | 2 | #include "odatebookaccess.h" |
3 | 3 | ||
4 | /** | ||
5 | * Simple constructor | ||
6 | * It takes a ODateBookAccessBackend as parent. If it is 0 the default implementation | ||
7 | * will be used! | ||
8 | * @param back The backend to be used or 0 for the default backend | ||
9 | * @param ac What kind of access is intended | ||
10 | */ | ||
4 | ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac ) | 11 | ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac ) |
5 | : OPimAccessTemplate<OEvent>( back ) | 12 | : OPimAccessTemplate<OEvent>( back ) |
6 | { | 13 | { |
@@ -12,27 +19,48 @@ ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac ) | |||
12 | } | 19 | } |
13 | ODateBookAccess::~ODateBookAccess() { | 20 | ODateBookAccess::~ODateBookAccess() { |
14 | } | 21 | } |
22 | |||
23 | /** | ||
24 | * @return all events available | ||
25 | */ | ||
15 | ODateBookAccess::List ODateBookAccess::rawEvents()const { | 26 | ODateBookAccess::List ODateBookAccess::rawEvents()const { |
16 | QArray<int> ints = m_backEnd->rawEvents(); | 27 | QArray<int> ints = m_backEnd->rawEvents(); |
17 | 28 | ||
18 | List lis( ints, this ); | 29 | List lis( ints, this ); |
19 | return lis; | 30 | return lis; |
20 | } | 31 | } |
32 | |||
33 | /** | ||
34 | * @return all repeating events | ||
35 | */ | ||
21 | ODateBookAccess::List ODateBookAccess::rawRepeats()const { | 36 | ODateBookAccess::List ODateBookAccess::rawRepeats()const { |
22 | QArray<int> ints = m_backEnd->rawRepeats(); | 37 | QArray<int> ints = m_backEnd->rawRepeats(); |
23 | 38 | ||
24 | List lis( ints, this ); | 39 | List lis( ints, this ); |
25 | return lis; | 40 | return lis; |
26 | } | 41 | } |
42 | |||
43 | /** | ||
44 | * @return all non repeating events | ||
45 | */ | ||
27 | ODateBookAccess::List ODateBookAccess::nonRepeats()const { | 46 | ODateBookAccess::List ODateBookAccess::nonRepeats()const { |
28 | QArray<int> ints = m_backEnd->nonRepeats(); | 47 | QArray<int> ints = m_backEnd->nonRepeats(); |
29 | 48 | ||
30 | List lis( ints, this ); | 49 | List lis( ints, this ); |
31 | return lis; | 50 | return lis; |
32 | } | 51 | } |
52 | |||
53 | /** | ||
54 | * @return dates in the time span between from and to | ||
55 | * @param from Include all events from... | ||
56 | * @param to Include all events to... | ||
57 | */ | ||
33 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) { | 58 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) { |
34 | return m_backEnd->effecticeEvents( from, to ); | 59 | return m_backEnd->effecticeEvents( from, to ); |
35 | } | 60 | } |
61 | /** | ||
62 | * @return all events at a given datetime | ||
63 | */ | ||
36 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) { | 64 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) { |
37 | return m_backEnd->effecticeEvents( start ); | 65 | return m_backEnd->effecticeEvents( start ); |
38 | } | 66 | } |
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 | |||
@@ -6,18 +6,27 @@ | |||
6 | 6 | ||
7 | #include "oevent.h" | 7 | #include "oevent.h" |
8 | 8 | ||
9 | /** | ||
10 | * This is the object orientated datebook database. It'll use OBackendFactory | ||
11 | * to query for a backend. | ||
12 | * All access to the datebook should be done via this class. | ||
13 | * Make sure to load and save the datebook this is not part of | ||
14 | * destructing and creating the object | ||
15 | * | ||
16 | * @author Holger Freyther | ||
17 | */ | ||
9 | class ODateBookAccess : public OPimAccessTemplate<OEvent> { | 18 | class ODateBookAccess : public OPimAccessTemplate<OEvent> { |
10 | public: | 19 | public: |
11 | ODateBookAccess( ODateBookAccessBackend* = 0l, enum Access acc = Random ); | 20 | ODateBookAccess( ODateBookAccessBackend* = 0l, enum Access acc = Random ); |
12 | ~ODateBookAccess(); | 21 | ~ODateBookAccess(); |
13 | 22 | ||
14 | /** return all events */ | 23 | /* return all events */ |
15 | List rawEvents()const; | 24 | List rawEvents()const; |
16 | 25 | ||
17 | /** return repeating events */ | 26 | /* return repeating events */ |
18 | List rawRepeats()const; | 27 | List rawRepeats()const; |
19 | 28 | ||
20 | /** return non repeating events */ | 29 | /* return non repeating events */ |
21 | List nonRepeats()const; | 30 | List nonRepeats()const; |
22 | 31 | ||
23 | OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to ); | 32 | OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to ); |
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 | |||
@@ -6,25 +6,66 @@ | |||
6 | #include "opimaccessbackend.h" | 6 | #include "opimaccessbackend.h" |
7 | #include "oevent.h" | 7 | #include "oevent.h" |
8 | 8 | ||
9 | /** | ||
10 | * This class is the interface to the storage of Events. | ||
11 | * @see OPimAccessBackend | ||
12 | * | ||
13 | */ | ||
9 | class ODateBookAccessBackend : public OPimAccessBackend<OEvent> { | 14 | class ODateBookAccessBackend : public OPimAccessBackend<OEvent> { |
10 | public: | 15 | public: |
11 | typedef int UID; | 16 | typedef int UID; |
17 | |||
18 | /** | ||
19 | * c'tor without parameter | ||
20 | */ | ||
12 | ODateBookAccessBackend(); | 21 | ODateBookAccessBackend(); |
13 | ~ODateBookAccessBackend(); | 22 | ~ODateBookAccessBackend(); |
14 | 23 | ||
24 | /** | ||
25 | * This method should return a list of UIDs containing | ||
26 | * all events. No filter should be applied | ||
27 | * @return list of events | ||
28 | */ | ||
15 | virtual QArray<UID> rawEvents()const = 0; | 29 | virtual QArray<UID> rawEvents()const = 0; |
30 | |||
31 | /** | ||
32 | * This method should return a list of UIDs containing | ||
33 | * all repeating events. No filter should be applied | ||
34 | * @return list of repeating events | ||
35 | */ | ||
16 | virtual QArray<UID> rawRepeats()const = 0; | 36 | virtual QArray<UID> rawRepeats()const = 0; |
37 | |||
38 | /** | ||
39 | * This mthod should return a list of UIDs containing all non | ||
40 | * repeating events. No filter should be applied | ||
41 | * @return list of nonrepeating events | ||
42 | */ | ||
17 | virtual QArray<UID> nonRepeats() const = 0; | 43 | virtual QArray<UID> nonRepeats() const = 0; |
18 | 44 | ||
19 | /** | 45 | /** |
20 | * these two methods are used if you do not implement | 46 | * If you do not want to implement the effectiveEvents methods below |
21 | * effectiveEvents... | 47 | * you need to supply it with directNonRepeats. |
48 | * This method can return empty lists if effectiveEvents is implememted | ||
22 | */ | 49 | */ |
23 | virtual OEvent::ValueList directNonRepeats() = 0; | 50 | virtual OEvent::ValueList directNonRepeats() = 0; |
51 | |||
52 | /** | ||
53 | * Same as above but return raw repeats! | ||
54 | */ | ||
24 | virtual OEvent::ValueList directRawRepeats() = 0; | 55 | virtual OEvent::ValueList directRawRepeats() = 0; |
25 | 56 | ||
26 | /* is implemented by default but you can reimplement it*/ | 57 | /* is implemented by default but you can reimplement it*/ |
58 | /** | ||
59 | * Effective Events are special event occuring during a time frame. This method does calcualte | ||
60 | * EffectiveEvents bases on the directNonRepeats and directRawRepeats. You may implement this method | ||
61 | * yourself | ||
62 | */ | ||
27 | virtual OEffectiveEvent::ValueList effecticeEvents( const QDate& from, const QDate& to ); | 63 | virtual OEffectiveEvent::ValueList effecticeEvents( const QDate& from, const QDate& to ); |
64 | |||
65 | /** | ||
66 | * this is an overloaded member function | ||
67 | * @see effecticeEvents | ||
68 | */ | ||
28 | virtual OEffectiveEvent::ValueList effecticeEvents( const QDateTime& start ); | 69 | virtual OEffectiveEvent::ValueList effecticeEvents( const QDateTime& start ); |
29 | 70 | ||
30 | }; | 71 | }; |
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 | |||
@@ -5,6 +5,12 @@ | |||
5 | 5 | ||
6 | #include "odatebookaccessbackend.h" | 6 | #include "odatebookaccessbackend.h" |
7 | 7 | ||
8 | /** | ||
9 | * This is the default XML implementation for DateBoook XML storage | ||
10 | * It fully implements the interface | ||
11 | * @see ODateBookAccessBackend | ||
12 | * @see OPimAccessBackend | ||
13 | */ | ||
8 | class ODateBookAccessBackend_XML : public ODateBookAccessBackend { | 14 | class ODateBookAccessBackend_XML : public ODateBookAccessBackend { |
9 | public: | 15 | public: |
10 | ODateBookAccessBackend_XML( const QString& appName, | 16 | ODateBookAccessBackend_XML( const QString& appName, |
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 | |||
@@ -30,9 +30,18 @@ struct OCalendarHelper { | |||
30 | 30 | ||
31 | class OPimNotifyManager; | 31 | class OPimNotifyManager; |
32 | class ORecur; | 32 | class ORecur; |
33 | |||
34 | /** | ||
35 | * This is the container for all Events. It encapsules all | ||
36 | * available information for a single Event | ||
37 | * @short container for events. | ||
38 | */ | ||
33 | class OEvent : public OPimRecord { | 39 | class OEvent : public OPimRecord { |
34 | public: | 40 | public: |
35 | typedef QValueList<OEvent> ValueList; | 41 | typedef QValueList<OEvent> ValueList; |
42 | /** | ||
43 | * RecordFields contain possible attributes | ||
44 | */ | ||
36 | enum RecordFields { | 45 | enum RecordFields { |
37 | Uid = Qtopia::UID_ID, | 46 | Uid = Qtopia::UID_ID, |
38 | Category = Qtopia::CATEGORY_ID, | 47 | Category = Qtopia::CATEGORY_ID, |
@@ -49,7 +58,14 @@ public: | |||
49 | TimeZone | 58 | TimeZone |
50 | }; | 59 | }; |
51 | 60 | ||
61 | /** | ||
62 | * Start with an Empty OEvent. UID == 0 means that it is empty | ||
63 | */ | ||
52 | OEvent(int uid = 0); | 64 | OEvent(int uid = 0); |
65 | |||
66 | /** | ||
67 | * copy c'tor | ||
68 | */ | ||
53 | OEvent( const OEvent& ); | 69 | OEvent( const OEvent& ); |
54 | ~OEvent(); | 70 | ~OEvent(); |
55 | OEvent &operator=( const OEvent& ); | 71 | OEvent &operator=( const OEvent& ); |
@@ -144,7 +160,6 @@ private: | |||
144 | /** | 160 | /** |
145 | * AN Event can span through multiple days. We split up a multiday eve | 161 | * AN Event can span through multiple days. We split up a multiday eve |
146 | */ | 162 | */ |
147 | |||
148 | class OEffectiveEvent { | 163 | class OEffectiveEvent { |
149 | public: | 164 | public: |
150 | typedef QValueList<OEffectiveEvent> ValueList; | 165 | typedef QValueList<OEffectiveEvent> ValueList; |
diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h index 3a73210..ad6cf5a 100644 --- a/libopie2/opiepim/backend/obackendfactory.h +++ b/libopie2/opiepim/backend/obackendfactory.h | |||
@@ -16,6 +16,11 @@ | |||
16 | * ===================================================================== | 16 | * ===================================================================== |
17 | * History: | 17 | * History: |
18 | * $Log$ | 18 | * $Log$ |
19 | * Revision 1.6 2003/04/13 18:07:10 zecke | ||
20 | * More API doc | ||
21 | * QString -> const QString& | ||
22 | * QString = 0l -> QString::null | ||
23 | * | ||
19 | * Revision 1.5 2003/02/21 23:31:52 zecke | 24 | * Revision 1.5 2003/02/21 23:31:52 zecke |
20 | * Add XML datebookresource | 25 | * Add XML datebookresource |
21 | * -clean up todoaccessxml header | 26 | * -clean up todoaccessxml header |
@@ -63,7 +68,21 @@ | |||
63 | #include "otodoaccesssql.h" | 68 | #include "otodoaccesssql.h" |
64 | #endif | 69 | #endif |
65 | 70 | ||
66 | 71 | /** | |
72 | * This class is our factory. It will give us the default implementations | ||
73 | * of at least Todolist, Contacts and Datebook. In the future this class will | ||
74 | * allow users to switch the backend with ( XML->SQLite ) without the need | ||
75 | * to recompile.# | ||
76 | * This class as the whole PIM Api is making use of templates | ||
77 | * | ||
78 | * <pre> | ||
79 | * OTodoAccessBackend* backend = OBackEndFactory<OTodoAccessBackend>::Default("todo", QString::null ); | ||
80 | * backend->load(); | ||
81 | * </pre> | ||
82 | * | ||
83 | * @author Stefan Eilers | ||
84 | * @version 0.1 | ||
85 | */ | ||
67 | template<class T> | 86 | template<class T> |
68 | class OBackendFactory | 87 | class OBackendFactory |
69 | { | 88 | { |
@@ -76,6 +95,11 @@ class OBackendFactory | |||
76 | DATE | 95 | DATE |
77 | }; | 96 | }; |
78 | 97 | ||
98 | /** | ||
99 | * Returns a backend implementation for backendName | ||
100 | * @param backendName the type of the backend | ||
101 | * @param appName will be passed on to the backend | ||
102 | */ | ||
79 | static T* Default( const QString backendName, const QString& appName ){ | 103 | static T* Default( const QString backendName, const QString& appName ){ |
80 | 104 | ||
81 | // __asm__("int3"); | 105 | // __asm__("int3"); |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend.h b/libopie2/opiepim/backend/ocontactaccessbackend.h index 821f5bf..ebeb42d 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend.h | |||
@@ -19,6 +19,11 @@ | |||
19 | * ===================================================================== | 19 | * ===================================================================== |
20 | * History: | 20 | * History: |
21 | * $Log$ | 21 | * $Log$ |
22 | * Revision 1.5 2003/04/13 18:07:10 zecke | ||
23 | * More API doc | ||
24 | * QString -> const QString& | ||
25 | * QString = 0l -> QString::null | ||
26 | * | ||
22 | * Revision 1.4 2002/11/13 14:14:51 eilers | 27 | * Revision 1.4 2002/11/13 14:14:51 eilers |
23 | * Added sorted for Contacts.. | 28 | * Added sorted for Contacts.. |
24 | * | 29 | * |
@@ -44,15 +49,26 @@ | |||
44 | #include "ocontact.h" | 49 | #include "ocontact.h" |
45 | #include "opimaccessbackend.h" | 50 | #include "opimaccessbackend.h" |
46 | 51 | ||
47 | #include "qregexp.h" | 52 | #include <qregexp.h> |
48 | 53 | ||
54 | /** | ||
55 | * This class represents the interface of all Contact Backends. | ||
56 | * Derivates of this class will be used to access the contacts. | ||
57 | * As implementation currently XML and vCard exist. This class needs to be implemented | ||
58 | * if you want to provide your own storage. | ||
59 | * In all queries a list of uids is passed on instead of loading the actual record! | ||
60 | * | ||
61 | * @see OContactAccessBackend_VCard | ||
62 | * @see OContactAccessBackend_XML | ||
63 | */ | ||
49 | class OContactAccessBackend: public OPimAccessBackend<OContact> { | 64 | class OContactAccessBackend: public OPimAccessBackend<OContact> { |
50 | public: | 65 | public: |
51 | OContactAccessBackend() {} | 66 | OContactAccessBackend() {} |
52 | virtual ~OContactAccessBackend() {} | 67 | virtual ~OContactAccessBackend() {} |
53 | 68 | ||
54 | 69 | ||
55 | /** Return if database was changed externally. | 70 | /** |
71 | * Return if database was changed externally. | ||
56 | * This may just make sense on file based databases like a XML-File. | 72 | * This may just make sense on file based databases like a XML-File. |
57 | * It is used to prevent to overwrite the current database content | 73 | * It is used to prevent to overwrite the current database content |
58 | * if the file was already changed by something else ! | 74 | * if the file was already changed by something else ! |
@@ -68,17 +84,23 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> { | |||
68 | 84 | ||
69 | virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; | 85 | virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; |
70 | 86 | ||
71 | /** Return all possible settings. | 87 | /** |
88 | * Return all possible settings. | ||
72 | * @return All settings provided by the current backend | 89 | * @return All settings provided by the current backend |
73 | * (i.e.: query_WildCards & query_IgnoreCase) | 90 | * (i.e.: query_WildCards & query_IgnoreCase) |
74 | */ | 91 | */ |
75 | virtual const uint querySettings() = 0; | 92 | virtual const uint querySettings() = 0; |
76 | 93 | ||
77 | /** Check whether settings are correct. | 94 | /** |
95 | * Check whether settings are correct. | ||
78 | * @return <i>true</i> if the given settings are correct and possible. | 96 | * @return <i>true</i> if the given settings are correct and possible. |
79 | */ | 97 | */ |
80 | virtual bool hasQuerySettings (uint querySettings) const = 0; | 98 | virtual bool hasQuerySettings (uint querySettings) const = 0; |
81 | 99 | ||
100 | /** | ||
101 | * FIXME!!! | ||
102 | * Returns a sorted list of records either ascendinf or descending for a giving criteria and category | ||
103 | */ | ||
82 | virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0; | 104 | virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0; |
83 | 105 | ||
84 | }; | 106 | }; |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp index f24523f..270bef3 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.10 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.9 2003/03/21 10:33:09 eilers | 25 | * Revision 1.9 2003/03/21 10:33:09 eilers |
21 | * Merged speed optimized xml backend for contacts to main. | 26 | * Merged speed optimized xml backend for contacts to main. |
22 | * Added QDateTime to querybyexample. For instance, it is now possible to get | 27 | * Added QDateTime to querybyexample. For instance, it is now possible to get |
@@ -76,7 +81,7 @@ | |||
76 | 81 | ||
77 | #include <qfile.h> | 82 | #include <qfile.h> |
78 | 83 | ||
79 | OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString filename ): | 84 | OContactAccessBackend_VCard::OContactAccessBackend_VCard ( const QString& , const QString& filename ): |
80 | m_dirty( false ), | 85 | m_dirty( false ), |
81 | m_file( filename ) | 86 | m_file( filename ) |
82 | { | 87 | { |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h index 93e2da3..712d769 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.h | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.6 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.5 2003/03/21 10:33:09 eilers | 25 | * Revision 1.5 2003/03/21 10:33:09 eilers |
21 | * Merged speed optimized xml backend for contacts to main. | 26 | * Merged speed optimized xml backend for contacts to main. |
22 | * Added QDateTime to querybyexample. For instance, it is now possible to get | 27 | * Added QDateTime to querybyexample. For instance, it is now possible to get |
@@ -47,9 +52,14 @@ | |||
47 | 52 | ||
48 | class VObject; | 53 | class VObject; |
49 | 54 | ||
55 | /** | ||
56 | * This is the vCard 2.1 implementation of the Contact Storage | ||
57 | * @see OContactAccessBackend_XML | ||
58 | * @see OPimAccessBackend | ||
59 | */ | ||
50 | class OContactAccessBackend_VCard : public OContactAccessBackend { | 60 | class OContactAccessBackend_VCard : public OContactAccessBackend { |
51 | public: | 61 | public: |
52 | OContactAccessBackend_VCard ( QString appname, QString filename = 0l ); | 62 | OContactAccessBackend_VCard ( const QString& appname, const QString& filename = QString::null ); |
53 | 63 | ||
54 | bool load (); | 64 | bool load (); |
55 | bool reload(); | 65 | bool reload(); |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp index c5a7820..661cd51 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.5 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.4 2003/03/21 14:32:54 mickeyl | 25 | * Revision 1.4 2003/03/21 14:32:54 mickeyl |
21 | * g++ compliance fix: default arguments belong into the declaration, but not the definition | 26 | * g++ compliance fix: default arguments belong into the declaration, but not the definition |
22 | * | 27 | * |
@@ -107,7 +112,7 @@ | |||
107 | using namespace Opie; | 112 | using namespace Opie; |
108 | 113 | ||
109 | 114 | ||
110 | OContactAccessBackend_XML::OContactAccessBackend_XML ( QString appname, QString filename ): | 115 | OContactAccessBackend_XML::OContactAccessBackend_XML ( const QString& appname, const QString& filename ): |
111 | m_changed( false ) | 116 | m_changed( false ) |
112 | { | 117 | { |
113 | // Just m_contactlist should call delete if an entry | 118 | // Just m_contactlist should call delete if an entry |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h index 4d6a7ef..7b5365b 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.14 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.13 2003/03/21 10:33:09 eilers | 25 | * Revision 1.13 2003/03/21 10:33:09 eilers |
21 | * Merged speed optimized xml backend for contacts to main. | 26 | * Merged speed optimized xml backend for contacts to main. |
22 | * Added QDateTime to querybyexample. For instance, it is now possible to get | 27 | * Added QDateTime to querybyexample. For instance, it is now possible to get |
@@ -84,9 +89,14 @@ | |||
84 | #include <qdict.h> | 89 | #include <qdict.h> |
85 | 90 | ||
86 | /* the default xml implementation */ | 91 | /* the default xml implementation */ |
92 | /** | ||
93 | * This class is the XML implementation of a Contact backend | ||
94 | * it does implement everything available for OContact. | ||
95 | * @see OPimAccessBackend for more information of available methods | ||
96 | */ | ||
87 | class OContactAccessBackend_XML : public OContactAccessBackend { | 97 | class OContactAccessBackend_XML : public OContactAccessBackend { |
88 | public: | 98 | public: |
89 | OContactAccessBackend_XML ( QString appname, QString filename = 0l ); | 99 | OContactAccessBackend_XML ( const QString& appname, const QString& filename = QString::null ); |
90 | 100 | ||
91 | bool save(); | 101 | bool save(); |
92 | 102 | ||
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend.h b/libopie2/opiepim/backend/odatebookaccessbackend.h index eb6e8fb..86ff298 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend.h +++ b/libopie2/opiepim/backend/odatebookaccessbackend.h | |||
@@ -6,25 +6,66 @@ | |||
6 | #include "opimaccessbackend.h" | 6 | #include "opimaccessbackend.h" |
7 | #include "oevent.h" | 7 | #include "oevent.h" |
8 | 8 | ||
9 | /** | ||
10 | * This class is the interface to the storage of Events. | ||
11 | * @see OPimAccessBackend | ||
12 | * | ||
13 | */ | ||
9 | class ODateBookAccessBackend : public OPimAccessBackend<OEvent> { | 14 | class ODateBookAccessBackend : public OPimAccessBackend<OEvent> { |
10 | public: | 15 | public: |
11 | typedef int UID; | 16 | typedef int UID; |
17 | |||
18 | /** | ||
19 | * c'tor without parameter | ||
20 | */ | ||
12 | ODateBookAccessBackend(); | 21 | ODateBookAccessBackend(); |
13 | ~ODateBookAccessBackend(); | 22 | ~ODateBookAccessBackend(); |
14 | 23 | ||
24 | /** | ||
25 | * This method should return a list of UIDs containing | ||
26 | * all events. No filter should be applied | ||
27 | * @return list of events | ||
28 | */ | ||
15 | virtual QArray<UID> rawEvents()const = 0; | 29 | virtual QArray<UID> rawEvents()const = 0; |
30 | |||
31 | /** | ||
32 | * This method should return a list of UIDs containing | ||
33 | * all repeating events. No filter should be applied | ||
34 | * @return list of repeating events | ||
35 | */ | ||
16 | virtual QArray<UID> rawRepeats()const = 0; | 36 | virtual QArray<UID> rawRepeats()const = 0; |
37 | |||
38 | /** | ||
39 | * This mthod should return a list of UIDs containing all non | ||
40 | * repeating events. No filter should be applied | ||
41 | * @return list of nonrepeating events | ||
42 | */ | ||
17 | virtual QArray<UID> nonRepeats() const = 0; | 43 | virtual QArray<UID> nonRepeats() const = 0; |
18 | 44 | ||
19 | /** | 45 | /** |
20 | * these two methods are used if you do not implement | 46 | * If you do not want to implement the effectiveEvents methods below |
21 | * effectiveEvents... | 47 | * you need to supply it with directNonRepeats. |
48 | * This method can return empty lists if effectiveEvents is implememted | ||
22 | */ | 49 | */ |
23 | virtual OEvent::ValueList directNonRepeats() = 0; | 50 | virtual OEvent::ValueList directNonRepeats() = 0; |
51 | |||
52 | /** | ||
53 | * Same as above but return raw repeats! | ||
54 | */ | ||
24 | virtual OEvent::ValueList directRawRepeats() = 0; | 55 | virtual OEvent::ValueList directRawRepeats() = 0; |
25 | 56 | ||
26 | /* is implemented by default but you can reimplement it*/ | 57 | /* is implemented by default but you can reimplement it*/ |
58 | /** | ||
59 | * Effective Events are special event occuring during a time frame. This method does calcualte | ||
60 | * EffectiveEvents bases on the directNonRepeats and directRawRepeats. You may implement this method | ||
61 | * yourself | ||
62 | */ | ||
27 | virtual OEffectiveEvent::ValueList effecticeEvents( const QDate& from, const QDate& to ); | 63 | virtual OEffectiveEvent::ValueList effecticeEvents( const QDate& from, const QDate& to ); |
64 | |||
65 | /** | ||
66 | * this is an overloaded member function | ||
67 | * @see effecticeEvents | ||
68 | */ | ||
28 | virtual OEffectiveEvent::ValueList effecticeEvents( const QDateTime& start ); | 69 | virtual OEffectiveEvent::ValueList effecticeEvents( const QDateTime& start ); |
29 | 70 | ||
30 | }; | 71 | }; |
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h index 563c31f..7848f7c 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h +++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h | |||
@@ -5,6 +5,12 @@ | |||
5 | 5 | ||
6 | #include "odatebookaccessbackend.h" | 6 | #include "odatebookaccessbackend.h" |
7 | 7 | ||
8 | /** | ||
9 | * This is the default XML implementation for DateBoook XML storage | ||
10 | * It fully implements the interface | ||
11 | * @see ODateBookAccessBackend | ||
12 | * @see OPimAccessBackend | ||
13 | */ | ||
8 | class ODateBookAccessBackend_XML : public ODateBookAccessBackend { | 14 | class ODateBookAccessBackend_XML : public ODateBookAccessBackend { |
9 | public: | 15 | public: |
10 | ODateBookAccessBackend_XML( const QString& appName, | 16 | ODateBookAccessBackend_XML( const QString& appName, |
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h index 32b2dcb..d7ceaf2 100644 --- a/libopie2/opiepim/core/ocontactaccess.h +++ b/libopie2/opiepim/core/ocontactaccess.h | |||
@@ -17,6 +17,11 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.7 2003/04/13 18:07:10 zecke | ||
21 | * More API doc | ||
22 | * QString -> const QString& | ||
23 | * QString = 0l -> QString::null | ||
24 | * | ||
20 | * Revision 1.6 2003/01/02 14:27:12 eilers | 25 | * Revision 1.6 2003/01/02 14:27:12 eilers |
21 | * Improved query by example: Search by date is possible.. First step | 26 | * Improved query by example: Search by date is possible.. First step |
22 | * for a today plugin for birthdays.. | 27 | * for a today plugin for birthdays.. |
@@ -55,9 +60,13 @@ | |||
55 | #include "ocontactaccessbackend.h" | 60 | #include "ocontactaccessbackend.h" |
56 | #include "opimaccesstemplate.h" | 61 | #include "opimaccesstemplate.h" |
57 | 62 | ||
58 | /** Class to access the contacts database. | 63 | /** |
64 | * Class to access the contacts database. | ||
59 | * This is just a frontend for the real database handling which is | 65 | * This is just a frontend for the real database handling which is |
60 | * done by the backend. | 66 | * done by the backend. |
67 | * This class is used to access the Contacts on a system. This class as any OPIE PIM | ||
68 | * class is backend independent. | ||
69 | |||
61 | * @see OPimAccessTemplate | 70 | * @see OPimAccessTemplate |
62 | */ | 71 | */ |
63 | class OContactAccess: public QObject, public OPimAccessTemplate<OContact> | 72 | class OContactAccess: public QObject, public OPimAccessTemplate<OContact> |
@@ -65,7 +74,8 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact> | |||
65 | Q_OBJECT | 74 | Q_OBJECT |
66 | 75 | ||
67 | public: | 76 | public: |
68 | /** Create Database with contacts (addressbook). | 77 | /** |
78 | * Create Database with contacts (addressbook). | ||
69 | * @param appname Name of application which wants access to the database | 79 | * @param appname Name of application which wants access to the database |
70 | * (i.e. "todolist") | 80 | * (i.e. "todolist") |
71 | * @param filename The name of the database file. If not set, the default one | 81 | * @param filename The name of the database file. If not set, the default one |
diff --git a/libopie2/opiepim/core/odatebookaccess.cpp b/libopie2/opiepim/core/odatebookaccess.cpp index 08e61ff..a3661a3 100644 --- a/libopie2/opiepim/core/odatebookaccess.cpp +++ b/libopie2/opiepim/core/odatebookaccess.cpp | |||
@@ -1,6 +1,13 @@ | |||
1 | #include "obackendfactory.h" | 1 | #include "obackendfactory.h" |
2 | #include "odatebookaccess.h" | 2 | #include "odatebookaccess.h" |
3 | 3 | ||
4 | /** | ||
5 | * Simple constructor | ||
6 | * It takes a ODateBookAccessBackend as parent. If it is 0 the default implementation | ||
7 | * will be used! | ||
8 | * @param back The backend to be used or 0 for the default backend | ||
9 | * @param ac What kind of access is intended | ||
10 | */ | ||
4 | ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac ) | 11 | ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac ) |
5 | : OPimAccessTemplate<OEvent>( back ) | 12 | : OPimAccessTemplate<OEvent>( back ) |
6 | { | 13 | { |
@@ -12,27 +19,48 @@ ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac ) | |||
12 | } | 19 | } |
13 | ODateBookAccess::~ODateBookAccess() { | 20 | ODateBookAccess::~ODateBookAccess() { |
14 | } | 21 | } |
22 | |||
23 | /** | ||
24 | * @return all events available | ||
25 | */ | ||
15 | ODateBookAccess::List ODateBookAccess::rawEvents()const { | 26 | ODateBookAccess::List ODateBookAccess::rawEvents()const { |
16 | QArray<int> ints = m_backEnd->rawEvents(); | 27 | QArray<int> ints = m_backEnd->rawEvents(); |
17 | 28 | ||
18 | List lis( ints, this ); | 29 | List lis( ints, this ); |
19 | return lis; | 30 | return lis; |
20 | } | 31 | } |
32 | |||
33 | /** | ||
34 | * @return all repeating events | ||
35 | */ | ||
21 | ODateBookAccess::List ODateBookAccess::rawRepeats()const { | 36 | ODateBookAccess::List ODateBookAccess::rawRepeats()const { |
22 | QArray<int> ints = m_backEnd->rawRepeats(); | 37 | QArray<int> ints = m_backEnd->rawRepeats(); |
23 | 38 | ||
24 | List lis( ints, this ); | 39 | List lis( ints, this ); |
25 | return lis; | 40 | return lis; |
26 | } | 41 | } |
42 | |||
43 | /** | ||
44 | * @return all non repeating events | ||
45 | */ | ||
27 | ODateBookAccess::List ODateBookAccess::nonRepeats()const { | 46 | ODateBookAccess::List ODateBookAccess::nonRepeats()const { |
28 | QArray<int> ints = m_backEnd->nonRepeats(); | 47 | QArray<int> ints = m_backEnd->nonRepeats(); |
29 | 48 | ||
30 | List lis( ints, this ); | 49 | List lis( ints, this ); |
31 | return lis; | 50 | return lis; |
32 | } | 51 | } |
52 | |||
53 | /** | ||
54 | * @return dates in the time span between from and to | ||
55 | * @param from Include all events from... | ||
56 | * @param to Include all events to... | ||
57 | */ | ||
33 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) { | 58 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) { |
34 | return m_backEnd->effecticeEvents( from, to ); | 59 | return m_backEnd->effecticeEvents( from, to ); |
35 | } | 60 | } |
61 | /** | ||
62 | * @return all events at a given datetime | ||
63 | */ | ||
36 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) { | 64 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) { |
37 | return m_backEnd->effecticeEvents( start ); | 65 | return m_backEnd->effecticeEvents( start ); |
38 | } | 66 | } |
diff --git a/libopie2/opiepim/core/odatebookaccess.h b/libopie2/opiepim/core/odatebookaccess.h index 7047039..7c7a63f 100644 --- a/libopie2/opiepim/core/odatebookaccess.h +++ b/libopie2/opiepim/core/odatebookaccess.h | |||
@@ -6,18 +6,27 @@ | |||
6 | 6 | ||
7 | #include "oevent.h" | 7 | #include "oevent.h" |
8 | 8 | ||
9 | /** | ||
10 | * This is the object orientated datebook database. It'll use OBackendFactory | ||
11 | * to query for a backend. | ||
12 | * All access to the datebook should be done via this class. | ||
13 | * Make sure to load and save the datebook this is not part of | ||
14 | * destructing and creating the object | ||
15 | * | ||
16 | * @author Holger Freyther | ||
17 | */ | ||
9 | class ODateBookAccess : public OPimAccessTemplate<OEvent> { | 18 | class ODateBookAccess : public OPimAccessTemplate<OEvent> { |
10 | public: | 19 | public: |
11 | ODateBookAccess( ODateBookAccessBackend* = 0l, enum Access acc = Random ); | 20 | ODateBookAccess( ODateBookAccessBackend* = 0l, enum Access acc = Random ); |
12 | ~ODateBookAccess(); | 21 | ~ODateBookAccess(); |
13 | 22 | ||
14 | /** return all events */ | 23 | /* return all events */ |
15 | List rawEvents()const; | 24 | List rawEvents()const; |
16 | 25 | ||
17 | /** return repeating events */ | 26 | /* return repeating events */ |
18 | List rawRepeats()const; | 27 | List rawRepeats()const; |
19 | 28 | ||
20 | /** return non repeating events */ | 29 | /* return non repeating events */ |
21 | List nonRepeats()const; | 30 | List nonRepeats()const; |
22 | 31 | ||
23 | OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to ); | 32 | OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to ); |
diff --git a/libopie2/opiepim/ocontact.h b/libopie2/opiepim/ocontact.h index 1fd1c75..25fa0e7 100644 --- a/libopie2/opiepim/ocontact.h +++ b/libopie2/opiepim/ocontact.h | |||
@@ -36,6 +36,13 @@ QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>; | |||
36 | 36 | ||
37 | class ContactPrivate; | 37 | class ContactPrivate; |
38 | 38 | ||
39 | /** | ||
40 | * OContact class represents a specialised PIM Record for contacts. | ||
41 | * It does store all kind of persopn related information. | ||
42 | * | ||
43 | * @short Contact Container | ||
44 | * @author TT, Stefan Eiler, Holger Freyther | ||
45 | */ | ||
39 | class QPC_EXPORT OContact : public OPimRecord | 46 | class QPC_EXPORT OContact : public OPimRecord |
40 | { | 47 | { |
41 | friend class DataSet; | 48 | friend class DataSet; |
diff --git a/libopie2/opiepim/oevent.h b/libopie2/opiepim/oevent.h index 585515c..57d32d0 100644 --- a/libopie2/opiepim/oevent.h +++ b/libopie2/opiepim/oevent.h | |||
@@ -30,9 +30,18 @@ struct OCalendarHelper { | |||
30 | 30 | ||
31 | class OPimNotifyManager; | 31 | class OPimNotifyManager; |
32 | class ORecur; | 32 | class ORecur; |
33 | |||
34 | /** | ||
35 | * This is the container for all Events. It encapsules all | ||
36 | * available information for a single Event | ||
37 | * @short container for events. | ||
38 | */ | ||
33 | class OEvent : public OPimRecord { | 39 | class OEvent : public OPimRecord { |
34 | public: | 40 | public: |
35 | typedef QValueList<OEvent> ValueList; | 41 | typedef QValueList<OEvent> ValueList; |
42 | /** | ||
43 | * RecordFields contain possible attributes | ||
44 | */ | ||
36 | enum RecordFields { | 45 | enum RecordFields { |
37 | Uid = Qtopia::UID_ID, | 46 | Uid = Qtopia::UID_ID, |
38 | Category = Qtopia::CATEGORY_ID, | 47 | Category = Qtopia::CATEGORY_ID, |
@@ -49,7 +58,14 @@ public: | |||
49 | TimeZone | 58 | TimeZone |
50 | }; | 59 | }; |
51 | 60 | ||
61 | /** | ||
62 | * Start with an Empty OEvent. UID == 0 means that it is empty | ||
63 | */ | ||
52 | OEvent(int uid = 0); | 64 | OEvent(int uid = 0); |
65 | |||
66 | /** | ||
67 | * copy c'tor | ||
68 | */ | ||
53 | OEvent( const OEvent& ); | 69 | OEvent( const OEvent& ); |
54 | ~OEvent(); | 70 | ~OEvent(); |
55 | OEvent &operator=( const OEvent& ); | 71 | OEvent &operator=( const OEvent& ); |
@@ -144,7 +160,6 @@ private: | |||
144 | /** | 160 | /** |
145 | * AN Event can span through multiple days. We split up a multiday eve | 161 | * AN Event can span through multiple days. We split up a multiday eve |
146 | */ | 162 | */ |
147 | |||
148 | class OEffectiveEvent { | 163 | class OEffectiveEvent { |
149 | public: | 164 | public: |
150 | typedef QValueList<OEffectiveEvent> ValueList; | 165 | typedef QValueList<OEffectiveEvent> ValueList; |