summaryrefslogtreecommitdiff
path: root/libopie2
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 /libopie2
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 (limited to 'libopie2') (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,54 +1,57 @@
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.
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
@@ -1230,60 +1230,60 @@ void OPimContact::insertEmail( const QString &v )
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
@@ -183,74 +183,74 @@ class QPC_EXPORT OPimContact : public OPimRecord
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
@@ -436,97 +436,97 @@ QString OPimEvent::toRichText() const
{
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;
}
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
@@ -138,97 +138,97 @@ class OPimEvent : public OPimRecord
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& );
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
@@ -102,97 +102,97 @@ void OPimRecord::addCategoryName( const QString& )
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 */
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
@@ -115,79 +115,79 @@ class OPimRecord : public Qtopia::Record
*/
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
@@ -658,54 +658,54 @@ void OPimTodo::changeOrModify()
}
// 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
@@ -250,71 +250,71 @@ class OPimTodo : public OPimRecord
* 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