summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimevent.cpp
authorzecke <zecke>2004-11-18 21:45:49 (UTC)
committer zecke <zecke>2004-11-18 21:45:49 (UTC)
commit7484344ff5be1f7c54e51715776d0e3cadeb1ed0 (patch) (unidiff)
tree96f427f7a1fb1c8ca0a6efbd72b51e916cb1651d /libopie2/opiepim/core/opimevent.cpp
parent3302eb30390e6053637929316670da3e8fbe279e (diff)
downloadopie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.zip
opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.tar.gz
opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.tar.bz2
Big PIM API Update Core Part (1/2 of what should be implemented):
OPimRecords: -Add a so called safeCast using the rtti value OPimTodo: -Fix memleak with OPimState OPimOccurrence: -New class. Every 'Access' can give occurrences for a period of time Move Documentation
Diffstat (limited to 'libopie2/opiepim/core/opimevent.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimevent.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp
index 7bc6c32..1b553d8 100644
--- a/libopie2/opiepim/core/opimevent.cpp
+++ b/libopie2/opiepim/core/opimevent.cpp
@@ -480,24 +480,43 @@ QString OPimEvent::type() const
480 480
481QString OPimEvent::recordField( int /*id */ ) const 481QString OPimEvent::recordField( int /*id */ ) const
482{ 482{
483 return QString::null; 483 return QString::null;
484} 484}
485 485
486 486
487int OPimEvent::rtti() const 487int OPimEvent::rtti() const
488{ 488{
489 return OPimResolver::DateBook; 489 return OPimResolver::DateBook;
490} 490}
491 491
492/**
493 * \brief Cast safely to OPimEvent from OPimRecord
494 *
495 * Safely cast from OPimRecord to OPimEvent. If the
496 * OPimRecord is not of type OPimEvent Null will be
497 * returned.
498 *
499 * @param rec The OPimRecord to be casted to OPimEvent
500 *
501 * @see OPimTodo::safeCast
502 * @return OPimEvent or Null Pointer
503 */
504OPimEvent* OPimEvent::safeCast( const OPimRecord* rec) {
505 return ( rec && rec->rtti() == OPimResolver::DateBook ) ?
506 static_cast<OPimEvent*>( const_cast<OPimRecord*>(rec) ) :
507 0l;
508}
509
510
492 511
493bool OPimEvent::loadFromStream( QDataStream& ) 512bool OPimEvent::loadFromStream( QDataStream& )
494{ 513{
495 return true; 514 return true;
496} 515}
497 516
498 517
499bool OPimEvent::saveToStream( QDataStream& ) const 518bool OPimEvent::saveToStream( QDataStream& ) const
500{ 519{
501 return true; 520 return true;
502} 521}
503 522