summaryrefslogtreecommitdiff
authoreilers <eilers>2004-05-04 18:50:47 (UTC)
committer eilers <eilers>2004-05-04 18:50:47 (UTC)
commitfa24fb520b91f060b8bd7d6f756a8e7f1b809e1b (patch) (side-by-side diff)
tree561073a52f13bee6bf1bd59bceafbcb8c3c537bc
parentf1a3fc696787ae946464469b3f252aa425dbe51b (diff)
downloadopie-fa24fb520b91f060b8bd7d6f756a8e7f1b809e1b.zip
opie-fa24fb520b91f060b8bd7d6f756a8e7f1b809e1b.tar.gz
opie-fa24fb520b91f060b8bd7d6f756a8e7f1b809e1b.tar.bz2
OOps.. Forgot to commit modification of rtti from static to nonstatic (virtual)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/TODO5
-rw-r--r--libopie2/opiepim/core/opimcontact.cpp2
-rw-r--r--libopie2/opiepim/core/opimcontact.h2
-rw-r--r--libopie2/opiepim/core/opimevent.cpp2
-rw-r--r--libopie2/opiepim/core/opimevent.h2
-rw-r--r--libopie2/opiepim/core/opimrecord.cpp2
-rw-r--r--libopie2/opiepim/core/opimrecord.h2
-rw-r--r--libopie2/opiepim/core/opimtodo.cpp2
-rw-r--r--libopie2/opiepim/core/opimtodo.h2
9 files changed, 12 insertions, 9 deletions
diff --git a/libopie2/opiepim/TODO b/libopie2/opiepim/TODO
index cdde11c..c3420cf 100644
--- a/libopie2/opiepim/TODO
+++ b/libopie2/opiepim/TODO
@@ -1,60 +1,63 @@
As to popular request....
1.) fix up the core/backend mess.
The actual Backend Implementation + Interface should be there
The API frontend used by the developer should not be used
-
+
+ Rename ODateBookAccess* to OPimDateBookAccess*
+ Fix filenames to OPim* ...
+
2.) Move sorting, Query By Example, Exposing of Attributes of a Record
available to the Ptr base class and have sane implementation
on the template level
3.) Have something like QProperty to expose attributes from OPimRecord.
This would include exporting,importing of data, and translated names.
This can be used for Cross Reference, Selector Widget, Generic Table
Shower
4.) Marshall/Demarshall all PIM Records correctly
5.) Add the Private Backend to the OPimRecord ( private ) make the base
access class friend and allow retrieving the backend. Make it virtual
so the template gets the right pointer. So it can only be accessed from
the inside
6.) Add signals for updating/adding/removing records to the access template
Internal connect method
7.) internal QCOP communication between the interfaces
8.) GUI:Better and Improved Recurrence Widget
9.) GUI:Improved Alarm Widget and handling classes
10.) GUI:Undo/Redo template look at KDE
11.) GUI: Generic X-Ref Selector using the factory and pointer interface
12.) GUI: Factory and also registration of foreign services. generate a records of type
13.) Multiple Backends for an Access Template
14.) ReadOnly Access
15.) GUI: Generic Table Widget maybe even baed on Selector with
configuration of shown Attribute
16.) Multiple Categories with Sub Categories including popup selector
Widget. Fix Bug with changing visible. Both helper class + gui.
Also group PopupNames Like in Function Menu of XEmacs
17.) ListView for TodolIst At least introduce parents and child
And query for them
18.) Add querieng to Ptr Level for dates and date ranges.
Return OEffectiveEvents or such which is also only loaded
if required.
19.) Clean Up
20.) Datebook Classes
22.) Better helper for AlarmServer \ No newline at end of file
diff --git a/libopie2/opiepim/core/opimcontact.cpp b/libopie2/opiepim/core/opimcontact.cpp
index 4a774e8..c1e06c8 100644
--- a/libopie2/opiepim/core/opimcontact.cpp
+++ b/libopie2/opiepim/core/opimcontact.cpp
@@ -510,780 +510,780 @@ QString OPimContact::toRichText() const
if ( businessZip().isEmpty() && !businessStreet().isEmpty() )
text += "<br>";
text += Qtopia::escapeString( value );
if ( state )
text += ", " + Qtopia::escapeString( state );
}
else if ( !state.isEmpty() )
{
text += "<br>" + Qtopia::escapeString( state );
marker = true;
}
break;
}
case City_State_Zip:
{ // City, State Zip_Code
state = businessState();
if ( !( value = businessCity() ).isEmpty() )
{
marker = true;
text += "<br>" + Qtopia::escapeString( value );
if ( state )
text += ", " + Qtopia::escapeString( state );
}
else if ( !state.isEmpty() )
{
text += "<br>" + Qtopia::escapeString( state );
marker = true;
}
if ( !( value = businessZip() ).isEmpty() )
{
text += " " + Qtopia::escapeString( value );
marker = true;
}
break;
}
}
if ( !( value = businessCountry() ).isEmpty() )
{
text += "<br>" + Qtopia::escapeString( value );
marker = true;
}
// rest of Business data
str = office();
if ( !str.isEmpty() )
{
text += "<br><b>" + QObject::tr( "Office: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
str = businessWebpage();
if ( !str.isEmpty() )
{
text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr( "Business Web Page: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
str = businessPhone();
if ( !str.isEmpty() )
{
text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr( "Business Phone: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
str = businessFax();
if ( !str.isEmpty() )
{
text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr( "Business Fax: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
str = businessMobile();
if ( !str.isEmpty() )
{
text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr( "Business Mobile: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
str = businessPager();
if ( !str.isEmpty() )
{
text += "<br><b>" + QObject::tr( "Business Pager: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
// text += "<br>";
// home address
if ( !homeStreet().isEmpty() || !homeCity().isEmpty() ||
!homeZip().isEmpty() || !homeCountry().isEmpty() )
{
text += QObject::tr( "<br><b>Home Address:</b>" );
marker = true;
}
if ( !( value = homeStreet() ).isEmpty() )
{
text += "<br>" + Qtopia::escapeString( value );
marker = true;
}
switch ( addressformat )
{
case Zip_City_State:
{ // Zip_Code City, State
state = homeState();
if ( !( value = homeZip() ).isEmpty() )
{
text += "<br>" + Qtopia::escapeString( value ) + " ";
marker = true;
}
if ( !( value = homeCity() ).isEmpty() )
{
marker = true;
if ( homeZip().isEmpty() && !homeStreet().isEmpty() )
text += "<br>";
text += Qtopia::escapeString( value );
if ( !state.isEmpty() )
text += ", " + Qtopia::escapeString( state );
}
else if ( !state.isEmpty() )
{
text += "<br>" + Qtopia::escapeString( state );
marker = true;
}
break;
}
case City_State_Zip:
{ // City, State Zip_Code
state = homeState();
if ( !( value = homeCity() ).isEmpty() )
{
marker = true;
text += "<br>" + Qtopia::escapeString( value );
if ( state )
text += ", " + Qtopia::escapeString( state );
}
else if ( !state.isEmpty() )
{
text += "<br>" + Qtopia::escapeString( state );
marker = true;
}
if ( !( value = homeZip() ).isEmpty() )
{
text += " " + Qtopia::escapeString( value );
marker = true;
}
break;
}
}
if ( !( value = homeCountry() ).isEmpty() )
{
text += "<br>" + Qtopia::escapeString( value );
marker = true;
}
// rest of Home data
str = homeWebpage();
if ( !str.isEmpty() )
{
text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr( "Home Web Page: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
str = homePhone();
if ( !str.isEmpty() )
{
text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr( "Home Phone: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
str = homeFax();
if ( !str.isEmpty() )
{
text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr( "Home Fax: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
str = homeMobile();
if ( !str.isEmpty() )
{
text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr( "Home Mobile: " ) + "</b>"
+ Qtopia::escapeString( str );
marker = true;
}
if ( marker )
text += "<br><hr>";
// the rest...
str = emails();
if ( !str.isEmpty() && ( str != defEmail ) )
text += "<br><b>" + QObject::tr( "All Emails: " ) + "</b>"
+ Qtopia::escapeString( str );
str = profession();
if ( !str.isEmpty() )
text += "<br><b>" + QObject::tr( "Profession: " ) + "</b>"
+ Qtopia::escapeString( str );
str = assistant();
if ( !str.isEmpty() )
text += "<br><b>" + QObject::tr( "Assistant: " ) + "</b>"
+ Qtopia::escapeString( str );
str = manager();
if ( !str.isEmpty() )
text += "<br><b>" + QObject::tr( "Manager: " ) + "</b>"
+ Qtopia::escapeString( str );
str = gender();
if ( !str.isEmpty() && str.toInt() != 0 )
{
text += "<br>";
if ( str.toInt() == 1 )
str = QObject::tr( "Male" );
else if ( str.toInt() == 2 )
str = QObject::tr( "Female" );
text += "<b>" + QObject::tr( "Gender: " ) + "</b>" + str;
}
str = spouse();
if ( !str.isEmpty() )
text += "<br><b>" + QObject::tr( "Spouse: " ) + "</b>"
+ Qtopia::escapeString( str );
if ( birthday().isValid() )
{
str = TimeString::numberDateString( birthday() );
text += "<br><b>" + QObject::tr( "Birthday: " ) + "</b>"
+ Qtopia::escapeString( str );
}
if ( anniversary().isValid() )
{
str = TimeString::numberDateString( anniversary() );
text += "<br><b>" + QObject::tr( "Anniversary: " ) + "</b>"
+ Qtopia::escapeString( str );
}
str = children();
if ( !str.isEmpty() )
text += "<br><b>" + QObject::tr( "Children: " ) + "</b>"
+ Qtopia::escapeString( str );
str = nickname();
if ( !str.isEmpty() )
text += "<br><b>" + QObject::tr( "Nickname: " ) + "</b>"
+ Qtopia::escapeString( str );
// categories
if ( categoryNames( "Contacts" ).count() )
{
text += "<br><b>" + QObject::tr( "Category:" ) + "</b> ";
text += categoryNames( "Contacts" ).join( ", " );
}
// notes last
if ( !( value = notes() ).isEmpty() )
{
text += "<br><hr><b>" + QObject::tr( "Notes:" ) + "</b> ";
QRegExp reg( "\n" );
//QString tmp = Qtopia::escapeString(value);
QString tmp = QStyleSheet::convertFromPlainText( value );
//tmp.replace( reg, "<br>" );
text += "<br>" + tmp + "<br>";
}
return text;
}
/*!
\internal
*/
void OPimContact::insert( int key, const QString &v )
{
QString value = v.stripWhiteSpace();
if ( value.isEmpty() )
mMap.remove( key );
else
mMap.insert( key, value );
}
/*!
\internal
*/
void OPimContact::replace( int key, const QString & v )
{
QString value = v.stripWhiteSpace();
if ( value.isEmpty() )
mMap.remove( key );
else
mMap.replace( key, value );
}
/*!
\internal
*/
QString OPimContact::find( int key ) const
{
return mMap[ key ];
}
/*!
\internal
*/
QString OPimContact::displayAddress( const QString &street,
const QString &city,
const QString &state,
const QString &zip,
const QString &country ) const
{
QString s = street;
if ( !street.isEmpty() )
s += "\n";
s += city;
if ( !city.isEmpty() && !state.isEmpty() )
s += ", ";
s += state;
if ( !state.isEmpty() && !zip.isEmpty() )
s += " ";
s += zip;
if ( !country.isEmpty() && !s.isEmpty() )
s += "\n";
s += country;
return s;
}
/*!
\internal
*/
QString OPimContact::displayBusinessAddress() const
{
return displayAddress( businessStreet(), businessCity(),
businessState(), businessZip(),
businessCountry() );
}
/*!
\internal
*/
QString OPimContact::displayHomeAddress() const
{
return displayAddress( homeStreet(), homeCity(),
homeState(), homeZip(),
homeCountry() );
}
/*!
Returns the full name of the contact
*/
QString OPimContact::fullName() const
{
QString title = find( Qtopia::Title );
QString firstName = find( Qtopia::FirstName );
QString middleName = find( Qtopia::MiddleName );
QString lastName = find( Qtopia::LastName );
QString suffix = find( Qtopia::Suffix );
QString name = title;
if ( !firstName.isEmpty() )
{
if ( !name.isEmpty() )
name += " ";
name += firstName;
}
if ( !middleName.isEmpty() )
{
if ( !name.isEmpty() )
name += " ";
name += middleName;
}
if ( !lastName.isEmpty() )
{
if ( !name.isEmpty() )
name += " ";
name += lastName;
}
if ( !suffix.isEmpty() )
{
if ( !name.isEmpty() )
name += " ";
name += suffix;
}
return name.simplifyWhiteSpace();
}
/*!
Returns a list of the names of the children of the contact.
*/
QStringList OPimContact::childrenList() const
{
return QStringList::split( " ", find( Qtopia::Children ) );
}
/*! \fn void OPimContact::insertEmail( const QString &email )
Insert \a email into the email list. Ensures \a email can only be added
once. If there is no default email address set, it sets it to the \a email.
*/
/*! \fn void OPimContact::removeEmail( const QString &email )
Removes the \a email from the email list. If the default email was \a email,
then the default email address is assigned to the first email in the
email list
*/
/*! \fn void OPimContact::clearEmails()
Clears the email list.
*/
/*! \fn void OPimContact::insertEmails( const QStringList &emailList )
Appends the \a emailList to the exiting email list
*/
/*!
Returns a list of email addresses belonging to the contact, including
the default email address.
*/
QStringList OPimContact::emailList() const
{
QString emailStr = emails();
QStringList r;
if ( !emailStr.isEmpty() )
{
qDebug( " emailstr " );
QStringList l = QStringList::split( emailSeparator(), emailStr );
for ( QStringList::ConstIterator it = l.begin();it != l.end();++it )
r += ( *it ).simplifyWhiteSpace();
}
return r;
}
/*!
\overload
Generates the string for the contact to be filed as from the first,
middle and last name of the contact.
*/
void OPimContact::setFileAs()
{
QString lastName, firstName, middleName, fileas;
lastName = find( Qtopia::LastName );
firstName = find( Qtopia::FirstName );
middleName = find( Qtopia::MiddleName );
if ( !lastName.isEmpty() && !firstName.isEmpty()
&& !middleName.isEmpty() )
fileas = lastName + ", " + firstName + " " + middleName;
else if ( !lastName.isEmpty() && !firstName.isEmpty() )
fileas = lastName + ", " + firstName;
else if ( !lastName.isEmpty() || !firstName.isEmpty() ||
!middleName.isEmpty() )
fileas = firstName + ( firstName.isEmpty() ? "" : " " )
+ middleName + ( middleName.isEmpty() ? "" : " " )
+ lastName;
replace( Qtopia::FileAs, fileas );
}
/*!
\internal
Appends the contact information to \a buf.
*/
void OPimContact::save( QString &buf ) const
{
static const QStringList SLFIELDS = fields();
// I'm expecting "<Contact " in front of this...
for ( QMap<int, QString>::ConstIterator it = mMap.begin();
it != mMap.end(); ++it )
{
const QString &value = it.data();
int key = it.key();
if ( !value.isEmpty() )
{
if ( key == Qtopia::AddressCategory || key == Qtopia::AddressUid )
continue;
key -= Qtopia::AddressCategory + 1;
buf += SLFIELDS[ key ];
buf += "=\"" + Qtopia::escapeString( value ) + "\" ";
}
}
buf += customToXml();
if ( categories().count() > 0 )
buf += "Categories=\"" + idsToString( categories() ) + "\" ";
buf += "Uid=\"" + QString::number( uid() ) + "\" ";
// You need to close this yourself
}
/*!
\internal
Returns the list of fields belonging to a contact
Never change order of this list ! It has to be regarding
enum AddressBookFields !!
*/
QStringList OPimContact::fields()
{
QStringList list;
list.append( "Title" ); // Not Used!
list.append( "FirstName" );
list.append( "MiddleName" );
list.append( "LastName" );
list.append( "Suffix" );
list.append( "FileAs" );
list.append( "JobTitle" );
list.append( "Department" );
list.append( "Company" );
list.append( "BusinessPhone" );
list.append( "BusinessFax" );
list.append( "BusinessMobile" );
list.append( "DefaultEmail" );
list.append( "Emails" );
list.append( "HomePhone" );
list.append( "HomeFax" );
list.append( "HomeMobile" );
list.append( "BusinessStreet" );
list.append( "BusinessCity" );
list.append( "BusinessState" );
list.append( "BusinessZip" );
list.append( "BusinessCountry" );
list.append( "BusinessPager" );
list.append( "BusinessWebPage" );
list.append( "Office" );
list.append( "Profession" );
list.append( "Assistant" );
list.append( "Manager" );
list.append( "HomeStreet" );
list.append( "HomeCity" );
list.append( "HomeState" );
list.append( "HomeZip" );
list.append( "HomeCountry" );
list.append( "HomeWebPage" );
list.append( "Spouse" );
list.append( "Gender" );
list.append( "Birthday" );
list.append( "Anniversary" );
list.append( "Nickname" );
list.append( "Children" );
list.append( "Notes" );
list.append( "Groups" );
return list;
}
/*!
Sets the list of email address for contact to those contained in \a str.
Email address should be separated by ';'s.
*/
void OPimContact::setEmails( const QString &str )
{
replace( Qtopia::Emails, str );
if ( str.isEmpty() )
setDefaultEmail( QString::null );
}
/*!
Sets the list of children for the contact to those contained in \a str.
*/
void OPimContact::setChildren( const QString &str )
{
replace( Qtopia::Children, str );
}
/*!
\overload
Returns TRUE if the contact matches the regular expression \a regexp.
Otherwise returns FALSE.
*/
bool OPimContact::match( const QRegExp &r ) const
{
setLastHitField( -1 );
bool match;
match = false;
QMap<int, QString>::ConstIterator it;
for ( it = mMap.begin(); it != mMap.end(); ++it )
{
if ( ( *it ).find( r ) > -1 )
{
setLastHitField( it.key() );
match = true;
break;
}
}
return match;
}
QString OPimContact::toShortText() const
{
return ( fullName() );
}
QString OPimContact::type() const
{
return QString::fromLatin1( "OPimContact" );
}
class QString OPimContact::recordField( int pos ) const
{
QStringList SLFIELDS = fields(); // ?? why this ? (se)
return SLFIELDS[ pos ];
}
// In future releases, we should store birthday and anniversary
// internally as QDate instead of QString !
// QString is always too complicate to interprete (DD.MM.YY, DD/MM/YY, MM/DD/YY, etc..)(se)
/*! \fn void OPimContact::setBirthday( const QDate& date )
Sets the birthday for the contact to \a date. If date is null
the current stored date will be removed.
*/
void OPimContact::setBirthday( const QDate &v )
{
if ( v.isNull() )
{
qWarning( "Remove Birthday" );
replace( Qtopia::Birthday, QString::null );
return ;
}
if ( v.isValid() )
replace( Qtopia::Birthday, OPimDateConversion::dateToString( v ) );
}
/*! \fn void OPimContact::setAnniversary( const QDate &date )
Sets the anniversary of the contact to \a date. If date is
null, the current stored date will be removed.
*/
void OPimContact::setAnniversary( const QDate &v )
{
if ( v.isNull() )
{
qWarning( "Remove Anniversary" );
replace( Qtopia::Anniversary, QString::null );
return ;
}
if ( v.isValid() )
replace( Qtopia::Anniversary, OPimDateConversion::dateToString( v ) );
}
/*! \fn QDate OPimContact::birthday() const
Returns the birthday of the contact.
*/
QDate OPimContact::birthday() const
{
QString str = find( Qtopia::Birthday );
// qWarning ("Birthday %s", str.latin1() );
if ( !str.isEmpty() )
return OPimDateConversion::dateFromString ( str );
else
return QDate();
}
/*! \fn QDate OPimContact::anniversary() const
Returns the anniversary of the contact.
*/
QDate OPimContact::anniversary() const
{
QDate empty;
QString str = find( Qtopia::Anniversary );
// qWarning ("Anniversary %s", str.latin1() );
if ( !str.isEmpty() )
return OPimDateConversion::dateFromString ( str );
else
return empty;
}
void OPimContact::insertEmail( const QString &v )
{
//qDebug("insertEmail %s", v.latin1());
QString e = v.simplifyWhiteSpace();
QString def = defaultEmail();
// if no default, set it as the default email and don't insert
if ( def.isEmpty() )
{
setDefaultEmail( e ); // will insert into the list for us
return ;
}
// otherwise, insert assuming doesn't already exist
QString emailsStr = find( Qtopia::Emails );
if ( emailsStr.contains( e ) )
return ;
if ( !emailsStr.isEmpty() )
emailsStr += emailSeparator();
emailsStr += e;
replace( Qtopia::Emails, emailsStr );
}
void OPimContact::removeEmail( const QString &v )
{
QString e = v.simplifyWhiteSpace();
QString def = defaultEmail();
QString emailsStr = find( Qtopia::Emails );
QStringList emails = emailList();
// otherwise, must first contain it
if ( !emailsStr.contains( e ) )
return ;
// remove it
//qDebug(" removing email from list %s", e.latin1());
emails.remove( e );
// reset the string
emailsStr = emails.join( emailSeparator() ); // Sharp's brain dead separator
replace( Qtopia::Emails, emailsStr );
// if default, then replace the default email with the first one
if ( def == e )
{
//qDebug("removeEmail is default; setting new default");
if ( !emails.count() )
clearEmails();
else // setDefaultEmail will remove e from the list
setDefaultEmail( emails.first() );
}
}
void OPimContact::clearEmails()
{
mMap.remove( Qtopia::DefaultEmail );
mMap.remove( Qtopia::Emails );
}
void OPimContact::setDefaultEmail( const QString &v )
{
QString e = v.simplifyWhiteSpace();
//qDebug("OPimContact::setDefaultEmail %s", e.latin1());
replace( Qtopia::DefaultEmail, e );
if ( !e.isEmpty() )
insertEmail( e );
}
void OPimContact::insertEmails( const QStringList &v )
{
for ( QStringList::ConstIterator it = v.begin(); it != v.end(); ++it )
insertEmail( *it );
}
-int OPimContact::rtti()
+int OPimContact::rtti() const
{
return OPimResolver::AddressBook;
}
void OPimContact::setUid( int i )
{
OPimRecord::setUid( i );
replace( Qtopia::AddressUid , QString::number( i ) );
}
}
diff --git a/libopie2/opiepim/core/opimcontact.h b/libopie2/opiepim/core/opimcontact.h
index 9d3cacc..6891dd6 100644
--- a/libopie2/opiepim/core/opimcontact.h
+++ b/libopie2/opiepim/core/opimcontact.h
@@ -1,256 +1,256 @@
/*
This file is part of the Opie Project
Copyright (C) Stefan Eilers <eilers.stefan@handhelds.org>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OCONTACT_H
#define OCONTACT_H
/* OPIE */
#include <opie2/opimrecord.h>
#include <qpe/recordfields.h>
/* QT */
#include <qdatetime.h>
#include <qstringlist.h>
#if defined(QPC_TEMPLATEDLL)
// MOC_SKIP_BEGIN
QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>;
// MOC_SKIP_END
#endif
namespace Opie
{
class OPimContactPrivate;
/**
* OPimContact 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 OPimContact : public OPimRecord
{
friend class DataSet;
public:
OPimContact();
OPimContact( const QMap<int, QString> &fromMap );
virtual ~OPimContact();
enum DateFormat{
Zip_City_State = 0,
City_State_Zip
};
/*
* do we need to inline them
* if yes do we need to inline them this way?
* -zecke
*/
void setTitle( const QString &v ) { replace( Qtopia::Title, v ); }
void setFirstName( const QString &v ) { replace( Qtopia::FirstName, v ); }
void setMiddleName( const QString &v ) { replace( Qtopia::MiddleName, v ); }
void setLastName( const QString &v ) { replace( Qtopia::LastName, v ); }
void setSuffix( const QString &v ) { replace( Qtopia::Suffix, v ); }
void setFileAs( const QString &v ) { replace( Qtopia::FileAs, v ); }
void setFileAs();
// default email address
void setDefaultEmail( const QString &v );
// inserts email to list and ensure's doesn't already exist
void insertEmail( const QString &v );
void removeEmail( const QString &v );
void clearEmails();
void insertEmails( const QStringList &v );
// home
void setHomeStreet( const QString &v ) { replace( Qtopia::HomeStreet, v ); }
void setHomeCity( const QString &v ) { replace( Qtopia::HomeCity, v ); }
void setHomeState( const QString &v ) { replace( Qtopia::HomeState, v ); }
void setHomeZip( const QString &v ) { replace( Qtopia::HomeZip, v ); }
void setHomeCountry( const QString &v ) { replace( Qtopia::HomeCountry, v ); }
void setHomePhone( const QString &v ) { replace( Qtopia::HomePhone, v ); }
void setHomeFax( const QString &v ) { replace( Qtopia::HomeFax, v ); }
void setHomeMobile( const QString &v ) { replace( Qtopia::HomeMobile, v ); }
void setHomeWebpage( const QString &v ) { replace( Qtopia::HomeWebPage, v ); }
// business
void setCompany( const QString &v ) { replace( Qtopia::Company, v ); }
void setBusinessStreet( const QString &v ) { replace( Qtopia::BusinessStreet, v ); }
void setBusinessCity( const QString &v ) { replace( Qtopia::BusinessCity, v ); }
void setBusinessState( const QString &v ) { replace( Qtopia::BusinessState, v ); }
void setBusinessZip( const QString &v ) { replace( Qtopia::BusinessZip, v ); }
void setBusinessCountry( const QString &v ) { replace( Qtopia::BusinessCountry, v ); }
void setBusinessWebpage( const QString &v ) { replace( Qtopia::BusinessWebPage, v ); }
void setJobTitle( const QString &v ) { replace( Qtopia::JobTitle, v ); }
void setDepartment( const QString &v ) { replace( Qtopia::Department, v ); }
void setOffice( const QString &v ) { replace( Qtopia::Office, v ); }
void setBusinessPhone( const QString &v ) { replace( Qtopia::BusinessPhone, v ); }
void setBusinessFax( const QString &v ) { replace( Qtopia::BusinessFax, v ); }
void setBusinessMobile( const QString &v ) { replace( Qtopia::BusinessMobile, v ); }
void setBusinessPager( const QString &v ) { replace( Qtopia::BusinessPager, v ); }
void setProfession( const QString &v ) { replace( Qtopia::Profession, v ); }
void setAssistant( const QString &v ) { replace( Qtopia::Assistant, v ); }
void setManager( const QString &v ) { replace( Qtopia::Manager, v ); }
// personal
void setSpouse( const QString &v ) { replace( Qtopia::Spouse, v ); }
void setGender( const QString &v ) { replace( Qtopia::Gender, v ); }
void setBirthday( const QDate &v );
void setAnniversary( const QDate &v );
void setNickname( const QString &v ) { replace( Qtopia::Nickname, v ); }
void setChildren( const QString &v );
// other
void setNotes( const QString &v ) { replace( Qtopia::Notes, v ); }
virtual bool match( const QRegExp &regexp ) const;
// // custom
// void setCustomField( const QString &key, const QString &v )
// { replace(Custom- + key, v ); }
// name
QString fullName() const;
QString title() const { return find( Qtopia::Title ); }
QString firstName() const { return find( Qtopia::FirstName ); }
QString middleName() const { return find( Qtopia::MiddleName ); }
QString lastName() const { return find( Qtopia::LastName ); }
QString suffix() const { return find( Qtopia::Suffix ); }
QString fileAs() const { return find( Qtopia::FileAs ); }
// email
QString defaultEmail() const { return find( Qtopia::DefaultEmail ); }
QStringList emailList() const;
// home
/*
* OPimAddress address(enum Location)const;
* would be some how nicer...
* -zecke
*/
QString homeStreet() const { return find( Qtopia::HomeStreet ); }
QString homeCity() const { return find( Qtopia::HomeCity ); }
QString homeState() const { return find( Qtopia::HomeState ); }
QString homeZip() const { return find( Qtopia::HomeZip ); }
QString homeCountry() const { return find( Qtopia::HomeCountry ); }
QString homePhone() const { return find( Qtopia::HomePhone ); }
QString homeFax() const { return find( Qtopia::HomeFax ); }
QString homeMobile() const { return find( Qtopia::HomeMobile ); }
QString homeWebpage() const { return find( Qtopia::HomeWebPage ); }
/** Multi line string containing all non-empty address info in the form
* Street
* City, State Zip
* Country
*/
QString displayHomeAddress() const;
// business
QString company() const { return find( Qtopia::Company ); }
QString businessStreet() const { return find( Qtopia::BusinessStreet ); }
QString businessCity() const { return find( Qtopia::BusinessCity ); }
QString businessState() const { return find( Qtopia::BusinessState ); }
QString businessZip() const { return find( Qtopia::BusinessZip ); }
QString businessCountry() const { return find( Qtopia::BusinessCountry ); }
QString businessWebpage() const { return find( Qtopia::BusinessWebPage ); }
QString jobTitle() const { return find( Qtopia::JobTitle ); }
QString department() const { return find( Qtopia::Department ); }
QString office() const { return find( Qtopia::Office ); }
QString businessPhone() const { return find( Qtopia::BusinessPhone ); }
QString businessFax() const { return find( Qtopia::BusinessFax ); }
QString businessMobile() const { return find( Qtopia::BusinessMobile ); }
QString businessPager() const { return find( Qtopia::BusinessPager ); }
QString profession() const { return find( Qtopia::Profession ); }
QString assistant() const { return find( Qtopia::Assistant ); }
QString manager() const { return find( Qtopia::Manager ); }
/** Multi line string containing all non-empty address info in the form
* Street
* City, State Zip
* Country
*/
QString displayBusinessAddress() const;
//personal
QString spouse() const { return find( Qtopia::Spouse ); }
QString gender() const { return find( Qtopia::Gender ); }
QDate birthday() const;
QDate anniversary() const;
QString nickname() const { return find( Qtopia::Nickname ); }
QString children() const { return find( Qtopia::Children ); }
QStringList childrenList() const;
// other
QString notes() const { return find( Qtopia::Notes ); }
QString groups() const { return find( Qtopia::Groups ); }
QStringList groupList() const;
QString toRichText() const;
QMap<int, QString> toMap() const;
QString field( int key ) const { return find( key ); }
void setUid( int i );
QString toShortText() const;
QString type() const;
class QString recordField( int ) const;
// Why private ? (eilers,se)
QString emailSeparator() const { return " "; }
// the emails should be seperated by a comma
void setEmails( const QString &v );
QString emails() const { return find( Qtopia::Emails ); }
- static int rtti();
+ int rtti() const;
private:
// The XML Backend needs some access to the private functions
friend class OPimContactAccessBackend_XML;
void insert( int key, const QString &value );
void replace( int key, const QString &value );
QString find( int key ) const;
static QStringList fields();
void save( QString &buf ) const;
QString displayAddress( const QString &street,
const QString &city,
const QString &state,
const QString &zip,
const QString &country ) const;
QMap<int, QString> mMap;
OPimContactPrivate *d;
};
}
#endif
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp
index 77730e9..8bf8b25 100644
--- a/libopie2/opiepim/core/opimevent.cpp
+++ b/libopie2/opiepim/core/opimevent.cpp
@@ -1,1022 +1,1022 @@
/*
This file is part of the Opie Project
Copyright (C) Stefan Eilers <Eilers.Stefan@epost.de>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "opimevent.h"
/* OPIE */
#include <opie2/opimrecurrence.h>
#include <opie2/opimresolver.h>
#include <opie2/opimnotifymanager.h>
#include <qpe/categories.h>
#include <qpe/stringutil.h>
/* QT */
namespace Opie
{
int OCalendarHelper::week( const QDate& date )
{
// Calculates the week this date is in within that
// month. Equals the "row" is is in in the month view
int week = 1;
QDate tmp( date.year(), date.month(), 1 );
if ( date.dayOfWeek() < tmp.dayOfWeek() )
++week;
week += ( date.day() - 1 ) / 7;
return week;
}
int OCalendarHelper::ocurrence( const QDate& date )
{
// calculates the number of occurrances of this day of the
// week till the given date (e.g 3rd Wednesday of the month)
return ( date.day() - 1 ) / 7 + 1;
}
int OCalendarHelper::dayOfWeek( char day )
{
int dayOfWeek = 1;
char i = OPimRecurrence::MON;
while ( !( i & day ) && i <= OPimRecurrence::SUN )
{
i <<= 1;
++dayOfWeek;
}
return dayOfWeek;
}
int OCalendarHelper::monthDiff( const QDate& first, const QDate& second )
{
return ( second.year() - first.year() ) * 12 +
second.month() - first.month();
}
struct OPimEvent::Data : public QShared
{
Data() : QShared()
{
child = 0;
recur = 0;
manager = 0;
isAllDay = false;
parent = 0;
}
~Data()
{
delete manager;
delete recur;
}
QString description;
QString location;
OPimNotifyManager* manager;
OPimRecurrence* recur;
QString note;
QDateTime created;
QDateTime start;
QDateTime end;
bool isAllDay : 1;
QString timezone;
QArray<int>* child;
int parent;
};
OPimEvent::OPimEvent( int uid )
: OPimRecord( uid )
{
data = new Data;
}
OPimEvent::OPimEvent( const OPimEvent& ev )
: OPimRecord( ev ), data( ev.data )
{
data->ref();
}
OPimEvent::OPimEvent( const QMap<int, QString> map )
: OPimRecord( 0 )
{
data = new Data;
fromMap( map );
}
OPimEvent::~OPimEvent()
{
if ( data->deref() )
{
delete data;
data = 0;
}
}
OPimEvent& OPimEvent::operator=( const OPimEvent& ev )
{
if ( this == &ev ) return * this;
OPimRecord::operator=( ev );
ev.data->ref();
deref();
data = ev.data;
return *this;
}
QString OPimEvent::description() const
{
return data->description;
}
void OPimEvent::setDescription( const QString& description )
{
changeOrModify();
data->description = description;
}
void OPimEvent::setLocation( const QString& loc )
{
changeOrModify();
data->location = loc;
}
QString OPimEvent::location() const
{
return data->location;
}
OPimNotifyManager &OPimEvent::notifiers() const
{
// I hope we can skip the changeOrModify here
// the notifier should take care of it
// and OPimNotify is shared too
if ( !data->manager )
data->manager = new OPimNotifyManager;
return *data->manager;
}
bool OPimEvent::hasNotifiers() const
{
if ( !data->manager )
return false;
if ( data->manager->reminders().isEmpty() &&
data->manager->alarms().isEmpty() )
return false;
return true;
}
OPimRecurrence OPimEvent::recurrence() const
{
if ( !data->recur )
data->recur = new OPimRecurrence;
return *data->recur;
}
void OPimEvent::setRecurrence( const OPimRecurrence& rec )
{
changeOrModify();
if ( data->recur )
( *data->recur ) = rec;
else
data->recur = new OPimRecurrence( rec );
}
bool OPimEvent::hasRecurrence() const
{
if ( !data->recur ) return false;
return data->recur->doesRecur();
}
QString OPimEvent::note() const
{
return data->note;
}
void OPimEvent::setNote( const QString& note )
{
changeOrModify();
data->note = note;
}
QDateTime OPimEvent::createdDateTime() const
{
return data->created;
}
void OPimEvent::setCreatedDateTime( const QDateTime& time )
{
changeOrModify();
data->created = time;
}
QDateTime OPimEvent::startDateTime() const
{
if ( data->isAllDay )
return QDateTime( data->start.date(), QTime( 0, 0, 0 ) );
return data->start;
}
QDateTime OPimEvent::startDateTimeInZone() const
{
/* if no timezone, or all day event or if the current and this timeZone match... */
if ( data->timezone.isEmpty() || data->isAllDay || data->timezone == OPimTimeZone::current().timeZone() ) return startDateTime();
OPimTimeZone zone( data->timezone );
return zone.toDateTime( data->start, OPimTimeZone::current() );
}
void OPimEvent::setStartDateTime( const QDateTime& dt )
{
changeOrModify();
data->start = dt;
}
QDateTime OPimEvent::endDateTime() const
{
/*
* if all Day event the end time needs
* to be on the same day as the start
*/
if ( data->isAllDay )
return QDateTime( data->start.date(), QTime( 23, 59, 59 ) );
return data->end;
}
QDateTime OPimEvent::endDateTimeInZone() const
{
/* if no timezone, or all day event or if the current and this timeZone match... */
if ( data->timezone.isEmpty() || data->isAllDay || data->timezone == OPimTimeZone::current().timeZone() ) return endDateTime();
OPimTimeZone zone( data->timezone );
return zone.toDateTime( data->end, OPimTimeZone::current() );
}
void OPimEvent::setEndDateTime( const QDateTime& dt )
{
changeOrModify();
data->end = dt;
}
bool OPimEvent::isMultipleDay() const
{
return data->end.date().day() - data->start.date().day();
}
bool OPimEvent::isAllDay() const
{
return data->isAllDay;
}
void OPimEvent::setAllDay( bool allDay )
{
changeOrModify();
data->isAllDay = allDay;
if ( allDay ) data->timezone = "UTC";
}
void OPimEvent::setTimeZone( const QString& tz )
{
changeOrModify();
data->timezone = tz;
}
QString OPimEvent::timeZone() const
{
if ( data->isAllDay ) return QString::fromLatin1( "UTC" );
return data->timezone;
}
bool OPimEvent::match( const QRegExp& re ) const
{
if ( re.match( data->description ) != -1 )
{
setLastHitField( Qtopia::DatebookDescription );
return true;
}
if ( re.match( data->note ) != -1 )
{
setLastHitField( Qtopia::Note );
return true;
}
if ( re.match( data->location ) != -1 )
{
setLastHitField( Qtopia::Location );
return true;
}
if ( re.match( data->start.toString() ) != -1 )
{
setLastHitField( Qtopia::StartDateTime );
return true;
}
if ( re.match( data->end.toString() ) != -1 )
{
setLastHitField( Qtopia::EndDateTime );
return true;
}
return false;
}
QString OPimEvent::toRichText() const
{
QString text, value;
// description
text += "<b><h3><img src=\"datebook/DateBook\">";
if ( !description().isEmpty() )
{
text += Qtopia::escapeString( description() ).replace( QRegExp( "[\n]" ), "" );
}
text += "</h3></b><br><hr><br>";
// location
if ( !( value = location() ).isEmpty() )
{
text += "<b>" + QObject::tr( "Location:" ) + "</b> ";
text += Qtopia::escapeString( value ) + "<br>";
}
// all day event
if ( isAllDay() )
{
text += "<b><i>" + QObject::tr( "This is an all day event" ) + "</i></b><br>";
}
// multiple day event
else if ( isMultipleDay () )
{
text += "<b><i>" + QObject::tr( "This is a multiple day event" ) + "</i></b><br>";
}
// start & end times
else
{
// start time
if ( startDateTime().isValid() )
{
text += "<b>" + QObject::tr( "Start:" ) + "</b> ";
text += Qtopia::escapeString( startDateTime().toString() ).
replace( QRegExp( "[\n]" ), "<br>" ) + "<br>";
}
// end time
if ( endDateTime().isValid() )
{
text += "<b>" + QObject::tr( "End:" ) + "</b> ";
text += Qtopia::escapeString( endDateTime().toString() ).
replace( QRegExp( "[\n]" ), "<br>" ) + "<br>";
}
}
// categories
if ( categoryNames( "Calendar" ).count() )
{
text += "<b>" + QObject::tr( "Category:" ) + "</b> ";
text += categoryNames( "Calendar" ).join( ", " );
text += "<br>";
}
//notes
if ( !note().isEmpty() )
{
text += "<b>" + QObject::tr( "Note:" ) + "</b><br>";
text += note();
// text += Qtopia::escapeString(note() ).
// replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
}
return text;
}
QString OPimEvent::toShortText() const
{
QString text;
text += QString::number( startDateTime().date().day() );
text += ".";
text += QString::number( startDateTime().date().month() );
text += ".";
text += QString::number( startDateTime().date().year() );
text += " ";
text += QString::number( startDateTime().time().hour() );
text += ":";
text += QString::number( startDateTime().time().minute() );
text += " - ";
text += description();
return text;
}
QString OPimEvent::type() const
{
return QString::fromLatin1( "OPimEvent" );
}
QString OPimEvent::recordField( int /*id */ ) const
{
return QString::null;
}
-int OPimEvent::rtti()
+int OPimEvent::rtti() const
{
return OPimResolver::DateBook;
}
bool OPimEvent::loadFromStream( QDataStream& )
{
return true;
}
bool OPimEvent::saveToStream( QDataStream& ) const
{
return true;
}
void OPimEvent::changeOrModify()
{
if ( data->count != 1 )
{
data->deref();
Data* d2 = new Data;
d2->description = data->description;
d2->location = data->location;
if ( data->manager )
d2->manager = new OPimNotifyManager( *data->manager );
if ( data->recur )
d2->recur = new OPimRecurrence( *data->recur );
d2->note = data->note;
d2->created = data->created;
d2->start = data->start;
d2->end = data->end;
d2->isAllDay = data->isAllDay;
d2->timezone = data->timezone;
d2->parent = data->parent;
if ( data->child )
{
d2->child = new QArray<int>( *data->child );
d2->child->detach();
}
data = d2;
}
}
void OPimEvent::deref()
{
if ( data->deref() )
{
delete data;
data = 0;
}
}
// Exporting Event data to map. Using the same
// encoding as ODateBookAccessBackend_xml does..
// Thus, we could remove the stuff there and use this
// for it and for all other places..
// Encoding should happen at one place, only ! (eilers)
QMap<int, QString> OPimEvent::toMap() const
{
QMap<int, QString> retMap;
retMap.insert( OPimEvent::FUid, QString::number( uid() ) );
retMap.insert( OPimEvent::FCategories, Qtopia::escapeString( Qtopia::Record::idsToString( categories() ) ) );
retMap.insert( OPimEvent::FDescription, Qtopia::escapeString( description() ) );
retMap.insert( OPimEvent::FLocation, Qtopia::escapeString( location() ) );
retMap.insert( OPimEvent::FType, isAllDay() ? "AllDay" : "" );
OPimAlarm alarm = notifiers().alarms() [ 0 ];
retMap.insert( OPimEvent::FAlarm, QString::number( alarm.dateTime().secsTo( startDateTime() ) / 60 ) );
retMap.insert( OPimEvent::FSound, ( alarm.sound() == OPimAlarm::Loud ) ? "loud" : "silent" );
OPimTimeZone zone( timeZone().isEmpty() ? OPimTimeZone::current() : timeZone() );
retMap.insert( OPimEvent::FStart, QString::number( zone.fromUTCDateTime( zone.toDateTime( startDateTime(), OPimTimeZone::utc() ) ) ) );
retMap.insert( OPimEvent::FEnd, QString::number( zone.fromUTCDateTime( zone.toDateTime( endDateTime(), OPimTimeZone::utc() ) ) ) );
retMap.insert( OPimEvent::FNote, Qtopia::escapeString( note() ) );
retMap.insert( OPimEvent::FTimeZone, timeZone().isEmpty() ? QString( "None" ) : timeZone() );
if ( parent() )
retMap.insert( OPimEvent::FRecParent, QString::number( parent() ) );
if ( children().count() )
{
QArray<int> childr = children();
QString buf;
for ( uint i = 0; i < childr.count(); i++ )
{
if ( i != 0 ) buf += " ";
buf += QString::number( childr[ i ] );
}
retMap.insert( OPimEvent::FRecChildren, buf );
}
// Add recurrence stuff
if ( hasRecurrence() )
{
OPimRecurrence recur = recurrence();
QMap<int, QString> recFields = recur.toMap();
retMap.insert( OPimEvent::FRType, recFields[ OPimRecurrence::RType ] );
retMap.insert( OPimEvent::FRWeekdays, recFields[ OPimRecurrence::RWeekdays ] );
retMap.insert( OPimEvent::FRPosition, recFields[ OPimRecurrence::RPosition ] );
retMap.insert( OPimEvent::FRFreq, recFields[ OPimRecurrence::RFreq ] );
retMap.insert( OPimEvent::FRHasEndDate, recFields[ OPimRecurrence::RHasEndDate ] );
retMap.insert( OPimEvent::FREndDate, recFields[ OPimRecurrence::EndDate ] );
retMap.insert( OPimEvent::FRCreated, recFields[ OPimRecurrence::Created ] );
retMap.insert( OPimEvent::FRExceptions, recFields[ OPimRecurrence::Exceptions ] );
}
else
{
OPimRecurrence recur = recurrence();
QMap<int, QString> recFields = recur.toMap();
retMap.insert( OPimEvent::FRType, recFields[ OPimRecurrence::RType ] );
}
return retMap;
}
void OPimEvent::fromMap( const QMap<int, QString>& map )
{
// We just want to set the UID if it is really stored.
if ( !map[ OPimEvent::FUid ].isEmpty() )
setUid( map[ OPimEvent::FUid ].toInt() );
setCategories( idsFromString( map[ OPimEvent::FCategories ] ) );
setDescription( map[ OPimEvent::FDescription ] );
setLocation( map[ OPimEvent::FLocation ] );
if ( map[ OPimEvent::FType ] == "AllDay" )
setAllDay( true );
else
setAllDay( false );
int alarmTime = -1;
if ( !map[ OPimEvent::FAlarm ].isEmpty() )
alarmTime = map[ OPimEvent::FAlarm ].toInt();
int sound = ( ( map[ OPimEvent::FSound ] == "loud" ) ? OPimAlarm::Loud : OPimAlarm::Silent );
if ( ( alarmTime != -1 ) )
{
QDateTime dt = startDateTime().addSecs( -1 * alarmTime * 60 );
OPimAlarm al( sound , dt );
notifiers().add( al );
}
if ( !map[ OPimEvent::FTimeZone ].isEmpty() && ( map[ OPimEvent::FTimeZone ] != "None" ) )
{
setTimeZone( map[ OPimEvent::FTimeZone ] );
}
time_t start = ( time_t ) map[ OPimEvent::FStart ].toLong();
time_t end = ( time_t ) map[ OPimEvent::FEnd ].toLong();
/* AllDay is always in UTC */
if ( isAllDay() )
{
OPimTimeZone utc = OPimTimeZone::utc();
setStartDateTime( utc.fromUTCDateTime( start ) );
setEndDateTime ( utc.fromUTCDateTime( end ) );
setTimeZone( "UTC" ); // make sure it is really utc
}
else
{
/* to current date time */
// qWarning(" Start is %d", start );
OPimTimeZone zone( timeZone().isEmpty() ? OPimTimeZone::current() : timeZone() );
QDateTime date = zone.toDateTime( start );
qWarning( " Start is %s", date.toString().latin1() );
setStartDateTime( zone.toDateTime( date, OPimTimeZone::current() ) );
date = zone.toDateTime( end );
setEndDateTime ( zone.toDateTime( date, OPimTimeZone::current() ) );
}
if ( !map[ OPimEvent::FRecParent ].isEmpty() )
setParent( map[ OPimEvent::FRecParent ].toInt() );
if ( !map[ OPimEvent::FRecChildren ].isEmpty() )
{
QStringList list = QStringList::split( ' ', map[ OPimEvent::FRecChildren ] );
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
addChild( ( *it ).toInt() );
}
}
// Fill recurrence stuff and put it directly into the OPimRecurrence-Object using fromMap..
if ( !map[ OPimEvent::FRType ].isEmpty() )
{
QMap<int, QString> recFields;
recFields.insert( OPimRecurrence::RType, map[ OPimEvent::FRType ] );
recFields.insert( OPimRecurrence::RWeekdays, map[ OPimEvent::FRWeekdays ] );
recFields.insert( OPimRecurrence::RPosition, map[ OPimEvent::FRPosition ] );
recFields.insert( OPimRecurrence::RFreq, map[ OPimEvent::FRFreq ] );
recFields.insert( OPimRecurrence::RHasEndDate, map[ OPimEvent::FRHasEndDate ] );
recFields.insert( OPimRecurrence::EndDate, map[ OPimEvent::FREndDate ] );
recFields.insert( OPimRecurrence::Created, map[ OPimEvent::FRCreated ] );
recFields.insert( OPimRecurrence::Exceptions, map[ OPimEvent::FRExceptions ] );
OPimRecurrence recur( recFields );
setRecurrence( recur );
}
}
int OPimEvent::parent() const
{
return data->parent;
}
void OPimEvent::setParent( int uid )
{
changeOrModify();
data->parent = uid;
}
QArray<int> OPimEvent::children() const
{
if ( !data->child ) return QArray<int>();
else
return data->child->copy();
}
void OPimEvent::setChildren( const QArray<int>& arr )
{
changeOrModify();
if ( data->child ) delete data->child;
data->child = new QArray<int>( arr );
data->child->detach();
}
void OPimEvent::addChild( int uid )
{
changeOrModify();
if ( !data->child )
{
data->child = new QArray<int>( 1 );
( *data->child ) [ 0 ] = uid;
}
else
{
int count = data->child->count();
data->child->resize( count + 1 );
( *data->child ) [ count ] = uid;
}
}
void OPimEvent::removeChild( int uid )
{
if ( !data->child || !data->child->contains( uid ) ) return ;
changeOrModify();
QArray<int> newAr( data->child->count() - 1 );
int j = 0;
uint count = data->child->count();
for ( uint i = 0; i < count; i++ )
{
if ( ( *data->child ) [ i ] != uid )
{
newAr[ j ] = ( *data->child ) [ i ];
j++;
}
}
( *data->child ) = newAr;
}
struct OEffectiveEvent::Data : public QShared
{
Data() : QShared()
{}
OPimEvent event;
QDate date;
QTime start, end;
QDate startDate, endDate;
bool dates : 1;
};
OEffectiveEvent::OEffectiveEvent()
{
data = new Data;
data->date = QDate::currentDate();
data->start = data->end = QTime::currentTime();
data->dates = false;
}
OEffectiveEvent::OEffectiveEvent( const OPimEvent& ev, const QDate& startDate,
Position pos )
{
data = new Data;
data->event = ev;
data->date = startDate;
if ( pos & Start )
data->start = ev.startDateTime().time();
else
data->start = QTime( 0, 0, 0 );
if ( pos & End )
data->end = ev.endDateTime().time();
else
data->end = QTime( 23, 59, 59 );
data->dates = false;
}
OEffectiveEvent::OEffectiveEvent( const OEffectiveEvent& ev )
{
data = ev.data;
data->ref();
}
OEffectiveEvent::~OEffectiveEvent()
{
if ( data->deref() )
{
delete data;
data = 0;
}
}
OEffectiveEvent& OEffectiveEvent::operator=( const OEffectiveEvent& ev )
{
if ( *this == ev ) return * this;
ev.data->ref();
deref();
data = ev.data;
return *this;
}
void OEffectiveEvent::setStartTime( const QTime& ti )
{
changeOrModify();
data->start = ti;
}
void OEffectiveEvent::setEndTime( const QTime& en )
{
changeOrModify();
data->end = en;
}
void OEffectiveEvent::setEvent( const OPimEvent& ev )
{
changeOrModify();
data->event = ev;
}
void OEffectiveEvent::setDate( const QDate& da )
{
changeOrModify();
data->date = da;
}
void OEffectiveEvent::setEffectiveDates( const QDate& from,
const QDate& to )
{
if ( !from.isValid() )
{
data->dates = false;
return ;
}
data->startDate = from;
data->endDate = to;
}
QString OEffectiveEvent::description() const
{
return data->event.description();
}
QString OEffectiveEvent::location() const
{
return data->event.location();
}
QString OEffectiveEvent::note() const
{
return data->event.note();
}
OPimEvent OEffectiveEvent::event() const
{
return data->event;
}
QTime OEffectiveEvent::startTime() const
{
return data->start;
}
QTime OEffectiveEvent::endTime() const
{
return data->end;
}
QDate OEffectiveEvent::date() const
{
return data->date;
}
int OEffectiveEvent::length() const
{
return ( data->end.hour() * 60 - data->start.hour() * 60 )
+ QABS( data->start.minute() - data->end.minute() );
}
int OEffectiveEvent::size() const
{
return ( data->end.hour() - data->start.hour() ) * 3600
+ ( data->end.minute() - data->start.minute() * 60
+ data->end.second() - data->start.second() );
}
QDate OEffectiveEvent::startDate() const
{
if ( data->dates )
return data->startDate;
else if ( data->event.hasRecurrence() ) // single day, since multi-day should have a d pointer
return data->date;
else
return data->event.startDateTime().date();
}
QDate OEffectiveEvent::endDate() const
{
if ( data->dates )
return data->endDate;
else if ( data->event.hasRecurrence() )
return data->date;
else
return data->event.endDateTime().date();
}
void OEffectiveEvent::deref()
{
if ( data->deref() )
{
delete data;
data = 0;
}
}
void OEffectiveEvent::changeOrModify()
{
if ( data->count != 1 )
{
data->deref();
Data* d2 = new Data;
d2->event = data->event;
d2->date = data->date;
d2->start = data->start;
d2->end = data->end;
d2->startDate = data->startDate;
d2->endDate = data->endDate;
d2->dates = data->dates;
data = d2;
}
}
bool OEffectiveEvent::operator<( const OEffectiveEvent &e ) const
{
if ( data->date < e.date() )
return TRUE;
if ( data->date == e.date() )
return ( startTime() < e.startTime() );
else
return FALSE;
}
bool OEffectiveEvent::operator<=( const OEffectiveEvent &e ) const
{
return ( data->date <= e.date() );
}
bool OEffectiveEvent::operator==( const OEffectiveEvent &e ) const
{
return ( date() == e.date()
&& startTime() == e.startTime()
&& endTime() == e.endTime()
&& event() == e.event() );
}
bool OEffectiveEvent::operator!=( const OEffectiveEvent &e ) const
{
return !( *this == e );
}
bool OEffectiveEvent::operator>( const OEffectiveEvent &e ) const
{
return !( *this <= e );
}
bool OEffectiveEvent::operator>= ( const OEffectiveEvent &e ) const
{
return !( *this < e );
}
}
diff --git a/libopie2/opiepim/core/opimevent.h b/libopie2/opiepim/core/opimevent.h
index 949f263..56fe917 100644
--- a/libopie2/opiepim/core/opimevent.h
+++ b/libopie2/opiepim/core/opimevent.h
@@ -1,275 +1,275 @@
/*
This file is part of the Opie Project
Copyright (C) Stefan Eilers <Eilers.Stefan@epost.de>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
// CONTAINS GPLed code of TT
#ifndef OEVENT_H
#define OEVENT_H
/* OPIE */
#include <opie2/opimtimezone.h>
#include <opie2/opimrecord.h>
#include <qpe/recordfields.h>
#include <qpe/palmtopuidgen.h>
/* QT */
#include <qstring.h>
#include <qdatetime.h>
#include <qvaluelist.h>
namespace Opie
{
struct OCalendarHelper
{
/** calculate the week number of the date */
static int week( const QDate& );
/** calculate the occurence of week days since the start of the month */
static int ocurrence( const QDate& );
// returns the dayOfWeek for the *first* day it finds (ignores
// any further days!). Returns 1 (Monday) if there isn't any day found
static int dayOfWeek( char day );
/** returns the diff of month */
static int monthDiff( const QDate& first, const QDate& second );
};
class OPimNotifyManager;
class OPimRecurrence;
/**
* This is the container for all Events. It encapsules all
* available information for a single Event
* @short container for events.
*/
class OPimEvent : public OPimRecord
{
public:
typedef QValueList<OPimEvent> ValueList;
/**
* RecordFields contain possible attributes
* used in the Results of toMap()..
*/
enum RecordFields {
FUid = Qtopia::UID_ID,
FCategories = Qtopia::CATEGORY_ID,
FDescription = 0,
FLocation,
FType,
FAlarm,
FSound,
FRType,
FRWeekdays,
FRPosition,
FRFreq,
FRHasEndDate,
FREndDate,
FRCreated,
FRExceptions,
FStart,
FEnd,
FNote,
FTimeZone,
FRecParent,
FRecChildren,
};
/**
* Start with an Empty OPimEvent. UID == 0 means that it is empty
*/
OPimEvent( int uid = 0 );
/**
* copy c'tor
*/
OPimEvent( const OPimEvent& );
/**
* Create OPimEvent, initialized by map
* @see enum RecordFields
*/
OPimEvent( const QMap<int, QString> map );
~OPimEvent();
OPimEvent &operator=( const OPimEvent& );
QString description() const;
void setDescription( const QString& description );
QString location() const;
void setLocation( const QString& loc );
bool hasNotifiers() const;
OPimNotifyManager &notifiers() const;
OPimRecurrence recurrence() const;
void setRecurrence( const OPimRecurrence& );
bool hasRecurrence() const;
QString note() const;
void setNote( const QString& note );
QDateTime createdDateTime() const;
void setCreatedDateTime( const QDateTime& dt );
/** set the date to dt. dt is the QDateTime in localtime */
void setStartDateTime( const QDateTime& );
/** returns the datetime in the local timeZone */
QDateTime startDateTime() const;
/** returns the start datetime in the current zone */
QDateTime startDateTimeInZone() const;
/** in current timezone */
void setEndDateTime( const QDateTime& );
/** in current timezone */
QDateTime endDateTime() const;
QDateTime endDateTimeInZone() const;
bool isMultipleDay() const;
bool isAllDay() const;
void setAllDay( bool isAllDay );
/* pin this event to a timezone! FIXME */
void setTimeZone( const QString& timeZone );
QString timeZone() const;
virtual bool match( const QRegExp& ) const;
/** For exception to recurrence here is a list of children... */
QArray<int> children() const;
void setChildren( const QArray<int>& );
void addChild( int uid );
void removeChild( int uid );
/** return the parent OPimEvent */
int parent() const;
void setParent( int uid );
/* needed reimp */
QString toRichText() const;
QString toShortText() const;
QString type() const;
QMap<int, QString> toMap() const;
void fromMap( const QMap<int, QString>& map );
QString recordField( int ) const;
- static int rtti();
+ int rtti() const;
bool loadFromStream( QDataStream& );
bool saveToStream( QDataStream& ) const;
/* bool operator==( const OPimEvent& );
bool operator!=( const OPimEvent& );
bool operator<( const OPimEvent& );
bool operator<=( const OPimEvent& );
bool operator>( const OPimEvent& );
bool operator>=(const OPimEvent& );
*/
private:
inline void changeOrModify();
void deref();
struct Data;
Data* data;
class Private;
Private* priv;
};
/**
* 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 };
// If we calculate the effective event of a multi-day event
// we have to figure out whether we are at the first day,
// at the end, or anywhere else ("middle"). This is important
// for the start/end times (00:00/23:59)
// MidWay: 00:00 -> 23:59, as we are "in the middle" of a multi-
// day event
// Start: start time -> 23:59
// End: 00:00 -> end time
// Start | End == StartEnd: for single-day events (default)
// here we draw start time -> end time
OEffectiveEvent();
OEffectiveEvent( const OPimEvent& event, const QDate& startDate, Position pos = StartEnd );
OEffectiveEvent( const OEffectiveEvent& );
OEffectiveEvent &operator=( const OEffectiveEvent& );
~OEffectiveEvent();
void setStartTime( const QTime& );
void setEndTime( const QTime& );
void setEvent( const OPimEvent& );
void setDate( const QDate& );
void setEffectiveDates( const QDate& from, const QDate& to );
QString description() const;
QString location() const;
QString note() const;
OPimEvent event() const;
QTime startTime() const;
QTime endTime() const;
QDate date() const;
/* return the length in hours */
int length() const;
int size() const;
QDate startDate() const;
QDate endDate() const;
bool operator<( const OEffectiveEvent &e ) const;
bool operator<=( const OEffectiveEvent &e ) const;
bool operator==( const OEffectiveEvent &e ) const;
bool operator!=( const OEffectiveEvent &e ) const;
bool operator>( const OEffectiveEvent &e ) const;
bool operator>= ( const OEffectiveEvent &e ) const;
private:
void deref();
inline void changeOrModify();
class Private;
Private* priv;
struct Data;
Data* data;
};
}
#endif
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp
index 67eed41..c783092 100644
--- a/libopie2/opiepim/core/opimrecord.cpp
+++ b/libopie2/opiepim/core/opimrecord.cpp
@@ -1,273 +1,273 @@
/*
This file is part of the Opie Project
Copyright (C) The Main Author <main-author@whereever.org>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "opimrecord.h"
/* OPIE */
#include <qpe/categories.h>
#include <qpe/categoryselect.h>
/* QT */
namespace Opie
{
Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia );
OPimRecord::OPimRecord( int uid )
: Qtopia::Record()
{
m_lastHit = -1;
setUid( uid );
}
OPimRecord::~OPimRecord()
{}
OPimRecord::OPimRecord( const OPimRecord& rec )
: Qtopia::Record( rec )
{
( *this ) = rec;
}
OPimRecord &OPimRecord::operator=( const OPimRecord& rec )
{
if ( this == &rec ) return * this;
Qtopia::Record::operator=( rec );
m_xrefman = rec.m_xrefman;
m_lastHit = rec.m_lastHit;
return *this;
}
/*
* category names
*/
QStringList OPimRecord::categoryNames( const QString& appname ) const
{
QStringList list;
QArray<int> cats = categories();
Categories catDB;
catDB.load( categoryFileName() );
for ( uint i = 0; i < cats.count(); i++ )
{
list << catDB.label( appname, cats[ i ] );
}
return list;
}
void OPimRecord::setCategoryNames( const QStringList& )
{
}
void OPimRecord::addCategoryName( const QString& )
{
Categories catDB;
catDB.load( categoryFileName() );
}
bool OPimRecord::isEmpty() const
{
return ( uid() == 0 );
}
/*QString OPimRecord::crossToString()const {
QString str;
QMap<QString, QArray<int> >::ConstIterator it;
for (it = m_relations.begin(); it != m_relations.end(); ++it ) {
QArray<int> id = it.data();
for ( uint i = 0; i < id.size(); ++i ) {
str += it.key() + "," + QString::number( i ) + ";";
}
}
str = str.remove( str.length()-1, 1); // strip the ;
//qWarning("IDS " + str );
return str;
}*/
/* if uid = 1 assign a new one */
void OPimRecord::setUid( int uid )
{
if ( uid == 1 )
uid = uidGen().generate();
Qtopia::Record::setUid( uid );
};
Qtopia::UidGen &OPimRecord::uidGen()
{
return m_uidGen;
}
OPimXRefManager &OPimRecord::xrefmanager()
{
return m_xrefman;
}
-int OPimRecord::rtti()
+int OPimRecord::rtti() const
{
return 0;
}
/**
* now let's put our data into the stream
*/
/*
* First read UID
* Categories
* XRef
*/
bool OPimRecord::loadFromStream( QDataStream& stream )
{
int Int;
uint UInt;
stream >> Int;
setUid( Int );
/** Categories */
stream >> UInt;
QArray<int> array( UInt );
for ( uint i = 0; i < UInt; i++ )
{
stream >> array[ i ];
}
setCategories( array );
/*
* now we do the X-Ref stuff
*/
OPimXRef xref;
stream >> UInt;
for ( uint i = 0; i < UInt; i++ )
{
xref.setPartner( OPimXRef::One, partner( stream ) );
xref.setPartner( OPimXRef::Two, partner( stream ) );
m_xrefman.add( xref );
}
return true;
}
bool OPimRecord::saveToStream( QDataStream& stream ) const
{
/** UIDs */
stream << uid();
/** Categories */
stream << categories().count();
for ( uint i = 0; i < categories().count(); i++ )
{
stream << categories() [ i ];
}
/*
* first the XRef count
* then the xrefs
*/
stream << m_xrefman.list().count();
for ( OPimXRef::ValueList::ConstIterator it = m_xrefman.list().begin();
it != m_xrefman.list().end(); ++it )
{
flush( ( *it ).partner( OPimXRef::One ), stream );
flush( ( *it ).partner( OPimXRef::Two ), stream );
}
return true;
}
void OPimRecord::flush( const OPimXRefPartner& par, QDataStream& str ) const
{
str << par.service();
str << par.uid();
str << par.field();
}
OPimXRefPartner OPimRecord::partner( QDataStream& stream )
{
OPimXRefPartner par;
QString str;
int i;
stream >> str;
par.setService( str );
stream >> i;
par.setUid( i );
stream >> i ;
par.setField( i );
return par;
}
void OPimRecord::setLastHitField( int lastHit ) const
{
m_lastHit = lastHit;
}
int OPimRecord::lastHitField() const
{
return m_lastHit;
}
QMap<QString, QString> OPimRecord::toExtraMap() const
{
return customMap;
}
void OPimRecord::setExtraMap( const QMap<QString, QString>& map )
{
customMap = map;
}
}
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
index 4981a41..127439a 100644
--- a/libopie2/opiepim/core/opimrecord.h
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -1,193 +1,193 @@
/*
This file is part of the Opie Project
Copyright (C) The Main Author <main-author@whereever.org>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OPIMRECORD_H
#define OPIMRECORD_H
/* OPIE */
#include <opie2/opimxrefmanager.h>
/*
* we need to get customMap which is private...
*/
#define private protected
#include <qpe/palmtoprecord.h>
#undef private
/* QT */
#include <qdatastream.h>
#include <qmap.h>
#include <qstring.h>
#include <qstringlist.h>
namespace Opie
{
/**
* This is the base class for
* all PIM Records
*
*/
class OPimRecord : public Qtopia::Record
{
public:
/**
* c'tor
* uid of 0 isEmpty
* uid of 1 will be assigned a new one
*/
OPimRecord( int uid = 0 );
~OPimRecord();
/**
* copy c'tor
*/
OPimRecord( const OPimRecord& rec );
/**
* copy operator
*/
OPimRecord &operator=( const OPimRecord& );
/**
* category names resolved
*/
QStringList categoryNames( const QString& appname ) const;
/**
* set category names they will be resolved
*/
void setCategoryNames( const QStringList& );
/**
* addCategoryName adds a name
* to the internal category list
*/
void addCategoryName( const QString& );
/**
* if a Record isEmpty
* it's empty if it's 0
*/
virtual bool isEmpty() const;
/**
* toRichText summary
*/
virtual QString toRichText() const = 0;
/**
* a small one line summary
*/
virtual QString toShortText() const = 0;
/**
* the name of the Record
*/
virtual QString type() const = 0;
/**
* matches the Records the regular expression?
*/
virtual bool match( const QString &regexp ) const
{
setLastHitField( -1 );
return Qtopia::Record::match( QRegExp( regexp ) );
};
/**
* if implemented this function returns which item has been
* last hit by the match() function.
* or -1 if not implemented or no hit has occured
*/
int lastHitField() const;
/**
* converts the internal structure to a map
*/
virtual QMap<int, QString> toMap() const = 0;
// virtual fromMap( const <int, QString>& map ) = 0; // Should be added in the future (eilers)
/**
* key value representation of extra items
*/
QMap<QString, QString> toExtraMap() const;
void setExtraMap( const QMap<QString, QString>& );
/**
* the name for a recordField
*/
virtual QString recordField( int ) const = 0;
/**
* returns a reference of the
* Cross Reference Manager
* Partner 'One' is THIS PIM RECORD!
* 'Two' is the Partner where we link to
*/
OPimXRefManager& xrefmanager();
/**
* set the uid
*/
virtual void setUid( int uid );
/*
* used inside the Templates for casting
* REIMPLEMENT in your ....
*/
- static int rtti();
+ virtual int rtti() const;
/**
* some marshalling and de marshalling code
* saves the OPimRecord
* to and from a DataStream
*/
virtual bool loadFromStream( QDataStream& );
virtual bool saveToStream( QDataStream& stream ) const;
protected:
// need to be const cause it is called from const methods
mutable int m_lastHit;
void setLastHitField( int lastHit ) const;
Qtopia::UidGen &uidGen();
// QString crossToString()const;
private:
class OPimRecordPrivate;
OPimRecordPrivate *d;
OPimXRefManager m_xrefman;
static Qtopia::UidGen m_uidGen;
private:
void flush( const OPimXRefPartner&, QDataStream& stream ) const;
OPimXRefPartner partner( QDataStream& );
};
}
#endif
diff --git a/libopie2/opiepim/core/opimtodo.cpp b/libopie2/opiepim/core/opimtodo.cpp
index f246bfd..47433e0 100644
--- a/libopie2/opiepim/core/opimtodo.cpp
+++ b/libopie2/opiepim/core/opimtodo.cpp
@@ -1,711 +1,711 @@
/*
This file is part of the Opie Project
Copyright (C) The Main Author <main-author@whereever.org>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "opimtodo.h"
/* OPIE */
#include <opie2/opimstate.h>
#include <opie2/opimrecurrence.h>
#include <opie2/opimmaintainer.h>
#include <opie2/opimnotifymanager.h>
#include <opie2/opimresolver.h>
#include <qpe/palmtopuidgen.h>
#include <qpe/palmtoprecord.h>
#include <qpe/categories.h>
#include <qpe/categoryselect.h>
#include <qpe/stringutil.h>
/* QT */
#include <qobject.h>
#include <qshared.h>
namespace Opie
{
struct OPimTodo::OPimTodoData : public QShared
{
OPimTodoData() : QShared()
{
recur = 0;
state = 0;
maintainer = 0;
notifiers = 0;
};
~OPimTodoData()
{
delete recur;
delete maintainer;
delete notifiers;
}
QDate date;
bool isCompleted: 1;
bool hasDate: 1;
int priority;
QString desc;
QString sum;
QMap<QString, QString> extra;
ushort prog;
OPimState *state;
OPimRecurrence *recur;
OPimMaintainer *maintainer;
QDate start;
QDate completed;
OPimNotifyManager *notifiers;
};
OPimTodo::OPimTodo( const OPimTodo &event )
: OPimRecord( event ), data( event.data )
{
data->ref();
// qWarning("ref up");
}
OPimTodo::~OPimTodo()
{
// qWarning("~OPimTodo " );
if ( data->deref() )
{
// qWarning("OPimTodo::dereffing");
delete data;
data = 0l;
}
}
OPimTodo::OPimTodo( bool completed, int priority,
const QArray<int> &category,
const QString& summary,
const QString &description,
ushort progress,
bool hasDate, QDate date, int uid )
: OPimRecord( uid )
{
// qWarning("OPimTodoData " + summary);
setCategories( category );
data = new OPimTodoData;
data->date = date;
data->isCompleted = completed;
data->hasDate = hasDate;
data->priority = priority;
data->sum = summary;
data->prog = progress;
data->desc = Qtopia::simplifyMultiLineSpace( description );
}
OPimTodo::OPimTodo( bool completed, int priority,
const QStringList &category,
const QString& summary,
const QString &description,
ushort progress,
bool hasDate, QDate date, int uid )
: OPimRecord( uid )
{
// qWarning("OPimTodoData" + summary);
setCategories( idsFromString( category.join( ";" ) ) );
data = new OPimTodoData;
data->date = date;
data->isCompleted = completed;
data->hasDate = hasDate;
data->priority = priority;
data->sum = summary;
data->prog = progress;
data->desc = Qtopia::simplifyMultiLineSpace( description );
}
bool OPimTodo::match( const QRegExp &regExp ) const
{
if ( QString::number( data->priority ).find( regExp ) != -1 )
{
setLastHitField( Priority );
return true;
}
else if ( data->hasDate && data->date.toString().find( regExp ) != -1 )
{
setLastHitField( HasDate );
return true;
}
else if ( data->desc.find( regExp ) != -1 )
{
setLastHitField( Description );
return true;
}
else if ( data->sum.find( regExp ) != -1 )
{
setLastHitField( Summary );
return true;
}
return false;
}
bool OPimTodo::isCompleted() const
{
return data->isCompleted;
}
bool OPimTodo::hasDueDate() const
{
return data->hasDate;
}
bool OPimTodo::hasStartDate() const
{
return data->start.isValid();
}
bool OPimTodo::hasCompletedDate() const
{
return data->completed.isValid();
}
int OPimTodo::priority() const
{
return data->priority;
}
QString OPimTodo::summary() const
{
return data->sum;
}
ushort OPimTodo::progress() const
{
return data->prog;
}
QDate OPimTodo::dueDate() const
{
return data->date;
}
QDate OPimTodo::startDate() const
{
return data->start;
}
QDate OPimTodo::completedDate() const
{
return data->completed;
}
QString OPimTodo::description() const
{
return data->desc;
}
bool OPimTodo::hasState() const
{
if ( !data->state ) return false;
return ( data->state->state() != OPimState::Undefined );
}
OPimState OPimTodo::state() const
{
if ( !data->state )
{
OPimState state;
return state;
}
return ( *data->state );
}
bool OPimTodo::hasRecurrence() const
{
if ( !data->recur ) return false;
return data->recur->doesRecur();
}
OPimRecurrence OPimTodo::recurrence() const
{
if ( !data->recur ) return OPimRecurrence();
return ( *data->recur );
}
bool OPimTodo::hasMaintainer() const
{
if ( !data->maintainer ) return false;
return ( data->maintainer->mode() != OPimMaintainer::Undefined );
}
OPimMaintainer OPimTodo::maintainer() const
{
if ( !data->maintainer ) return OPimMaintainer();
return ( *data->maintainer );
}
void OPimTodo::setCompleted( bool completed )
{
changeOrModify();
data->isCompleted = completed;
}
void OPimTodo::setHasDueDate( bool hasDate )
{
changeOrModify();
data->hasDate = hasDate;
}
void OPimTodo::setDescription( const QString &desc )
{
// qWarning( "desc " + desc );
changeOrModify();
data->desc = Qtopia::simplifyMultiLineSpace( desc );
}
void OPimTodo::setSummary( const QString& sum )
{
changeOrModify();
data->sum = sum;
}
void OPimTodo::setPriority( int prio )
{
changeOrModify();
data->priority = prio;
}
void OPimTodo::setDueDate( const QDate& date )
{
changeOrModify();
data->date = date;
}
void OPimTodo::setStartDate( const QDate& date )
{
changeOrModify();
data->start = date;
}
void OPimTodo::setCompletedDate( const QDate& date )
{
changeOrModify();
data->completed = date;
}
void OPimTodo::setState( const OPimState& state )
{
changeOrModify();
if ( data->state )
( *data->state ) = state;
else
data->state = new OPimState( state );
}
void OPimTodo::setRecurrence( const OPimRecurrence& rec )
{
changeOrModify();
if ( data->recur )
( *data->recur ) = rec;
else
data->recur = new OPimRecurrence( rec );
}
void OPimTodo::setMaintainer( const OPimMaintainer& pim )
{
changeOrModify();
if ( data->maintainer )
( *data->maintainer ) = pim;
else
data->maintainer = new OPimMaintainer( pim );
}
bool OPimTodo::isOverdue( )
{
if ( data->hasDate && !data->isCompleted )
return QDate::currentDate() > data->date;
return false;
}
void OPimTodo::setProgress( ushort progress )
{
changeOrModify();
data->prog = progress;
}
QString OPimTodo::toShortText() const
{
return summary();
}
/*!
Returns a richt text string
*/
QString OPimTodo::toRichText() const
{
QString text;
QStringList catlist;
// summary
text += "<b><h3><img src=\"todo/TodoList\"> ";
if ( !summary().isEmpty() )
{
text += Qtopia::escapeString( summary() ).replace( QRegExp( "[\n]" ), "" );
}
text += "</h3></b><br><hr><br>";
// description
if ( !description().isEmpty() )
{
text += "<b>" + QObject::tr( "Description:" ) + "</b><br>";
text += Qtopia::escapeString( description() ).replace( QRegExp( "[\n]" ), "<br>" ) + "<br>";
}
// priority
int priorityval = priority();
text += "<b>" + QObject::tr( "Priority:" ) + " </b><img src=\"todo/priority" +
QString::number( priorityval ) + "\"> ";
switch ( priorityval )
{
case 1 : text += QObject::tr( "Very high" );
break;
case 2 : text += QObject::tr( "High" );
break;
case 3 : text += QObject::tr( "Normal" );
break;
case 4 : text += QObject::tr( "Low" );
break;
case 5 : text += QObject::tr( "Very low" );
break;
};
text += "<br>";
// progress
text += "<b>" + QObject::tr( "Progress:" ) + " </b>"
+ QString::number( progress() ) + " %<br>";
// due date
if ( hasDueDate() )
{
QDate dd = dueDate();
int off = QDate::currentDate().daysTo( dd );
text += "<b>" + QObject::tr( "Deadline:" ) + " </b><font color=\"";
if ( off < 0 )
text += "#FF0000";
else if ( off == 0 )
text += "#FFFF00";
else if ( off > 0 )
text += "#00FF00";
text += "\">" + dd.toString() + "</font><br>";
}
// categories
text += "<b>" + QObject::tr( "Category:" ) + "</b> ";
text += categoryNames( "Todo List" ).join( ", " );
text += "<br>";
return text;
}
bool OPimTodo::hasNotifiers() const
{
if ( !data->notifiers ) return false;
return !data->notifiers->isEmpty();
}
OPimNotifyManager& OPimTodo::notifiers()
{
if ( !data->notifiers )
data->notifiers = new OPimNotifyManager;
return ( *data->notifiers );
}
const OPimNotifyManager& OPimTodo::notifiers() const
{
if ( !data->notifiers )
data->notifiers = new OPimNotifyManager;
return ( *data->notifiers );
}
bool OPimTodo::operator<( const OPimTodo &toDoEvent ) const
{
if ( !hasDueDate() && !toDoEvent.hasDueDate() ) return true;
if ( !hasDueDate() && toDoEvent.hasDueDate() ) return false;
if ( hasDueDate() && toDoEvent.hasDueDate() )
{
if ( dueDate() == toDoEvent.dueDate() )
{ // let's the priority decide
return priority() < toDoEvent.priority();
}
else
{
return dueDate() < toDoEvent.dueDate();
}
}
return false;
}
bool OPimTodo::operator<=( const OPimTodo &toDoEvent ) const
{
if ( !hasDueDate() && !toDoEvent.hasDueDate() ) return true;
if ( !hasDueDate() && toDoEvent.hasDueDate() ) return true;
if ( hasDueDate() && toDoEvent.hasDueDate() )
{
if ( dueDate() == toDoEvent.dueDate() )
{ // let's the priority decide
return priority() <= toDoEvent.priority();
}
else
{
return dueDate() <= toDoEvent.dueDate();
}
}
return true;
}
bool OPimTodo::operator>( const OPimTodo &toDoEvent ) const
{
if ( !hasDueDate() && !toDoEvent.hasDueDate() ) return false;
if ( !hasDueDate() && toDoEvent.hasDueDate() ) return false;
if ( hasDueDate() && toDoEvent.hasDueDate() )
{
if ( dueDate() == toDoEvent.dueDate() )
{ // let's the priority decide
return priority() > toDoEvent.priority();
}
else
{
return dueDate() > toDoEvent.dueDate();
}
}
return false;
}
bool OPimTodo::operator>=( const OPimTodo &toDoEvent ) const
{
if ( !hasDueDate() && !toDoEvent.hasDueDate() ) return true;
if ( !hasDueDate() && toDoEvent.hasDueDate() ) return false;
if ( hasDueDate() && toDoEvent.hasDueDate() )
{
if ( dueDate() == toDoEvent.dueDate() )
{ // let's the priority decide
return priority() > toDoEvent.priority();
}
else
{
return dueDate() > toDoEvent.dueDate();
}
}
return true;
}
bool OPimTodo::operator==( const OPimTodo &toDoEvent ) const
{
if ( data->priority != toDoEvent.data->priority ) return false;
if ( data->priority != toDoEvent.data->prog ) return false;
if ( data->isCompleted != toDoEvent.data->isCompleted ) return false;
if ( data->hasDate != toDoEvent.data->hasDate ) return false;
if ( data->date != toDoEvent.data->date ) return false;
if ( data->sum != toDoEvent.data->sum ) return false;
if ( data->desc != toDoEvent.data->desc ) return false;
if ( data->maintainer != toDoEvent.data->maintainer )
return false;
return OPimRecord::operator==( toDoEvent );
}
void OPimTodo::deref()
{
// qWarning("deref in ToDoEvent");
if ( data->deref() )
{
// qWarning("deleting");
delete data;
data = 0;
}
}
OPimTodo &OPimTodo::operator=( const OPimTodo &item )
{
if ( this == &item ) return * this;
OPimRecord::operator=( item );
//qWarning("operator= ref ");
item.data->ref();
deref();
data = item.data;
return *this;
}
QMap<int, QString> OPimTodo::toMap() const
{
QMap<int, QString> map;
map.insert( Uid, QString::number( uid() ) );
map.insert( Category, idsToString( categories() ) );
map.insert( HasDate, QString::number( data->hasDate ) );
map.insert( Completed, QString::number( data->isCompleted ) );
map.insert( Description, data->desc );
map.insert( Summary, data->sum );
map.insert( Priority, QString::number( data->priority ) );
map.insert( DateDay, QString::number( data->date.day() ) );
map.insert( DateMonth, QString::number( data->date.month() ) );
map.insert( DateYear, QString::number( data->date.year() ) );
map.insert( Progress, QString::number( data->prog ) );
// map.insert( CrossReference, crossToString() );
/* FIXME!!! map.insert( State, );
map.insert( Recurrence, );
map.insert( Reminders, );
map.
*/
return map;
}
/**
* change or modify looks at the ref count and either
* creates a new QShared Object or it can modify it
* right in place
*/
void OPimTodo::changeOrModify()
{
if ( data->count != 1 )
{
qWarning( "changeOrModify" );
data->deref();
OPimTodoData* d2 = new OPimTodoData();
copy( data, d2 );
data = d2;
}
}
// WATCHOUT
/*
* if you add something to the Data struct
* be sure to copy it here
*/
void OPimTodo::copy( OPimTodoData* src, OPimTodoData* dest )
{
dest->date = src->date;
dest->isCompleted = src->isCompleted;
dest->hasDate = src->hasDate;
dest->priority = src->priority;
dest->desc = src->desc;
dest->sum = src->sum;
dest->extra = src->extra;
dest->prog = src->prog;
if ( src->state )
dest->state = new OPimState( *src->state );
if ( src->recur )
dest->recur = new OPimRecurrence( *src->recur );
if ( src->maintainer )
dest->maintainer = new OPimMaintainer( *src->maintainer )
;
dest->start = src->start;
dest->completed = src->completed;
if ( src->notifiers )
dest->notifiers = new OPimNotifyManager( *src->notifiers );
}
QString OPimTodo::type() const
{
return QString::fromLatin1( "OPimTodo" );
}
QString OPimTodo::recordField( int /*id*/ ) const
{
return QString::null;
}
-int OPimTodo::rtti()
+int OPimTodo::rtti() const
{
return OPimResolver::TodoList;
}
}
diff --git a/libopie2/opiepim/core/opimtodo.h b/libopie2/opiepim/core/opimtodo.h
index 5304180..e17fe6a 100644
--- a/libopie2/opiepim/core/opimtodo.h
+++ b/libopie2/opiepim/core/opimtodo.h
@@ -1,320 +1,320 @@
/*
This file is part of the Opie Project
Copyright (C) The Main Author <main-author@whereever.org>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OTODOEVENT_H
#define OTODOEVENT_H
/* OPIE */
#include <opie2/opimrecord.h>
#include <qpe/recordfields.h>
#include <qpe/palmtopuidgen.h>
/* QT */
#include <qarray.h>
#include <qmap.h>
#include <qregexp.h>
#include <qstringlist.h>
#include <qdatetime.h>
#include <qvaluelist.h>
namespace Opie
{
class OPimState;
class OPimRecurrence;
class OPimMaintainer;
class OPimNotifyManager;
class OPimTodo : public OPimRecord
{
public:
typedef QValueList<OPimTodo> ValueList;
enum RecordFields {
Uid = Qtopia::UID_ID,
Category = Qtopia::CATEGORY_ID,
HasDate,
Completed,
Description,
Summary,
Priority,
DateDay,
DateMonth,
DateYear,
Progress,
CrossReference,
State,
Recurrence,
Alarms,
Reminders,
Notifiers,
Maintainer,
StartDate,
CompletedDate
};
public:
// priorities from Very low to very high
enum TaskPriority { VeryHigh = 1, High, Normal, Low, VeryLow };
/* Constructs a new ToDoEvent
@param completed Is the TodoEvent completed
@param priority What is the priority of this ToDoEvent
@param category Which category does it belong( uid )
@param summary A small summary of the todo
@param description What is this ToDoEvent about
@param hasDate Does this Event got a deadline
@param date what is the deadline?
@param uid what is the UUID of this Event
**/
OPimTodo( bool completed = false, int priority = Normal,
const QStringList &category = QStringList(),
const QString &summary = QString::null ,
const QString &description = QString::null,
ushort progress = 0,
bool hasDate = false, QDate date = QDate::currentDate(),
int uid = 0 /*empty*/ );
OPimTodo( bool completed, int priority,
const QArray<int>& category,
const QString& summary = QString::null,
const QString& description = QString::null,
ushort progress = 0,
bool hasDate = false, QDate date = QDate::currentDate(),
int uid = 0 /* empty */ );
/** Copy c'tor
*
*/
OPimTodo( const OPimTodo & );
/**
*destructor
*/
~OPimTodo();
/**
* Is this event completed?
*/
bool isCompleted() const;
/**
* Does this Event have a deadline
*/
bool hasDueDate() const;
bool hasStartDate() const;
bool hasCompletedDate() const;
/**
* What is the priority?
*/
int priority() const ;
/**
* progress as ushort 0, 20, 40, 60, 80 or 100%
*/
ushort progress() const;
/**
* The due Date
*/
QDate dueDate() const;
/**
* When did it start?
*/
QDate startDate() const;
/**
* When was it completed?
*/
QDate completedDate() const;
/**
* does it have a state?
*/
bool hasState() const;
/**
* What is the state of this OPimTodo?
*/
OPimState state() const;
/**
* has recurrence?
*/
bool hasRecurrence() const;
/**
* the recurrance of this
*/
OPimRecurrence recurrence() const;
/**
* does this OPimTodo have a maintainer?
*/
bool hasMaintainer() const;
/**
* the Maintainer of this OPimTodo
*/
OPimMaintainer maintainer() const;
/**
* The description of the todo
*/
QString description() const;
/**
* A small summary of the todo
*/
QString summary() const;
/**
* @reimplemented
* Return this todoevent in a RichText formatted QString
*/
QString toRichText() const;
bool hasNotifiers() const;
/*
* FIXME check if the sharing is still fine!! -zecke
* ### CHECK If API is fine
*/
/**
* return a reference to our notifiers...
*/
OPimNotifyManager &notifiers();
/**
*
*/
const OPimNotifyManager &notifiers() const;
/**
* reimplementations
*/
QString type() const;
QString toShortText() const;
QString recordField( int id ) const;
/**
* toMap puts all data into the map. int relates
* to ToDoEvent RecordFields enum
*/
QMap<int, QString> toMap() const;
/**
* Set if this Todo is completed
*/
void setCompleted( bool completed );
/**
* set if this todo got an end data
*/
void setHasDueDate( bool hasDate );
// FIXME we do not have these for start, completed
// cause we'll use the isNull() of QDate for figuring
// out if it's has a date...
// decide what to do here? -zecke
/**
* Set the priority of the Todo
*/
void setPriority( int priority );
/**
* Set the progress.
*/
void setProgress( ushort progress );
/**
* set the end date
*/
void setDueDate( const QDate& date );
/**
* set the start date
*/
void setStartDate( const QDate& date );
/**
* set the completed date
*/
void setCompletedDate( const QDate& date );
void setRecurrence( const OPimRecurrence& );
void setDescription( const QString& );
void setSummary( const QString& );
/**
* set the state of a Todo
* @param state State what the todo should take
*/
void setState( const OPimState& state );
/**
* set the Maintainer Mode
*/
void setMaintainer( const OPimMaintainer& );
bool isOverdue();
virtual bool match( const QRegExp &r ) const;
bool operator<( const OPimTodo &toDoEvent ) const;
bool operator<=( const OPimTodo &toDoEvent ) const;
bool operator!=( const OPimTodo &toDoEvent ) const;
bool operator>( const OPimTodo &toDoEvent ) const;
bool operator>=( const OPimTodo &toDoEvent ) const;
bool operator==( const OPimTodo &toDoEvent ) const;
OPimTodo &operator=( const OPimTodo &toDoEvent );
- static int rtti();
+ int rtti() const;
private:
class OPimTodoPrivate;
struct OPimTodoData;
void deref();
inline void changeOrModify();
void copy( OPimTodoData* src, OPimTodoData* dest );
OPimTodoPrivate *d;
OPimTodoData *data;
};
inline bool OPimTodo::operator!=( const OPimTodo &toDoEvent ) const
{
return !( *this == toDoEvent );
}
}
#endif